each value in the exception index table array must be a valid index into the constant pool table the constant pool entry referenced by each table item must be a constant class info structure representing a class type that this method is declared to throw

public int get exception index table entry ( int i ) { return exception index table [ i ] & 0xffff ; }


checks if the given bytes ends with the delimiter at the given end position

public static final boolean ends with delimiter ( byte [ ] bytes , int end pos , byte [ ] delim ) { if ( end pos < delim length - 1 ) { return false ; } for ( int pos = 0 ; pos < delim length ; + + pos ) { if ( delim [ pos ] ! = bytes [ end pos - delim length + 1 + pos ] ) { return false ; } } return true ; }


process the heartbeat invoke message after receiving the message , the instance will send a heartbeat to leader to check its health if alive , it will inform the next instance to do the heartbeat if not , it will start the election process

protected void handle heartbeat invoke message ( ) { try { boolean is leader alive = message manager send heartbeat message ( leader id ) ; if ( is leader alive ) { logger info ( instance + local id + " - leader is alive " ) ; thread sleep ( heartbeat interval ) ; message manager send heartbeat invoke message ( local id ) ; } else { logger info ( instance + local id + " - leader is not alive start election " ) ; boolean election result = message manager send election message ( local id , string value of ( local id ) ) ; if ( election result ) { logger info ( instance + local id + " - succeed in election start leader notification " ) ; message manager send leader message ( local id , local id ) ; } } } catch ( interrupted exception e ) { logger info ( instance + local id + " - interrupted " ) ; } }


sets the color to modify if null ( the default ) , the { @ link # get actor ( ) actor ' s } { @ link actor # get color ( ) color } will be used

public void set color ( @ null color color ) { this color = color ; }


returns a { @ link concurrently mutated list } that performs the given operations as its concurrent modifications the mutations occur in the same thread as the triggering method call

private static concurrently mutated list < integer > new concurrently mutated list ( final collection < integer > initial contents , final iterable < list frobber > actions to perform concurrently ) { invocation handler invocation handler = new invocation handler ( ) { final copy on write array list < integer > delegate = new copy on write array list < > ( initial contents ) ; final method get all states method = get only element ( as list ( concurrently mutated list class get declared methods ( ) ) ) ; final iterator < list frobber > remaining actions = actions to perform concurrently iterator ( ) ; final set < list < integer > > all states = new hash set ( ) ; @ override public object invoke ( object proxy , method method , object [ ] args ) throws throwable { return method equals ( get all states method ) ? get all states ( ) : invoke list method ( method , args ) ; } private set < list < integer > > get all states ( ) { return all states ; } private object invoke list method ( method method , object [ ] args ) throws throwable { try { object return value = method invoke ( delegate , args ) ; mutate delegate ( ) ; return return value ; } catch ( invocation target exception e ) { throw e get cause ( ) ; } catch ( illegal access exception e ) { throw new assertion error ( e ) ; } } private void mutate delegate ( ) { all states add ( immutable list copy of ( delegate ) ) ; remaining actions next ( ) perform ( delegate ) ; all states add ( immutable list copy of ( delegate ) ) ; } } ; @ suppress warnings ( " unchecked " ) concurrently mutated list < integer > list = ( concurrently mutated list < integer > ) new proxy instance ( immutable list test creation tests class get class loader ( ) , new class [ ] { concurrently mutated list class } , invocation handler ) ; return list ; }


public void write to ( annotated output out , dalv insn insn ) { register spec list regs = insn get registers ( ) ; int cpi = ( ( cst insn ) insn ) get index ( ) ; int first reg = ( regs size ( ) = = 0 ) ? 0 : regs get ( 0 ) get reg ( ) ; int count = regs get word count ( ) ; write ( out , opcode unit ( insn , count ) , ( short ) cpi , ( short ) first reg ) ; }


interprets the contents as notification lite objects and calls the appropriate observer method

public < u > boolean accept ( observer < ? super u > observer ) { object [ ] a = head ; final int c = capacity ; while ( a ! = null ) { for ( int i = 0 ; i < c ; i + + ) { object o = a [ i ] ; if ( o = = null ) { break ; } if ( notification lite accept full ( o , observer ) ) { return true ; } } a = ( object [ ] ) a [ c ] ; } return false ; }


gets the format to use on the output of this aggregation

public string format ( ) { return format ; }


returns true if object members are serialized when their value is null this has no impact on array elements the default is true

public final boolean get serialize nulls ( ) { return serialize nulls ; }


calls an elasticsearch api with the parameters and request body provided as arguments saves the obtained response in the execution context

public client yaml test response call api ( string api name , map < string , string > params , list < map < string , object > > bodies , map < string , string > headers ) throws i o exception { return call api ( api name , params , bodies , headers , node selector any ) ; }


raw { @ code get file status } that talks direct to s3 used to implement { @ link # inner get file status ( path , boolean , set ) } , and for direct management of empty directory blobs checks made , in order : head : look for an object at the given key , provided that the key doesn ' t end in " " dir marker : look for the directory marker - the key with a trailing if not passed in if an object was found with size 0 bytes , a directory status entry is returned which declares that the directory is empty list : issue a list on the key ( with if needed ) , require one entry to be found for the path to be considered a non - empty directory notes : objects ending in which are not 0 - bytes long are not treated as directory markers , but instead as files there ' s ongoing discussions about whether a dir marker should be interpreted as an empty dir the head requests require the permissions to read an object , including ( we believe ) the ability to decrypt the file at the very least , for sse - c markers , you need the same key on the client for the head to work the list probe needs list permission ; it is also more prone to inconsistency , even on newly created files retry policy : retry translated

s 3 a file status s 3 get file status ( final path path , final string key , final set < status probe enum > probes , @ nullable final set < path > tombstones , final boolean need empty directory flag ) throws i o exception { log debug ( " s 3 get file status { } " , path ) ; / / either you aren ' t looking for the directory flag , or you are , / / and if you are , the probe list must contain list preconditions check argument ( ! need empty directory flag | | probes contains ( status probe enum list ) , " s 3 get file status ( % s ) wants to know if a directory is empty but " + " does not request a list probe " , path ) ; if ( key is empty ( ) & & ! need empty directory flag ) { return new s 3 a file status ( tristate unknown , path , username ) ; } if ( ! key is empty ( ) & & ! key ends with ( " / " ) & & probes contains ( status probe enum head ) ) { try { / / look for the simple file object metadata meta = get object metadata ( key ) ; log debug ( " found exact file : normal file { } " , key ) ; return new s 3 a file status ( meta get content length ( ) , date to long ( meta get last modified ( ) ) , path , get default block size ( path ) , username , meta get e tag ( ) , meta get version id ( ) ) ; } catch ( amazon service exception e ) { / / if the response is a 404 error , it just means that there is / / no file at that path the remaining checks will be needed if ( e get status code ( ) ! = sc 404 | | is unknown bucket ( e ) ) { throw translate exception ( " get file status " , path , e ) ; } } catch ( amazon client exception e ) { throw translate exception ( " get file status " , path , e ) ; } } / / execute the list if ( probes contains ( status probe enum list ) ) { try { / / this will find a marker dir / as well as an entry / / when making a simple " is this a dir check " all is good / / but when looking for an empty dir , we need to verify there are no / / children , so ask for two entries , so as to find / / a child string dir key = maybe add trailing slash ( key ) ; / / list size is dir marker + at least one non - tombstone entry / / there ' s a corner case : more tombstones than you have in a / / single page list we assume that if you have been deleting / / that many files , then the aws listing will have purged some / / by the time of listing so that the response includes some / / which have not int list size ; if ( tombstones = = null ) { / / no tombstones so look for a marker and at least one child list size = 2 ; } else { / / build a listing > tombstones if the caller has many thousands / / of tombstones this won ' t work properly , which is why pruning / / of expired tombstones matters list size = math min ( 2 + tombstones size ( ) , math max ( 2 , max keys ) ) ; } s 3 list request request = create list objects request ( dir key , " / " , list size ) ; / / execute the request s 3 list result list result = list objects ( request , get duration tracker factory ( ) ) ; if ( list result has prefixes or objects ( context accessors , tombstones ) ) { if ( log is debug enabled ( ) ) { log debug ( " found path as directory ( with / ) " ) ; list result log at debug ( log ) ; } / / at least one entry has been found / / if looking for an empty directory , the marker must exist but no / / children / / so the listing must contain the marker entry only if ( need empty directory flag & & list result represents empty directory ( context accessors , dir key , tombstones ) ) { return new s 3 a file status ( tristate true , path , username ) ; } / / either an empty directory is not needed , or the / / listing does not meet the requirements return new s 3 a file status ( tristate false , path , username ) ; } else if ( key is empty ( ) ) { log debug ( " found root directory " ) ; return new s 3 a file status ( tristate true , path , username ) ; } } catch ( amazon service exception e ) { if ( e get status code ( ) ! = sc 404 | | is unknown bucket ( e ) ) { throw translate exception ( " get file status " , path , e ) ; } } catch ( amazon client exception e ) { throw translate exception ( " get file status " , path , e ) ; } } log debug ( " not found : { } " , path ) ; throw new file not found exception ( " no such file or directory : " + path ) ; }


return the column names of the auto generated keys

public string [ ] get generated keys column names ( ) { return this generated keys column names ; }


pre - check node to see if it satisfy the given scheduler key and scheduler mode

public boolean precheck node ( scheduler request key scheduler key , scheduler node scheduler node , scheduling mode scheduling mode , optional < diagnostics collector > dc opt ) { this read lock lock ( ) ; try { app placement allocator ap = scheduler key to app placement allocator get ( scheduler key ) ; return ( ap ! = null ) & & ( ap get placement attempt ( ) < retry attempts ) & & ap precheck node ( scheduler node , scheduling mode , dc opt ) ; } finally { this read lock unlock ( ) ; } }


sets the interval of the date histogram using fixed units ( ` 1ms ` , ` 1s ` , ` 1 0m ` , ` 4h ` , etc ) these are not calendar aware and are simply multiples of fixed , si units this is mutually exclusive with { @ link date interval wrapper # calendar interval ( date histogram interval ) }

public void fixed interval ( date histogram interval interval ) { if ( interval = = null | | strings is null or empty ( interval to string ( ) ) ) { throw new illegal argument exception ( " [ interval ] must not be null : [ date histogram ] " ) ; } set interval type ( interval type enum fixed ) ; / / parse to make sure it is a valid fixed too time value parse time value ( interval to string ( ) , date histogram aggregation builder name + " fixed interval " ) ; this date histogram interval = interval ; }


shortcut for < code > a ( selector ) $ href ( href ) ( anchor text ) ( ) ; < code >

anchor a ( string selector , string href , string anchor text ) ;


returns the value of a header with the specified { @ code name } in milliseconds and removes the header from this object if there is more than one value for the specified { @ code name } , the first value in insertion order is returned in any case all values for { @ code name } are removed if an exception occurs during the translation from type { @ code t } all entries with { @ code name } may still be removed

long get time millis and remove ( k name ) ;


public boolean set progress ( float progress ) { return super set progress ( progress ) ; }


function that actually creates the { @ link reservation id } by calling the client r m service

private new reservation create new reservation ( ) throws i o exception { get new reservation request req = record factory new record instance ( get new reservation request class ) ; get new reservation response resp ; try { resp = rm get client r m service ( ) get new reservation ( req ) ; } catch ( yarn exception e ) { string msg = " unable to create new reservation from rm web service " ; log error ( msg , e ) ; throw new yarn runtime exception ( msg , e ) ; } new reservation reservation id = new new reservation ( resp get reservation id ( ) to string ( ) ) ; return reservation id ; } @ post @ path ( r m w s consts reservation submit ) @ produces ( { media type application json + " ; " + jetty utils utf 8 , media type application xml + " ; " + jetty utils utf 8 } ) @ consumes ( { media type application json , media type application xml }


submits the single { @ code worker } instance { @ code m task runner } to the underlying executor an additional time if there are fewer than { @ code m max concurrency } pending submissions does nothing if the maximum number of workers is already pending

private void start worker if needed ( ) { / / perform a compare - and - swap retry loop for synchronization to make sure we don ' t start more / / workers than desired int current count = m pending workers get ( ) ; while ( current count < m max concurrency ) { int updated count = current count + 1 ; if ( m pending workers compare and set ( current count , updated count ) ) { / / start a new worker f log v ( tag , " % s : starting worker % d of % d " , m name , updated count , m max concurrency ) ; m executor execute ( m task runner ) ; break ; } / / else : compare and set failed due to race ; snapshot the new count and try again f log v ( tag , " % s : race in start worker if needed ; retrying " , m name ) ; current count = m pending workers get ( ) ; } }


decides whether to include a test in a test suite or not

private static boolean test matches filters ( rule test target , collection < string > required tags , collection < string > excluded tags ) { attribute map non configurable attrs = nonconfigurable attribute mapper of ( test target ) ; set < string > test tags = new hash set < > ( non configurable attrs get ( " tags " , type string list ) ) ; test tags add ( non configurable attrs get ( " size " , type string ) ) ; return test matches filters ( test tags , required tags , excluded tags ) ; }


register bean into application context t

public static < t > t register bean into application context ( final configurable application context application context , final t bean instance , final string bean id ) { val bean factory = application context get bean factory ( ) ; if ( bean factory contains bean ( bean id ) ) { return ( t ) application context get bean ( bean id , bean instance get class ( ) ) ; } bean factory initialize bean ( bean instance , bean id ) ; bean factory autowire bean ( bean instance ) ; bean factory register singleton ( bean id , bean instance ) ; return bean instance ; }


is the test enabled ; this is controlled by the configuration and the { @ code - dscale } maven option

protected final boolean is enabled ( ) { return enabled ; }


advanced api to allow for multi - dimensional load balancing by remote server for receiving lb assignments , the steps are : 1 , the management server is configured with per clusterzoneload metric capacity configuration the capacity configuration definition is outside of the scope of this document 2 envoy issues a standard { stream , fetch } endpoints request for the clusters to balance independently , envoy will initiate a stream load stats bidi stream with a management server : 1 once a connection establishes , the management server publishes a load stats response for all clusters it is interested in learning load stats about 2 for each cluster , envoy load balances incoming traffic to upstream hosts based on per - zone weights andor per - instance weights ( if specified ) based on intra - zone lb policy this information comes from the above { stream , fetch } endpoints 3 when upstream hosts reply , they optionally add header & lt ; define header name & gt ; with ascii representation of endpoint load metric stats 4 envoy aggregates load reports over the period of time given to it in load stats response load reporting interval this includes aggregation stats envoy maintains by itself ( total requests , rpc errors etc ) as well as load metrics from upstream hosts 5 when the timer of load reporting interval expires , envoy sends new load stats request filled with load reports for each cluster 6 the management server uses the load reports from all reported envoys from around the world , computes global assignment and prepares traffic assignment destined for each zone envoys are located in goto 2

public io grpc stub stream observer < io envoyproxy envoy service load stats v 2 load stats request > stream load stats ( io grpc stub stream observer < io envoyproxy envoy service load stats v 2 load stats response > response observer ) { return io grpc stub client calls async bidi streaming call ( get channel ( ) new call ( get stream load stats method ( ) , get call options ( ) ) , response observer ) ; }


public int get module index ( ) { return internals get module index ( ) ; }


protected void create service authorization check action ( final flow flow ) { val service authorization check = create action state ( flow , cas webflow constants state id service authz check , cas webflow constants action id service authz check ) ; create state default transition ( service authorization check , cas webflow constants state id init login form ) ; }


tests that files can be served with the { @ link static file server handler }

public void test static file server handler ( ) throws exception { final file file = temporary folder new file ( ) ; files write ( file to path ( ) , collections singleton list ( " foobar " ) ) ; final url url = new url ( server endpoint get rest base url ( ) + " / " + file get name ( ) ) ; final http u r l connection connection = ( http u r l connection ) url open connection ( ) ; connection set request method ( " get " ) ; final string file contents = i o utils to string ( connection get input stream ( ) ) ; assert equals ( " foobar " , file contents trim ( ) ) ; }


returns the expire after access in nanoseconds

public optional long get expire after access ( ) { return ( expire after access nanos = = null ) ? optional long empty ( ) : optional long of ( expire after access nanos ) ; }


job did not complete successfully and should not be tried again dependent jobs will also be failed

public static result failure ( ) { return failure ; }


this method returns a { @ code immutable sorted map } , consisting of the entries whose keys ranges from { @ code from key } , inclusive , to { @ code to key } , exclusive the { @ link sorted map # sub map } documentation states that a submap of a submap throws an { @ link illegal argument exception } if passed a { @ code from key } less than an earlier { @ code from key } however , this method doesn ' t throw an exception in that situation , but instead keeps the original { @ code from key } similarly , this method keeps the original { @ code to key } , instead of throwing an exception , if passed a { @ code to key } greater than an earlier { @ code to key }

public immutable sorted map < k , v > sub map ( k from key , k to key ) { return sub map ( from key , true , to key , false ) ; }


constructs and returns a metadata request builder for fetching cluster data and all active topics

protected metadata request builder new metadata request builder ( ) { return metadata request builder all topics ( ) ; }


writes all the remaining floats of the { @ code src } float buffer to this buffer ' s current position , and increases both buffers ' position by the number of floats copied

public float buffer put ( float buffer src ) { if ( src = = this ) { throw new illegal argument exception ( ) ; } if ( src remaining ( ) > remaining ( ) ) { throw new buffer overflow exception ( ) ; } float [ ] contents = new float [ src remaining ( ) ] ; src get ( contents ) ; put ( contents ) ; return this ; }


the java compatible android package name of the app < code > optional string package name = 2 ; < code >

private void clear package name ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 2 ) ; package name = get default instance ( ) get package name ( ) ; }


attributes describing stream this is inherited from the transport attributes , and used as the basis of { @ link io grpc server call # get attributes }


returns true if this field type is compatible with nullability

default boolean can be nullable ( ) { return false ; }


returns an immutable copy of the provided table the { @ link table # cell set ( ) } iteration order of the provided table determines the iteration ordering of all views in the returned table note that some views of the original table and the copied table may have different iteration orders for more control over the ordering , create a { @ link builder } and call { @ link builder # order rows by } , { @ link builder # order columns by } , and { @ link builder # put all } despite the method name , this method attempts to avoid actually copying the data when it is safe to do so the exact circumstances under which a copy will or will not be performed are undocumented and subject to change

public static < r , c , v > immutable table < r , c , v > copy of ( table < ? extends r , ? extends c , ? extends v > table ) { if ( table instanceof immutable table ) { @ suppress warnings ( " unchecked " ) immutable table < r , c , v > parameterized table = ( immutable table < r , c , v > ) table ; return parameterized table ; } else { return copy of ( table cell set ( ) ) ; } }


map of digests to chunkers to upload when the file is a regular , non - directory file it is transmitted through { @ link # get digest to file ( ) } when it is a directory , it is transmitted as a { @ link tree } protobuf message through { @ link # get digest to blobs ( ) }

public map < digest , byte string > get digest to blobs ( ) { return digest to blobs ; }


read 3 byte fixed length integer from byte buffers

public int read int 3 ( ) { return byte buf read unsigned medium l e ( ) ; }


public static void start activity ( @ non null final class < ? extends activity > clz , @ nullable final bundle options ) { context context = get top activity or app ( ) ; start activity ( context , null , context get package name ( ) , clz get name ( ) , options ) ; }


marks the given visitor accepter as being used

protected void mark as used ( visitor accepter visitor accepter ) { visitor accepter set visitor info ( used ) ; }


returns the address to which the socket is connected

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


return the { @ link # set max in memory size configured } byte count limit

public int get max in memory size ( ) { return this max in memory size ; }


get the raw image data size as contained within this resource if compressed , this will be smaller than the value returned by { @ link # get image data size ( ) } which reflects the uncompressed size

public int get raw size image ( ) { return raw size image ; }


this test will use the dependency injection of spring to inject the runtime service in the java delegate

public void test use injected runtime service in service task ( ) { runtime service start process instance by key ( " start process from delegate " ) ; / / starting the process should lead to two processes being started , / / the other one started from the java delegate in the service task list < process instance > process instances = runtime service create process instance query ( ) list ( ) ; assert that ( process instances ) has size ( 2 ) ; boolean start process from delegate found = false ; boolean one task process found = false ; for ( process instance process instance : process instances ) { process definition process definition = repository service get process definition ( process instance get process definition id ( ) ) ; if ( process definition get key ( ) equals ( " start process from delegate " ) ) { start process from delegate found = true ; } else if ( process definition get key ( ) equals ( " one task process " ) ) { one task process found = true ; } } assert that ( start process from delegate found ) is true ( ) ; assert that ( one task process found ) is true ( ) ; }


get a batch of under construction files from the currently active leases file i node i d is the cursor used to fetch new batch of results and the batch size is configurable using below config param since the list is fetched in batches , it does not represent a consistent view of all open files

public batched list entries < open file entry > get under construction files ( final long prev id , final string path ) throws i o exception { assert fsnamesystem has read lock ( ) ; sorted map < long , lease > remaining leases ; synchronized ( this ) { remaining leases = leases by id tail map ( prev id , false ) ; } collection < long > inode ids = remaining leases key set ( ) ; final int num responses = math min ( this fsnamesystem get max list open files responses ( ) , inode ids size ( ) ) ; final list < open file entry > open file entries = lists new array list with expected size ( num responses ) ; int count = 0 ; string full path name = null ; iterator < long > inode id iterator = inode ids iterator ( ) ; while ( inode id iterator has next ( ) ) { long inode id = inode id iterator next ( ) ; final i node file inode file = fsnamesystem get f s directory ( ) get inode ( inode id ) as file ( ) ; if ( ! inode file is under construction ( ) ) { log warn ( " the file { } is not under construction but has lease " , inode file get full path name ( ) ) ; continue ; } full path name = inode file get full path name ( ) ; if ( string utils is empty ( path ) | | d f s util is parent entry ( full path name , path ) ) { open file entries add ( new open file entry ( inode file get id ( ) , full path name , inode file get file under construction feature ( ) get client name ( ) , inode file get file under construction feature ( ) get client machine ( ) ) ) ; count + + ; } if ( count > = num responses ) { break ; } } / / avoid rescanning all leases when we have checked all leases already boolean has more = inode id iterator has next ( ) ; return new batched list entries < > ( open file entries , has more ) ; }


public enum number enum get enum number ( ) { return enum number ; }


read in the cached du value and return it if it is less than cached dfs used check time which is set by dfs datanode cached - dfsused check interval ms parameter slight imprecision of dfs used is not critical and skipping du can significantly shorten the startup time if the cached value is not available or too old , - 1 is returned

long load dfs used ( ) { long cached dfs used ; long mtime ; scanner sc ; try { sc = new scanner ( new file ( current dir , du cache file ) , " utf - 8 " ) ; } catch ( file not found exception fnfe ) { return - 1 ; } try { / / get the recorded dfs used from the file if ( sc has next long ( ) ) { cached dfs used = sc next long ( ) ; } else { return - 1 ; } / / get the recorded mtime from the file if ( sc has next long ( ) ) { mtime = sc next long ( ) ; } else { return - 1 ; } / / return the cached value if mtime is okay if ( mtime > 0 & & ( timer now ( ) - mtime < cached dfs used check time ) ) { fs dataset impl log info ( " cached dfs used found for " + current dir + " : " + cached dfs used ) ; return cached dfs used ; } return - 1 ; } finally { sc close ( ) ; } }


test illegal state exception is thrown when original index and write index name are the same

public void test perform action same original target error ( ) { string data stream name = random alpha of length ( 10 ) ; string write index name = data stream get default backing index name ( data stream name , 2 ) ; string index name = write index name ; string policy name = " test - ilm - policy " ; index metadata source index metadata = index metadata builder ( index name ) settings ( settings ( version current ) put ( lifecycle settings lifecycle name , policy name ) ) number of shards ( random int between ( 1 , 5 ) ) number of replicas ( random int between ( 0 , 5 ) ) build ( ) ; index metadata write index metadata = index metadata builder ( write index name ) settings ( settings ( version current ) put ( lifecycle settings lifecycle name , policy name ) ) number of shards ( random int between ( 1 , 5 ) ) number of replicas ( random int between ( 0 , 5 ) ) build ( ) ; string index prefix = " test - prefix - " ; string target index = index prefix + index name ; index metadata target index metadata = index metadata builder ( target index ) settings ( settings ( version current ) ) number of shards ( random int between ( 1 , 5 ) ) number of replicas ( random int between ( 0 , 5 ) ) build ( ) ; list < index > backing indices = list of ( source index metadata get index ( ) , write index metadata get index ( ) ) ; cluster state cluster state = cluster state builder ( empty cluster state ( ) ) metadata ( metadata builder ( ) put ( source index metadata , true ) put ( write index metadata , true ) put ( new data stream ( data stream name , create timestamp field ( " @ timestamp " ) , backing indices ) ) put ( target index metadata , true ) build ( ) ) build ( ) ; replace data stream backing index step replace source index step = new replace data stream backing index step ( random step key ( ) , random step key ( ) , index prefix ) ; illegal state exception ex = expect throws ( illegal state exception class , ( ) - > replace source index step perform action ( source index metadata get index ( ) , cluster state ) ) ; assert equals ( " index [ " + write index name + " ] is the write index for data stream [ " + data stream name + " ] , pausing ilm execution of lifecycle [ test - ilm - policy ] until this index is no longer the write index for the data " + " stream via manual or automated rollover " , ex get message ( ) ) ; }


specifies that the entry should be automatically removed from the cache once the duration has elapsed after its last read to indicate no expiration an entry may be given an excessively long period , such as { @ code long # max value } the { @ code current duration } may be returned to not modify the expiration time < b > note : < b > the { @ code current time } is supplied by the configured { @ link ticker } and by default does not relate to system or wall - clock time when calculating the duration based on a time stamp , the current time should be obtained independently

long expire after read ( @ non null k key , @ non null v value , long current time , @ non negative long current duration ) ;


returns the entries to populate the " native " module with , for workspace - loaded bzl files

static immutable map < string , object > create native module bindings ( rule class provider rule class provider , string version ) { / / machinery to build the collection of workspace functions rule factory rule factory = new rule factory ( rule class provider ) ; workspace globals workspace globals = new workspace globals ( / * allow override = * / false , rule factory ) ; / / todo ( bazel - team ) : starlark semantics should be a parameter here , as native module can be / / configured by flags [ brandjon : this should be possible now that we create the native module / / in starlark builtins function we could defer creation until the starlark semantics are known / / but mind that some code may depend on being able to enumerate all possible entries regardless / / of the particular semantics ] immutable map < string , object > workspace functions = create workspace functions ( / * allow override = * / false , rule factory , workspace globals , starlark semantics default ) ; / / determine the contents for native immutable map builder < string , object > bindings = new immutable map builder < > ( ) ; starlark add methods ( bindings , new starlark native module ( ) ) ; for ( map entry < string , object > entry : workspace functions entry set ( ) ) { string name = entry get key ( ) ; if ( name starts with ( " $ " ) ) { / / skip " abstract " rules like " $ go rule " continue ; } / / " workspace " is explicitly omitted from the native module , / / as it must only occur at the top of a workspace file / / todo ( cparsons ) : clean up separation between environments if ( name equals ( " workspace " ) ) { continue ; } bindings put ( entry ) ; } bindings put ( " bazel version " , version ) ; return bindings build ( ) ; }


fake endpoint to test group parameters ( optional ) fake endpoint to test group parameters ( optional )

public void test group parameters test ( ) { integer required string group = null ; boolean required boolean group = null ; long required int 6 4 group = null ; integer string group = null ; boolean boolean group = null ; long int 6 4 group = null ; / / api test group parameters ( required string group , required boolean group , required int 6 4 group , string group , boolean group , int 6 4 group ) ; / / todo : test validations }


public void int 3 2 test ( ) { / / todo : test int 3 2 }


adds the specified value to the current set


return an { @ link archived tree artifact } for a provided { @ linkplain special artifact tree artifact } if one is available the { @ linkplain archived tree artifact archived tree artifact } can be used instead of the tree artifact expansion

default archived tree artifact get archived tree artifact ( special artifact tree artifact ) { return null ; }


set the transaction attribute source which is used to find transaction attributes this should usually be identical to the source reference set on the transaction interceptor itself

public void set transaction attribute source ( transaction attribute source transaction attribute source ) { this transaction attribute source = transaction attribute source ; }


trying to abort from an invalid handle must fail

public void test abort unknown upload ( ) throws exception { path file = method path ( ) ; byte buffer byte buffer = byte buffer wrap ( " invalid - handle " get bytes ( charsets utf 8 ) ) ; intercept ( file not found exception class , ( ) - > abort upload ( b b upload handle from ( byte buffer ) , file ) ) ; }


tests modifying xattrs on a directory that has been snapshotted

public void test modify reads current state ( ) throws exception { / / init file system mkdirs ( hdfs , path , fs permission create immutable ( ( short ) 0700 ) ) ; snapshot test helper create snapshot ( hdfs , path , snapshot name ) ; hdfs set x attr ( path , name 1 , value 1 ) ; hdfs set x attr ( path , name 2 , value 2 ) ; / / verify that current path reflects xattrs , snapshot doesn ' t map < string , byte [ ] > xattrs = hdfs get x attrs ( path ) ; assert equals ( xattrs size ( ) , 2 ) ; assert array equals ( value 1 , xattrs get ( name 1 ) ) ; assert array equals ( value 2 , xattrs get ( name 2 ) ) ; xattrs = hdfs get x attrs ( snapshot path ) ; assert equals ( xattrs size ( ) , 0 ) ; / / modify each xattr and make sure it ' s reflected hdfs set x attr ( path , name 1 , value 2 , enum set of ( x attr set flag replace ) ) ; xattrs = hdfs get x attrs ( path ) ; assert equals ( xattrs size ( ) , 2 ) ; assert array equals ( value 2 , xattrs get ( name 1 ) ) ; assert array equals ( value 2 , xattrs get ( name 2 ) ) ; hdfs set x attr ( path , name 2 , value 1 , enum set of ( x attr set flag replace ) ) ; xattrs = hdfs get x attrs ( path ) ; assert equals ( xattrs size ( ) , 2 ) ; assert array equals ( value 2 , xattrs get ( name 1 ) ) ; assert array equals ( value 1 , xattrs get ( name 2 ) ) ; / / paranoia checks xattrs = hdfs get x attrs ( snapshot path ) ; assert equals ( xattrs size ( ) , 0 ) ; hdfs remove x attr ( path , name 1 ) ; hdfs remove x attr ( path , name 2 ) ; xattrs = hdfs get x attrs ( path ) ; assert equals ( xattrs size ( ) , 0 ) ; }


callback method to be invoked when an item in this recycler view has been clicked

void on item click ( @ non null base quick adapter < ? , ? > adapter , @ non null view view , int position ) ;


deprecated in api level 23 , but must remain to allow compatibility with api < 23

public void on attach ( @ non null activity activity ) { super on attach ( activity ) ; m context = activity ; }


returns the completed { @ link constraint collection } instance

public constraint collection build ( ) throws duplicate constraint exception { immutable list < constraint value info > constraint values = this constraint values build ( ) ; validate constraints ( constraint values ) ; return new auto value constraint collection ( this parent , constraint values stream ( ) collect ( to immutable map ( constraint value info : : constraint , function identity ( ) ) ) ) ; }


returns true if all services are currently in the { @ linkplain state # running running } state users who want more detailed information should use the { @ link # services by state } method to get detailed information about which services are not running

public boolean is healthy ( ) { for ( service service : services ) { if ( ! service is running ( ) ) { return false ; } } return true ; }


adds the given increment to this resource counter value and returns the resulting value

public resource counter add ( map < resource profile , integer > increment ) { return internal add ( increment entry set ( ) ) ; }


test setting a value for the default metric that is not contained in the " metrics " field an exception must be thrown

public void test undefined default metric ( ) { exception e = expect throws ( mapper parsing exception class , ( ) - > create document mapper ( field mapping ( b - > b field ( " type " , content type ) field ( metrics field , new string [ ] { " value count " , " sum " } ) field ( default metric , " min " ) ) ) ) ; assert that ( e get message ( ) , contains string ( " default metric [ min ] is not defined in the metrics of field [ field ] " ) ) ; }


void ensure valid ( string name , object value ) ;


vibrate must hold { @ code < uses - permission android : name = " android permission vibrate " > }

public static void vibrate ( final long [ ] pattern , final int repeat ) { vibrator vibrator = get vibrator ( ) ; if ( vibrator = = null ) return ; vibrator vibrate ( pattern , repeat ) ; }


register a new transaction synchronization for the current thread typically called by resource management code note that synchronizations can implement the { @ link org springframework core ordered } interface they will be executed in an order according to their order value ( if any )

public static void register synchronization ( transaction synchronization synchronization ) throws illegal state exception { assert not null ( synchronization , " transaction synchronization must not be null " ) ; set < transaction synchronization > synchs = synchronizations get ( ) ; if ( synchs = = null ) { throw new illegal state exception ( " transaction synchronization is not active " ) ; } synchs add ( synchronization ) ; }


public big decimal get number item ( ) { return number item ; }


returns a template that loads the given artifact it is important that the artifact is also an input for the action , or this won ' t work therefore this method is private , and you should use the corresponding { @ link template expansion action } constructor

static template for artifact ( final artifact template artifact ) { return new artifact template ( template artifact ) ; }


returns the upper endpoint of this range

public c upper endpoint ( ) { return upper bound endpoint ( ) ; }


after reading a corrupted block , make sure the client can correctly report the corruption to the name node

public void test report bad block ( ) throws i o exception { / / create file final path file = new path ( " / corrupted " ) ; final int length = 10 ; / / length of " corruption " final byte [ ] bytes = striped file test util generate bytes ( length ) ; d f s test util write file ( dfs , file , bytes ) ; / / corrupt the first data block int dn index = read striped file with decoding helper find first data node ( cluster , dfs , file , cell size * num data units ) ; assert assert not equals ( - 1 , dn index ) ; located striped block slb = ( located striped block ) dfs get client ( ) get located blocks ( file to string ( ) , 0 , cell size * num data units ) get ( 0 ) ; final located block [ ] blks = striped block util parse striped block group ( slb , cell size , num data units , num parity units ) ; / / find the first block file file storage dir = cluster get instance storage dir ( dn index , 0 ) ; file blk file = mini d f s cluster get block file ( storage dir , blks [ 0 ] get block ( ) ) ; assert assert true ( " block file does not exist " , blk file exists ( ) ) ; / / corrupt the block file log info ( " deliberately corrupting file " + blk file get name ( ) ) ; try ( file output stream out = new file output stream ( blk file ) ) { out write ( " corruption " get bytes ( ) ) ; } / / disable the heartbeat from dn so that the corrupted block record is kept / / in name node for ( data node dn : cluster get data nodes ( ) ) { data node test utils set heartbeats disabled for tests ( dn , true ) ; } try { / / do stateful read striped file test util verify stateful read ( dfs , file , length , bytes , byte buffer allocate ( 1024 ) ) ; / / check whether the corruption has been reported to the name node final f s namesystem ns = cluster get namesystem ( ) ; final block manager bm = ns get block manager ( ) ; block info block info = ( ns get f s directory ( ) get i node 4 write ( file to string ( ) ) as file ( ) get blocks ( ) ) [ 0 ] ; assert assert equals ( 1 , bm get corrupt replicas ( block info ) size ( ) ) ; } finally { for ( data node dn : cluster get data nodes ( ) ) { data node test utils set heartbeats disabled for tests ( dn , false ) ; } } }


get available erasure coding codecs and corresponding coders

map < string , string > get erasure coding codecs ( ) throws i o exception { final string operation name = " get erasure coding codecs " ; boolean success = false ; check operation ( operation category read ) ; check erasure coding supported ( operation name ) ; read lock ( ) ; try { check operation ( operation category read ) ; final map < string , string > ret = f s dir erasure coding op get erasure coding codecs ( this ) ; success = true ; return ret ; } finally { read unlock ( operation name , get lock report info supplier ( null ) ) ; log audit event ( success , operation name , null ) ; } }


return a cleared { @ link native datagram packet array } that can be used for writes in this { @ link event loop }

native datagram packet array clean datagram packet array ( ) { if ( datagram packet array = = null ) { datagram packet array = new native datagram packet array ( ) ; } else { datagram packet array clear ( ) ; } return datagram packet array ; }


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

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


public static byte [ ] copy array ( byte [ ] src ) { return arrays copy of ( src , src length ) ; }


test that values supplied to @ configuration ( value = " " ) are propagated as the bean name for the configuration class even in the case of inclusion via @ import or in the case of automatic registration via nesting

public void repro spr 9 0 2 3 ( ) { annotation config application context ctx = new annotation config application context ( ) ; ctx register ( b class ) ; ctx refresh ( ) ; system out println ( ctx get bean factory ( ) ) ; assert that ( ctx get bean names for type ( b class ) [ 0 ] ) is equal to ( " config - b " ) ; assert that ( ctx get bean names for type ( a class ) [ 0 ] ) is equal to ( " config - a " ) ; }


public list < list < read only first > > get array array of model ( ) { return array array of model ; }


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


returns the { @ link track group } s exposed by the period this method is only called after the period has been prepared

track group array get track groups ( ) ;


shortcut of { @ link # value of ( string ) value of ( first name component get name ( ) + " # " + second name component ) }

public static signal value of ( class < ? > first name component , string second name component ) { return pool value of ( first name component , second name component ) ; }


regression test for case where the user requests that we delete nodes that are already in the queue to be dirtied we should handle that gracefully and not complain

public void deleting dirty nodes ( ) throws exception { sky key node 0 = graph tester non hermetic key ( " node 0 " ) ; sky key key = make test key ( node 0 ) ; / / seed the graph assert that ( ( ( string value ) tester eval and get ( / * keep going = * / false , key ) ) get value ( ) ) is equal to ( " node 0 " ) ; / / start the dirtying process tester set ( node 0 , new string value ( " new " ) ) ; tester invalidate ( ) ; / / interrupt current thread on a next invalidate call final thread thread = thread current thread ( ) ; tester progress receiver set next invalidation callback ( thread : : interrupt ) ; assert throws ( interrupted exception class , ( ) - > tester eval ( / * keep going = * / false , key ) ) ; / / cleanup + paranoid check tester progress receiver set next invalidation callback ( null ) ; / / now delete all the nodes the node that was going to be dirtied is also deleted , which we / / should handle tester evaluator delete ( predicates always true ( ) ) ; assert that ( ( ( string value ) tester eval and get ( / * keep going = * / false , key ) ) get value ( ) ) is equal to ( " new " ) ; }


checks to see if the given java project is a ghidra module project

public static boolean is ghidra module project ( i project project ) { return is ghidra project ( project ) & & project get file ( module utilities manifest file name ) exists ( ) ; }


adds configuration options that aren ' t required by configuration fragments if { @ link # add configuration fragment } adds a fragment that also requires these options , this method is redundant

public builder add configuration options ( class < ? extends fragment options > configuration options ) { this configuration options add ( configuration options ) ; return this ; }


runs the provided { @ link runnable } on the playback thread , blocking until execution completes

public void run on playback thread ( final runnable runnable ) { throwable [ ] throwable = new throwable [ 1 ] ; count down latch finished latch = new count down latch ( 1 ) ; playback handler post ( ( ) - > { try { runnable run ( ) ; } catch ( throwable e ) { throwable [ 0 ] = e ; } finally { finished latch count down ( ) ; } } ) ; try { assert that ( finished latch await ( timeout ms , milliseconds ) ) is true ( ) ; } catch ( interrupted exception e ) { util sneaky throw ( e ) ; } if ( throwable [ 0 ] ! = null ) { util sneaky throw ( throwable [ 0 ] ) ; } }


returns the interval in milliseconds between sending lifeline messages

public long get lifeline interval ms ( ) { return lifeline interval ms ; }


records a miss when the cold set is not full

private void on hir warmup miss ( node node ) { node status = status hir resident ; node move to top ( stack type q ) ; }


get the total number of active clients holding lease in the system

public long get num active clients ( ) { return lease manager count lease ( ) ; }


public long renew delegation token ( token < delegation token identifier > token ) throws invalid token , i o exception , interrupted exception { return token renew ( get conf ( ) ) ; }


returns the { @ link mapped field type } for the provided field name if the field is not mapped , the behaviour depends on the index query parse allow unmapped fields setting , which defaults to true in case unmapped fields are allowed , null is returned when the field is not mapped in case unmapped fields are not allowed , either an exception is thrown or the field is automatically mapped as a text field

public mapped field type get field type ( string name ) { return fail if field mapping not found ( name , field type ( name ) ) ; }


test the truncate to method lops off messages and appropriately updates the size

public void test truncate ( ) throws i o exception { record batch batch = batches ( file records ) get ( 0 ) ; int end = file records search for offset with size ( 1 , 0 ) position ; file records truncate to ( end ) ; assert equals ( collections singleton list ( batch ) , batches ( file records ) ) ; assert equals ( batch size in bytes ( ) , file records size in bytes ( ) ) ; }


public string get class name ( ) { return class name ; }


allows the controller to handle a touch event

boolean on touch event ( motion event event ) ;


public list < node vo > fetch cluster node of machine ( string ip , int port , boolean include zero ) { string type = " not zero " ; if ( include zero ) { type = " zero " ; } return fetch items ( ip , port , cluster node path , type , node vo class ) ; }


void create global traffic counter ( scheduled executor service executor ) { / / default set max deviation ( default deviation , default slowdown , default acceleration ) ; if ( executor = = null ) { throw new illegal argument exception ( " executor must not be null " ) ; } traffic counter tc = new global channel traffic counter ( this , executor , " global channel t c " , check interval ) ; set traffic counter ( tc ) ; tc start ( ) ; }


returns the stream graph without clearing the transformations

private static stream graph get stream graph ( stream execution environment s env ) { return s env get stream graph ( stream execution environment default job name , false ) ; }


returns a new instance , which is the same as this instance , except that it has an additional type prepended to the original

public std type list with first ( type type ) { int sz = size ( ) ; std type list result = new std type list ( sz + 1 ) ; result set 0 ( 0 , type ) ; for ( int i = 0 ; i < sz ; i + + ) { result set 0 ( i + 1 , get or null 0 ( i ) ) ; } return result ; }


sets the directories where to mount an empty tmpfs , if any

public command line builder set tmpfs directories ( set < path > tmpfs directories ) { this tmpfs directories = tmpfs directories ; return this ; }


public static document construct document from xml ( final string xml string ) { logger trace ( " attempting to construct an instance of document from xml : [ { } ] " , xml string ) ; try { val builder = new s a x builder ( ) ; builder set feature ( " http : / / xml org / sax / features / external - parameter - entities " , false ) ; builder set feature ( " http : / / xml org / sax / features / external - general - entities " , false ) ; builder set feature ( " http : / / apache org / xml / features / disallow - doctype - decl " , true ) ; return builder build ( new byte array input stream ( xml string get bytes ( charset default charset ( ) ) ) ) ; } catch ( final exception e ) { logging utils error ( logger , e ) ; return null ; } }


creates a new listenable future - style stub that supports unary calls on the service

public static reconnect service future stub new future stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < reconnect service future stub > factory = new io grpc stub abstract stub stub factory < reconnect service future stub > ( ) { @ java lang override public reconnect service future stub new stub ( io grpc channel channel , io grpc call options call options ) { return new reconnect service future stub ( channel , call options ) ; } } ; return reconnect service future stub new stub ( factory , channel ) ; }


return a unique int result from the given collection throws an exception if 0 or more than 1 result objects found , of if the unique result object is not convertible to an int

public static int int result ( @ nullable collection < ? > results ) throws incorrect result size data access exception , type mismatch data access exception { return object result ( results , number class ) int value ( ) ; }


update query and header parameters based on authentication settings

protected void update params for auth ( string [ ] auth names , list < pair > query params , map < string , string > header params , map < string , string > cookie params , string payload , string method , uri uri ) throws api exception { for ( string auth name : auth names ) { authentication auth = authentications get ( auth name ) ; if ( auth = = null ) { continue ; } auth apply to params ( query params , header params , cookie params , payload , method , uri ) ; } }


get the virtual memory used by all the processes in the process - tree that are older than the passed in age

public long get virtual memory size ( int older than age ) { return unavailable ; }


test that a typedef of a union can ' t be added to the union

public void test cyclic dependency problem 3 ( ) { type def type def = create type def ( union ) ; try { union add ( type def ) ; assert fail ( " shouldn ' t be able to add a union typedef to the typedef ' s union " ) ; } catch ( illegal argument exception e ) { / / should get an exception from adding the union to itself } try { union insert ( 0 , type def ) ; assert fail ( " shouldn ' t be able to insert a union typedef into the typedef ' s union " ) ; } catch ( illegal argument exception e ) { / / should get an exception from inserting the union to itself } }


checks a file for inclusion in a jar archive

public boolean check entry ( string archive path ) throws zip abort exception ;


reads { @ link allocation commands } from a { @ link x content parser } { " commands " : [ { " allocate " : { " index " : " test " , " shard " : 0 , " node " : " test " } } ] }

public static allocation commands from x content ( x content parser parser ) throws i o exception { allocation commands commands = new allocation commands ( ) ; x content parser token token = parser current token ( ) ; if ( token = = null ) { throw new elasticsearch parse exception ( " no commands " ) ; } if ( token = = x content parser token field name ) { if ( ! parser current name ( ) equals ( " commands " ) ) { throw new elasticsearch parse exception ( " expected field name to be named [ commands ] , got [ { } ] instead " , parser current name ( ) ) ; } token = parser next token ( ) ; if ( token ! = x content parser token start array ) { throw new elasticsearch parse exception ( " commands should follow with an array element " ) ; } } else if ( token = = x content parser token start array ) { / / ok } else { throw new elasticsearch parse exception ( " expected either field name [ commands ] , or start array , got [ { } ] instead " , token ) ; } while ( ( token = parser next token ( ) ) ! = x content parser token end array ) { if ( token = = x content parser token start object ) { / / move to the command name token = parser next token ( ) ; string command name = parser current name ( ) ; token = parser next token ( ) ; commands add ( parser named object ( allocation command class , command name , null ) ) ; / / move to the end object one if ( parser next token ( ) ! = x content parser token end object ) { throw new elasticsearch parse exception ( " allocation command is malformed , done parsing a command , " + " but didn ' t get end object , got [ { } ] instead " , token ) ; } } else { throw new elasticsearch parse exception ( " allocation command is malformed , got [ { } ] instead " , token ) ; } } return commands ; }


tool was removed from a workspace ; update the display

void tool removed ( plugin tool tool ) { int index = producer model index of ( tool ) ; if ( index > = 0 ) { producer model remove ( index ) ; } index = consumer model index of ( tool ) ; if ( index > = 0 ) { consumer model remove ( index ) ; } process selection ( ) ; validate ( ) ; }


return data contained in a sock j s " message " and " close " frames otherwise for sock j s " open " and " close " frames , which do not contain data , return { @ code null }

public string get frame data ( ) { if ( get type ( ) = = sock js frame type open | | get type ( ) = = sock js frame type heartbeat ) { return null ; } else { return get content ( ) substring ( 1 ) ; } }


public boolean contains ( node node ) { if ( node = = null ) return false ; netlock read lock ( ) lock ( ) ; try { node parent = node get parent ( ) ; for ( int level = node get level ( ) ; parent ! = null & & level > 0 ; parent = parent get parent ( ) , level - - ) { if ( parent = = cluster map ) { return true ; } } } finally { netlock read lock ( ) unlock ( ) ; } return false ; }


get the leader state stored in this worker coordinator

private leader state leader state ( ) { return leader state ; }


set the routing to decide which shard the documents need to be routed to

public reindex request set dest routing ( string routing ) { this get destination ( ) routing ( routing ) ; return this ; }


if a connection has not been used in this many milliseconds , ping the database to make sure the connection is still good

public void set pool ping connections not used for ( int milliseconds ) { this pool ping connections not used for = milliseconds ; force close all ( ) ; }


returned information is a json representation of an array , each element of the array is a map contains the information about a block pool service actor

public string get b p service actor info ( ) { final array list < map < string , string > > info array = new array list < map < string , string > > ( ) ; for ( b p offer service bpos : block pool manager get all namenode threads ( ) ) { if ( bpos ! = null ) { for ( b p service actor actor : bpos get b p service actors ( ) ) { info array add ( actor get actor info map ( ) ) ; } } } return json to string ( info array ) ; }


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


does this aabb contain the provided aabb

public final boolean contains ( final aabb aabb ) { / * * boolean result = true ; result = result & & lower bound x < = aabb lower bound x ; result = result * & & lower bound y < = aabb lower bound y ; result = result & & aabb upper bound x < = upper bound x ; * result = result & & aabb upper bound y < = upper bound y ; return result ; * / / / djm : faster putting all of them together , as if one is false we leave the logic / / early return lower bound x < = aabb lower bound x & & lower bound y < = aabb lower bound y & & aabb upper bound x < = upper bound x & & aabb upper bound y < = upper bound y ; }


query the service state this is a non - blocking operation

public service state get state ( ) { return state ; }


public boolean get more results ( ) throws s q l exception { check closed ( ) ; return false ; }


public application id get application id ( ) { return this application id ; }


sets the alpha ( opacity ) of this component

public t alpha ( float alpha ) { m component get or create common props ( ) alpha ( alpha ) ; return get this ( ) ; }


returns the offset of the byte array which this buffer is based on , if there is one the offset is the index of the array which corresponds to the zero position of the buffer

public final int array offset ( ) { return protected array offset ( ) ; }


test that a configuration with a single rm fails

public void test h a conf with single r m i d ( ) { configuration conf = new configuration ( configuration ) ; conf set boolean ( yarn configuration rm ha enabled , true ) ; conf set boolean ( yarn configuration auto failover enabled , true ) ; conf set boolean ( yarn configuration auto failover embedded , true ) ; conf set ( yarn configuration rm ha ids , " rm 1 " ) ; int base = 100 ; for ( string conf key : yarn configuration get service address conf keys ( configuration ) ) { conf set ( h a util add suffix ( conf key , " rm 1 " ) , " 0 0 0 0 : " + ( base + 20 ) ) ; base = base * 2 ; } conf set ( yarn configuration rm ha id , " rm 1 " ) ; check bad configuration ( conf ) ; }


configures key store related settings in ssl context factory

protected static void configure ssl context factory key store ( ssl context factory ssl , map < string , object > ssl config values ) { ssl set key store type ( ( string ) get or default ( ssl config values , ssl configs ssl keystore type config , ssl configs default ssl keystore type ) ) ; string ssl keystore location = ( string ) ssl config values get ( ssl configs ssl keystore location config ) ; if ( ssl keystore location ! = null ) ssl set key store path ( ssl keystore location ) ; password ssl keystore password = ( password ) ssl config values get ( ssl configs ssl keystore password config ) ; if ( ssl keystore password ! = null ) ssl set key store password ( ssl keystore password value ( ) ) ; password ssl key password = ( password ) ssl config values get ( ssl configs ssl key password config ) ; if ( ssl key password ! = null ) ssl set key manager password ( ssl key password value ( ) ) ; }


register each bean definition within the given root { @ code < beans > } element

protected void do register bean definitions ( element root ) { / / any nested < beans > elements will cause recursion in this method in / / order to propagate and preserve < beans > default - * attributes correctly , / / keep track of the current ( parent ) delegate , which may be null create / / the new ( child ) delegate with a reference to the parent for fallback purposes , / / then ultimately reset this delegate back to its original ( parent ) reference / / this behavior emulates a stack of delegates without actually necessitating one bean definition parser delegate parent = this delegate ; this delegate = create delegate ( get reader context ( ) , root , parent ) ; if ( this delegate is default namespace ( root ) ) { string profile spec = root get attribute ( profile attribute ) ; if ( string utils has text ( profile spec ) ) { string [ ] specified profiles = string utils tokenize to string array ( profile spec , bean definition parser delegate multi value attribute delimiters ) ; / / we cannot use profiles of ( ) since profile expressions are not supported / / in xml config see spr - 12458 for details if ( ! get reader context ( ) get environment ( ) accepts profiles ( specified profiles ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " skipped xml bean definition file due to specified profiles [ " + profile spec + " ] not matching : " + get reader context ( ) get resource ( ) ) ; } return ; } } } pre process xml ( root ) ; parse bean definitions ( root , this delegate ) ; post process xml ( root ) ; this delegate = parent ; }


returns the set of vertices contained within the given edges

public static < v , e extends g edge < v > > set < v > to vertices ( collection < e > edges ) { set < v > result = new hash set < > ( ) ; for ( e e : edges ) { result add ( e get start ( ) ) ; result add ( e get end ( ) ) ; } return result ; }


connect to the specified hostnameip by default uses port 1883 if you want to change the port number , see { @ link # connect ( string , int ) }

public future < mqtt connect result > connect ( string host ) { return connect ( host , 1883 ) ; }


gets the partition number of this partition

int get partition number ( ) { return this partition number ; }


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


sets the < code > map number < code > property

public void set map number ( map < string , big decimal > map number ) { this map number = map number ; }


dispatches { @ link # on load started ( int , media period id , load event info , media load data ) }

public void load started ( load event info load event info , int data type , int track type , @ nullable format track format , int track selection reason , @ nullable object track selection data , long media start time us , long media end time us ) { load started ( load event info , new media load data ( data type , track type , track format , track selection reason , track selection data , adjust media time ( media start time us ) , adjust media time ( media end time us ) ) ) ; }


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


sets the string describing this data type

public void set description ( string desc ) ;


gets the root { @ link g file } object for this filesystem index

public g file get root dir ( ) { return root dir ; }


specify the { @ link source extractor } to use the default implementation is { @ link null source extractor } which simply returns { @ code null } as the source object this means that - during normal runtime execution - no additional source metadata is attached to the bean configuration metadata

public void set source extractor ( @ nullable source extractor source extractor ) { this source extractor = ( source extractor ! = null ? source extractor : new null source extractor ( ) ) ; }


when we can ' t find primary data , but still find replica data , we go ahead and keep it unassigned to be allocated this is today behavior , which relies on a primary corruption identified with adding a replica and having that replica actually recover and cause the corruption to be identified see corrupt file test #

public void test no primary data ( ) { routing allocation allocation = one primary on node 1 and 1 replica ( yes allocation deciders ( ) ) ; test allocator add data ( node 2 , " match " , new store file metadata ( " file 1 " , 10 , " match checksum " , min supported lucene version ) ) ; allocate all unassigned ( allocation ) ; assert that ( allocation routing nodes ( ) shards with state ( shard routing state unassigned ) size ( ) , equal to ( 1 ) ) ; assert that ( allocation routing nodes ( ) shards with state ( shard routing state unassigned ) get ( 0 ) shard id ( ) , equal to ( shard id ) ) ; }


runs simplification inside a non - specialized node

private rex node simplify generic node ( rex call e ) { final list < rex node > operands = new array list < > ( e operands ) ; simplify list ( operands , unknown ) ; if ( e operands equals ( operands ) ) { return e ; } return rex builder make call ( e get type ( ) , e get operator ( ) , operands ) ; }


return a local map spill file created earlier

public path get spill file ( int spill number ) throws i o exception { return l dir alloc get local path to read ( m r job config output + " / spill " + spill number + " out " , get conf ( ) ) ; }


get the operator coordinator provider for this operator

operator coordinator provider get coordinator provider ( string operator name , operator i d operator i d ) ;


called from within { @ link # render frame } to ask the caller for a cached bitmap for the specified frame number if the caller has the bitmap cached , it can greatly reduce the work required to render the requested frame

closeable reference < bitmap > get cached bitmap ( int frame number ) ;


returns the value for the specific variable and only checks this scope and not any parent scope

object get variable local ( string variable name ) ;


add an asynchronous part with { @ link publisher } - based content

< t , p extends publisher < t > > multipart inserter with publisher ( string name , p publisher , class < t > element class ) ;


function which calls { @ code input stream read ( ) } and downgrades an ioe to a runtime exception

public static int read ( input stream in ) { try { return in read ( ) ; } catch ( i o exception ex ) { throw new assertion error ( ex ) ; } }


tests get proxy with random order configuration set to false this expects the proxy order to be consistent every time a new configured failover proxy provider is created

public void test non random get proxy ( ) throws exception { final atomic integer nn 1 count = new atomic integer ( 0 ) ; final atomic integer nn 2 count = new atomic integer ( 0 ) ; map < inet socket address , client protocol > proxy map = new hash map < > ( ) ; final client protocol nn 1 mock = mock ( client protocol class ) ; when ( nn 1 mock get stats ( ) ) then answer ( create answer ( nn 1 count , 1 ) ) ; proxy map put ( ns 1nn 1 , nn 1 mock ) ; final client protocol nn 2 mock = mock ( client protocol class ) ; when ( nn 2 mock get stats ( ) ) then answer ( create answer ( nn 2 count , 2 ) ) ; proxy map put ( ns 1nn 2 , nn 2 mock ) ; configured failover proxy provider < client protocol > provider 1 = new configured failover proxy provider < > ( conf , ns 1 uri , client protocol class , create factory ( proxy map ) ) ; client protocol proxy 1 = provider 1 get proxy ( ) proxy ; proxy 1 get stats ( ) ; assert equals ( 1 , nn 1 count get ( ) ) ; assert equals ( 0 , nn 2 count get ( ) ) ; proxy 1 get stats ( ) ; assert equals ( 2 , nn 1 count get ( ) ) ; assert equals ( 0 , nn 2 count get ( ) ) ; nn 1 count set ( 0 ) ; nn 2 count set ( 0 ) ; for ( int i = 0 ; i < num iterations ; i + + ) { configured failover proxy provider < client protocol > provider 2 = new configured failover proxy provider < > ( conf , ns 1 uri , client protocol class , create factory ( proxy map ) ) ; client protocol proxy 2 = provider 2 get proxy ( ) proxy ; proxy 2 get stats ( ) ; } assert equals ( num iterations , nn 1 count get ( ) ) ; assert equals ( 0 , nn 2 count get ( ) ) ; }


run a simple workload of becoming the active writer and writing two log segments : 1 - 3 and 4 - 6

private static int do workload ( mini journal cluster cluster , quorum journal manager qjm ) throws i o exception { int last acked = 0 ; try { qjm recover unfinalized segments ( ) ; write segment ( cluster , qjm , 1 , 3 , true ) ; last acked = 3 ; write segment ( cluster , qjm , 4 , 3 , true ) ; last acked = 6 ; } catch ( quorum exception qe ) { log info ( " failed to write at txid " + last acked , qe ) ; } return last acked ; }


get a packed database which whose unpacking will be cached if possible

public static packed database get packed database ( file packed db file , task monitor monitor ) throws i o exception , cancelled exception { return get packed database ( packed db file , false , monitor ) ; }


method to check initial value of the statistics which should be 0

private void check initial value ( string stat name , long stat value ) { assert equals ( " mismatch in " + stat name , 0 , stat value ) ; }


set up terasort by cleaning out the destination , and note the initial time before any of the jobs are executed this is executed first for each parameterized run it is where all variables which need to be reset for each run need to be reset

public void test 100 terasort setup ( ) throws throwable { describe ( " setting up for a terasort " ) ; get file system ( ) delete ( terasort path , true ) ; completed stages = new hash map < > ( ) ; terasort duration = optional of ( new duration info ( log , false , " terasort " ) ) ; }


adds a node to this node ' s children at the given index and notifies the tree must be called from the swing thread

protected synchronized void do add node ( int index , g tree node node ) { list < g tree node > kids = children ( ) ; if ( kids contains ( node ) ) { return ; } int insert index = math min ( kids size ( ) , index ) ; kids add ( insert index , node ) ; node set parent ( ( g tree node ) this ) ; do fire node added ( node ) ; }


compares the specified object to this multimap for equality two { @ code set multimap } instances are equal if , for each key , they contain the same values equality does not depend on the ordering of keys or values an empty { @ code set multimap } is equal to any other empty { @ code multimap } , including an empty { @ code list multimap }

boolean equals ( @ nullable object obj ) ;


is this a fast moving body that should be prevented from tunneling through other moving bodies ? note that all bodies are prevented from tunneling through kinematic and static bodies this setting is only considered on dynamic bodies @ warning you should use this flag sparingly since it increases processing time

public void set bullet ( boolean bullet ) { this bullet = bullet ; }


assert whether the cookie must be http only

public result matcher http only ( string name , boolean http only ) { return result - > { cookie cookie = get cookie ( result , name ) ; assert equals ( " response cookie ' " + name + " ' http only " , http only , cookie is http only ( ) ) ; } ; }


we need skip bytes to write when the remain bytes of current segment is not enough to write window part

private int check skip write for window part ( abstract paged output view out ) throws i o exception { / / skip if there is no enough size int available = out get segment size ( ) - out get current position in segment ( ) ; if ( available < get serialized fixed part length ( ) ) { out advance ( ) ; return available ; } return 0 ; }


for example , creating an amazon s3 bucket ends up as a zero - length post

@ test public void zero length put ( ) throws exception { zero length payload ( " put " ) ; }


check whether the given envoy rls rule is valid

public static boolean is valid rule ( envoy rls rule rule ) { if ( rule = = null | | string util is blank ( rule get domain ( ) ) ) { return false ; } list < envoy rls rule resource descriptor > descriptors = rule get descriptors ( ) ; if ( descriptors = = null | | descriptors is empty ( ) ) { return false ; } for ( envoy rls rule resource descriptor descriptor : descriptors ) { if ( descriptor = = null | | descriptor get count ( ) = = null | | descriptor get count ( ) < 0 ) { return false ; } set < envoy rls rule key value resource > resources = descriptor get resources ( ) ; if ( resources = = null | | resources is empty ( ) ) { return false ; } for ( envoy rls rule key value resource resource : resources ) { if ( resource = = null | | string util is blank ( resource get key ( ) ) | | string util is blank ( resource get value ( ) ) ) { return false ; } } } return true ; }


returns the sum of this long value and the given specific long value

public long value add ( specific long value other ) { return this ; }


used on windows to determine if the specified file is a symlink that targets a directory on most platforms , these checks can be done using commons - io on windows , the commons - io implementation is unreliable and always returns false instead , this method checks the output of the dir command after migrating to java 7 , this method can be removed in favor of the new method java nio file files is symbolic link , which is expected to work cross - platform

private static boolean is windows symlinked directory ( file file ) throws i o exception { string dir out = shell exec command ( " cmd " , " / c " , " dir " , file get absolute file ( ) get parent ( ) ) ; string reader sr = new string reader ( dir out ) ; buffered reader br = new buffered reader ( sr ) ; try { string line = br read line ( ) ; while ( line ! = null ) { line = br read line ( ) ; if ( line contains ( file get name ( ) ) & & line contains ( " < symlinkd > " ) ) { return true ; } } return false ; } finally { i o utils close stream ( br ) ; i o utils close stream ( sr ) ; } }


generate expected colors as in checked page

private set < string > generate expected colors ( final int initial color , final int step color , final int n x , final int n y ) { set < string > colors = new tree set < > ( ) ; int cnt = 1 ; for ( int i = 1 ; i < n x ; i + + ) { for ( int j = 1 ; j < n y ; j + + ) { int color = initial color + ( cnt * step color ) ; string hex = string format ( " # % 0 2x % 0 2x % 0 2x " , ( ( color & 0x f f 0 0 0 0 ) > > 16 ) , ( ( color & 0x 0 0 f f 0 0 ) > > 8 ) , ( ( color & 0x 0 0 0 0 f f ) ) ) ; colors add ( hex ) ; cnt + + ; } } return colors ; }


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 ;


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


see original { @ link stubber # do answer ( answer ) }

b d d stubber will answer ( answer < ? > answer ) ;


return the priority level assigned by call queue to an rpc returns 0 in case no priority is assigned

public static int get priority level ( ) { call call = cur call get ( ) ; return call ! = null ? call get priority level ( ) : 0 ; }


returns a new { @ code future } whose result is asynchronously derived from the result of the given { @ code future } if the given { @ code future } fails , the returned { @ code future } fails with the same exception ( and the function is not invoked ) more precisely , the returned { @ code future } takes its result from a { @ code future } produced by applying the given { @ code async function } to the result of the original { @ code future } example usage : { @ code listenable future < row key > row key future = index service look up ( query ) ; listenable future < query result > query future = transform async ( row key future , data service : : read future , executor ) ; } when selecting an executor , note that { @ code direct executor } is dangerous in some cases see the warnings the { @ link more executors # direct executor } documentation the returned { @ code future } attempts to keep its cancellation state in sync with that of the input future and that of the future returned by the chain function that is , if the returned { @ code future } is cancelled , it will attempt to cancel the other two , and if either of the other two is cancelled , the returned { @ code future } will receive a callback in which it will attempt to cancel itself

public static < i , o > listenable future < o > transform async ( listenable future < i > input , async function < ? super i , ? extends o > function , executor executor ) { return abstract transform future create ( input , function , executor ) ; }


removes the given field note that removing a field that is still being referenced can cause unpredictable effects

public void remove field ( field field ) { int fields count = target class u 2fields count ; field [ ] fields = target class fields ; int field index = find field index ( field ) ; / / shift the field entries system arraycopy ( fields , field index + 1 , fields , field index , fields count - field index - 1 ) ; / / clear the last entry fields [ - - target class u 2fields count ] = null ; }


creates a symbol , specifying all information for the record this method is not on the public interface and is only intended for program api internal use the user of this method must carefully provided exactly the information needed depending on the type of symbol being created

public symbol d b create special symbol ( address addr , string name , namespace parent , symbol type symbol type , long data 1 , int data 2 , string data 3 , source type source ) throws duplicate name exception , invalid input exception { lock acquire ( ) ; try { parent = validate namespace ( parent , addr , symbol type ) ; source = validate source ( source , name , addr , symbol type ) ; name = validate name ( name , source ) ; check duplicate symbol name ( addr , name , parent , symbol type ) ; return do create symbol ( name , addr , parent , symbol type , data 1 , data 2 , data 3 , source ) ; } finally { lock release ( ) ; } }


throw { @ link runtime exception } inside a thread of { @ link resource manager } with ha enabled and check if the { @ link resource manager } is transited to standby state

public void test uncaught exception handler with h a enabled ( ) throws interrupted exception { conf set ( yarn configuration rm cluster id , " yarn - test - cluster " ) ; conf set ( yarn configuration rm zk address , host port ) ; cluster init ( conf ) ; cluster start ( ) ; assert false ( " rm never turned active " , - 1 = = cluster get active r m index ( ) ) ; resource manager resource manager = cluster get resource manager ( cluster get active r m index ( ) ) ; final r m critical thread uncaught exception handler ex handler = new r m critical thread uncaught exception handler ( resource manager get r m context ( ) ) ; / / create a thread and throw a rte inside it final runtime exception rte = new runtime exception ( " test runtime exception " ) ; final thread test thread = new thread ( new runnable ( ) { @ override public void run ( ) { throw rte ; } } ) ; test thread set name ( " test thread " ) ; test thread set uncaught exception handler ( ex handler ) ; test thread start ( ) ; test thread join ( ) ; verify r m transition to standby ( resource manager ) ; }


describe topics result describe topics ( collection < string > topic names , describe topics options options ) ;


returns the remainder of the given unknown integer value divided by this integer value

public integer value remainder of ( unknown integer value other ) { return remainder of ( ( integer value ) other ) ; }


decode an integer value according to parameters stored in the < code > context < code > object

public abstract long do decode ( dwarf decode context context ) throws memory access exception ;


public integer get prefix ns integer ( ) { return prefix ns integer ; }


prepares to upgrade to another protocol from http disables the { @ link encoder }

public void prepare upgrade from ( channel handler context ctx ) { ( ( encoder ) outbound handler ( ) ) upgraded = true ; }


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


add the given element to the created list , provided the element does not exist , i e i < 0

private void add created ( final e element , final int i ) { if ( i > = 0 ) { throw new assertion error ( " element already exists : element = " + element + " , created = " + created ) ; } if ( created = = null ) { created = new array list < > ( default array initial capacity ) ; } created add ( - i - 1 , element ) ; }


renames the given java element to the given new name currently only supports renaming packages and compilation units

private static void rename java element ( i java element element , string new name , i progress monitor monitor ) throws core exception , illegal argument exception { string id ; if ( element get element type ( ) = = i java element package fragment ) { id = i java refactorings rename package ; } else if ( element get element type ( ) = = i java element compilation unit ) { id = i java refactorings rename compilation unit ; } else { throw new illegal argument exception ( " can only rename packages and compilation units ! " ) ; } refactoring contribution contribution = refactoring core get refactoring contribution ( id ) ; rename java element descriptor descriptor = ( rename java element descriptor ) contribution create descriptor ( ) ; descriptor set project ( element get resource ( ) get project ( ) get name ( ) ) ; descriptor set new name ( new name ) ; descriptor set java element ( element ) ; refactoring status status = new refactoring status ( ) ; refactoring refactoring = descriptor create refactoring ( status ) ; refactoring check initial conditions ( monitor ) ; refactoring check final conditions ( monitor ) ; change change = refactoring create change ( monitor ) ; change perform ( monitor ) ; }


public big decimal get prefix ns number ( ) { return prefix ns number ; }


returns one of the keyword constants or < code > token i d e n t < code > for a scanned identifier

private int get token ( string s ) { assert ( s ! = null ) ; switch ( s length ( ) ) { case 3 : if ( s q l indent symbols end equals ( s ) ) { return tokenend ; } if ( s q l indent symbols end equals ignore case ( s ) ) { return token e n d ; } break ; case 5 : if ( s q l indent symbols begin equals ( s ) ) { return tokenbegin ; } if ( s q l indent symbols begin equals ignore case ( s ) ) { return token b e g i n ; } break ; } final d b p keyword type keyword type = syntax manager get dialect ( ) get keyword type ( s ) ; if ( keyword type = = d b p keyword type keyword ) { return token keyword ; } / / if ( syntax manager get dialect ( ) is keyword start ( s ) ) { / / return token keyword start ; / / } return token o t h e r ; }


resolves the script source from either the ' { @ code script - source } ' attribute or the ' { @ code inline - script } ' element logs and { @ link xml reader context # error } and returns { @ code null } if neither or both of these values are specified

private string resolve script source ( element element , xml reader context reader context ) { boolean has script source = element has attribute ( script source attribute ) ; list < element > elements = dom utils get child elements by tag name ( element , inline script element ) ; if ( has script source & & ! elements is empty ( ) ) { reader context error ( " only one of ' script - source ' and ' inline - script ' should be specified " , element ) ; return null ; } else if ( has script source ) { return element get attribute ( script source attribute ) ; } else if ( ! elements is empty ( ) ) { element inline element = elements get ( 0 ) ; return " inline : " + dom utils get text value ( inline element ) ; } else { reader context error ( " must specify either ' script - source ' or ' inline - script ' " , element ) ; return null ; } }


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 " ) ; }


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 ; }


for each archive or cache file - get the corresponding delegation token

public static void get delegation tokens ( configuration job , credentials credentials ) throws i o exception { uri [ ] tarchives = distributed cache get cache archives ( job ) ; uri [ ] tfiles = distributed cache get cache files ( job ) ; int size = ( tarchives ! = null ? tarchives length : 0 ) + ( tfiles ! = null ? tfiles length : 0 ) ; path [ ] ps = new path [ size ] ; int i = 0 ; if ( tarchives ! = null ) { for ( i = 0 ; i < tarchives length ; i + + ) { ps [ i ] = new path ( tarchives [ i ] to string ( ) ) ; } } if ( tfiles ! = null ) { for ( int j = 0 ; j < tfiles length ; j + + ) { ps [ i + j ] = new path ( tfiles [ j ] to string ( ) ) ; } } token cache obtain tokens for namenodes ( credentials , ps , job ) ; }


only select the historic process instances with which the user with the given id is involved

historic process instance query involved user ( string user id ) ;


scroll the view of the listing to the given location

public void scroll to ( program location location ) { field location field location = get field location ( location ) ; field panel scroll to ( field location ) ; }


public void add listener ( analytics listener listener ) { assertions check not null ( listener ) ; listeners add ( listener ) ; }


this test start a cluster , fill the data nodes to be 30 % full ; it then adds an empty node and start balancing

private void run test ( final int n name nodes , string [ ] racks , string [ ] new rack , configuration conf , int n name nodesto balance , balancer parameters balancer parameters ) throws exception { final int n data nodes = racks length ; final long [ ] capacities = new long [ n data nodes ] ; arrays fill ( capacities , capacity ) ; log info ( " n name nodes = " + n name nodes + " , n data nodes = " + n data nodes ) ; assert assert equals ( n data nodes , racks length ) ; log info ( " run test - 1 : start a cluster with n name nodes = " + n name nodes + " , n data nodes = " + n data nodes ) ; final mini d f s cluster cluster = new mini d f s cluster builder ( new configuration ( conf ) ) nn topology ( mini d f s n n topology simple federated topology ( n name nodes ) ) num data nodes ( n data nodes ) racks ( racks ) simulated capacities ( capacities ) build ( ) ; log info ( " run test 0 " ) ; d f s test util set federated configuration ( cluster , conf ) ; try { cluster wait active ( ) ; log info ( " run test 1 " ) ; suite s ; set < string > blockpools = new hash set < > ( ) ; if ( balancer parameters = = null ) { s = new suite ( cluster , n name nodes , n data nodes , balancer parameters default , conf ) ; } else { for ( int i = 0 ; i < n name nodesto balance ; i + + ) { blockpools add ( cluster get namesystem ( i ) get block pool id ( ) ) ; } balancer parameters builder b = new balancer parameters builder ( ) ; b set balancing policy ( balancer parameters get balancing policy ( ) ) ; b set blockpools ( blockpools ) ; balancer parameters params = b build ( ) ; s = new suite ( cluster , n name nodes , n data nodes , params , conf , ( short ) 2 ) ; } long total capacity = test balancer sum ( capacities ) ; log info ( " run test 2 : create files " ) ; / / fill up the cluster to be 30 % full final long total used = total capacity * 3 / 10 ; final long size = ( total used / n name nodes ) / s replication ; for ( int n = 0 ; n < n name nodes ; n + + ) { create file ( s , n , size ) ; } log info ( " run test 3 : " + new rack length + " new datanodes " ) ; / / start up an empty node with the same capacity and on the same rack final long [ ] new capacity = new long [ new rack length ] ; arrays fill ( new capacity , capacity ) ; cluster start data nodes ( conf , new capacity length , true , null , new rack , new capacity ) ; total capacity + = test balancer sum ( new capacity ) ; log info ( " run test 4 : run balancer " ) ; / / run run test and validate results run balancer ( s , total used , total capacity ) ; log info ( " run test 5 " ) ; } finally { cluster shutdown ( ) ; } log info ( " run test 6 : done " ) ; }


visit a parse tree produced by { @ link eql base parser # query }

t visit query ( eql base parser query context ctx ) ;


compile a string pattern in to a pattern object

protected abstract pattern compile ( string s ) ;


returns the item that corresponds to the period with the given id , or null if no media queue or period with id { @ code period id } exist

public media queue item get item ( int period id ) { media status media status = get media status ( ) ; return media status ! = null & & current timeline get index of period ( period id ) ! = c index unset ? media status get item by id ( period id ) : null ; }


public static < k , v > v create if absent return last ( @ not null final concurrent map < k , v > map , final k key , @ not null final value creator < ? extends v > creator ) { final v value = map get ( key ) ; if ( value = = null ) { return put if absent return last ( map , key , creator get ( ) ) ; } return value ; }


set the name of the logger to use the name will be passed to the underlying logger implementation through commons logging , getting interpreted as log category according to the logger ' s configuration this can be specified to not log into the category of a class ( whether this interceptor ' s class or the class getting called ) but rather into a specific named category < b > note : < b > specify either this property or " use dynamic logger " , not both

public void set logger name ( string logger name ) { this default logger = log factory get log ( logger name ) ; }


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


declares that this aspect propagates along all attributes on the target associated with this aspect specify either this or { @ link # propagate along attribute ( string ) } , not both

public final builder propagate along all attributes ( ) { preconditions check state ( this propagate along attributes ! = null , " aspects for all attributes must only be specified once " ) ; preconditions check state ( this propagate along attributes is empty ( ) , " specify either aspects for all attributes , or for specific attributes , not both " ) ; this propagate along attributes = null ; return this ; }


obtain a { @ link jackson 2 object mapper builder } instance in order to build a smile data format { @ link object mapper } instance

public static jackson 2 object mapper builder smile ( ) { return new jackson 2 object mapper builder ( ) factory ( new smile factory initializer ( ) create ( ) ) ; }


reports the start of a particular task is a wrapper around report ( ) with event kind start should always be matched by a corresponding call to finish task ( ) with the same message , except that the leading percentage progress indicator ( if any ) in the message may differ

public void start task ( location location , string message ) { handle ( event of ( event kind start , location , message ) ) ; }


converts the given { @ link data stream } into a { @ link table } the field names of the { @ link table } are automatically derived from the type of the { @ link data stream }

< t > table from data stream ( data stream < t > data stream ) ;


open a test file with the read buffer specified in the setting { @ link org apache hadoop fs s 3a s 3 a test constants # key read buffer size }

private f s data input stream open data file ( s 3 a file system fs , path path , s 3 a input policy input policy , long readahead ) throws i o exception { int buffer size = get conf ( ) get int ( key read buffer size , default read buffer size ) ; s 3 a input policy policy = fs get input policy ( ) ; fs set input policy ( input policy ) ; try { f s data input stream stream = fs open ( path , buffer size ) ; if ( readahead > = 0 ) { stream set readahead ( readahead ) ; } stream statistics = get input stream statistics ( stream ) ; return stream ; } finally { fs set input policy ( policy ) ; } }


blocking retrieval and removal of the object to share

public v get and remove ( string key ) { try { v obj to share = retrieve shared queue ( key ) take ( ) ; mediations remove ( key ) ; return obj to share ; } catch ( interrupted exception e ) { throw new runtime exception ( e ) ; } }


applies a flat map transformation on a { @ link data set } the transformation calls a { @ link org apache flink api common functions rich flat map function } for each element of the data set each flat map function call can return any number of elements including none

public < r > flat map operator < t , r > flat map ( flat map function < t , r > flat mapper ) { if ( flat mapper = = null ) { throw new null pointer exception ( " flat map function must not be null " ) ; } string call location = utils get call location name ( ) ; type information < r > result type = type extractor get flat map return types ( flat mapper , get type ( ) , call location , true ) ; return new flat map operator < > ( this , result type , clean ( flat mapper ) , call location ) ; }


it ' s not ok to drop tombstones for non - final - results windowed streams , since we may have emitted some results for the window before getting the tombstone ( see the { @ link suppressed internal } javadoc )

public void suppress should not drop tombstones for session windows ( ) { final harness < windowed < string > , long > harness = new harness < > ( until time limit ( of millis ( 0 ) , max records ( 0 ) ) , session windowed serde from ( string class ) , long ( ) ) ; final mock internal processor context context = harness context ; final long timestamp = 100l ; context set record metadata ( " " , 0 , 0l , null , timestamp ) ; final windowed < string > key = new windowed < > ( " hey " , new session window ( 0l , 0l ) ) ; final change < long > value = new change < > ( null , arbitrary long ) ; harness processor process ( key , value ) ; assert that ( context forwarded ( ) , has size ( 1 ) ) ; final mock processor context captured forward captured forward = context forwarded ( ) get ( 0 ) ; assert that ( captured forward key value ( ) , is ( new key value < > ( key , value ) ) ) ; assert that ( captured forward timestamp ( ) , is ( timestamp ) ) ; }


compiles the supplied { @ code string [ ] } into an array of { @ link pattern } objects and returns that array

private pattern [ ] compile patterns ( string [ ] source ) throws pattern syntax exception { pattern [ ] destination = new pattern [ source length ] ; for ( int i = 0 ; i < source length ; i + + ) { destination [ i ] = pattern compile ( source [ i ] ) ; } return destination ; }


remove a metric if it exists and return it return null otherwise if a metric is removed , ` metric removal ` will be invoked for each reporter

public synchronized kafka metric remove metric ( metric name metric name ) { kafka metric metric = this metrics remove ( metric name ) ; if ( metric ! = null ) { for ( metrics reporter reporter : reporters ) { try { reporter metric removal ( metric ) ; } catch ( exception e ) { log error ( " error when removing metric from " + reporter get class ( ) get name ( ) , e ) ; } } log trace ( " removed metric named { } " , metric name ) ; } return metric ; }