returns the default ( first ) host name associated by the default nameserver with the address bound to the specified network interface

public static string get default host ( @ nullable string str interface ) throws unknown host exception { return get default host ( str interface , null , false ) ; }


adds records to queues if a record has an invalid ( i e , negative ) timestamp , the record is skipped and not added to the queue for processing

public void add records ( final topic partition partition , final iterable < consumer record < byte [ ] , byte [ ] > > records ) { final int new queue size = partition group add raw records ( partition , records ) ; if ( log is trace enabled ( ) ) { log trace ( " added records into the buffered queue of partition { } , new queue size is { } " , partition , new queue size ) ; } / / if after adding these records , its partition queue ' s buffered size has been / / increased beyond the threshold , we can then pause the consumption for this partition if ( new queue size > max buffered size ) { main consumer pause ( singleton ( partition ) ) ; } }


set the body of the request and build it the string is assumed to be utf - 8 encoded unless the request has a " content - type " header with a charset attribute

mock server http request body ( string body ) ;


, , ， ， ， ， 5

public static < k , v > hash map < k , v > new hash map with capacity ( int expected size , float load factor ) { int final size = ( int ) ( expected size / load factor + 1 0f ) ; return new hash map < k , v > ( final size , load factor ) ; }


in this test case , i have created an image with a file having preferredblock size = 0 we are trying to read this image ( since file with preferredblock size = 0 was allowed pre 2 1 0 - beta version the namenode after 2 6 version will not be able to read this particular file see hdfs - 7788 for more information

public void test zero block size ( ) throws exception { final configuration conf = new hdfs configuration ( ) ; string tar file = system get property ( " test cache data " , " build / test / cache " ) + " / " + hadoop 2 7 zer0 block size tgz ; string test dir = path utils get test dir name ( get class ( ) ) ; file dfs dir = new file ( test dir , " image - with - zero - block - size " ) ; if ( dfs dir exists ( ) & & ! file util fully delete ( dfs dir ) ) { throw new i o exception ( " could not delete dfs directory ' " + dfs dir + " ' " ) ; } file util un tar ( new file ( tar file ) , new file ( test dir ) ) ; file name dir = new file ( dfs dir , " name " ) ; generic test utils assert exists ( name dir ) ; conf set ( d f s config keys dfs namenode name dir key , name dir get absolute path ( ) ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( 1 ) format ( false ) manage data dfs dirs ( false ) manage name dfs dirs ( false ) wait safe mode ( false ) startup option ( startup option upgrade ) build ( ) ; try { file system fs = cluster get file system ( ) ; path test path = new path ( " / tmp / zero block file " ) ; assert true ( " file / tmp / zero block file doesn ' t exist " , fs exists ( test path ) ) ; assert true ( " name node didn ' t come up " , cluster is name node up ( 0 ) ) ; } finally { cluster shutdown ( ) ; / / clean up file util fully delete ( dfs dir ) ; } }


returns the symbol ' s visibility for example , default

public byte get visibility ( ) { return ( byte ) ( st other & 0x 0 3 ) ; }


public void write ( short u 0 , short u 1 , short u 2 , short u 3 , short u 4 ) ;


decommission or perform maintenance for data nodes and wait for them to reach the expected state

protected datanode info take node outof service ( int nn index , string datanode uuid , long maintenance expiration in m s , list < datanode info > decommissioned nodes , map < datanode info , long > in maintenance nodes , admin states wait for state ) throws i o exception { return take node outof service ( nn index , ( datanode uuid ! = null ? lists new array list ( datanode uuid ) : null ) , maintenance expiration in m s , decommissioned nodes , in maintenance nodes , wait for state ) get ( 0 ) ; }


we cannot use value of since the allow from enum differs from its value allow - from this is a helper method that does exactly what valueof does , but allows us to handle the allow from issue gracefully

private static x frame option get enum ( string value ) { preconditions check state ( value ! = null & & ! value is empty ( ) ) ; for ( x frame option xoption : values ( ) ) { if ( value equals ( xoption to string ( ) ) ) { return xoption ; } } throw new illegal argument exception ( " unexpected value in x frame option " ) ; }


public int get client selector thread size ( ) { return config get int ( configuration keys client selector thread size , default selector thread size ) ; }


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


to formatting string all " | " in { @ link # resource } will be replaced with " " , format is : < br > < code > timestamp | resource | pass qps | block qps | success qps | exception qps | rt | occupied pass qps < code >

public string to thin string ( ) { string builder sb = new string builder ( ) ; sb append ( timestamp ) append ( " | " ) ; string legal name = resource replace all ( " \ \ | " , " " ) ; sb append ( legal name ) append ( " | " ) ; sb append ( pass qps ) append ( " | " ) ; sb append ( block qps ) append ( " | " ) ; sb append ( success qps ) append ( " | " ) ; sb append ( exception qps ) append ( " | " ) ; sb append ( rt ) append ( " | " ) ; sb append ( occupied pass qps ) append ( " | " ) ; sb append ( concurrency ) append ( " | " ) ; sb append ( classification ) ; return sb to string ( ) ; }


public boolean get bool item ( ) { return bool item ; }


get the offset of this data item from the start of some hierarchy of structures

public int get root offset ( ) { return parent get root offset ( ) + get parent offset ( ) ; }


domain purchase with user name and item name , with validation for user name

public receipt view model purchase ( string user name , string item name ) { db user user = db get instance ( ) find user by user name ( user name ) ; if ( user = = null ) { return new invalid user ( user name ) ; } db account account = db get instance ( ) find account by user ( user ) ; return purchase ( user , account , item name ) ; }


marks the current position in this input stream a subsequent call to the { @ code reset } method repositions this stream at the last marked position so that subsequent reads re - read the same bytes the bytes read or skipped following a { @ code mark } call will be buffered internally and any previously buffered bytes are discarded the { @ code readlimit } arguments tells this input stream to allow that many bytes to be read before the mark position can be invalidated the { @ code readlimit } argument value must be smaller than the { @ code buffer size } constructor argument value , as returned by { @ link # get max mark readlimit ( ) } the invalidation of the mark position when the read count exceeds the read limit is not currently enforced a mark position is invalidated when the read count exceeds the maximum read limit , as returned by { @ link # get max mark readlimit ( ) }

public void mark ( int readlimit ) { / / readlimit is otherwise ignored but this defensively fails if the caller is expecting to be able to mark / reset more than this / / instance can accommodate in the fixed ring buffer if ( readlimit > ring buffer get buffer size ( ) ) { throw new illegal argument exception ( " readlimit value [ " + readlimit + " ] exceeds the maximum value of [ " + ring buffer get buffer size ( ) + " ] " ) ; } else if ( readlimit < 0 ) { throw new illegal argument exception ( " readlimit value [ " + readlimit + " ] cannot be negative " ) ; } if ( closed ) { return ; } / / signal that further read or skipped bytes must be stored to the buffer store to buffer = true ; if ( replay from buffer ) { / / the mark operation while replaying after a reset / / this only discards the previously buffered bytes before the current position / / as well as updates the mark position in the buffer ring buffer mark ( ) ; } else { / / any previously stored bytes are discarded because mark only has to retain bytes from this position on ring buffer clear ( ) ; } }


returns the stack of starlark calls active at the moment of the error

public immutable list < starlark thread call stack entry > get call stack ( ) { return stack ; }


allocate the next external block entry location based upon the specified size

private address get next external block entry address ( int entry size ) { if ( next external block entry address = = null ) { int alignment = elf get load adapter ( ) get linkage block alignment ( ) ; external block limits = allocate linkage block ( alignment , - 1 , " external block " ) ; next external block entry address = external block limits ! = null ? external block limits get min address ( ) : address no address ; } address addr = next external block entry address ; if ( addr ! = address no address ) { try { address last addr = next external block entry address add no wrap ( entry size - 1 ) ; if ( external block limits contains ( last addr ) ) { last external block entry address = last addr ; next external block entry address = last external block entry address add no wrap ( 1 ) ; if ( ! external block limits contains ( next external block entry address ) ) { next external block entry address = address no address ; } } else { / / unable to allocation entry size next external block entry address = address no address ; return address no address ; } } catch ( address overflow exception e ) { next external block entry address = address no address ; } } return addr ! = address no address ? addr : null ; }


tells whether a particular key needs to be looked up in the stash based on its name returns true if the string representation of the key starts with " $ " , false otherwise the stash contains fields eventually extracted from previous responses that can be reused as arguments for following requests ( e g scroll id )

public boolean contains stashed value ( object key ) { if ( key = = null | | false = = key instanceof char sequence ) { return false ; } string stash key = key to string ( ) ; if ( false = = strings has length ( stash key ) ) { return false ; } if ( stash key starts with ( " $ " ) ) { return true ; } return extended key matcher ( stash key ) find ( ) ; }


obtain user selected media path list in the starting activity or fragment

public static list < string > obtain path result ( intent data ) { return data get string array list extra ( matisse activity extra result selection path ) ; }


get { @ link cluster node } of the resource name

public static cluster node get cluster node ( string id ) { if ( id = = null ) { return null ; } cluster node cluster node = null ; for ( entry type node type : entry type values ( ) ) { cluster node = cluster node map get ( new string resource wrapper ( id , node type ) ) ; if ( cluster node ! = null ) { break ; } } return cluster node ; }


runs the provided sql and returns a cursor over the result set you may include ? in where clause in the query , which will be replaced by the second to the last parameters , such as : cursor cursor = lite pal find by s q l ( & quot ; select from person where name = ? and age = ? & quot ; , & quot ; tom & quot ; , & quot ; 14 & quot ; ) ;

public static cursor find by s q l ( string sql ) { synchronized ( lite pal support class ) { base utility check conditions correct ( sql ) ; if ( sql = = null ) { return null ; } if ( sql length < = 0 ) { return null ; } string [ ] selection args ; if ( sql length = = 1 ) { selection args = null ; } else { selection args = new string [ sql length - 1 ] ; system arraycopy ( sql , 1 , selection args , 0 , sql length - 1 ) ; } return connector get database ( ) raw query ( sql [ 0 ] , selection args ) ; } }


put fakebody - with - file - schema for this test , the body for this request much reference a schema named & # x 6 0 ; file & # x 6 0 ;

default response entity < void > test body with file schema ( file schema test class body ) { return new response entity < > ( http status not implemented ) ; }


partitions a data set on the key returned by the selector , using a custom partitioner this method takes the key selector to get the key to partition on , and a partitioner that accepts the key type note : this method works only on single field keys , i e the selector cannot return tuples of fields

public < k extends comparable < k > > partition operator < t > partition custom ( partitioner < k > partitioner , key selector < t , k > key extractor ) { final type information < k > key type = type extractor get key selector types ( key extractor , get type ( ) ) ; return new partition operator < > ( this , new keys selector function keys < > ( key extractor , get type ( ) , key type ) , clean ( partitioner ) , utils get call location name ( ) ) ; }


gets the id of the stream last successfully created by this endpoint


public void namespace string test ( ) { / / todo : test namespace string }


returns the current size of the key table

public int get capacity ( ) { return capacity ; }


public long get data length ( ) { return data length ; }


all of the named writeables needed to deserialize the instances of { @ linkplain bucket extractor } s

public static list < named writeable registry entry > get named writeables ( ) { list < named writeable registry entry > entries = new array list < > ( bucket extractors get named writeables ( ) ) ; entries add ( new entry ( bucket extractor class , composite key extractor name , composite key extractor : : new ) ) ; entries add ( new entry ( bucket extractor class , metric agg extractor name , metric agg extractor : : new ) ) ; entries add ( new entry ( bucket extractor class , top hits agg extractor name , top hits agg extractor : : new ) ) ; entries add ( new entry ( bucket extractor class , pivot extractor name , pivot extractor : : new ) ) ; return entries ; }


public boolean is empty ( ) { return size = = 0 ; }


adds all of the given entries to the built bimap duplicate keys or values are not allowed , and will cause { @ link # build } to fail

public builder < k , v > put all ( iterable < ? extends entry < ? extends k , ? extends v > > entries ) { super put all ( entries ) ; return this ; }


returns a string containing the string representation of each of { @ code parts } , using the previously configured separator between each

public final string join ( object [ ] parts ) { return join ( arrays as list ( parts ) ) ; }


public static shard routing new unassigned ( shard id shard id , boolean primary , recovery source recovery source , unassigned info unassigned info ) { return new shard routing ( shard id , null , null , primary , shard routing state unassigned , recovery source , unassigned info , null , unavailable expected shard size ) ; }


get the adapter for the given reactive type

public reactive adapter get adapter ( class < ? > reactive type ) { return get adapter ( reactive type , null ) ; }


gets the output dir ( where we write generated files ) defaults to the current directory

public string get output dir ( ) { return output dir ; }


choose and kill a container in case of oom we try to find the most recently launched opportunistic container that exceeds its limit and fall back to the most recently launched opportunistic container if there is no such container found , we choose to kill a guaranteed container in the same way

protected boolean kill container ( ) { boolean container killed = false ; array list < container candidate > candidates = new array list < > ( 0 ) ; for ( container container : context get containers ( ) values ( ) ) { if ( ! container is running ( ) ) { / / skip containers that are not running yet because killing them / / won ' t release any memory to get us out of oom continue ; / / note even if it is indicated that the container is running from / / container is running ( ) , the container process might not have been / / running yet from nm ' s perspective , a container is running as / / soon as the container launch is handed over the container executor } candidates add ( new container candidate ( container , is container out of limit ( container ) ) ) ; } collections sort ( candidates ) ; if ( candidates is empty ( ) ) { log warn ( " found no running containers to kill in order to release memory " ) ; } / / make sure one container is killed successfully to release memory for ( int i = 0 ; ! container killed & & i < candidates size ( ) ; i + + ) { container candidate candidate = candidates get ( i ) ; if ( sig kill ( candidate container ) ) { string message = string format ( " container % s killed by elastic cgroups oom handler " , candidate container get container id ( ) ) ; log warn ( message ) ; container killed = true ; } } return container killed ; }


tests all fs edit log ops that are converted to inotify events

public void test basic ( ) throws i o exception , u r i syntax exception , interrupted exception , missing events exception { configuration conf = new hdfs configuration ( ) ; conf set long ( d f s config keys dfs block size key , block size ) ; conf set boolean ( d f s config keys dfs namenode acls enabled key , true ) ; / / so that we can get an atime change conf set long ( d f s config keys dfs namenode accesstime precision key , 1 ) ; mini q j m h a cluster builder builder = new mini q j m h a cluster builder ( conf ) ; builder get dfs builder ( ) num data nodes ( 2 ) ; mini q j m h a cluster cluster = builder build ( ) ; try { cluster get dfs cluster ( ) wait active ( ) ; cluster get dfs cluster ( ) transition to active ( 0 ) ; d f s client client = new d f s client ( cluster get dfs cluster ( ) get name node ( 0 ) get name node address ( ) , conf ) ; file system fs = cluster get dfs cluster ( ) get file system ( 0 ) ; d f s test util create file ( fs , new path ( " / file " ) , block size , ( short ) 1 , 0l ) ; d f s test util create file ( fs , new path ( " / file 3 " ) , block size , ( short ) 1 , 0l ) ; d f s test util create file ( fs , new path ( " / file 5 " ) , block size , ( short ) 1 , 0l ) ; d f s test util create file ( fs , new path ( " / truncate file " ) , block size * 2 , ( short ) 1 , 0l ) ; d f s inotify event input stream eis = client get inotify event stream ( ) ; client rename ( " / file " , " / file 4 " , null ) ; / / rename op - > rename event client rename ( " / file 4 " , " / file 2 " ) ; / / rename old op - > rename event / / delete op , add op - > unlink event , create event output stream os = client create ( " / file 2 " , true , ( short ) 2 , block size ) ; os write ( new byte [ block size ] ) ; os close ( ) ; / / close op - > close event / / add op - > append event os = client append ( " / file 2 " , block size , enum set of ( create flag append ) , null , null ) ; os write ( new byte [ block size ] ) ; os close ( ) ; / / close op - > close event thread sleep ( 10 ) ; / / so that the atime will get updated on the next line client open ( " / file 2 " ) read ( new byte [ 1 ] ) ; / / times op - > metadata update event / / set replication op - > metadata update event client set replication ( " / file 2 " , ( short ) 1 ) ; / / concat delete op - > append event , unlink event , close event client concat ( " / file 2 " , new string [ ] { " / file 3 " } ) ; client delete ( " / file 2 " , false ) ; / / delete op - > unlink event client mkdirs ( " / dir " , null , false ) ; / / mkdir op - > create event / / set permissions op - > metadata update event client set permission ( " / dir " , fs permission value of ( " - rw - rw - rw - " ) ) ; / / set owner op - > metadata update event client set owner ( " / dir " , " username " , " groupname " ) ; client create symlink ( " / dir " , " / dir 2 " , false ) ; / / symlink op - > create event client set x attr ( " / file 5 " , " user field " , " value " get bytes ( ) , enum set of ( x attr set flag create ) ) ; / / set x attr op - > metadata update event / / remove x attr op - > metadata update event client remove x attr ( " / file 5 " , " user field " ) ; / / set acl op - > metadata update event client set acl ( " / file 5 " , acl entry parse acl spec ( " user : : rwx , user : foo : rw - , group : : r - - , other : : - - - " , true ) ) ; client remove acl ( " / file 5 " ) ; / / set acl op - > metadata update event client rename ( " / file 5 " , " / dir " ) ; / / rename old op - > rename event / / truncate op - > truncate event client truncate ( " / truncate file " , block size ) ; client create ( " / file ec test 1 " , false ) ; event batch batch = null ; / / rename op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; long txid = batch get txid ( ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type rename ) ; event rename event re = ( event rename event ) batch get events ( ) [ 0 ] ; assert assert equals ( " / file 4 " , re get dst path ( ) ) ; assert assert equals ( " / file " , re get src path ( ) ) ; assert assert true ( re get timestamp ( ) > 0 ) ; log info ( re to string ( ) ) ; assert assert true ( re to string ( ) starts with ( " rename event [ src path = " ) ) ; long events behind = eis get txids behind estimate ( ) ; / / rename old op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type rename ) ; event rename event re 2 = ( event rename event ) batch get events ( ) [ 0 ] ; assert assert true ( re 2 get dst path ( ) equals ( " / file 2 " ) ) ; assert assert true ( re 2 get src path ( ) equals ( " / file 4 " ) ) ; assert assert true ( re 2 get timestamp ( ) > 0 ) ; log info ( re 2 to string ( ) ) ; / / add op with overwrite batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type create ) ; event create event ce = ( event create event ) batch get events ( ) [ 0 ] ; assert assert true ( ce geti node type ( ) = = event create event i node type file ) ; assert assert true ( ce get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( ce get ctime ( ) > 0 ) ; assert assert true ( ce get replication ( ) > 0 ) ; assert assert true ( ce get symlink target ( ) = = null ) ; assert assert true ( ce get overwrite ( ) ) ; assert assert equals ( block size , ce get default block size ( ) ) ; assert assert true ( ce is erasure coded ( ) is present ( ) ) ; assert assert false ( ce is erasure coded ( ) get ( ) ) ; log info ( ce to string ( ) ) ; assert assert true ( ce to string ( ) starts with ( " create event [ i node type = " ) ) ; / / close op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type close ) ; event close event ce 2 = ( event close event ) batch get events ( ) [ 0 ] ; assert assert true ( ce 2 get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( ce 2 get file size ( ) > 0 ) ; assert assert true ( ce 2 get timestamp ( ) > 0 ) ; log info ( ce 2 to string ( ) ) ; assert assert true ( ce 2 to string ( ) starts with ( " close event [ path = " ) ) ; / / append op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type append ) ; event append event append 2 = ( event append event ) batch get events ( ) [ 0 ] ; assert assert equals ( " / file 2 " , append 2 get path ( ) ) ; assert assert false ( append 2 to new block ( ) ) ; log info ( append 2 to string ( ) ) ; assert assert true ( append 2 to string ( ) starts with ( " append event [ path = " ) ) ; / / close op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type close ) ; assert assert true ( ( ( event close event ) batch get events ( ) [ 0 ] ) get path ( ) equals ( " / file 2 " ) ) ; / / times op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( mue get metadata type ( ) = = event metadata update event metadata type times ) ; log info ( mue to string ( ) ) ; assert assert true ( mue to string ( ) starts with ( " metadata update event [ path = " ) ) ; / / set replication op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 2 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 2 get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( mue 2 get metadata type ( ) = = event metadata update event metadata type replication ) ; assert assert true ( mue 2 get replication ( ) = = 1 ) ; log info ( mue 2 to string ( ) ) ; / / concat delete op batch = wait for next events ( eis ) ; assert assert equals ( 3 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type append ) ; assert assert true ( ( ( event append event ) batch get events ( ) [ 0 ] ) get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( batch get events ( ) [ 1 ] get event type ( ) = = event event type unlink ) ; event unlink event ue 2 = ( event unlink event ) batch get events ( ) [ 1 ] ; assert assert true ( ue 2 get path ( ) equals ( " / file 3 " ) ) ; assert assert true ( ue 2 get timestamp ( ) > 0 ) ; log info ( ue 2 to string ( ) ) ; assert assert true ( ue 2 to string ( ) starts with ( " unlink event [ path = " ) ) ; assert assert true ( batch get events ( ) [ 2 ] get event type ( ) = = event event type close ) ; event close event ce 3 = ( event close event ) batch get events ( ) [ 2 ] ; assert assert true ( ce 3 get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( ce 3 get timestamp ( ) > 0 ) ; / / delete op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type unlink ) ; event unlink event ue = ( event unlink event ) batch get events ( ) [ 0 ] ; assert assert true ( ue get path ( ) equals ( " / file 2 " ) ) ; assert assert true ( ue get timestamp ( ) > 0 ) ; log info ( ue to string ( ) ) ; / / mkdir op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type create ) ; event create event ce 4 = ( event create event ) batch get events ( ) [ 0 ] ; assert assert true ( ce 4 geti node type ( ) = = event create event i node type directory ) ; assert assert true ( ce 4 get path ( ) equals ( " / dir " ) ) ; assert assert true ( ce 4 get ctime ( ) > 0 ) ; assert assert true ( ce 4 get replication ( ) = = 0 ) ; assert assert true ( ce 4 get symlink target ( ) = = null ) ; log info ( ce 4 to string ( ) ) ; / / set permissions op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 3 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 3 get path ( ) equals ( " / dir " ) ) ; assert assert true ( mue 3 get metadata type ( ) = = event metadata update event metadata type perms ) ; assert assert true ( mue 3 get perms ( ) to string ( ) contains ( " rw - rw - rw - " ) ) ; log info ( mue 3 to string ( ) ) ; / / set owner op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 4 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 4 get path ( ) equals ( " / dir " ) ) ; assert assert true ( mue 4 get metadata type ( ) = = event metadata update event metadata type owner ) ; assert assert true ( mue 4 get owner name ( ) equals ( " username " ) ) ; assert assert true ( mue 4 get group name ( ) equals ( " groupname " ) ) ; log info ( mue 4 to string ( ) ) ; / / symlink op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type create ) ; event create event ce 5 = ( event create event ) batch get events ( ) [ 0 ] ; assert assert true ( ce 5 geti node type ( ) = = event create event i node type symlink ) ; assert assert true ( ce 5 get path ( ) equals ( " / dir 2 " ) ) ; assert assert true ( ce 5 get ctime ( ) > 0 ) ; assert assert true ( ce 5 get replication ( ) = = 0 ) ; assert assert true ( ce 5 get symlink target ( ) equals ( " / dir " ) ) ; log info ( ce 5 to string ( ) ) ; / / set x attr op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 5 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 5 get path ( ) equals ( " / file 5 " ) ) ; assert assert true ( mue 5 get metadata type ( ) = = event metadata update event metadata type xattrs ) ; assert assert true ( mue 5 getx attrs ( ) size ( ) = = 1 ) ; assert assert true ( mue 5 getx attrs ( ) get ( 0 ) get name ( ) contains ( " field " ) ) ; assert assert true ( ! mue 5 isx attrs removed ( ) ) ; log info ( mue 5 to string ( ) ) ; / / remove x attr op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 6 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 6 get path ( ) equals ( " / file 5 " ) ) ; assert assert true ( mue 6 get metadata type ( ) = = event metadata update event metadata type xattrs ) ; assert assert true ( mue 6 getx attrs ( ) size ( ) = = 1 ) ; assert assert true ( mue 6 getx attrs ( ) get ( 0 ) get name ( ) contains ( " field " ) ) ; assert assert true ( mue 6 isx attrs removed ( ) ) ; log info ( mue 6 to string ( ) ) ; / / set acl op ( 1 ) batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 7 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 7 get path ( ) equals ( " / file 5 " ) ) ; assert assert true ( mue 7 get metadata type ( ) = = event metadata update event metadata type acls ) ; assert assert true ( mue 7 get acls ( ) contains ( acl entry parse acl entry ( " user : : rwx " , true ) ) ) ; log info ( mue 7 to string ( ) ) ; / / set acl op ( 2 ) batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type metadata ) ; event metadata update event mue 8 = ( event metadata update event ) batch get events ( ) [ 0 ] ; assert assert true ( mue 8 get path ( ) equals ( " / file 5 " ) ) ; assert assert true ( mue 8 get metadata type ( ) = = event metadata update event metadata type acls ) ; assert assert true ( mue 8 get acls ( ) = = null ) ; log info ( mue 8 to string ( ) ) ; / / rename op ( 2 ) batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type rename ) ; event rename event re 3 = ( event rename event ) batch get events ( ) [ 0 ] ; assert assert true ( re 3 get dst path ( ) equals ( " / dir / file 5 " ) ) ; assert assert true ( re 3 get src path ( ) equals ( " / file 5 " ) ) ; assert assert true ( re 3 get timestamp ( ) > 0 ) ; log info ( re 3 to string ( ) ) ; / / truncate op batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type truncate ) ; event truncate event et = ( ( event truncate event ) batch get events ( ) [ 0 ] ) ; assert assert true ( et get path ( ) equals ( " / truncate file " ) ) ; assert assert true ( et get file size ( ) = = block size ) ; assert assert true ( et get timestamp ( ) > 0 ) ; log info ( et to string ( ) ) ; assert assert true ( et to string ( ) starts with ( " truncate event [ path = " ) ) ; / / create event without overwrite batch = wait for next events ( eis ) ; assert assert equals ( 1 , batch get events ( ) length ) ; txid = check txid ( batch , txid ) ; assert assert true ( batch get events ( ) [ 0 ] get event type ( ) = = event event type create ) ; ce = ( event create event ) batch get events ( ) [ 0 ] ; assert assert true ( ce geti node type ( ) = = event create event i node type file ) ; assert assert true ( ce get path ( ) equals ( " / file ec test 1 " ) ) ; assert assert true ( ce get ctime ( ) > 0 ) ; assert assert true ( ce get replication ( ) > 0 ) ; assert assert true ( ce get symlink target ( ) = = null ) ; assert assert false ( ce get overwrite ( ) ) ; assert assert equals ( block size , ce get default block size ( ) ) ; assert assert true ( ce is erasure coded ( ) is present ( ) ) ; assert assert false ( ce is erasure coded ( ) get ( ) ) ; log info ( ce to string ( ) ) ; assert assert true ( ce to string ( ) starts with ( " create event [ i node type = " ) ) ; / / returns null when there are no further events assert assert true ( eis poll ( ) = = null ) ; / / make sure the estimate hasn ' t changed since the above assertion / / tells us that we are fully caught up to the current namesystem state / / and we should not have been behind at all when events behind was set / / either , since there were few enough events that they should have all / / been read to the client during the first poll ( ) call assert assert true ( eis get txids behind estimate ( ) = = events behind ) ; } finally { cluster shutdown ( ) ; } }


set the deserialization schema used to deserialize incoming pub sub messages

public < out > project name builder < out > with deserialization schema ( pub sub deserialization schema < out > deserialization schema ) { return new pub sub source builder < > ( deserialization schema ) ; }


returns the jvm ' s current version as a { @ link string } see https : openjdk java netjeps 2 2 3 for the expected format until java 8 included , the expected format should be starting with { @ code 1 x } starting with java 9 , cf jep - 223 linked above , the version got simplified in 9 x , 10 x , etc

public static string get current runtime java version ( ) { / / todo : leverage runtime version ( ) once on java 9 + return system get property ( " java specification version " ) ; }


this is here to verify role and path setup

public void test cannot touch under r o dir ( ) throws throwable { forbidden ( " touching the empty child " + read only child , " " , ( ) - > { touch ( role f s , read only child ) ; return read only child ; } ) ; }


stores a short value in the table at the given row and column note - all values in a given column must be of the same type

public void put short ( int row , int col , short value ) { max row = math max ( max row , row ) ; occupied put ( row , true ) ; super put short ( row , col , value ) ; }


public void test json form data test ( ) { string param = null ; string param 2 = null ; / / api test json form data ( param , param 2 ) ; / / todo : test validations }


call this to set the phase of the listing merge that you are in currently

void set conflict type ( string conflict type ) { this conflict type = conflict type ; titled border t border = ( titled border ) get border ( ) ; t border set title ( " resolve " + conflict type + " conflict " ) ; }


add cookies to the request that is being built

protected void add cookies to request ( multi value map < string , string > cookies , web client request body spec request builder ) { for ( entry < string , list < string > > entry : cookies entry set ( ) ) { list < string > values = entry get value ( ) ; for ( string value : values ) { if ( value ! = null ) { request builder cookie ( entry get key ( ) , value ) ; } } } }


public list < object > get params by index ( int index ) { return parameters get ( index ) ; }


projects a pair of joined elements to a { @ link tuple } with the previously selected fields requires the classes of the fields of the resulting tuples

public < t0 , t1 > project join < i1 , i2 , tuple 2 < t0 , t1 > > project tuple 2 ( ) { type information < ? > [ ] f types = extract field types ( field indexes ) ; tuple type info < tuple 2 < t0 , t1 > > t type = new tuple type info < tuple 2 < t0 , t1 > > ( f types ) ; return new project join < i1 , i2 , tuple 2 < t0 , t1 > > ( this ds 1 , this ds 2 , this keys 1 , this keys 2 , this hint , this field indexes , this is field in first , t type , this ) ; }


create a json representation of a resource bundle

private static j s o n object to j s o n object ( @ non null resource bundle bundle ) { j s o n object json = new j s o n object ( ) ; for ( string key : bundle key set ( ) ) { json put ( key , bundle get string ( key ) ) ; } return json ; }


return an { @ link advisor } wrapping the given advice should by default at least support { @ link org aopalliance intercept method interceptor } , { @ link org springframework aop method before advice } , { @ link org springframework aop after returning advice } , { @ link org springframework aop throws advice }

advisor wrap ( object advice ) throws unknown advice type exception ;


set a custom inclusion strategy for serialization

public jackson 2 object mapper builder serialization inclusion ( json include include inclusion ) { return serialization inclusion ( json include value construct ( inclusion , inclusion ) ) ; }


performs scalar replacement on all eligible arrays

private void scalar replacement ( ) { / / iterate through lattice , looking for non - escaping replaceable arrays for ( escape set esc set : lattice values ) { if ( ! esc set replaceable array | | esc set escape ! = escape state none ) { continue ; } / / get the instructions for the definition and move of the array int e = esc set reg set next set bit ( 0 ) ; ssa insn def = ssa meth get definition for register ( e ) ; ssa insn prev = get insn for move ( def ) ; / / create a map for the new registers that will be created type bearer length reg = prev get sources ( ) get ( 0 ) get type bearer ( ) ; int length = ( ( cst literal bits ) length reg ) get int bits ( ) ; array list < register spec > new regs = new array list < register spec > ( length ) ; hash set < ssa insn > deleted insns = new hash set < ssa insn > ( ) ; / / replace the definition of the array with registers replace def ( def , prev , length , new regs ) ; / / mark definition instructions for deletion deleted insns add ( prev ) ; deleted insns add ( def ) ; / / go through all uses of the array list < ssa insn > use list = ssa meth get use list for register ( e ) ; for ( ssa insn use : use list ) { / / replace the use with scalars and then mark it for deletion replace use ( use , prev , new regs , deleted insns ) ; deleted insns add ( use ) ; } / / delete all marked instructions ssa meth delete insns ( deleted insns ) ; ssa meth on insns changed ( ) ; / / convert the method back to ssa form ssa converter update ssa method ( ssa meth , reg count ) ; / / propagate and remove extra moves added by scalar replacement move propagate ( ) ; } }


executes some arbitrary code iff the on - going request has not been cancelled , otherwise throws { @ link cancellation exception } this is needed to guarantee that cancelling a request works correctly even in case { @ link # cancel ( ) } is called between different attempts of the same request the low - level client reuses the same instance of the { @ link abstract execution aware request } by calling { @ link abstract execution aware request # reset ( ) } between subsequent retries the { @ link # cancel ( ) } method can be called at anytime , and we need to handle the case where it gets called while there is no request being executed as one attempt may have failed and the subsequent attempt has not been started yet if the request has already been cancelled we don ' t go ahead with the next attempt , and artificially raise the { @ link cancellation exception } , otherwise we run the provided { @ link runnable } which will reset the request and send the next attempt note that this method must be synchronized as well as the { @ link # cancel ( ) } method , to prevent a request from being cancelled when there is no future to cancel , which would make cancelling the request a no - op

synchronized void run if not cancelled ( runnable runnable ) { if ( this http request is aborted ( ) ) { throw new cancellation exception ( ) ; } runnable run ( ) ; }


peeks at the next integer without incrementing the current index

public int peek next int ( ) throws i o exception { return read int ( current index ) ; }


the timeout value is extended over the default so that large updates are allowed to take time , especially to remote stores

protected int get test timeout millis ( ) { return 15 * 60 * 1000 ; }


stores a boolean value in the table at the given row and column note - all values in a given column must be of the same type

public void put boolean ( int row , int col , boolean value ) { if ( col > = data columns length ) { grow table ( col + 1 ) ; } boolean array ba = null ; if ( data columns [ col ] = = null ) { ba = new boolean array ( ) ; data columns [ col ] = ba ; } else { ba = ( boolean array ) data columns [ col ] ; } ba put ( row , value ) ; }


to test special tags to test special tags and operation id starting with number

public void call 1 2 3test special tags ( client body , handler < async result < client > > result handler ) { call 1 2 3test special tags ( body , null , result handler ) ; }


helper method to describe lists of sets of things

private static < t > void describe ( string builder result , immutable list < immutable set < t > > list of sets , function < t , string > describe one ) { joiner joiner = joiner on ( " , " ) ; for ( immutable set < t > ids : list of sets ) { if ( result length ( ) > 0 ) { result append ( " or " ) ; } result append ( ( ids size ( ) > 1 ) ? " [ " : " " ) ; joiner append to ( result , ids stream ( ) map ( describe one ) iterator ( ) ) ; result append ( ( ids size ( ) > 1 ) ? " ] " : " " ) ; } }


public void logout user test ( ) throws api exception { api logout user ( ) ; / / todo : test validations }


checks if the current security principal has one of the supplied permissions this is just a convenience function

public final void check any permission ( @ non null permission permissions ) { if ( permissions length = = 0 ) { throw new illegal argument exception ( " at least one permission must be provided " ) ; } boolean failed = ! has any permission ( permissions ) ; authentication authentication = jenkins get authentication 2 ( ) ; if ( failed ) { / / we know that none of the permissions are granted set < permission > enabled permissions = new linked hash set < > ( ) ; for ( permission p : permissions ) { while ( ! p enabled & & p implied by ! = null ) { p = p implied by ; } enabled permissions add ( p ) ; } string permissions display name = enabled permissions stream ( ) map ( p - > p group title + " / " + p name ) collect ( collectors joining ( " , " ) ) ; string error message ; if ( enabled permissions size ( ) = = 1 ) { error message = messages access denied exception 2 missing permission ( authentication get name ( ) , permissions display name ) ; } else { error message = messages access denied exception missing permissions ( authentication get name ( ) , permissions display name ) ; } throw new access denied exception ( error message ) ; } }


find the fields constant that matches name , or null if its not found

public static fields find by name ( string name ) { return by name get ( name ) ; }


try to add the component to the map of critical path components if there is an existing component for its primary output it uses that to update the rest of the outputs

private critical path component try add component ( critical path component new component ) throws interrupted exception { action new action = new component get action ( ) ; artifact primary output = new action get primary output ( ) ; critical path component stored component = output artifact to component put if absent ( primary output , new component ) ; if ( stored component ! = null ) { action old action = stored component get action ( ) ; / / todo ( b / 120663721 ) replace this fragile reference equality check with something principled if ( old action ! = new action & & ! actions can be shared ( action key context , new action , old action ) ) { throw new illegal state exception ( " duplicate output artifact found for unsharable actions " + " this can happen if a previous event registered the action \ n " + " old action : " + old action + " \ n \ n new action : " + new action + " \ n \ n artifact : " + primary output + " \ n " ) ; } } else { stored component = new component ; } / / try to insert the existing component for the rest of the outputs even if we failed to be / / the ones inserting the component so that at the end of this method we guarantee that all the / / outputs have a component for ( artifact output : new action get outputs ( ) ) { if ( output = = primary output ) { continue ; } critical path component old = output artifact to component put if absent ( output , stored component ) ; / / if two actions run concurrently maybe we find a component by primary output but we are / / the first updating the rest of the outputs preconditions check state ( old = = null | | old = = stored component , " inconsistent state for % s " , new action ) ; } return stored component ; }


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

public void display tasks ( final job i d job id , string type , string state ) throws i o exception { try { job job = get job using cluster ( job id ) ; super display tasks ( job , type , state ) ; } catch ( interrupted exception ie ) { throw new i o exception ( ie ) ; } }


build encrypter for saml object encrypter

protected encrypter build encrypter for saml object ( final object saml object , final saml registered service service , final saml registered service service provider metadata facade adaptor ) { val entity id = adaptor get entity id ( ) ; logger trace ( " calculating encryption security configuration for [ { } ] based on service [ { } ] " , entity id , service get name ( ) ) ; val encryption configuration = configure encryption security configuration ( service ) ; logger trace ( " fetching key encryption credential for [ { } ] based on service [ { } ] " , entity id , service get name ( ) ) ; configure key encryption credential ( entity id , adaptor , service , encryption configuration ) ; logger trace ( " fetching key encryption parameters for [ { } ] based on service [ { } ] " , entity id , service get name ( ) ) ; val key enc params = get key encryption parameters ( saml object , service , adaptor , encryption configuration ) ; if ( key enc params ! = null ) { logger trace ( " key encryption algorithm for [ { } ] is [ { } ] " , key enc params get recipient ( ) , key enc params get algorithm ( ) ) ; } logger trace ( " fetching data encryption parameters for [ { } ] based on service [ { } ] " , entity id , service get name ( ) ) ; val data enc params = get data encryption parameters ( saml object , service , adaptor , encryption configuration ) ; if ( data enc params ! = null ) { logger trace ( " data encryption algorithm for [ { } ] is [ { } ] " , entity id , data enc params get algorithm ( ) ) ; } logger trace ( " building encrypter component for [ { } ] " , entity id ) ; return get encrypter ( saml object , service , adaptor , key enc params , data enc params ) ; }


loads the long value from the variable with the given index

public long value lload ( int index ) { return load ( index ) long value ( ) ; }


create a new jdbc 3 0 savepoint for the current connection , using generated savepoint names that are unique for the connection

public savepoint create savepoint ( ) throws s q l exception { this savepoint counter + + ; return get connection ( ) set savepoint ( savepoint name prefix + this savepoint counter ) ; }


closes this stream and releases any system resources associated with it

public synchronized void close ( ) throws i o exception { closed = true ; close blob input stream ( ) ; stream buffer = null ; stream buffer position = 0 ; stream buffer length = 0 ; }


public boolean get bool item ( ) { return bool item ; }


public void print help ( ) { string header = " creates a plan that describes how much data should be " + " moved between disks \ n \ n " ; string footer = " \ n plan command creates a set of steps that represent a " + " planned data move a plan file can be executed on a data node , which " + " will balance the data " ; help formatter help formatter = new help formatter ( ) ; help formatter print help ( " hdfs diskbalancer - plan < hostname > [ options ] " , header , disk balancer c l i get plan options ( ) , footer ) ; }


installs this key event dispatcher into java ' s key event processing system calling this method more than once has no effect

static void install ( ) { if ( instance = = null ) { instance = new key binding override key event dispatcher ( ) ; keyboard focus manager kfm = keyboard focus manager get current keyboard focus manager ( ) ; kfm add key event dispatcher ( instance ) ; } }


override the base implementation to completely ignore watermarks propagated from upstream ( we rely only on the { @ link assigner with periodic watermarks } to emit watermarks from here )

public void process watermark ( watermark mark ) throws exception { / / if we receive a long max value watermark we forward it since it is used / / to signal the end of input and to not block watermark progress downstream if ( mark get timestamp ( ) = = long max value & & current watermark ! = long max value ) { current watermark = long max value ; output emit watermark ( mark ) ; } }


returns the rate of fatal errors , in errors per play time second , or { @ code 0 0 } if no time was spend playing this is equivalent to 1 0 { @ link # get mean time between fatal errors ( ) }

public float get fatal error rate ( ) { long play time ms = get total play time ms ( ) ; return play time ms = = 0 ? 0f : 1 0 0 0f * fatal error count / play time ms ; }


creates list of users with given input array ( asynchronously )

public okhttp 3 call create users with array input async ( list < user > body , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = create users with array input validate before call ( body , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


main event loop for polling , and processing records through topologies

void run loop ( ) { subscribe consumer ( ) ; / / if the thread is still in the middle of a rebalance , we should keep polling / / until the rebalance is completed before we close and commit the tasks while ( is running ( ) | | task manager is rebalance in progress ( ) ) { try { run once ( ) ; if ( next probing rebalance ms get ( ) < time milliseconds ( ) ) { log info ( " triggering the followup rebalance scheduled for { } ms " , next probing rebalance ms get ( ) ) ; main consumer enforce rebalance ( ) ; next probing rebalance ms set ( long max value ) ; } } catch ( final task corrupted exception e ) { log warn ( " detected the states of tasks " + e corrupted task with changelogs ( ) + " are corrupted " + " will close the task as dirty and re - create and bootstrap from scratch " , e ) ; try { task manager handle corruption ( e corrupted task with changelogs ( ) ) ; } catch ( final task migrated exception task migrated ) { handle task migrated ( task migrated ) ; } } catch ( final task migrated exception e ) { handle task migrated ( e ) ; } catch ( final unsupported version exception e ) { final string error message = e get message ( ) ; if ( error message ! = null & & error message starts with ( " broker unexpectedly doesn ' t support require stable flag on version " ) ) { log error ( " shutting down because the kafka cluster seems to be on a too old version " + " setting { } = \ " { } \ " requires broker version 2 5 or higher " , streams config processing guarantee config , exactly once beta ) ; } failed stream thread sensor record ( ) ; this streams uncaught exception handler accept ( e ) ; } catch ( final throwable e ) { failed stream thread sensor record ( ) ; this streams uncaught exception handler accept ( e ) ; } } }


public static string get e z trash root ( encryption zone ez , user group information ugi ) { string ezpath = ez get path ( ) ; return ( ezpath equals ( " / " ) ? ezpath : ezpath + path separator ) + file system trash prefix + path separator + ugi get short user name ( ) ; }


set credentials store , on which fs delegatin token will be cached

protected void set credentials ( credentials credentials ) { this credentials = credentials ; }


gets artifact version only for testing purposes

public string get artifact version ( ) { return this artifact version ; }


starts async lazy persist service for a new volume

synchronized void add volume ( fs volume impl volume ) { string storage id = volume get storage i d ( ) ; if ( executors = = null ) { throw new runtime exception ( " async lazy persist service is already shutdown " ) ; } thread pool executor executor = executors get ( storage id ) ; if ( executor ! = null ) { throw new runtime exception ( " volume " + volume + " is already existed " ) ; } add executor for volume ( storage id ) ; }


sets the state of the component in the component spec

private void set component state ( org apache hadoop yarn service api records component state state ) { org apache hadoop yarn service api records component state cur state = component spec get state ( ) ; if ( ! cur state equals ( state ) ) { component spec set state ( state ) ; log info ( " [ component { } ] spec state changed from { } - > { } " , component spec get name ( ) , cur state , state ) ; } }


convert an array of file status to an array of path if stats if null , return path

public static path [ ] stat 2 paths ( file status [ ] stats , path path ) { if ( stats = = null ) return new path [ ] { path } ; else return stat 2 paths ( stats ) ; }


computes the checksum with the given options

public void update checksum ( memory memory , address set view addr set , task monitor monitor , boolean ones comp , boolean twos comp ) throws memory access exception , cancelled exception { byte [ ] bytes = new byte [ 1024 ] ; long sum ; try ( checked input stream cis = new checked input stream ( new memory input stream ( memory , addr set ) , new adler 3 2 ( ) ) ) { while ( cis read ( bytes ) > 0 ) { if ( monitor is cancelled ( ) ) { throw new cancelled exception ( ) ; } } sum = cis get checksum ( ) get value ( ) ; } catch ( i o exception e ) { throw new memory access exception ( e get message ( ) ) ; } if ( ones comp ) { sum = ~ sum ; } else if ( twos comp ) { sum = - sum ; } checksum = to array ( sum , 4 ) ; }


the interpretedcompiled version of the ` value ` string < code > optional aapt pb item compiled item = 6 ; < code >


returns all nodes in this graph adjacent to { @ code node } which can be reached by traversing { @ code node } ' s incoming edges against the direction ( if any ) of the edge some algorithms that operate on a { @ code predecessors function } may produce undesired results if the returned { @ link iterable } contains duplicate elements implementations of such algorithms should document their behavior in the presence of duplicates the elements of the returned { @ code iterable } must each be : non - null usable as { @ code map } keys ( see the guava user guide ' s section on < a href = " https : github comgoogleguavawiki graphs explained # graph - elements - nodes - and - edges " > graph elements for details )

iterable < ? extends n > predecessors ( n node ) ;


build the default context for the language

protected void build context ( ) { default context = new assembly default context ( lang ) ; }


public input stream read ( ) throws i o exception , interrupted exception { return read ( null , false ) ; }


createinitialize the housekeeping service { @ link scheduled executor service } if the user specified an executor to be used in the { @ link hikari config } , then we use that if no executor was specified ( typical ) , then create an executor and configure it

private scheduled executor service initialize house keeping executor service ( ) { if ( config get scheduled executor ( ) = = null ) { final thread factory thread factory = optional of nullable ( config get thread factory ( ) ) or else get ( ( ) - > new default thread factory ( pool name + " housekeeper " , true ) ) ; final scheduled thread pool executor executor = new scheduled thread pool executor ( 1 , thread factory , new thread pool executor discard policy ( ) ) ; executor set execute existing delayed tasks after shutdown policy ( false ) ; executor set remove on cancel policy ( true ) ; return executor ; } else { return config get scheduled executor ( ) ; } }


gets the data type of the index into the string stream will be either { @ link d word data type } or { @ link word data type }

public data type get string index data type ( ) { return ( ( heap sizes & 0x 0 1 ) ! = 0 ) ? d word data type data type : word data type data type ; }


given a particular seed variable , find the set of local variables that are intended to be merged containing that seed the result will be an array with at least the seed variable in it

private static variable [ ] gather merge set ( function function , variable seed ) { tree map < string , variable > name map = new tree map < string , variable > ( ) ; for ( variable var : function get all variables ( ) ) { name map put ( var get name ( ) , var ) ; } string base name = seed get name ( ) ; int pos = base name last index of ( ' $ ' ) ; if ( pos > = 0 ) { base name = base name substring ( 0 , pos ) ; } data type data type = seed get data type ( ) ; variable current var = name map get ( base name ) ; int index = 0 ; boolean saw seed = false ; array list < variable > merge array = new array list < variable > ( ) ; for ( ; ; ) { if ( current var = = null ) { break ; } if ( ! current var get data type ( ) equals ( data type ) ) { break ; } if ( index ! = 0 & & current var instanceof parameter ) { break ; } if ( index ! = 0 & & current var has stack storage ( ) ) { break ; } if ( current var = = seed ) { saw seed = true ; } merge array add ( current var ) ; index + = 1 ; string new name = base name + ' $ ' + integer to string ( index ) ; current var = name map get ( new name ) ; } variable [ ] res ; if ( ! saw seed ) { res = new variable [ 1 ] ; res [ 0 ] = seed ; } else { res = new variable [ merge array size ( ) ] ; merge array to array ( res ) ; } return res ; }


public set < string > get final parameters ( ) { set < string > set final params = collections new set from map ( new concurrent hash map < string , boolean > ( ) ) ; set final params add all ( final parameters ) ; return set final params ; }


parse the gzip trailer ( assuming we ' re in the appropriate state ) in order to deal with degenerate cases ( e g , user buffer is one byte long ) , we copy trailer bytes ( all 8 of ' em ) to a local buffer see http : www ietf orgrfcrfc 1 9 5 2 txt for the gzip spec

private void execute trailer state ( ) throws i o exception { if ( user buf len < = 0 ) { return ; } / / verify that the crc - 32 of the decompressed stream matches the value / / stored in the gzip trailer if ( state = = gzip state label trailer crc ) { / / local buf was empty before we handed off to inflater , so we handle this / / exactly like header fields assert ( local buf off < 4 ) ; / / initially 0 , but may need multiple calls int n = math min ( user buf len , 4 - local buf off ) ; copy bytes to local ( n ) ; if ( local buf off > = 4 ) { long stream c r c = read u int l e ( local buf , 0 ) ; if ( stream c r c ! = crc get value ( ) ) { throw new i o exception ( " gzip stream crc failure " ) ; } local buf off = 0 ; crc reset ( ) ; state = gzip state label trailer size ; } } if ( user buf len < = 0 ) { return ; } / / verify that the mod - 2 ^ 32 decompressed stream size matches the value / / stored in the gzip trailer if ( state = = gzip state label trailer size ) { assert ( local buf off < 4 ) ; / / initially 0 , but may need multiple calls int n = math min ( user buf len , 4 - local buf off ) ; copy bytes to local ( n ) ; / / modifies user buf len , etc if ( local buf off > = 4 ) { / / should be strictly = = long input size = read u int l e ( local buf , 0 ) ; if ( input size ! = ( inflater get bytes written ( ) & 0xffffffff l ) ) { throw new i o exception ( " stored gzip size doesn ' t match decompressed size " ) ; } local buf off = 0 ; state = gzip state label finished ; } } if ( state = = gzip state label finished ) { return ; } }


verifies the logic of handling directory markers in delete operations , specifically : all markers above empty directories must be deleted all markers above non - empty directories must not be deleted as the delete list may include subdirectories , we need to work up from the bottom of the list of deleted files before probing the parents , that being done by a s 3guard get ( path , need - empty - directory ) call this is pretty sensitive code

public void test subdir delete failures ( ) throws throwable { describe ( " multiobject delete handling of director yes fory markers " ) ; assume ( " multiobject delete only " , multi delete ) ; }


convenience method to create a shallow copy of the internal node , set a new yoga node , update all components and component context , release all the unnecessary properties from the new internal node

private static default internal node get clean updated shallow copy ( final layout state context layout state context , final default internal node current , final component head , final @ nullable string head key , final yoga node node ) { final boolean is tracing = components systrace is tracing ( ) ; if ( is tracing ) { components systrace begin section ( " clone : " + head get simple name ( ) ) ; } / / 1 shallow copy this layout final default internal node layout = current clone ( ) ; if ( is tracing ) { components systrace end section ( ) ; components systrace begin section ( " clean : " + head get simple name ( ) ) ; } / / 2 reset and release properties layout clean ( ) ; if ( is tracing ) { components systrace end section ( ) ; components systrace begin section ( " update : " + head get simple name ( ) ) ; } / / 3 get updated components pair < list < component > , list < string > > updated = current get updated components ( layout state context , head , head key ) ; / / 4 update the layout with the updated context , components , and yoga node layout update with ( head get scoped context ( layout state context , head key ) , node , updated first , updated second , null ) ; if ( is tracing ) { components systrace end section ( ) ; } return layout ; }


public map < string , boolean > get indirect map ( ) { return indirect map ; }


test that actions registered in an aspect are reported as extra - actions on the attached rule aspect that registers action registers a null action , whose mnemonic is " null " we have an action listener that targets that mnemonic , which makes sure the aspect machinery will expose an extra action artifacts provider the rule a : a doesn ' t have an aspect , so the only action we get is the one on a : b ( which does have an aspect )

public void extra actions are emitted ( ) throws exception { set rules and aspects available in tests ( immutable list of ( test aspects simple aspect , extra actions are emitted aspect that registers action instance ) , immutable list of ( test aspects base rule , extra actions are emitted test rule ) ) ; use configuration ( " - - experimental action listener = / / extra actions : listener " ) ; scratch file ( " extra actions / build " , " extra action ( name = ' xa ' , cmd = ' echo dont - care ' ) " , " action listener ( name = ' listener ' , mnemonics = [ ' null ' ] , extra actions = [ ' : xa ' ] ) " ) ; pkg ( " a " , " testrule ( name = ' a ' , foo = [ ' : b ' ] ) " , " testrule ( name = ' b ' ) " ) ; update ( ) ; configured target a = get configured target ( " / / a : a " ) ; nested set < artifact derived artifact > extra action artifacts = a get provider ( extra action artifacts provider class ) get transitive extra action artifacts ( ) ; for ( artifact artifact : extra action artifacts to list ( ) ) { assert that ( artifact get owner label ( ) ) is equal to ( label create ( " @ / / a " , " b " ) ) ; } }


stops resource discovery no method in this class should be called after this point

void shutdown ( ) { if ( request observer ! = null ) { request observer on completed ( ) ; request observer = null ; channel shutdown now ( ) ; if ( event loop group ! = null ) { event loop group = shared resource holder release ( event loop group resource , event loop group ) ; } } }


set the next node of the given node at the given level

private void help set next node ( long node , long next node , int level ) { skip list utils help set next node ( node , next node , level , level index header , space allocator ) ; }


compute the index into the dynamic table given the index in the header entry

private int get index ( int index ) { return index = = not found ? not found : index - head before index + 1 ; }


serialize the given java object into string entity according the given content - type ( only json is supported for now )

public entity < ? > serialize ( object obj , map < string , object > form params , string content type , boolean is body nullable ) throws api exception { entity < ? > entity ; if ( content type starts with ( " multipart / form - data " ) ) { multi part multi part = new multi part ( ) ; for ( entry < string , object > param : form params entry set ( ) ) { if ( param get value ( ) instanceof file ) { file file = ( file ) param get value ( ) ; form data content disposition content disp = form data content disposition name ( param get key ( ) ) file name ( file get name ( ) ) size ( file length ( ) ) build ( ) ; multi part body part ( new form data body part ( content disp , file , media type application octet stream type ) ) ; } else { form data content disposition content disp = form data content disposition name ( param get key ( ) ) build ( ) ; multi part body part ( new form data body part ( content disp , parameter to string ( param get value ( ) ) ) ) ; } } entity = entity entity ( multi part , media type multipart form data type ) ; } else if ( content type starts with ( " application / x - www - form - urlencoded " ) ) { form form = new form ( ) ; for ( entry < string , object > param : form params entry set ( ) ) { form param ( param get key ( ) , parameter to string ( param get value ( ) ) ) ; } entity = entity entity ( form , media type application form urlencoded type ) ; } else { / / we let jersey handle the serialization if ( is body nullable ) { / / payload is nullable if ( obj instanceof string ) { entity = entity entity ( obj = = null ? " null " : " \ " " + ( ( string ) obj ) replace all ( " \ " " , matcher quote replacement ( " \ \ \ " " ) ) + " \ " " , content type ) ; } else { entity = entity entity ( obj = = null ? " null " : obj , content type ) ; } } else { if ( obj instanceof string ) { entity = entity entity ( obj = = null ? " " : " \ " " + ( ( string ) obj ) replace all ( " \ " " , matcher quote replacement ( " \ \ \ " " ) ) + " \ " " , content type ) ; } else { entity = entity entity ( obj = = null ? " " : obj , content type ) ; } } } return entity ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


whether the user should display the content revealed dot in voice notes

public static boolean viewed receipts ( ) { return get boolean ( viewed receipts , false ) ; }


stop the timer note : no effect if timer is already stopped

public void stop ( ) { if ( this started ) { this started = false ; this cumulate + = system nano time ( ) - this last ; } }


public void snake case test ( ) { / / todo : test snake case }


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

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


called when the offload buffer has been filled completely

default void on offload buffer full ( long buffer emptying deadline ms ) { }


set this to false to disable all gestures and touches on the chart , default : true

public void set touch enabled ( boolean enabled ) { this m touch enabled = enabled ; }


resolve current method generic return type to a { @ link generic metadata support }

public generic metadata support resolve generic return type ( method method ) { type generic return type = method get generic return type ( ) ; / / logger log ( " method ' " + method to generic string ( ) + " ' has return type : " + / / generic return type get class ( ) get interfaces ( ) [ 0 ] get simple name ( ) + " : " + / / generic return type ) ; int arity = 0 ; while ( generic return type instanceof generic array type ) { arity + + ; generic return type = ( ( generic array type ) generic return type ) get generic component type ( ) ; } generic metadata support generic metadata support = resolve generic type ( generic return type , method ) ; if ( arity = = 0 ) { return generic metadata support ; } else { return new generic array return type ( generic metadata support , arity ) ; } }


get the byte string for frequently used fixed and small set strings

public static byte string get fixed byte string ( string key ) { byte string value = fixed bytestring cache get ( key ) ; if ( value = = null ) { value = byte string copy from utf 8 ( key ) ; fixed bytestring cache put ( key , value ) ; } return value ; }


configure a limit on the number of bytes that can be buffered whenever the input stream needs to be aggregated this can be a result of decoding to a single { @ code data buffer } , { @ link java nio byte buffer byte buffer } , { @ code byte [ ] } , { @ link org springframework core io resource resource } , { @ code string } , etc it can also occur when splitting the input stream , e g delimited text , in which case the limit applies to data buffered between delimiters by default this is set to 256k

public void set max in memory size ( int byte count ) { this string decoder set max in memory size ( byte count ) ; }


set to true if global state should be stored as part of the snapshot

public create snapshot request include global state ( boolean include global state ) { this include global state = include global state ; return this ; }


public int get body count ( ) { return m body count ; }


post user : create user this can only be done by the logged in user

default response entity < void > create user ( @ api param ( value = " created user object " , required = true ) @ valid @ request body user body ) { return get delegate ( ) create user ( body ) ; }


checkpoint stats counts create snapshot ( ) { return new checkpoint stats counts ( num restored checkpoints , num total checkpoints , num in progress checkpoints , num completed checkpoints , num failed checkpoints ) ; }


expectation for the url to match a specific regular expression

public static expected condition < boolean > url matches ( final string regex ) { return new expected condition < boolean > ( ) { private final pattern pattern = pattern compile ( regex ) ; private string current url ; @ override public boolean apply ( web driver driver ) { current url = driver get current url ( ) ; return pattern matcher ( current url ) find ( ) ; } @ override public string to string ( ) { return string format ( " url to match the regex \ " % s \ " current url : \ " % s \ " " , regex , current url ) ; } } ; }


public void test array of number only ( ) { / / todo : test array of number only }


timeout to wait for any async actions this request must take it must take anywhere from 0 to 2

public time value get timeout ( ) { return timeout ; }


how many nanoseconds per iop , byte , etc

public long nanos per operation ( long operations ) { return duration ( ) / operations ; }


public void start parsing member ( byte array bytes , int offset , string name , string descriptor ) { / / this space intentionally left blank }


public float get scale x ( ) { return m scale x ; }


return an identifying description for this cache operation returned value is produced by calling { @ link builder # get operation description ( ) } during object construction this method is used in { @ link # hash code } and { @ link # equals }

public final string to string ( ) { return this to string ; }


issue : add at least one assertion to this test case solution : inserted assertion to check whether the execution of the main method in { @ link app } throws an exception

void should execute application without exception ( ) { assert does not throw ( ( ) - > app main ( new string [ ] { } ) ) ; }


provide your own network cache directory by default , animations will be saved in your application ' s cache dirlottie network cache

public builder set network cache dir ( @ non null final file file ) { if ( cache provider ! = null ) { throw new illegal state exception ( " there is already a cache provider ! " ) ; } cache provider = new lottie network cache provider ( ) { @ override @ non null public file get cache dir ( ) { if ( ! file is directory ( ) ) { throw new illegal argument exception ( " cache file must be a directory " ) ; } return file ; } } ; return this ; }


interrupt process , pipeline will be destroy when this method called

void on interrupt ( throwable exception ) ;


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


test that ensures that deserialization schema can emit multiple records via a collector

public void run collecting schema test ( ) throws exception { final int element count = 20 ; final string topic = write sequence ( " test collecting schema " , element count , 1 , 1 ) ; / / read using custom schema final stream execution environment env 1 = stream execution environment get execution environment ( ) ; env 1 set parallelism ( 1 ) ; env 1 get config ( ) set restart strategy ( restart strategies no restart ( ) ) ; properties props = new properties ( ) ; props put all ( standard props ) ; props put all ( secure props ) ; data stream < tuple 2 < integer , string > > from kafka = env 1 add source ( kafka server get consumer ( topic , new collecting deserialization schema ( element count ) , props ) assign timestamps and watermarks ( new ascending timestamp extractor < tuple 2 < integer , string > > ( ) { @ override public long extract ascending timestamp ( tuple 2 < integer , string > element ) { string string = element f 1 ; return long parse long ( string substring ( 0 , string length ( ) - 1 ) ) ; } } ) ) ; from kafka key by ( t - > t f 0 ) process ( new keyed process function < integer , tuple 2 < integer , string > , void > ( ) { private boolean registered = false ; @ override public void process element ( tuple 2 < integer , string > value , context ctx , collector < void > out ) throws exception { if ( ! registered ) { ctx timer service ( ) register event time timer ( element count - 2 ) ; registered = true ; } } @ override public void on timer ( long timestamp , on timer context ctx , collector < void > out ) throws exception { throw new success exception ( ) ; } } ) ; try execute ( env 1 , " consume " + element count + " elements from kafka " ) ; delete test topic ( topic ) ; }


public abstract ks get current key ( ) ;


disassembles code starting at start addr and restricted to addr set note : a single instance of this disassembler does not support concurrent invocations of the various disassemble methods disassembler must be instantiated with a program object

public address set disassemble ( address start addr , address set view restricted set ) { return disassemble ( start addr , restricted set , true ) ; }


public order get order ( ) { return order get order ( depth and order & 3 ) ; }


returns the class name of the entry in the stack that comes before all references to the given classes this is useful for figuring out at runtime who is calling a particular method this method can take multiple classes , but you really only need to pass the oldest class of disinterest

public static string get class name older than ( class < ? > classes ) { throwable t = create throwable with stack older than ( classes ) ; stack trace element [ ] stack trace = t get stack trace ( ) ; return stack trace [ 0 ] get class name ( ) ; }


public map < string , list < object > > get map array anytype ( ) { return map array anytype ; }


see { @ link socket # get reuse address ( ) } calling this method does not trigger mode detection

public boolean get reuse address ( ) throws socket exception { return get socket allow unknown mode ( ) get reuse address ( ) ; }


public void set unique id ( string unique id ) { this unique id = unique id ; }


test that program merge can determine that function local names are different

public void test apply function local name diff ( ) throws exception { / / 0x 1 0 0 5 9a 3 : renamed local 18 to num available in p 1 int transaction i d 1 = p 1 start transaction ( " test transaction " ) ; function function 1 = p 1 get function manager ( ) get function at ( addr ( p 1 , 0x 1 0 0 5 9a 3 ) ) ; variable [ ] local variables = function 1 get local variables ( ) ; assert equals ( 5 , local variables length ) ; assert equals ( - 0x 1 8 , local variables [ 4 ] get stack offset ( ) ) ; local variables [ 4 ] set name ( " num available " , source type user defined ) ; p 1 end transaction ( transaction i d 1 , true ) ; program merge = new program merge manager ( p 1 , p 2 , task monitor adapter dummy monitor ) ; address set diff as = new address set ( ) ; diff as add range ( addr ( 0x 1 0 0 5 9a 3 ) , addr ( 0x 1 0 0 5 9a 3 ) ) ; program merge set diff filter ( new program diff filter ( program diff filter function diffs ) ) ; program merge set merge filter ( new program merge filter ( program merge filter functions , program merge filter replace ) ) ; assert equals ( diff as , program merge get filtered differences ( ) ) ; program merge merge ( diff as , task monitor adapter dummy monitor ) ; assert equals ( new address set ( ) , program merge get filtered differences ( ) ) ; }


public static void build ( mesh part builder builder , float radius , int divisions , final vector 3 center , final vector 3 normal , final vector 3 tangent , final vector 3 binormal , float angle from , float angle to ) { build ( builder , radius , divisions , center x , center y , center z , normal x , normal y , normal z , tangent x , tangent y , tangent z , binormal x , binormal y , binormal z , angle from , angle to ) ; }


returns true if the given string is a java code snippet that references this class

public static boolean is icons reference ( string snippet ) { return snippet starts with ( icons class get simple name ( ) ) ; }


gets the { @ link result partition state }


public string type name ( ) { return " array " ; }


inner method for adding resource roots to a collection may fail and report to the { @ link rule error consumer } if the input is invalid

private static path fragment add resource dir ( artifact file , @ nullable artifact last file , @ nullable path fragment last resource dir , set < path fragment > resource roots , string resources attr , rule error consumer rule error consumer ) throws rule error exception { path fragment resource dir = find resource dir ( file ) ; if ( resource dir = = null ) { throw rule error consumer throw with attribute error ( resources attr , string format ( incorrect resource layout message , file get root relative path ( ) ) ) ; } if ( last resource dir ! = null & & ! resource dir equals ( last resource dir ) ) { throw rule error consumer throw with attribute error ( resources attr , string format ( " ' % s ' ( generated by ' % s ' ) is not in the same directory ' % s ' ( derived from % s ) " + " all resources must share a common directory " , file get root relative path ( ) , file get owner label ( ) , last resource dir , last file get root relative path ( ) ) ) ; } path fragment package fragment = file get owner label ( ) get package identifier ( ) get source root ( ) ; path fragment package relative path = file get root relative path ( ) relative to ( package fragment ) ; try { path fragment path = file get exec path ( ) ; resource roots add ( path sub fragment ( 0 , path segment count ( ) - segment count after ancestor ( resource dir , package relative path ) ) ) ; } catch ( illegal argument exception e ) { throw rule error consumer throw with attribute error ( resources attr , string format ( " ' % s ' ( generated by ' % s ' ) is not under the directory ' % s ' ( derived from % s ) " , file get root relative path ( ) , file get owner label ( ) , package relative path , file get root relative path ( ) ) ) ; } return resource dir ; }


refresh the hosts and exclude files ( rereads them ) see { @ link client protocol # refresh nodes ( ) } for more details

public void refresh nodes ( ) throws i o exception { check open ( ) ; try ( trace scope ignored = tracer new scope ( " refresh nodes " ) ) { namenode refresh nodes ( ) ; } }


removes header text for this panel and all tablerow information

public void clear ( ) { listener = null ; button group remove ( left list choice rb ) ; button group remove ( right list choice rb ) ; left list choice rb set selected ( false ) ; right list choice rb set selected ( false ) ; button group add ( left list choice rb ) ; button group add ( right list choice rb ) ; / / list < string [ ] > no data = new array list < string [ ] > ( ) ; / / left list choice set data ( new string [ 0 ] , no data ) ; / / right list choice set data ( new string [ 0 ] , no data ) ; / / set header ( null ) ; row panel validate ( ) ; validate ( ) ; invalidate ( ) ; }


creates a { @ link build info properties translator } to use for redacted version of the build informations

protected abstract build info properties translator create redacted translator ( ) ;


returns additional listeners to the console output stream called at the beginning of each command ( after # before command )

public out err get output listener ( ) { return null ; }


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

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


uninstall the app target a p is greater than 25 must hold must hold { @ code < uses - permission android : name = " android permission request delete packages " > }

public static void uninstall app ( final string package name ) { if ( utils bridge is space ( package name ) ) return ; utils get app ( ) start activity ( utils bridge get uninstall app intent ( package name ) ) ; }


execute the given sql script using default settings for statement separators , comment delimiters , and exception handling flags statement separators and comments will be removed before executing individual statements within the supplied script warning : this method does not release the provided { @ link connection }

public static mono < void > execute sql script ( connection connection , resource resource ) throws script exception { return execute sql script ( connection , new encoded resource ( resource ) ) ; }


returns the milli second part of the datetime

private static int get millis ( string date str ) { int length = date str length ( ) ; if ( length = = 19 ) { / / " 1999 - 12 - 31 12 : 34 : 56 " , no milli second left return 0 ; } else if ( length = = 21 ) { / / " 1999 - 12 - 31 12 : 34 : 56 7 " , return 7 return integer parse int ( date str substring ( 20 ) ) * 100 ; } else if ( length = = 22 ) { / / " 1999 - 12 - 31 12 : 34 : 56 78 " , return 78 return integer parse int ( date str substring ( 20 ) ) * 10 ; } else if ( length > = 23 & & length < = 26 ) { / / " 1999 - 12 - 31 12 : 34 : 56 123 " ~ " 1999 - 12 - 31 12 : 34 : 56 123456 " return integer parse int ( date str substring ( 20 , 23 ) ) ; } else { return 0 ; } }


serialize a { @ link i node symlink } node

private static void write i node symlink ( i node symlink node , data output out ) throws i o exception { write local name ( node , out ) ; out write long ( node get id ( ) ) ; out write short ( 0 ) ; / / replication out write long ( 0 ) ; / / modification time out write long ( 0 ) ; / / access time out write long ( 0 ) ; / / preferred block size out write int ( - 2 ) ; / / # of blocks text write string ( out , node get symlink string ( ) ) ; write permission status ( node , out ) ; }


applies { @ code mutations } to the { @ link content metadata } for the given resource a new { @ link cached content } is added if there isn ' t one already for the resource this method may be slow and shouldn ' t normally be called on the main thread

void apply content metadata mutations ( string key , content metadata mutations mutations ) throws cache exception ;


delegates to the underlying file type map

public string get content type ( file file ) { return get file type map ( ) get content type ( file ) ; }


determine the constructor to use for the given service locator exception class only called in case of a custom service locator exception the default implementation looks for a constructor with one of the following parameter types : { @ code ( string , throwable ) } or { @ code ( throwable ) } or { @ code ( string ) }

protected constructor < exception > determine service locator exception constructor ( class < ? extends exception > exception class ) { try { return ( constructor < exception > ) exception class get constructor ( string class , throwable class ) ; } catch ( no such method exception ex ) { try { return ( constructor < exception > ) exception class get constructor ( throwable class ) ; } catch ( no such method exception ex 2 ) { try { return ( constructor < exception > ) exception class get constructor ( string class ) ; } catch ( no such method exception ex 3 ) { throw new illegal argument exception ( " service locator exception [ " + exception class get name ( ) + " ] neither has a ( string , throwable ) constructor nor a ( string ) constructor " ) ; } } } }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case func args : return is set func args ( ) ; case request id : return is set request id ( ) ; } throw new illegal state exception ( ) ; }


the specification of this method matches that of { @ link file context # rename ( path , path , options rename ) } except that path f must be for this file system and no overwrite is performed file systems that do not have a built in overwrite need implement only this method and can take advantage of the default impl of the other { @ link # rename internal ( path , path , boolean ) }

public abstract void rename internal ( final path src , final path dst ) throws access control exception , file already exists exception , file not found exception , parent not directory exception , unresolved link exception , i o exception ;


returns the index of the last window in the playback order depending on whether shuffling is enabled

public int get last window index ( boolean shuffle mode enabled ) { return is empty ( ) ? c index unset : get window count ( ) - 1 ; }


adds a node to the policy and the data store if an existing node is found , then its value is updated if allowed

@ nullable v put ( k key , v value , expiry < k , v > expiry , boolean notify writer , boolean only if absent ) { require non null ( key ) ; require non null ( value ) ; node < k , v > node = null ; long now = expiration ticker ( ) read ( ) ; int new weight = weigher weigh ( key , value ) ; for ( ; ; ) { node < k , v > prior = data get ( node factory new lookup key ( key ) ) ; if ( prior = = null ) { if ( node = = null ) { node = node factory new node ( key , key reference queue ( ) , value , value reference queue ( ) , new weight , now ) ; set variable time ( node , expire after create ( key , value , expiry , now ) ) ; } if ( notify writer & & has writer ( ) ) { node < k , v > computed = node ; prior = data compute if absent ( node get key reference ( ) , k - > { writer write ( key , value ) ; return computed ; } ) ; if ( prior = = node ) { after write ( new add task ( node , new weight ) ) ; return null ; } } else { prior = data put if absent ( node get key reference ( ) , node ) ; if ( prior = = null ) { after write ( new add task ( node , new weight ) ) ; return null ; } } } else if ( only if absent ) { / / an optimistic fast path to avoid unnecessary locking v current value = prior get value ( ) ; if ( ( current value ! = null ) & & ! has expired ( prior , now ) ) { if ( ! is computing async ( prior ) ) { try expire after read ( prior , key , current value , expiry ( ) , now ) ; set access time ( prior , now ) ; } after read ( prior , now , / * record hit * / false ) ; return current value ; } } v old value ; long var time ; int old weight ; boolean expired = false ; boolean may update = true ; boolean exceeds tolerance = false ; synchronized ( prior ) { if ( ! prior is alive ( ) ) { continue ; } old value = prior get value ( ) ; old weight = prior get weight ( ) ; if ( old value = = null ) { var time = expire after create ( key , value , expiry , now ) ; writer delete ( key , null , removal cause collected ) ; } else if ( has expired ( prior , now ) ) { expired = true ; var time = expire after create ( key , value , expiry , now ) ; writer delete ( key , old value , removal cause expired ) ; } else if ( only if absent ) { may update = false ; var time = expire after read ( prior , key , value , expiry , now ) ; } else { var time = expire after update ( prior , key , value , expiry , now ) ; } if ( notify writer & & ( expired | | ( may update & & ( value ! = old value ) ) ) ) { writer write ( key , value ) ; } if ( may update ) { exceeds tolerance = ( expires after write ( ) & & ( now - prior get write time ( ) ) > expire write tolerance ) | | ( expires variable ( ) & & math abs ( var time - prior get variable time ( ) ) > expire write tolerance ) ; set write time ( prior , now ) ; prior set weight ( new weight ) ; prior set value ( value , value reference queue ( ) ) ; } set variable time ( prior , var time ) ; set access time ( prior , now ) ; } if ( has removal listener ( ) ) { if ( expired ) { notify removal ( key , old value , removal cause expired ) ; } else if ( old value = = null ) { notify removal ( key , / * old value * / null , removal cause collected ) ; } else if ( may update & & ( value ! = old value ) ) { notify removal ( key , old value , removal cause replaced ) ; } } int weighted difference = may update ? ( new weight - old weight ) : 0 ; if ( ( old value = = null ) | | ( weighted difference ! = 0 ) | | expired ) { after write ( new update task ( prior , weighted difference ) ) ; } else if ( ! only if absent & & exceeds tolerance ) { after write ( new update task ( prior , weighted difference ) ) ; } else { if ( may update ) { set write time ( prior , now ) ; } after read ( prior , now , / * record hit * / false ) ; } return expired ? null : old value ; } }


specify a factory method name that refers to an overloaded method

public void set non unique factory method name ( string name ) { assert has text ( name , " factory method name must not be empty " ) ; set factory method name ( name ) ; this is factory method unique = false ; }


adds each element of { @ code elements } to the { @ code immutable collection } being built note that each builder class overrides this method in order to covariantly return its own type

public builder < e > add all ( iterator < ? extends e > elements ) { while ( elements has next ( ) ) { add ( elements next ( ) ) ; } return this ; }


{ @ inherit doc } forwards to older method { @ link # handle authentication ( server cnxn , byte [ ] ) }

public keeper exception code handle authentication ( server objs server objs , byte [ ] auth data ) { return implementation handle authentication ( server objs get cnxn ( ) , auth data ) ; }


builds a hadoop - path from a swift path , inserting the uri authority of this fs instance

private path get correct swift path ( swift object path path ) throws swift exception { try { final uri full uri = new uri ( uri get scheme ( ) , uri get authority ( ) , path get object ( ) , null , null ) ; return new path ( full uri ) ; } catch ( u r i syntax exception e ) { throw new swift exception ( " specified path " + path + " is incorrect " , e ) ; } }


public void install ( intent intent result , class < ? extends abstract result service > service class , abstract patch upgrade patch ) { s installed = true ; share tinker log e ( tag , " [ - ] tinker is disabled since i ' m no - op version " ) ; }