analyze the given string using its analyzer , constructing either a { @ code prefix query } or a { @ code boolean query } made up of { @ code term query } s and { @ code prefix query } s

private query new possibly analyzed query ( string field , string term str , analyzer analyzer ) { list < list < bytes ref > > tlist = new array list < > ( ) ; try ( token stream source = analyzer token stream ( field , term str ) ) { source reset ( ) ; list < bytes ref > current pos = new array list < > ( ) ; char term attribute term att = source add attribute ( char term attribute class ) ; position increment attribute pos att = source add attribute ( position increment attribute class ) ; try { boolean has more tokens = source increment token ( ) ; while ( has more tokens ) { if ( current pos is empty ( ) = = false & & pos att get position increment ( ) > 0 ) { tlist add ( current pos ) ; current pos = new array list < > ( ) ; } final bytes ref term = analyzer normalize ( field , term att to string ( ) ) ; current pos add ( term ) ; has more tokens = source increment token ( ) ; } if ( current pos is empty ( ) = = false ) { tlist add ( current pos ) ; } } catch ( i o exception e ) { / / ignore / / todo : we should not ignore the exception and return a prefix query with the original term ? } } catch ( i o exception e ) { / / bail on any exceptions , going with a regular prefix query return new prefix query ( new term ( field , term str ) ) ; } if ( tlist size ( ) = = 0 ) { return null ; } if ( tlist size ( ) = = 1 & & tlist get ( 0 ) size ( ) = = 1 ) { return new prefix query ( new term ( field , tlist get ( 0 ) get ( 0 ) ) ) ; } / / build a boolean query with prefix on the last position only boolean query builder builder = new boolean query builder ( ) ; for ( int pos = 0 ; pos < tlist size ( ) ; pos + + ) { list < bytes ref > plist = tlist get ( pos ) ; boolean is last pos = ( pos = = tlist size ( ) - 1 ) ; query pos query ; if ( plist size ( ) = = 1 ) { if ( is last pos ) { pos query = new prefix query ( new term ( field , plist get ( 0 ) ) ) ; } else { pos query = new term query ( new term ( field , plist get ( 0 ) ) , boost attribute default boost ) ; } } else if ( is last pos = = false ) { / / build a synonym query for terms in the same position term [ ] terms = new term [ plist size ( ) ] ; for ( int i = 0 ; i < plist size ( ) ; i + + ) { terms [ i ] = new term ( field , plist get ( i ) ) ; } pos query = new synonym query ( terms ) ; } else { boolean query builder inner builder = new boolean query builder ( ) ; for ( bytes ref token : plist ) { inner builder add ( new boolean clause ( new prefix query ( new term ( field , token ) ) , boolean clause occur should ) ) ; } pos query = inner builder build ( ) ; } builder add ( new boolean clause ( pos query , get default operator ( ) ) ) ; } return builder build ( ) ; }


check the given request for supported methods and a required session , if any

protected final void check request ( http servlet request request ) throws servlet exception { / / check whether we should support the request method string method = request get method ( ) ; if ( this supported methods ! = null & & ! this supported methods contains ( method ) ) { throw new http request method not supported exception ( method , this supported methods ) ; } / / check whether a session is required if ( this require session & & request get session ( false ) = = null ) { throw new http session required exception ( " pre - existing session required but none found " ) ; } }


key command : ssh - keygen - f openssh - t rsa - b 1024 in this key we remove some lines to break the key

public void load key broken ( ) throws i o exception , general security exception { file file = new file ( this get class ( ) get resource ( " openssh - broken " ) get file ( ) ) ; string password = " password " ; assert throws ( illegal argument exception class , ( ) - > private key provider load key ( file , password ) ) ; }


returns the underlying { @ link ordinal map } for this fielddata or null if global ordinals are not needed ( constant value or single segment )


does the database use upper case for identifiers ?

protected boolean is stores upper case identifiers ( ) { return this stores upper case identifiers ; }


attempt disassembly of all undefined code units within the specified set of addresses note : a single instance of this disassembler does not support concurrent invocations of the various disassemble methods disassembler must be instantiated with a program object

public address set disassemble ( address set view start set , address set view restricted set , register value initial context value , boolean do follow flow ) { address set disassembled addrs ; disassembled addrs = new address set ( ) ; int alignment = language get instruction alignment ( ) ; address range iterator address ranges = start set get address ranges ( ) ; for ( address range address range : address ranges ) { if ( monitor is cancelled ( ) ) { break ; } if ( disassembled addrs contains ( address range get min address ( ) , address range get max address ( ) ) ) { continue ; } address set todo subset = new address set ( address range ) ; while ( ! todo subset is empty ( ) & & ! monitor is cancelled ( ) ) { address next addr = todo subset get min address ( ) ; / / check if location is already on disassembly list if ( disassembled addrs contains ( next addr ) ) { address range done range = disassembled addrs get range containing ( next addr ) ; todo subset delete ( done range ) ; continue ; } todo subset delete ( next addr , next addr ) ; / / must be aligned if ( next addr get offset ( ) % alignment ! = 0 ) { continue ; } data data = listing get undefined data at ( next addr ) ; if ( data = = null ) { address set view undefined ranges = null ; try { undefined ranges = program get listing ( ) get undefined ranges ( todo subset , true , monitor ) ; todo subset = new address set ( undefined ranges ) ; } catch ( cancelled exception e ) { break ; } } else { address set current set = disassemble ( next addr , restricted set , initial context value , do follow flow ) ; if ( ! current set is empty ( ) ) { / / nothing disassembled todo subset delete ( current set ) ; disassembled addrs add ( current set ) ; } } if ( monitor is cancelled ( ) ) { break ; } } } return disassembled addrs ; }


process the opening handshake initiated by { @ link # handshake } }

public final channel future process handshake ( final channel channel , http response response , final channel promise promise ) { if ( response instanceof full http response ) { try { finish handshake ( channel , ( full http response ) response ) ; promise set success ( ) ; } catch ( throwable cause ) { promise set failure ( cause ) ; } } else { channel pipeline p = channel pipeline ( ) ; channel handler context ctx = p context ( http response decoder class ) ; if ( ctx = = null ) { ctx = p context ( http client codec class ) ; if ( ctx = = null ) { return promise set failure ( new illegal state exception ( " channel pipeline does not contain " + " an http response decoder or http client codec " ) ) ; } } / / add aggregator and ensure we feed the http response so it is aggregated a limit of 8192 should be more / / then enough for the websockets handshake payload / / / / todo : make handshake work without http object aggregator at all string aggregator name = " http aggregator " ; p add after ( ctx name ( ) , aggregator name , new http object aggregator ( 8192 ) ) ; p add after ( aggregator name , " handshaker " , new simple channel inbound handler < full http response > ( ) { @ override protected void channel read 0 ( channel handler context ctx , full http response msg ) throws exception { / / remove ourself and do the actual handshake ctx pipeline ( ) remove ( this ) ; try { finish handshake ( channel , msg ) ; promise set success ( ) ; } catch ( throwable cause ) { promise set failure ( cause ) ; } } @ override public void exception caught ( channel handler context ctx , throwable cause ) throws exception { / / remove ourself and fail the handshake promise ctx pipeline ( ) remove ( this ) ; promise set failure ( cause ) ; } @ override public void channel inactive ( channel handler context ctx ) throws exception { / / fail promise if channel was closed if ( ! promise is done ( ) ) { promise try failure ( new closed channel exception ( ) ) ; } ctx fire channel inactive ( ) ; } } ) ; try { ctx fire channel read ( reference count util retain ( response ) ) ; } catch ( throwable cause ) { promise set failure ( cause ) ; } } return promise ; }


this tests that serializers used for snapshots are duplicates of the ones used in processing to avoid race conditions in stateful serializers

public void test serializer duplication in snapshot ( ) throws i o exception { final test duplicate serializer namespace serializer = new test duplicate serializer ( ) ; final test duplicate serializer state serializer = new test duplicate serializer ( ) ; final test duplicate serializer key serializer = new test duplicate serializer ( ) ; registered key value state backend meta info < integer , integer > meta info = new registered key value state backend meta info < > ( state descriptor type value , " test " , namespace serializer , state serializer ) ; internal key context < integer > mock key context = new mock internal key context < > ( ) ; copy on write state table < integer , integer , integer > table = new copy on write state table < > ( mock key context , meta info , key serializer ) ; table put ( 0 , 0 , 0 , 0 ) ; table put ( 1 , 0 , 0 , 1 ) ; table put ( 2 , 0 , 1 , 2 ) ; final copy on write state table snapshot < integer , integer , integer > snapshot = table state snapshot ( ) ; final state snapshot state key group writer partitioned snapshot = snapshot get key group writer ( ) ; namespace serializer disable ( ) ; key serializer disable ( ) ; state serializer disable ( ) ; partitioned snapshot write state in key group ( new data output view stream wrapper ( new byte array output stream with pos ( 1024 ) ) , 0 ) ; }


public string to string ( ) { string builder sb = new string builder ( ) ; sb append ( ' { ' ) ; boolean first = true ; for ( int i = bits find first ( bits , 0 ) ; i > = 0 ; i = bits find first ( bits , i + 1 ) ) { if ( ! first ) { sb append ( " , " ) ; } first = false ; sb append ( i ) ; } sb append ( ' } ' ) ; return sb to string ( ) ; }


public string get shape type ( ) { return shape type ; }


tests that cancel with savepoint without a properly configured savepoint directory , will fail with a meaningful exception message

public void test cancel with savepoint without configured savepoint directory ( ) throws exception { set up with checkpoint interval ( 10l ) ; try { cluster client cancel with savepoint ( job graph get job i d ( ) , null ) get ( ) ; } catch ( exception e ) { if ( ! exception utils find throwable with message ( e , " savepoint directory " ) is present ( ) ) { throw e ; } } }


public boolean delete ( ) { if ( storage ! = null ) return storage delete ( ) ; return true ; }


does this filesystem have a metadata store ?

public boolean has metadata store ( ) { return ! s 3 guard is null metadata store ( metadata store ) ; }


in the event of ungraceful shutdown , embedded clusters call exit or halt with non - zero exit statuses exiting with a non - zero status forces a test to fail and is hard to handle because graceful exit is usually not required during a test and because depending on such an exit increases flakiness , this setting allows masking exit and halt procedures by using a runtime exception instead customization of the exit and halt procedures is possible through { @ code exit procedure } and { @ code halt procedure } respectively

public builder mask exit procedures ( boolean mask ) { this mask exit procedures = mask ; return this ; }


returns next occurrence of % s skips any % %

private static int next occurrence ( string format str , int n , int idx ) { while ( idx < n ) { idx = format str index of ( ' % ' , idx ) ; if ( idx = = - 1 ) { break ; } if ( ( idx + 1 ) < n ) { char c = format str char at ( idx + 1 ) ; if ( c = = ' s ' ) { return idx ; } if ( c ! = ' % ' ) { / / illegal sequence found return - 2 ; } idx + = 2 ; } else { / / terminating ' % ' found , illegal return - 2 ; } } return - 1 ; }


get check task type , refer to enum health check type


public integer get integer ( ) { return integer ; }


method creates a filename to store the service

public string build ( final registered service service , final string extension ) { return string utils remove ( service get name ( ) , ' ' ) + ' - ' + service get id ( ) + ' ' + extension ; }


public text prop model view model title quantity res ( @ plurals res int plural res , int quantity , object format args ) { on mutation ( ) ; assigned attributes epoxy generated model set ( 0 ) ; title string attribute data set value ( plural res , quantity , format args ) ; return this ; }


assert that a specific number of files were created

private void assert files created ( azure blob storage test account account , string name , int expected ) { assert equals ( " files created in account " + name , expected , get files created ( account ) ) ; }


public router rpc client get r p c client ( ) { return rpc client ; }


public static serializer type get by code ( int code ) { for ( serializer type b : serializer type values ( ) ) { if ( code = = b code ) { return b ; } } throw new illegal argument exception ( " unknown codec : " + code ) ; }


return the http url of the target service


print all of the thread ' s information and stack traces

public synchronized static void print thread info ( print stream stream , string title ) { final int stack depth = 20 ; boolean contention = thread bean is thread contention monitoring enabled ( ) ; long [ ] thread ids = thread bean get all thread ids ( ) ; stream println ( " process thread dump : " + title ) ; stream println ( thread ids length + " active threads " ) ; for ( long tid : thread ids ) { thread info info = thread bean get thread info ( tid , stack depth ) ; if ( info = = null ) { stream println ( " inactive " ) ; continue ; } stream println ( " thread " + get task name ( info get thread id ( ) , info get thread name ( ) ) + " : " ) ; thread state state = info get thread state ( ) ; stream println ( " state : " + state ) ; stream println ( " blocked count : " + info get blocked count ( ) ) ; stream println ( " waited count : " + info get waited count ( ) ) ; if ( contention ) { stream println ( " blocked time : " + info get blocked time ( ) ) ; stream println ( " waited time : " + info get waited time ( ) ) ; } if ( state = = thread state waiting ) { stream println ( " waiting on " + info get lock name ( ) ) ; } else if ( state = = thread state blocked ) { stream println ( " blocked on " + info get lock name ( ) ) ; stream println ( " blocked by " + get task name ( info get lock owner id ( ) , info get lock owner name ( ) ) ) ; } stream println ( " stack : " ) ; for ( stack trace element frame : info get stack trace ( ) ) { stream println ( " " + frame to string ( ) ) ; } } stream flush ( ) ; }


public static list < rowtime attribute descriptor > derive rowtime attributes ( descriptor properties properties ) { map < string , string > names = properties get indexed property ( schema , schema name ) ; list < rowtime attribute descriptor > attributes = new array list < > ( ) ; / / check for rowtime in every field for ( int i = 0 ; i < names size ( ) ; i + + ) { optional < tuple 2 < timestamp extractor , watermark strategy > > rowtime components = rowtime validator get rowtime components ( properties , schema + " " + i + " " ) ; int index = i ; / / create descriptor rowtime components if present ( tuple 2 - > attributes add ( new rowtime attribute descriptor ( properties get string ( schema + " " + index + " " + schema name ) , tuple 2 f 0 , tuple 2 f 1 ) ) ) ; } return attributes ; }


start the work , dispatch tasks and stop the thread pool at last

private static void execute ( work center work center , task set task set ) throws interrupted exception { var workers = work center get workers ( ) ; var exec = executors new fixed thread pool ( workers size ( ) ) ; workers for each ( exec : : submit ) ; thread sleep ( 1000 ) ; add tasks ( task set ) ; exec await termination ( 2 , time unit seconds ) ; exec shutdown now ( ) ; }


copy the instance as by reading and writing using the code specific to the provided version the version is useful for sanity checking the backwards compatibility of the wire it isn ' t a substitute for real backwards compatibility tests but it is so much faster

protected abstract t copy instance ( t instance , version version ) throws i o exception ;


releases the stream this method should be called when the stream is no longer required either this method or { @ link # release ( release callback ) } can be used to release this stream

public void release ( ) { release ( null ) ; }


< code > optional org apache dubbo metadata definition protobuf model p b request type c dubbo p b request type = 3 ; < code >

public org apache dubbo metadata definition protobuf model google p b p b request type get c dubbo p b request type ( ) { return c dubbo p b request type = = null ? org apache dubbo metadata definition protobuf model google p b p b request type get default instance ( ) : c dubbo p b request type ; }


returns the topic names for any optimized source changelogs

public set < string > source topic changelogs ( ) { return source topics stream ( ) filter ( state changelog topics : : contains key ) collect ( collectors to set ( ) ) ; }


simple query string builder flags ( int flags ) { this flags = flags ; return this ; }


set the message body converters to use these converters are used to convert from and to http requests and responses

public void set message converters ( list < http message converter < ? > > message converters ) { this sync template set message converters ( message converters ) ; }


shortens the body of { @ code response } but not the corresponding headers only useful to test how clients respond to the premature conclusion of the http body

private mock response truncate violently ( mock response response , int num bytes to keep ) { response set socket policy ( disconnect at end ) ; headers headers = response get headers ( ) ; buffer truncated body = new buffer ( ) ; truncated body write ( response get body ( ) , num bytes to keep ) ; response set body ( truncated body ) ; response set headers ( headers ) ; return response ; }


generate a quoted string from us - ascii character bytes assuming 1 - byte chars special characters and non - printable characters will be escaped using c character escape conventions ( e g , \ t , \ n , \ \ u h h h h , etc ) if a character size other than 1 - byte is required the alternate form of this method should be used the result string will be single quoted ( ie " ' " ) if the input byte array is 1 byte long , otherwise the result will be double - quoted ( ' " ' )

public static string to quoted string ( byte [ ] bytes ) { string builder builder = new string builder ( ) ; for ( byte b : bytes ) { append char converted to escape sequence ( ( char ) ( b & 0xff ) , 1 , builder ) ; } string str = builder to string ( ) ; if ( bytes length = = 1 ) { str = str replace ( " ' " , " \ \ ' " ) ; return " ' " + str + " ' " ; } str = str replace ( " \ " " , " \ \ \ " " ) ; return " \ " " + str + " \ " " ; }


read window state from an operator in a { @ code savepoint } this method supports reading from any type of window

public < w extends window > window reader < w > window ( type serializer < w > window serializer ) { preconditions check not null ( window serializer , " the window serializer must not be null " ) ; return new window reader < > ( env , metadata , state backend , window serializer ) ; }


a convenience method to start a builder using the given runnable after calling this method you are still required to call { @ link # set title ( string ) } this method allows for a more attractive fluent api usage than does the constructor ( see the javadoc header )

public static task builder with runnable ( monitored runnable r ) { return new task builder ( r ) ; }


determines whether any of this range set ' s member ranges contains { @ code value }


makes sure the current output stream is set up for the given entry

private boolean prepare entry ( data entry data entry ) throws i o exception { / / get the parent stream , new or existing / / this may finish our own jar output stream output stream parent output stream = data entry writer get output stream ( data entry get parent ( ) , this ) ; / / did we get a stream ? if ( parent output stream = = null ) { return false ; } / / do we need a new stream ? if ( current parent output stream = = null ) { current parent output stream = parent output stream ; / / create a new jar stream , with a manifest , if set current jar output stream = manifest ! = null ? new jar output stream ( parent output stream , manifest ) : new zip output stream ( parent output stream ) ; / / add a comment , if set if ( comment ! = null ) { current jar output stream set comment ( comment ) ; } } return true ; }


set the following offset ( based on time or row - count intervals ) for over window

public over window partitioned ordered preceding following ( string following ) { return this following ( expression parser parse expression ( following ) ) ; }


sets the parallelism for this optimizer node the parallelism denotes how many parallel instances of the operator will be spawned during the execution

public void set parallelism ( int parallelism ) { if ( parallelism < 1 & & parallelism ! = execution config parallelism default ) { throw new illegal argument exception ( " parallelism of " + parallelism + " is invalid " ) ; } this parallelism = parallelism ; }


implementation of inputformat : : create record reader ( )

public record reader < k , v > create record reader ( input split input split , task attempt context task attempt context ) throws i o exception , interrupted exception { chunk context = get chunk context ( task attempt context get configuration ( ) ) ; return new dynamic record reader < k , v > ( chunk context ) ; }


validity - checks that no group has its environment referenced in both the " compatible with " and restricted to " attributes returns true if all is good , returns false and reports appropriate errors if there are any problems

boolean validate environment specifications ( ) { immutable collection < environment labels > restriction groups = restriction environments get groups ( ) ; boolean has errors = false ; for ( environment labels group : compatibility environments get groups ( ) ) { if ( restriction groups contains ( group ) ) { / / to avoid error - spamming the user , when we find a conflict we only report one example / / environment from each attribute for that group label compatibility env = compatibility environments get environments ( group ) iterator ( ) next ( ) ; label restriction env = restriction environments get environments ( group ) iterator ( ) next ( ) ; if ( compatibility env equals ( restriction env ) ) { attribute error ( rule context , compatibility attr , compatibility env + " cannot appear both here and in " + restriction attr ) ; } else { attribute error ( rule context , compatibility attr , compatibility env + " and " + restriction env + " belong to the same environment group they should be declared " + " together either here or in " + restriction attr ) ; } has errors = true ; } } return ! has errors ; }


returns { @ link list } & lt ; { @ link record number } & gt ; of what appears to be type indices

public list < record number > get type record numbers ( ) { return type record numbers ; }


load tinker j a rs and add them to the application class loader

public static boolean load tinker jars ( final tinker application application , string directory , string oat dir , intent intent result , boolean is system o t a , boolean is protected app ) { if ( load dex list is empty ( ) & & class n dex info is empty ( ) ) { share tinker log w ( tag , " there is no dex to load " ) ; return true ; } class loader class loader = tinker dex loader class get class loader ( ) ; if ( class loader ! = null ) { share tinker log i ( tag , " classloader : " + class loader to string ( ) ) ; } else { share tinker log e ( tag , " classloader is null " ) ; share intent util set intent return code ( intent result , share constants error load patch version dex classloader null ) ; return false ; } string dex path = directory + " / " + dex path + " / " ; array list < file > legal files = new array list < > ( ) ; for ( share dex diff patch info info : load dex list ) { / / for dalvik , ignore art support dex if ( is just art support dex ( info ) ) { continue ; } string path = dex path + info real name ; file file = new file ( path ) ; if ( application is tinker load verify flag ( ) ) { long start = system current time millis ( ) ; string check md 5 = get info md 5 ( info ) ; if ( ! share patch file util verify dex file md 5 ( file , check md 5 ) ) { / / it is good to delete the mismatch file share intent util set intent return code ( intent result , share constants error load patch version dex md5 mismatch ) ; intent result put extra ( share intent util intent patch mismatch dex path , file get absolute path ( ) ) ; return false ; } share tinker log i ( tag , " verify dex file : " + file get path ( ) + " md 5 , use time : " + ( system current time millis ( ) - start ) ) ; } legal files add ( file ) ; } / / verify merge class n apk if ( is vm art & & ! class n dex info is empty ( ) ) { file class n file = new file ( dex path + share constants class n apk name ) ; long start = system current time millis ( ) ; if ( application is tinker load verify flag ( ) ) { for ( share dex diff patch info info : class n dex info ) { if ( ! share patch file util verify dex file md 5 ( class n file , info raw name , info dest md 5 in art ) ) { share intent util set intent return code ( intent result , share constants error load patch version dex md5 mismatch ) ; intent result put extra ( share intent util intent patch mismatch dex path , class n file get absolute path ( ) ) ; return false ; } } } share tinker log i ( tag , " verify dex file : " + class n file get path ( ) + " md 5 , use time : " + ( system current time millis ( ) - start ) ) ; legal files add ( class n file ) ; } file optimize dir = new file ( directory + " / " + oat dir ) ; if ( is system o t a ) { final boolean [ ] parallel o t a result = { true } ; final throwable [ ] parallel o t a throwable = new throwable [ 1 ] ; string target i s a ; try { target i s a = share tinker internals get current instruction set ( ) ; } catch ( throwable throwable ) { share tinker log i ( tag , " get current instruction set fail : " + throwable ) ; / / try { / / target i s a = share oat util get oat file instruction set ( test opt dex file ) ; / / } catch ( throwable throwable ) { / / don ' t ota on the front delete out of date o a t file ( directory ) ; intent result put extra ( share intent util intent patch interpret exception , throwable ) ; share intent util set intent return code ( intent result , share constants error load patch get ota instruction set exception ) ; return false ; / / } } delete out of date o a t file ( directory ) ; share tinker log w ( tag , " system o t a , try parallel oat dexes , target i s a : " + target i s a ) ; / / change dir optimize dir = new file ( directory + " / " + interpret dex optimize path ) ; tinker dex optimizer optimize all ( application , legal files , optimize dir , true , application is use delegate last class loader ( ) , target i s a , new tinker dex optimizer result callback ( ) { long start ; @ override public void on start ( file dex file , file optimized dir ) { start = system current time millis ( ) ; share tinker log i ( tag , " start to optimize dex : " + dex file get path ( ) ) ; } @ override public void on success ( file dex file , file optimized dir , file optimized file ) { / / do nothing share tinker log i ( tag , " success to optimize dex " + dex file get path ( ) + " , use time " + ( system current time millis ( ) - start ) ) ; } @ override public void on failed ( file dex file , file optimized dir , throwable thr ) { parallel o t a result [ 0 ] = false ; parallel o t a throwable [ 0 ] = thr ; share tinker log i ( tag , " fail to optimize dex " + dex file get path ( ) + " , use time " + ( system current time millis ( ) - start ) ) ; } } ) ; if ( ! parallel o t a result [ 0 ] ) { share tinker log e ( tag , " parallel oat dexes failed " ) ; intent result put extra ( share intent util intent patch interpret exception , parallel o t a throwable [ 0 ] ) ; share intent util set intent return code ( intent result , share constants error load patch ota interpret only exception ) ; return false ; } } try { final boolean use d l c = application is use delegate last class loader ( ) ; system class loader adder install dexes ( application , class loader , optimize dir , legal files , is protected app , use d l c ) ; } catch ( throwable e ) { share tinker log e ( tag , " install dexes failed " ) ; intent result put extra ( share intent util intent patch exception , e ) ; share intent util set intent return code ( intent result , share constants error load patch version dex load exception ) ; return false ; } return true ; }


method to capture symbol type that was unexpected as a global symbol

void witness global symbol type ( abstract ms symbol symbol ) { if ( ! expected global symbols contains ( symbol get pdb id ( ) ) ) { unexpected global symbols add ( symbol get class ( ) ) ; } }


if set to true , the load balancer will send a 301 redirect for all http connections , asking the clients to use https < code > bool https redirect = 1 ; < code >

public builder set https redirect ( boolean value ) { https redirect = value ; on changed ( ) ; return this ; }


allow map access to the environment to be set for the connector , with the option to add or override specific entries useful for specifying entries directly , for example via " environment [ my key ] " this is particularly useful for adding or overriding entries in child bean definitions

public map < string , ? > get environment ( ) { return this environment ; }


returns what values to pick in the case a document contains multiple values for the targeted sort field

public sort mode sort mode ( ) { return this sort mode ; }


recursively handles files in an already opened g file system

private void process f s ( g file system fs , g file start dir , task monitor task monitor ) throws cancelled exception , i o exception { / / todo : drop f s utils list file system and do recursion here for ( g file file : f s utilities list file system ( fs , start dir , null , task monitor ) ) { task monitor check canceled ( ) ; do add file ( file system service get instance ( ) get fully qualified f s r l ( file get f s r l ( ) , task monitor ) , task monitor ) ; current u a s i inc raw file count ( ) ; } }


cleanup resources when the process exits

void cleanup resources ( int exit status ) { synchronized ( this ) { m shell pid = - 1 ; m shell exit status = exit status ; } / / stop the reader and writer threads , and close the i / o streams m terminal to process i o queue close ( ) ; m process to terminal i o queue close ( ) ; jni close ( m terminal file descriptor ) ; }


build call for fake outer boolean serialize

public okhttp 3 call fake outer boolean serialize call ( boolean body , final api callback callback ) throws api exception { object local var post body = body ; / / create path and map variables string local var path = " / fake / outer / boolean " ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " * / * " } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , " post " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


called after { @ link # setup transitions } has been called and the new layout has been mounted this restores the state of the previous layout for content that will animate and then starts the corresponding animations

void run transitions ( ) { render core systrace begin section ( " run transitions " ) ; restore initial states ( ) ; if ( m debug tag ! = null ) { debug log starting animations ( ) ; } if ( m root animation to run ! = null ) { m root animation to run add listener ( m root animation listener ) ; m root animation to run start ( m resolver ) ; m root animation to run = null ; } render core systrace end section ( ) ; }


return the current { @ link state } of this { @ code kafka streams } instance

public state state ( ) { return state ; }


public static string get collection link ( final string database name , final string collection name ) { return get database link ( database name ) + " / colls / " + collection name ; }


public void last name test ( ) { / / todo : test last name }


concatenates an array of path segments into a path string

private string create path ( string segments ) { string builder buf = new string builder ( ) ; for ( string segment : segments ) { if ( ! string utils is empty ( segment ) & & ! segment equals ( " " ) ) { if ( buf length ( ) ! = 0 ) buf append ( file separator char ) ; buf append ( segment ) ; } } for ( int i = 0 ; i < buf length ( ) ; i + + ) { char c = buf char at ( i ) ; if ( ( c = = ' / ' | | c = = ' \ \ ' ) & & c ! = file separator char ) buf set char at ( i , file separator char ) ; } return buf to string ( ) ; }


returns the address to which the socket is connected

socket address get remote socket address ( ) { return remote socket address ; }


public void attribute boolean test ( ) { / / todo : test attribute boolean }


public void test animal ( ) { / / todo : test animal }


create a new controller listener wrapper or return null if the listener is null

public static controller listener wrapper create ( @ nullable controller listener < image info > controller listener ) { return controller listener = = null ? null : new controller listener wrapper ( controller listener ) ; }


determine the context class that any context passed to { @ code set application context } must be an instance of can be overridden in subclasses

protected class < ? > required context class ( ) { return application context class ; }


most of the tests in this class run against every one of these caches

private iterable < loading cache < object , object > > caches ( ) { / / lots of different ways to configure a loading cache cache builder factory factory = cache factory ( ) ; return iterables transform ( factory build all permutations ( ) , new function < cache builder < object , object > , loading cache < object , object > > ( ) { @ override public loading cache < object , object > apply ( cache builder < object , object > builder ) { return builder build ( identity loader ( ) ) ; } } ) ; }


private double [ ] concat embeddings ( list < feature value [ ] > feature vectors ) { double [ ] concat = new double [ concat layer size ] ; int offset = 0 ; / / " es index " stands for " embedding space index " for ( int es index = 0 ; es index < feature vectors size ( ) ; + + es index ) { byte [ ] embedding weight = this embeddings weights [ es index ] ; short [ ] quants = this embeddings quant scales [ es index ] ; int embedding dim = embedding dimensions [ es index ] ; feature value [ ] feature vector = feature vectors get ( es index ) ; assert ( offset + embedding dim < = concat length ) ; for ( feature value feature value : feature vector ) { / / multiplier for each embedding weight int row = feature value get row ( ) ; double multiplier = feature value get weight ( ) * short to double ( quants [ row ] ) ; / / iterate across columns for this row for ( int i = 0 ; i < embedding dim ; + + i ) { double value = ( get row major data ( embedding weight , embedding dim , row , i ) ) * multiplier ; int concat index = offset + i ; concat [ concat index ] + = value ; } } offset + = embedding dim ; } return concat ; }


public void test inline object 1 ( ) { / / todo : test inline object 1 }


public static fresco vito image decode options defaults ( ) { return defaults ; }


gets the total number of open streams ( input plus output )

public int get total number of open streams ( ) { lock lock ( ) ; try { return num reserved output streams + num reserved input streams ; } finally { lock unlock ( ) ; } }


returns whether the visited class is declared in the scope of a lambda in that case { @ link lambda desugaring } will want to rewrite the enclosing method attribute of the class

public boolean need outer class rewrite ( ) { return need outer class rewrite ; }


configure whether to verify certificate and hostname when making https requests default to true note : do not set to false in production code , otherwise you would face multiple types of cryptographic attacks

public api client set verifying ssl ( boolean verifying ssl ) { this verifying ssl = verifying ssl ; apply ssl settings ( ) ; return this ; }


this test checks an implementation dependent feature it tests that the method { @ code add edge } will silently add the missing nodes to the graph , then add the edge connecting them we are not using the proxy methods here as we want to test { @ code add edge } when the end - points are not elements of the graph

public void add edge nodes not in graph ( ) { assume ( ) that ( graph is mutable ( ) ) is true ( ) ; network as mutable network add node ( n1 ) ; assert true ( network as mutable network add edge ( n1 , n5 , e15 ) ) ; assert true ( network as mutable network add edge ( n4 , n1 , e41 ) ) ; assert true ( network as mutable network add edge ( n2 , n3 , e23 ) ) ; assert that ( network nodes ( ) ) contains exactly ( n1 , n5 , n4 , n2 , n3 ) ; assert that ( network edges ( ) ) contains exactly ( e15 , e41 , e23 ) ; assert that ( network edges connecting ( n1 , n5 ) ) contains exactly ( e15 ) ; assert that ( network edges connecting ( n4 , n1 ) ) contains exactly ( e41 ) ; assert that ( network edges connecting ( n2 , n3 ) ) contains exactly ( e23 ) ; assert that ( network edges connecting ( n3 , n2 ) ) contains exactly ( e23 ) ; }


writes a { @ link type serializer snapshot } to the provided data output view it is written with a format that can be later read again using { @ link # read serializer snapshot ( data input view , class loader , type serializer ) }

public static < t > void write serializer snapshot ( data output view out , type serializer snapshot < t > serializer snapshot , type serializer < t > serializer ) throws i o exception { new type serializer snapshot serialization proxy < > ( serializer snapshot , serializer ) write ( out ) ; }


blocks until the stream is available or until the request is canceled

public synchronized optional < input stream > get stream ( ) { while ( stream = = null & & ! canceled ) { util wait ( this , 0 ) ; } return optional from nullable ( this stream ) ; }


returns results program for update this represents the checkin program containing the merged data program returned will be released by the merge test facilitator when disposed or re - initialized

public program d b get result program ( ) { return result program ; }


get either full or partial information about this cache pool

cache pool info get info ( boolean full info ) { cache pool info info = new cache pool info ( pool name ) ; if ( ! full info ) { return info ; } return info set owner name ( owner name ) set group name ( group name ) set mode ( new fs permission ( mode ) ) set limit ( limit ) set default replication ( default replication ) set max relative expiry ms ( max relative expiry ms ) ; }


test document failures ( failures after seq no generation ) are added as noop operation to the translog for primary and replica shards

public void test document failure replication ( ) throws exception { final i o exception index exception = new i o exception ( " simulated indexing failure " ) ; final engine factory engine factory = config - > internal engine tests create internal engine ( ( dir , iwc ) - > new index writer ( dir , iwc ) { @ override public long add document ( iterable < ? extends indexable field > doc ) throws i o exception { boolean is tombstone = false ; for ( indexable field field : doc ) { if ( seq no field mapper tombstone name equals ( field name ( ) ) ) { is tombstone = true ; } } if ( is tombstone ) { return super add document ( doc ) ; / / allow to add noop } else { throw index exception ; } } } , null , null , config ) ; try ( replication group shards = new replication group ( build index metadata ( 0 ) ) { @ override protected engine factory get engine factory ( shard routing routing ) { return engine factory ; } } ) { / / start with the primary only so two first failures are replicated to replicas via recovery from the translog of the primary shards start primary ( ) ; long primary term = shards get primary ( ) get pending primary term ( ) ; list < translog operation > expected translog ops = new array list < > ( ) ; bulk item response index resp = shards index ( new index request ( index get name ( ) ) id ( " 1 " ) source ( " { } " , x content type json ) ) ; assert that ( index resp is failed ( ) , equal to ( true ) ) ; assert that ( index resp get failure ( ) get cause ( ) , equal to ( index exception ) ) ; expected translog ops add ( new translog no op ( 0 , primary term , index exception to string ( ) ) ) ; try ( translog snapshot snapshot = get translog ( shards get primary ( ) ) new snapshot ( ) ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } shards assert all equal ( 0 ) ; int n replica = random int between ( 1 , 3 ) ; for ( int i = 0 ; i < n replica ; i + + ) { shards add replica ( ) ; } shards start replicas ( n replica ) ; for ( index shard shard : shards ) { try ( translog snapshot snapshot = get translog ( shard ) new snapshot ( ) ) { / / we flush at the end of peer recovery if ( shard routing entry ( ) primary ( ) | | shard index settings ( ) is soft delete enabled ( ) = = false ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } else { assert that ( snapshot total operations ( ) , equal to ( 0 ) ) ; } } try ( translog snapshot snapshot = shard new changes snapshot ( " test " , 0 , long max value , false ) ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } } / / the failure replicated directly from the replication channel index resp = shards index ( new index request ( index get name ( ) ) id ( " any " ) source ( " { } " , x content type json ) ) ; assert that ( index resp get failure ( ) get cause ( ) , equal to ( index exception ) ) ; translog no op noop 2 = new translog no op ( 1 , primary term , index exception to string ( ) ) ; expected translog ops add ( noop 2 ) ; for ( index shard shard : shards ) { try ( translog snapshot snapshot = get translog ( shard ) new snapshot ( ) ) { if ( shard routing entry ( ) primary ( ) | | shard index settings ( ) is soft delete enabled ( ) = = false ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } else { assert that ( snapshot , snapshot matchers contains operations in any order ( collections singleton list ( noop 2 ) ) ) ; } } try ( translog snapshot snapshot = shard new changes snapshot ( " test " , 0 , long max value , false ) ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } } shards assert all equal ( 0 ) ; } }


returns { @ code true } if the rows are equal to each other and { @ code false } otherwise

boolean equals ( row data row 1 , row data row 2 ) ;


remove any memory requirement that is stored for the specified anomaly detector job it doesn ' t matter if this method is called for a job that doesn ' t have a stored memory requirement

public void remove anomaly detector job ( string job id ) { memory requirement by anomaly detector job remove ( job id ) ; }


fails the whole job graph due to task failure

void fail job due to task failure ( final throwable cause , final execution attempt i d failing task ) ;


we used to serialize a change into a single byte [ ] now , we don ' t anymore , but we still need to be able to read it ( so that we can load the state store from previously - written changelog records )

public static change < byte [ ] > decompose legacy formatted array into change arrays ( final byte [ ] data ) { if ( data = = null ) { return null ; } final byte buffer buffer = byte buffer wrap ( data ) ; final byte [ ] old bytes = get nullable size prefixed array ( buffer ) ; final byte [ ] new bytes = get nullable size prefixed array ( buffer ) ; return new change < > ( new bytes , old bytes ) ; }


writes data to a page blob of the given size , flushing every x bytes measure performance of that and return it

private static test result write page blob test file ( native azure file system fs , long size , long flush interval ) throws i o exception { path test file = azure test utils blob path for tests ( fs , " write page blob test file " ) ; return write test file ( fs , test file , size , flush interval ) ; }


handle the given runtime exception thrown by the cache provider when updating an item with the specified { @ code key } and { @ code value } , possibly rethrowing it as a fatal exception

void handle cache put error ( runtime exception exception , cache cache , object key , @ nullable object value ) ;


register a listener that will be called when this model is bound to a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public model view with paris model on bind ( on model bound listener < model view with paris model , model view with paris > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


randomly selects digital signature algorithm uri for given private key algorithm ( { @ link private key # get algorithm ( ) } )

protected string get signature algorithm u r i ( private key key ) { string algo uri = null ; switch ( key get algorithm ( ) ) { case " rsa " : algo uri = random from ( " http : / / www w 3 org / 2001 / 04 / xmldsig - more # rsa - sha 2 5 6 " , " http : / / www w 3 org / 2001 / 04 / xmldsig - more # rsa - sha 5 1 2 " ) ; break ; case " dsa " : algo uri = " http : / / www w 3 org / 2009 / xmldsig 1 1 # dsa - sha 2 5 6 " ; break ; case " ec " : algo uri = random from ( " http : / / www w 3 org / 2001 / 04 / xmldsig - more # ecdsa - sha 2 5 6 " , " http : / / www w 3 org / 2001 / 04 / xmldsig - more # ecdsa - sha 5 1 2 " ) ; break ; default : throw new illegal argument exception ( " unsupported algorithm : " + key get algorithm ( ) + " for signature , allowed values for private key algorithm are [ rsa , dsa , ec ] " ) ; } return algo uri ; }


get default diagram image as bytes array

protected input stream get default diagram ( string diagram image file name ) { string image file name = diagram image file name ! = null ? diagram image file name : get default diagram image file name ( ) ; input stream image stream = get class ( ) get resource as stream ( image file name ) ; if ( image stream = = null ) { throw new activiti image exception ( " error occurred while getting default diagram image from file : " + image file name ) ; } return image stream ; }


returns whether { @ link freezable } s having this { @ code mutability } allow the { @ link # unsafe shallow freeze } operation

public boolean allows unsafe shallow freeze ( ) { return allows unsafe shallow freeze ; }


given a set of features , add to it all the features directly or indirectly implied by any of them , and return it

public static set < feature < ? > > add implied features ( set < feature < ? > > features ) { queue < feature < ? > > queue = new array deque < > ( features ) ; while ( ! queue is empty ( ) ) { feature < ? > feature = queue remove ( ) ; for ( feature < ? > implied : feature get implied features ( ) ) { if ( features add ( implied ) ) { queue add ( implied ) ; } } } return features ; }


public task attempt i d get task attempt i d ( ) { return ( task attempt i d ) super get task attempt i d ( ) ; }


converts a string into a { @ link bit set } with one bit per character of the string and bits set to 1 if the corresponding character in the string is a digit and 0 if not ( the first character of the string corresponds to the least significant bit in the { @ link bit set } , so if the { @ link bit set } is printed in natural order it will be reversed compared to the input , and then the most significant bit will be printed first however , in terms of random access to individual charactersbits , this " reversal " is by far the most intuitive representation )

static bit set string to number pos bit set ( string str ) { bit set result = new bit set ( ) ; for ( int index = 0 ; index < str length ( ) ; + + index ) { if ( character is digit ( str char at ( index ) ) ) { result set ( index ) ; } } return result ; }


a single preview frame will be returned to the handler supplied the data will arrive as byte [ ] in the message obj field , with width and height encoded as message arg 1 and message arg 2 , respectively

public synchronized void request preview frame ( handler handler , int message ) { open camera the camera = camera ; if ( the camera ! = null & & previewing ) { preview callback set handler ( handler , message ) ; the camera get camera ( ) set one shot preview callback ( preview callback ) ; } }


public string get class name ( clazz clazz ) { return clazz get class name ( u 2class index ) ; }


return the list of supported content types in cases when the content - type header is parsed but not supported , or an empty list otherwise

public list < media type > get supported media types ( ) { return this supported media types ; }


return the current offset from the start of the file

public long get pos ( ) throws i o exception { return current pos ; }


returns true if the given name could match a default dynamic label ( ext , lab , sub , fun , dat ) at some address warning ! does not handle dynamic labels which use data - type prefixes - see { @ link # is dynamic symbol pattern ( string , boolean ) } for more liberal check

public static boolean is reserved dynamic label name ( string name , address factory addr factory ) { string prefix = find dynamic prefix ( name ) ; if ( prefix = = null ) { return false ; } int len = prefix length ( ) ; if ( name length ( ) < len + 1 ) { return false ; } return parse dynamic name ( addr factory , name ) ! = null ; }


the default mapping type to use for fields of this { @ link x content field type } when defined as runtime fields by default , the lowercase field type is used

string default runtime mapping type ( ) { return to string ( ) ; }


public marshaller get marshaller ( ) { return this marshaller ; }


reports whether the given repository is the special builtins pseudo - repository

static boolean is builtins repo ( repository name repo ) { / / use string equals ( ) , not repository name equals ( ) , to force case sensitivity return repo get name ( ) equals ( builtins name ) ; }


private void iterate long keys ( boolean test stored d b , int record cnt , long key increment , int var data size ) throws i o exception { d b record [ ] recs = null ; if ( key increment = = 0 ) { recs = create random long key table records ( null , record cnt , var data size ) ; } else { recs = create ordered long key table records ( record cnt , key increment , var data size ) ; } arrays sort ( recs ) ; if ( test stored d b ) { save as and reopen ( db name ) ; } table table = dbh get table ( table 1 name ) ; assert equals ( record cnt , table get record count ( ) ) ; assert equals ( recs [ record cnt - 1 ] get key ( ) , table get max key ( ) ) ; / / forward iteration ( no start ) int rec ix = 0 ; d b long iterator iter = table long key iterator ( ) ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( record cnt , rec ix ) ; / / forward iteration ( start in middle ) rec ix = record cnt / 2 ; iter = table long key iterator ( recs [ rec ix ] get key ( ) ) ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( record cnt , rec ix ) ; / / reverse iteration ( no start ) rec ix = record cnt - 1 ; iter = table long key iterator ( long max value ) ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( - 1 , rec ix ) ; / / reverse iteration ( start in middle ) rec ix = record cnt / 2 ; iter = table long key iterator ( recs [ rec ix ] get key ( ) ) ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( - 1 , rec ix ) ; / / range iteration ( forward ) starting at min on existing record int min ix = record cnt / 10 ; int max ix = 2 * min ix ; iter = table long key iterator ( recs [ min ix ] get key ( ) , recs [ max ix ] get key ( ) , recs [ min ix ] get key ( ) ) ; rec ix = min ix ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( rec ix , max ix + 1 ) ; / / range iteration ( reverse ) starting at max on existing record iter = table long key iterator ( recs [ min ix ] get key ( ) , recs [ max ix ] get key ( ) , recs [ max ix ] get key ( ) ) ; rec ix = max ix ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( rec ix , min ix - 1 ) ; / / assumes consecutive keys do not exist - assumption could be a problem with random keys if ( key increment ! = 1 ) { / / range iteration ( forward ) starting at min and not on existing record long missing min key = recs [ min ix ] get key ( ) - 1 ; long missing max key = recs [ max ix ] get key ( ) + 1 ; iter = table long key iterator ( missing min key , missing max key , missing min key ) ; rec ix = min ix ; assert true ( ! iter has previous ( ) ) ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( rec ix , max ix + 1 ) ; / / range iteration - no records ( forward and reverse ) iter = table long key iterator ( missing min key , missing min key , missing min key ) ; assert true ( ! iter has next ( ) ) ; assert true ( ! iter has previous ( ) ) ; iter = table long key iterator ( missing max key , missing max key , missing max key ) ; assert true ( ! iter has next ( ) ) ; assert true ( ! iter has previous ( ) ) ; / / range iteration ( reverse ) starting at max and not on existing record iter = table long key iterator ( missing min key , missing max key , missing max key ) ; rec ix = max ix ; assert true ( ! iter has next ( ) ) ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( rec ix , min ix - 1 ) ; / / range iteration ( reverse ) starting at mid and not on existing record int mid ix = ( min ix + max ix ) / 2 ; long missing mid key = recs [ mid ix ] get key ( ) - 1 ; iter = table long key iterator ( missing min key , missing max key , missing mid key ) ; rec ix = mid ix - 1 ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( rec ix , min ix - 1 ) ; / / range iteration ( forward ) starting at mid and not on existing record iter = table long key iterator ( missing min key , missing max key , missing mid key ) ; rec ix = mid ix ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( rec ix , max ix + 1 ) ; } / / delete ( forward ) long tx id = dbh start transaction ( ) ; iter = table long key iterator ( recs [ min ix ] get key ( ) , recs [ max ix ] get key ( ) , recs [ min ix ] get key ( ) ) ; rec ix = min ix ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; iter delete ( ) ; } assert equals ( rec ix , max ix + 1 ) ; dbh end transaction ( tx id , true ) ; record cnt - = max ix - min ix + 1 ; assert equals ( table get record count ( ) , record cnt ) ; iter = table long key iterator ( recs [ min ix - 1 ] get key ( ) , recs [ max ix + 1 ] get key ( ) , recs [ min ix - 1 ] get key ( ) ) ; assert equals ( recs [ min ix - 1 ] get key ( ) , iter next ( ) ) ; assert equals ( recs [ max ix + 1 ] get key ( ) , iter next ( ) ) ; / / range iteration ( reverse ) tx id = dbh start transaction ( ) ; min ix = min ix * 3 ; max ix + = min ix ; iter = table long key iterator ( recs [ min ix ] get key ( ) , recs [ max ix ] get key ( ) , recs [ max ix ] get key ( ) ) ; rec ix = max ix ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; iter delete ( ) ; } assert equals ( rec ix , min ix - 1 ) ; dbh end transaction ( tx id , true ) ; record cnt - = max ix - min ix + 1 ; assert equals ( table get record count ( ) , record cnt ) ; iter = table long key iterator ( recs [ min ix - 1 ] get key ( ) , recs [ max ix + 1 ] get key ( ) , recs [ min ix - 1 ] get key ( ) ) ; assert equals ( recs [ min ix - 1 ] get key ( ) , iter next ( ) ) ; assert equals ( recs [ max ix + 1 ] get key ( ) , iter next ( ) ) ; }


sets whether or not negative numbers are accepted

public void set allow negative values ( boolean b ) { big integer current value = get value ( ) ; allows negative = b ; if ( ! allows negative ) { if ( current value ! = null & & current value compare to ( big integer zero ) < 0 ) { current value = null ; } } update text field ( current value ) ; }


add the child node to parent and , if child is a file , update block map this method is only used for image loading so that synchronization , modification time update and space count update are not needed

private void add to parent ( i node directory parent , i node child ) throws illegal reserved path exception { f s directory fs dir = namesystem dir ; if ( parent = = fs dir root dir ) { child set local name ( rename reserved root component on upgrade ( child get local name bytes ( ) , get layout version ( ) ) ) ; } / / note : this does not update space counts for parents if ( ! parent add child ( child ) ) { return ; } namesystem dir cache name ( child ) ; if ( child is file ( ) ) { update blocks map ( child as file ( ) ) ; } }


retrieve the { @ link connection factory } identified by the given name

connection factory get connection factory ( string connection factory name ) throws connection factory lookup failure exception ;


returns the { @ link batch segregating criteria } of this group

public batch segregating criteria get criteria ( ) { return criteria ; }


public string get task name ( ) { return this task name ; }


public void update pet test ( ) { pet body = null ; / / api update pet ( body ) ; / / todo : test validations }


test when number of live nodes are less than the " dfs client block write replace - datanode - on - failure min replication "

public void test less number of live datanodes than write replace datanode on failure r f ( ) throws exception { final mini d f s cluster cluster = setup cluster ( 2 ) ; try { final distributed file system fs = cluster get file system ( ) ; final path dir = new path ( dir ) ; final slow writer [ ] slowwriters = new slow writer [ 1 ] ; for ( int i = 1 ; i < = slowwriters length ; i + + ) { / / create slow writers in different speed slowwriters [ i - 1 ] = new slow writer ( fs , new path ( dir , " file " + i ) , i * 200l ) ; } for ( slow writer s : slowwriters ) { s start ( ) ; } / / let slow writers write something / / some of them are too slow and will be not yet started sleep seconds ( 1 ) ; / / stop an old datanode cluster stop data node ( 0 ) ; cluster stop data node ( 0 ) ; / / let the slow writer writes a few more seconds / / everyone should have written something sleep seconds ( 20 ) ; / / check replication and interrupt for ( slow writer s : slowwriters ) { try { s out get current block replication ( ) ; assert fail ( " must throw exception as failed to add a new datanode for write " + " pipeline , minimum failure replication " ) ; } catch ( i o exception e ) { / / expected } s interrupt running ( ) ; } / / close files for ( slow writer s : slowwriters ) { s join and close ( ) ; } / / verify the file verify file content ( fs , slowwriters ) ; } finally { if ( cluster ! = null ) { cluster shutdown ( ) ; } } }


public void update null ( string column label ) throws s q l exception { }


public list < string > get commands ( ) { return commands ; }


initialize egl for a given configuration spec

public void start ( ) { if ( log egl ) { log w ( " egl helper " , " start ( ) tid = " + thread current thread ( ) get id ( ) ) ; } / * * get an egl instance * / egl = ( egl10 ) e g l context get e g l ( ) ; / * * get to the default display * / egl display = egl egl get display ( egl10 egl default display ) ; if ( egl display = = egl10 egl no display ) { throw new runtime exception ( " egl get display failed " ) ; } / * * we can now initialize egl for that display * / int [ ] version = new int [ 2 ] ; if ( ! egl egl initialize ( egl display , version ) ) { throw new runtime exception ( " egl initialize failed " ) ; } g l texture view view = gl texture view weak ref get ( ) ; if ( view = = null ) { egl config = null ; egl context = null ; } else { egl config = view egl config chooser choose config ( egl , egl display ) ; / * * create an egl context we want to do this as rarely as we can , because an * egl context is a somewhat heavy object * / egl context = view egl context factory create context ( egl , egl display , egl config ) ; } if ( egl context = = null | | egl context = = egl10 egl no context ) { egl context = null ; throw egl exception ( " create context " ) ; } if ( log egl ) { log w ( " egl helper " , " create context " + egl context + " tid = " + thread current thread ( ) get id ( ) ) ; } egl surface = null ; }


adds a buffer to a priority queue in log ( size ) time if one tries to add more objects than max size from initialize a runtime exception ( array index out of bound ) is thrown

public final void put ( t element ) { size + + ; heap [ size ] = element ; up heap ( ) ; }


open paypal open collective link and add event

private static void on paypal click ( final notification notification , final hyperlink event event ) { final url url = event get u r l ( ) ; try { @ non nls final j s o n object props = new j s o n object ( ) ; props put ( " url " , url ) ; m t analytics get instance ( ) track with data ( m t analytics update notification , props ) ; } catch ( final j s o n exception ignored ) { } if ( url = = null ) { browser util browse ( event get description ( ) ) ; } else { browser util browse ( url ) ; } notification expire ( ) ; }


whether the contained type has any exception mappings

public boolean has exception mappings ( ) { return ! this mapped methods is empty ( ) ; }


public void add properties ( map < string , string > properties ) { if ( properties ! = null ) { this store put all ( properties ) ; } }


public prepared statement prepare statement ( string sql , int [ ] column indexes ) throws s q l exception { if ( throw exception ) { throw new s q l exception ( ) ; } return new stub prepared statement ( this ) ; }


returns the rtti number : { 0 - 4 , or - 1 if not an rtti }

public int get r t t i number ( ) { return basic name get r t t i number ( ) ; }


puts an utf8 string into this byte vector the byte vector is automatically enlarged if necessary the string length is encoded in two bytes before the encoded characters , if there is space for that ( i e if this length - offset - 2 & gt ; = 0 )

final byte vector encode utf 8 ( final string string value , final int offset , final int max byte length ) { int char length = string value length ( ) ; int byte length = offset ; for ( int i = offset ; i < char length ; + + i ) { char char value = string value char at ( i ) ; if ( char value > = 0x 0 0 0 1 & & char value < = 0x 0 0 7 f ) { byte length + + ; } else if ( char value < = 0x 0 7 f f ) { byte length + = 2 ; } else { byte length + = 3 ; } } if ( byte length > max byte length ) { throw new illegal argument exception ( " utf8 string too large " ) ; } / / compute where ' byte length ' must be stored in ' data ' , and store it at this location int byte length offset = length - offset - 2 ; if ( byte length offset > = 0 ) { data [ byte length offset ] = ( byte ) ( byte length > > > 8 ) ; data [ byte length offset + 1 ] = ( byte ) byte length ; } if ( length + byte length - offset > data length ) { enlarge ( byte length - offset ) ; } int current length = length ; for ( int i = offset ; i < char length ; + + i ) { char char value = string value char at ( i ) ; if ( char value > = 0x 0 0 0 1 & & char value < = 0x 0 0 7 f ) { data [ current length + + ] = ( byte ) char value ; } else if ( char value < = 0x 0 7 f f ) { data [ current length + + ] = ( byte ) ( 0x c 0 | char value > > 6 & 0x 1 f ) ; data [ current length + + ] = ( byte ) ( 0x 8 0 | char value & 0x 3 f ) ; } else { data [ current length + + ] = ( byte ) ( 0x e 0 | char value > > 12 & 0x f ) ; data [ current length + + ] = ( byte ) ( 0x 8 0 | char value > > 6 & 0x 3 f ) ; data [ current length + + ] = ( byte ) ( 0x 8 0 | char value & 0x 3 f ) ; } } length = current length ; return this ; }


public v t match info create random match ( v t session session ) { return create random match ( addr ( ) , addr ( ) , session ) ; }


determine the options present when invoking a jvm with the given user defined options

public static map < string , jvm option > find final options ( final list < string > user defined jvm options ) throws interrupted exception , i o exception { return flags final ( user defined jvm options ) stream ( ) map ( option : : matcher ) filter ( matcher : : matches ) collect ( collectors to unmodifiable map ( m - > m group ( " flag " ) , m - > new jvm option ( m group ( " value " ) , m group ( " origin " ) ) ) ) ; }


returns indices that were included in this snapshot

public list < string > indices ( ) { return indices ; }


creates new action cache entry using given compressed entry data data will stay in the compressed format until entry is actually used by the dependency checker

private static action cache entry decode ( string indexer indexer , byte [ ] data ) throws i o exception { try { byte buffer source = byte buffer wrap ( data ) ; byte [ ] action key bytes = new byte [ var int get var int ( source ) ] ; source get ( action key bytes ) ; string action key = new string ( action key bytes , iso 8859 1 ) ; byte [ ] digest = metadata digest utils read ( source ) ; int count = var int get var int ( source ) ; if ( count ! = no input discovery count & & count < 0 ) { throw new i o exception ( " negative discovered file count : " + count ) ; } immutable list < string > files = null ; if ( count ! = no input discovery count ) { immutable list builder < string > builder = immutable list builder with expected size ( count ) ; for ( int i = 0 ; i < count ; i + + ) { int id = var int get var int ( source ) ; string filename = ( id > = 0 ? indexer get string for index ( id ) : null ) ; if ( filename = = null ) { throw new i o exception ( " corrupted file index " ) ; } builder add ( filename ) ; } files = builder build ( ) ; } byte [ ] used client env digest = metadata digest utils read ( source ) ; if ( source remaining ( ) > 0 ) { throw new i o exception ( " serialized entry data has not been fully decoded " ) ; } return new action cache entry ( action key , used client env digest , files , digest ) ; } catch ( buffer underflow exception e ) { throw new i o exception ( " encoded entry data is incomplete " , e ) ; } }


called when the value returned from { @ link # get play when ready ( ) } changes

default void on play when ready changed ( boolean play when ready , @ play when ready change reason int reason ) { }


void test deserialize junk data ( ) { try { under test deserialize ( read context , coded input stream new instance ( " junk " get bytes ( standard charsets utf 8 ) ) ) ; fail ( " expected exception " ) ; } catch ( serialization exception | i o exception e ) { / / expected } }


sets the chaining strategy of this { @ code transformation }

public abstract void set chaining strategy ( chaining strategy strategy ) ;


display the information about a job ' s tasks , of a particular type and in a particular state

protected void display tasks ( job job , string type , string state ) throws i o exception , interrupted exception { task report [ ] reports = null ; reports = job get task reports ( task type value of ( org apache hadoop util string utils to upper case ( type ) ) ) ; for ( task report report : reports ) { t i p status status = report get current status ( ) ; if ( ( state equals ignore case ( " pending " ) & & status = = t i p status pending ) | | ( state equals ignore case ( " running " ) & & status = = t i p status running ) | | ( state equals ignore case ( " completed " ) & & status = = t i p status complete ) | | ( state equals ignore case ( " failed " ) & & status = = t i p status failed ) | | ( state equals ignore case ( " killed " ) & & status = = t i p status killed ) ) { print task attempts ( report ) ; } } }


sets image drawable into this image aware view < br > displays drawable in this image aware view { @ linkplain com nostra 1 3 universalimageloader core display image options builder # show image for empty uri ( android graphics drawable drawable ) for empty uri } , { @ linkplain com nostra 1 3 universalimageloader core display image options builder # show image on loading ( android graphics drawable drawable ) on loading } or { @ linkplain com nostra 1 3 universalimageloader core display image options builder # show image on fail ( android graphics drawable drawable ) on loading fail } these drawables can be specified in { @ linkplain com nostra 1 3 universalimageloader core display image options display options } < br > also can be called in { @ link com nostra 1 3 universalimageloader core display bitmap displayer bitmap displayer } < br > is called on ui thread if image loader was called on ui thread otherwise - on background thread

boolean set image drawable ( drawable drawable ) ;


drains the queue as { @ link blocking queue # drain to ( collection , int ) } , but if the requested { @ code num elements } elements are not available , it will wait for them up to the specified timeout

public static < e > int drain ( blocking queue < e > q , collection < ? super e > buffer , int num elements , long timeout , time unit unit ) throws interrupted exception { preconditions check not null ( buffer ) ; / * * this code performs one system nano time ( ) more than necessary , and in return , the time to * execute queue # drain to is not added * on top * of waiting for the timeout ( which could make * the timeout arbitrarily inaccurate , given a queue that is slow to drain ) * / long deadline = system nano time ( ) + unit to nanos ( timeout ) ; int added = 0 ; while ( added < num elements ) { / / we could rely solely on # poll , but # drain to might be more efficient when there are multiple / / elements already available ( e g linked blocking queue # drain to locks only once ) added + = q drain to ( buffer , num elements - added ) ; if ( added < num elements ) { / / not enough elements immediately available ; will have to poll e e = q poll ( deadline - system nano time ( ) , time unit nanoseconds ) ; if ( e = = null ) { break ; / / we already waited enough , and there are no more elements in sight } buffer add ( e ) ; added + + ; } } return added ; }


returns a { @ link string } view of the data

public string string ( ) { return text = = null ? bytes utf 8 to string ( ) : text ; }


register a listener that will be called when this model is bound to a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public model with super attributes on bind ( on model bound listener < model with super attributes , object > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


public static void short 2bytes ( short v , byte [ ] b , int off ) { b [ off + 1 ] = ( byte ) v ; b [ off + 0 ] = ( byte ) ( v > > > 8 ) ; }


returns a { @ link media source event listener event dispatcher } which dispatches all events to the registered listeners with the specified window index , media period id and time offset

protected final media source event listener event dispatcher create event dispatcher ( int window index , @ nullable media period id media period id , long media time offset ms ) { return event dispatcher with parameters ( window index , media period id , media time offset ms ) ; }


this is a way to know about updates from the table

public void add threaded table model listener ( threaded table model listener listener ) { listeners add ( listener ) ; }


returns the strategy for loading the configuration

public static supplier < config > config source ( ) { return typesafe configurator config source ; }


returns an array containing all of the elements in this queue , in proper sequence ; the runtime type of the returned array is that of the specified array if the queue fits in the specified array , it is returned therein otherwise , a new array is allocated with the runtime type of the specified array and the size of this queue if this queue fits in the specified array with room to spare ( i e , the array has more elements than this queue ) , the element in the array immediately following the end of the queue is set to < tt > null < tt > like the { @ link # to array ( ) } method , this method acts as bridge between array - based and collection - based a p is further , this method allows precise control over the runtime type of the output array , and may , under certain circumstances , be used to save allocation costs suppose < tt > x < tt > is a queue known to contain only strings the following code can be used to dump the queue into a newly allocated array of < tt > string < tt > : string [ ] y = x to array ( new string [ 0 ] ) ; note that < tt > to array ( new object [ 0 ] ) < tt > is identical in function to < tt > to array ( ) < tt >

public < t > t [ ] to array ( t [ ] a ) { final e [ ] items = this items ; final monitor monitor = this monitor ; monitor enter ( ) ; try { if ( a length < count ) a = object arrays new array ( a , count ) ; int k = 0 ; int i = take index ; while ( k < count ) { / / this cast is not itself safe , but the following statement / / will fail if the runtime type of items [ i ] is not assignable / / to the runtime type of a [ k + + ] , which is all that the method / / contract requires ( see @ throws array store exception above ) @ suppress warnings ( " unchecked " ) t t = ( t ) items [ i ] ; a [ k + + ] = t ; i = inc ( i ) ; } if ( a length > count ) a [ count ] = null ; return a ; } finally { monitor leave ( ) ; } }


create a { @ link subscriber } with the given parameters

public static < t , r > subscriber < t > subscribe ( subscriber < ? super r > downstream , function < ? super t , ? extends iterable < ? extends r > > mapper , int prefetch ) { return new flatten iterable subscriber < > ( downstream , mapper , prefetch ) ; }


computes the hyperlink to actions , to handle the situation when the { @ link action # get url name ( ) } returns absolute url

public static @ check for null string get action url ( string it url , action action ) { string url name = action get url name ( ) ; if ( url name = = null ) return null ; / / should not be displayed try { if ( new uri ( url name ) is absolute ( ) ) { return url name ; } } catch ( u r i syntax exception x ) { logger get logger ( functions class get name ( ) ) log ( level warning , " failed to parse url for { 0 } : { 1 } " , new object [ ] { action , x } ) ; return null ; } if ( url name starts with ( " / " ) ) return join path ( stapler get current request ( ) get context path ( ) , url name ) ; else / / relative url name return join path ( stapler get current request ( ) get context path ( ) + ' / ' + it url , url name ) ; }


public string get catalog name ( ) { return this call meta data context get catalog name ( ) ; }


public just symbol enum get just symbol ( ) { return just symbol ; }


returns the section where the relocations will be applied for example , this method will return " plt " for " rel plt "

public elf section header get section to be relocated ( ) { return section to be relocated ; }


public string get prefix string ( ) { return prefix string ; }


finds pets by status multiple status values can be provided with comma separated strings

public list < pet > find pets by status ( list < string > status ) { / / todo : implement return null ; }


public simple future < t > reset ( ) { super reset ( ) ; result = null ; exception = null ; waiter = null ; internal callback = null ; silent = false ; return this ; }


add a listener to the list of listeners to be notified when there is a change in the content

public void add modify listener ( modify listener listener ) { if ( listeners = = null ) listeners = new array list < > ( ) ; listeners add ( listener ) ; }


writes out the given local info the written string will be something like : " local var " : ljavalang string ; , " some signature " " local var " : ljavalang string ; " local var " : v , " some signature " null : ljavalang string ; , " some signature " null : v , " some signature " one of name , type or signature must be non - null

public static void write local ( @ nonnull indenting writer writer , @ nullable string name , @ nullable string type , @ nullable string signature ) throws i o exception { if ( name ! = null ) { reference formatter write string reference ( writer , name ) ; } else { writer write ( " null " ) ; } writer write ( ' : ' ) ; if ( type ! = null ) { writer write ( type ) ; } else { writer write ( " v " ) ; } if ( signature ! = null ) { writer write ( " , " ) ; reference formatter write string reference ( writer , signature ) ; } }


adds the broadcast connection identified by the given { @ code name } to this node

public void add broadcast connection ( string name , dag connection broadcast connection ) { this broadcast connection names add ( name ) ; this broadcast connections add ( broadcast connection ) ; }


private static string generate test file ( string output file , int length ) throws i o exception , no such algorithm exception { path output file path = new path ( output file ) ; final file system file system = output file path get file system ( ) ; try ( final f s data output stream fs data output stream = file system create ( output file path , file system write mode overwrite ) ) { return write random content ( fs data output stream , length ) ; } }


get the adjusted memory size in bytes of the memory block which relates to this program header ; it may be zero if no block should be created the returned value reflects any adjustment the elf extension may require based upon the specific processorlanguage implementation which may require filtering of file bytes as loaded into memory

public long get adjusted memory size ( ) { return header get load adapter ( ) get adjusted memory size ( this ) ; }


return < code > shutdown hook manager < code > singleton

public static shutdown hook manager get ( ) { return mgr ; }


gets signing key registered service property

protected registered service properties get signing key registered service property ( ) { return registered service properties token as service ticket signing key ; }


returns shards based on node attributes given such as node name , node attribute , node ip supports node specifications in cluster api

public shard iterator only node selector active initializing shards it ( string [ ] node attributes , discovery nodes discovery nodes ) { array list < shard routing > ordered = new array list < > ( active shards size ( ) + all initializing shards size ( ) ) ; set < string > selected nodes = sets new hash set ( discovery nodes resolve nodes ( node attributes ) ) ; int seed = shuffler next seed ( ) ; for ( shard routing shard routing : shuffler shuffle ( active shards , seed ) ) { if ( selected nodes contains ( shard routing current node id ( ) ) ) { ordered add ( shard routing ) ; } } for ( shard routing shard routing : shuffler shuffle ( all initializing shards , seed ) ) { if ( selected nodes contains ( shard routing current node id ( ) ) ) { ordered add ( shard routing ) ; } } if ( ordered is empty ( ) ) { final string message = string format ( locale root , " no data nodes with % s [ % s ] found for shard : % s " , node attributes length = = 1 ? " criteria " : " criterion " , string join ( " , " , node attributes ) , shard id ( ) ) ; throw new illegal argument exception ( message ) ; } return new plain shard iterator ( shard id , ordered ) ; }


public int get update count ( ) throws s q l exception { return 0 ; }


set the active animation , replacing any current animation

public animation desc set animation ( final string id , int loop count , float speed , final animation listener listener ) { return set animation ( id , 0f , - 1f , loop count , speed , listener ) ; }


private @ check for null runnable make buildable ( final buildable item p ) { if ( p task instanceof flyweight task ) { string task display name = logger is loggable ( level finest ) ? p task get full display name ( ) : null ; if ( ! is blocked by shutdown ( p task ) ) { runnable runnable = make fly weight task buildable ( p ) ; logger log ( level finest , " converting flyweight task : { 0 } into a buildable runnable " , task display name ) ; if ( runnable ! = null ) { return runnable ; } / / this is to solve jenkins - 30084 : the task has to be buildable to force the provisioning of nodes / / if the execution gets here , it means the task could not be scheduled since the node / / the task is supposed to run on is offline or not available / / thus , the flyweighttask enters the buildables queue and will ask jenkins to provision a node logger log ( level finest , " flyweight task { 0 } is entering as buildable to provision a node " , task display name ) ; return new buildable runnable ( p ) ; } / / if the execution gets here , it means the task is blocked by shutdown and null is returned logger log ( level finest , " task { 0 } is blocked by shutdown " , task display name ) ; return null ; } else { / / regular heavyweight task return new buildable runnable ( p ) ; } }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


get an instance based on the exception : either a value or a reference to { @ link # none }

public static maybe i o e of ( i o exception ex ) { return ex ! = null ? new maybe i o e ( ex ) : none ; }


records the successful load of a new entry this should be called when a cache request causes an entry to be loaded , and the loading completes successfully in contrast to { @ link # record misses } , this method should only be called by the loading thread

void record load success ( long load time ) ;


gets the properties that are interesting for this node to produce

public interesting properties get interesting properties ( ) { return this int props ; }


public < t > t execute ( function < response , t > handler ) { return handler apply ( rest assured given ( ) spec ( req spec build ( ) ) expect ( ) spec ( resp spec build ( ) ) when ( ) request ( req method , req uri ) ) ; }


returns the test sharding strategy optionally specified by the jvm flag { @ link # test sharding strategy } , which maps to the enums in { @ link com google testing junit runner sharding sharding filters sharding strategy }

public string get test sharding strategy ( ) { return system get property ( test sharding strategy ) ; }


return the protocol scheme for the file system

public string get scheme ( ) { return " s 3n " ; }


public boolean accept ( final path key path , final string prefix ) { return false ; }


public void release target ( object object ) { }


return whether the aop proxy will expose the aop proxy for each invocation

public boolean is expose proxy ( ) { return this expose proxy ; }


public cancellable start transform async ( start transform request request , request options options , action listener < start transform response > listener ) { return rest high level client perform request async and parse entity ( request , transform request converters : : start transform , options , start transform response : : from x content , listener , collections empty set ( ) ) ; }


returns { @ link bug reporter } to use when reporting bugs , instead of { @ link com google devtools build lib bugreport bug report # send bug report }

public bug reporter get bug reporter ( ) { return executor get bug reporter ( ) ; }


public string read output file ( configuration conf ) throws i o exception { file system local fs = file system get local ( conf ) ; path file = new path ( output dir , " part - 00000 " ) ; return utils for tests slurp hadoop ( file , local fs ) ; }


similar to { @ link # nearest container matching ( file type , artifact ) } , but returns the container closest to the root that matches the given type

static optional < path fragment > farthest container matching ( file type type , artifact artifact ) { path fragment container = artifact get exec path ( ) ; optional < path fragment > last match = optional absent ( ) ; do { if ( type matches ( container ) ) { last match = optional of ( container ) ; } container = container get parent directory ( ) ; } while ( container ! = null ) ; return last match ; }


this gets the handler type structure for this model

public data type get data type ( ) { if ( data type = = null ) { data type = get data type ( get program ( ) ) ; } return data type ; }


test for the choose low redundancy blocks are processed based on priority

public void test choose low redundancy blocks ( ) throws exception { low redundancy blocks low redundancy blocks = new low redundancy blocks ( ) ; for ( int i = 0 ; i < 5 ; i + + ) { / / adding queue highest priority block low redundancy blocks add ( gen block info ( thread local random current ( ) next long ( ) ) , 1 , 0 , 0 , 3 ) ; / / adding queue very low redundancy block low redundancy blocks add ( gen block info ( thread local random current ( ) next long ( ) ) , 2 , 0 , 0 , 7 ) ; / / adding queue replicas badly distributed block low redundancy blocks add ( gen block info ( thread local random current ( ) next long ( ) ) , 6 , 0 , 0 , 6 ) ; / / adding queue low redundancy block low redundancy blocks add ( gen block info ( thread local random current ( ) next long ( ) ) , 5 , 0 , 0 , 6 ) ; / / adding queue with corrupt blocks block low redundancy blocks add ( gen block info ( thread local random current ( ) next long ( ) ) , 0 , 0 , 0 , 3 ) ; } / / choose 6 blocks from low redundancy blocks then it should pick 5 blocks / / from queue highest priority and 1 block from queue very low redundancy list < list < block info > > chosen blocks = low redundancy blocks choose low redundancy blocks ( 6 ) ; assert the chosen blocks ( chosen blocks , 5 , 1 , 0 , 0 , 0 ) ; / / choose 10 blocks from low redundancy blocks then it should pick 4 blocks / / from queue very low redundancy , 5 blocks from queue low redundancy and 1 / / block from queue replicas badly distributed chosen blocks = low redundancy blocks choose low redundancy blocks ( 10 ) ; assert the chosen blocks ( chosen blocks , 0 , 4 , 5 , 1 , 0 ) ; / / adding queue highest priority low redundancy blocks add ( gen block info ( thread local random current ( ) next long ( ) ) , 0 , 1 , 0 , 3 ) ; / / choose 10 blocks from low redundancy blocks then it should pick 1 block / / from queue highest priority , 4 blocks from / / queue replicas badly distributed chosen blocks = low redundancy blocks choose low redundancy blocks ( 10 ) ; assert the chosen blocks ( chosen blocks , 1 , 0 , 0 , 4 ) ; / / since it is reached to end of all lists , / / should start picking the blocks from start / / choose 7 blocks from low redundancy blocks then it should pick 6 blocks / / from queue highest priority , 1 block from queue very low redundancy chosen blocks = low redundancy blocks choose low redundancy blocks ( 7 ) ; assert the chosen blocks ( chosen blocks , 6 , 1 , 0 , 0 , 0 ) ; }


tests that branches that are re - joined have place pipeline breakers - > ( sink ) - > ( reduce ) - + - > ( flatmap ) - > ( sink ) \ ( source ) - > ( map ) - ( join ) - + - - - - - \ \ \ \ - > ( filter ) - + \ \ ( co group ) - > ( sink ) \ \ - > ( reduce ) -

public void test re joined branches ( ) { try { / / build a test program execution environment env = execution environment get execution environment ( ) ; data set < tuple 2 < long , long > > data = env from elements ( 33l , 44l ) map ( new map function < long , tuple 2 < long , long > > ( ) { @ override public tuple 2 < long , long > map ( long value ) { return new tuple 2 < long , long > ( value , value ) ; } } ) ; data set < tuple 2 < long , long > > reduced = data group by ( 0 ) reduce ( new select one reducer < tuple 2 < long , long > > ( ) ) ; reduced output ( new discarding output format < tuple 2 < long , long > > ( ) ) ; data set < tuple 2 < long , long > > filtered = data filter ( new filter function < tuple 2 < long , long > > ( ) { @ override public boolean filter ( tuple 2 < long , long > value ) throws exception { return false ; } } ) ; data set < tuple 2 < long , long > > joined = reduced join ( filtered ) where ( 1 ) equal to ( 1 ) with ( new dummy flat join function < tuple 2 < long , long > > ( ) ) ; joined flat map ( new identity flat mapper < tuple 2 < long , long > > ( ) ) output ( new discarding output format < tuple 2 < long , long > > ( ) ) ; joined co group ( filtered group by ( 1 ) reduce group ( new top 1 group reducer < tuple 2 < long , long > > ( ) ) ) where ( 0 ) equal to ( 0 ) with ( new dummy co group function < tuple 2 < long , long > , tuple 2 < long , long > > ( ) ) output ( new discarding output format < tuple 2 < tuple 2 < long , long > , tuple 2 < long , long > > > ( ) ) ; list < data sink node > sinks = convert plan ( env create program plan ( ) ) ; / / gather the optimizer dag nodes data sink node sink after reduce = sinks get ( 0 ) ; data sink node sink after flat map = sinks get ( 1 ) ; data sink node sink after co group = sinks get ( 2 ) ; single input node reduce node = ( single input node ) sink after reduce get predecessor node ( ) ; single input node map node = ( single input node ) reduce node get predecessor node ( ) ; single input node flat map node = ( single input node ) sink after flat map get predecessor node ( ) ; two input node join node = ( two input node ) flat map node get predecessor node ( ) ; single input node filter node = ( single input node ) join node get second predecessor node ( ) ; two input node co group node = ( two input node ) sink after co group get predecessor node ( ) ; single input node other reduce node = ( single input node ) co group node get second predecessor node ( ) ; / / test sanity checks ( that we constructed the dag correctly ) assert equals ( reduce node , join node get first predecessor node ( ) ) ; assert equals ( map node , filter node get predecessor node ( ) ) ; assert equals ( join node , co group node get first predecessor node ( ) ) ; assert equals ( filter node , other reduce node get predecessor node ( ) ) ; / / verify the pipeline breaking status assert false ( sink after reduce get input connection ( ) is breaking pipeline ( ) ) ; assert false ( sink after flat map get input connection ( ) is breaking pipeline ( ) ) ; assert false ( sink after co group get input connection ( ) is breaking pipeline ( ) ) ; assert false ( map node get incoming connection ( ) is breaking pipeline ( ) ) ; assert false ( flat map node get incoming connection ( ) is breaking pipeline ( ) ) ; assert false ( join node get first incoming connection ( ) is breaking pipeline ( ) ) ; assert false ( co group node get first incoming connection ( ) is breaking pipeline ( ) ) ; assert false ( co group node get second incoming connection ( ) is breaking pipeline ( ) ) ; / / these should be pipeline breakers assert true ( reduce node get incoming connection ( ) is breaking pipeline ( ) ) ; assert true ( filter node get incoming connection ( ) is breaking pipeline ( ) ) ; assert true ( other reduce node get incoming connection ( ) is breaking pipeline ( ) ) ; assert true ( join node get second incoming connection ( ) is breaking pipeline ( ) ) ; } catch ( exception e ) { e print stack trace ( ) ; fail ( e get message ( ) ) ; } }


returns whether { @ link # lazy stack trace } will use the special implementation described in its documentation

public static boolean lazy stack trace is lazy ( ) { return get stack trace element method ! = null & & get stack trace depth method ! = null ; }


cancel any existing requests for the specified target { @ link image view }

public void cancel request ( @ non null image view view ) { / / check main ( ) is called from cancel existing request ( ) check not null ( view , " view = = null " ) ; cancel existing request ( view ) ; }


checks for an error and rethrows it if one was reported

void check error ( ) throws i o exception { final throwable t = channel error get ( ) ; if ( t ! = null ) { if ( t instanceof i o exception ) { throw ( i o exception ) t ; } else { throw new i o exception ( " there has been an error in the channel " , t ) ; } } }


gets the table with the provided table type id from the metadata stream

public cli abstract table get table ( int table id ) { return get table ( cli type table from id ( table id ) ) ; }


assert that a set of properties files all contain the same data we cannot simply check the md 5sums here , since properties files contain timestamps - - thus , two properties files from the same save namespace operation may actually differ in md 5sum

public static void assert properties files same ( file [ ] prop files ) throws i o exception { assert properties files same ( prop files , null ) ; }


simple test with image , edits , and inprogress edits

public void test current storage inspector ( ) throws i o exception { f s image transactional storage inspector inspector = new f s image transactional storage inspector ( ) ; storage directory mock dir = f s image test util mock storage directory ( name node dir type image and edits , false , " / foo / current / " + get image file name ( 123 ) , " / foo / current / " + get finalized edits file name ( 123 , 456 ) , " / foo / current / " + get image file name ( 456 ) , " / foo / current / " + get in progress edits file name ( 457 ) ) ; inspector inspect directory ( mock dir ) ; assert equals ( 2 , inspector found images size ( ) ) ; f s image file latest image = inspector get latest images ( ) get ( 0 ) ; assert equals ( 456 , latest image tx id ) ; assert same ( mock dir , latest image sd ) ; assert true ( inspector is upgrade finalized ( ) ) ; assert equals ( new file ( " / foo / current / " + get image file name ( 456 ) ) , latest image get file ( ) ) ; }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


returns a list of scheduled tasks for the currently running group

public list < g scheduled task > get scheduled tasks ( ) { lock lock ( ) ; try { return new array list < g scheduled task > ( priority q ) ; } finally { lock unlock ( ) ; } }


encode string literal according to section 5 2

private void encode string literal ( byte buf out , char sequence string ) { int huffman length ; if ( string length ( ) > = huff code threshold & & ( huffman length = hpack huffman encoder get encoded length ( string ) ) < string length ( ) ) { encode integer ( out , 0x 8 0 , 7 , huffman length ) ; hpack huffman encoder encode ( out , string ) ; } else { encode integer ( out , 0x 0 0 , 7 , string length ( ) ) ; if ( string instanceof ascii string ) { / / fast - path ascii string ascii string = ( ascii string ) string ; out write bytes ( ascii string array ( ) , ascii string array offset ( ) , ascii string length ( ) ) ; } else { / / only ascii is allowed in http 2 headers , so its fine to use this / / https : / / tools ietf org / html / rfc 7 5 4 0 # section - 8 1 2 out write char sequence ( string , charset util iso 8859 1 ) ; } } }


public boolean delete ( final string path ) throws exception { if ( exists ( path ) ) { curator delete ( ) deleting children if needed ( ) for path ( path ) ; return true ; } return false ; }


returns the character at the current index and then increments the index by one if the resulting index is greater or equal to the end index , the current index is reset to the end index and a value of done is returned

public char get and increment ( ) { try { return string char at ( index + + ) ; } catch ( index out of bounds exception e ) { index = string length ( ) ; return done ; } }