indicates whether or not implementations of this class is writing to the raw keyed state streams on snapshots , using { @ link # snapshot state ( state snapshot context ) } if yes , subclasses should override this method to return { @ code true } subclasses need to explicitly indicate the use of raw keyed state because , internally , the { @ link abstract stream operator } may attempt to read from it as well to restore heap - based timers and ultimately fail with read errors by setting this flag to { @ code true } , this allows the { @ link abstract stream operator } to know that the data written in the raw keyed states were not written by the timer services , and skips the timer restore attempt please refer to flink - 19741 for further details todo : this method can be removed once all timers are moved to be managed by state backends

protected boolean is using custom raw keyed state ( ) { return false ; }


get all available log files under remote app log directory

public static list < file status > get remote node file list ( configuration conf , application id app id , string app owner , org apache hadoop fs path remote root log dir , string suffix ) throws i o exception { string builder diagnostics msg = new string builder ( ) ; list < file status > node files = new array list < > ( ) ; / / get node files from new app log dir try { path remote app log dir = get remote app log dir ( conf , app id , app owner , remote root log dir , suffix ) ; path qualified log dir = file context get file context ( conf ) make qualified ( remote app log dir ) ; node files add all ( arrays as list ( file context get file context ( qualified log dir to uri ( ) , conf ) util ( ) list status ( remote app log dir ) ) ) ; } catch ( i o exception ex ) { diagnostics msg append ( ex get message ( ) + " \ n " ) ; } / / get node files from old app log dir if ( is older path enabled ( conf ) ) { try { path remote app log dir = get older remote app log dir ( conf , app id , app owner , remote root log dir , suffix ) ; path qualified log dir = file context get file context ( conf ) make qualified ( remote app log dir ) ; node files add all ( arrays as list ( file context get file context ( qualified log dir to uri ( ) , conf ) util ( ) list status ( remote app log dir ) ) ) ; } catch ( i o exception ex ) { diagnostics msg append ( ex get message ( ) + " \ n " ) ; } } / / error reading from or new app log dir does not exist if ( node files is empty ( ) ) { throw new i o exception ( diagnostics msg to string ( ) ) ; } return node files ; }


returns the number of documents in the in this commit

public int get num docs ( ) { return num docs ; }


public term vectors request builder set id ( string id ) { request id ( id ) ; return this ; }


test the dfs datanode failed volumes tolerated key configuration option , ie the dn shuts itself down when the number of failures experienced drops below the tolerated amount

public void test configure min valid volumes ( ) throws exception { assume not windows ( ) ; / / bring up two additional datanodes that need both of their volumes / / functioning in order to stay up conf set int ( d f s config keys dfs datanode failed volumes tolerated key , 0 ) ; conf set time duration ( d f s config keys dfs datanode disk check min gap key , 0 , time unit milliseconds ) ; cluster start data nodes ( conf , 2 , true , null , null ) ; cluster wait active ( ) ; final datanode manager dm = cluster get namesystem ( ) get block manager ( ) get datanode manager ( ) ; long orig capacity = d f s test util get live datanode capacity ( dm ) ; long dn capacity = d f s test util get datanode capacity ( dm , 0 ) ; / / fail a volume on the 2nd dn file dn 2 vol 1 = cluster get instance storage dir ( 1 , 0 ) ; data node test utils inject data dir failure ( dn 2 vol 1 ) ; / / should only get two replicas ( the first dn and the 3rd ) path file 1 = new path ( " / test 1 " ) ; d f s test util create file ( fs , file 1 , 1024 , ( short ) 3 , 1l ) ; d f s test util wait replication ( fs , file 1 , ( short ) 2 ) ; / / check that this single failure caused a dn to die d f s test util wait for datanode status ( dm , 2 , 1 , 0 , orig capacity - ( 1 * dn capacity ) , wait for heartbeats ) ; / / if we restore the volume we should still only be able to get / / two replicas since the dn is still considered dead data node test utils restore data dir from failure ( dn 2 vol 1 ) ; path file 2 = new path ( " / test 2 " ) ; d f s test util create file ( fs , file 2 , 1024 , ( short ) 3 , 1l ) ; d f s test util wait replication ( fs , file 2 , ( short ) 2 ) ; }


returns the coverage data artifact , if available , and null otherwise

public path get coverage data ( ) { if ( data get has coverage ( ) ) { return test action get coverage data ( ) get path ( ) ; } return null ; }


close resources associated with the remote execution client


public void start ( ) { emitter start ( ) ; for ( influencer influencer : influencers ) influencer start ( ) ; }


called when a track of type { @ code track type } is not supported by the player

void on unsupported track ( int track type ) ;


get the current number of locked buffers

public synchronized int get lock count ( ) { return lock count ; }


public object node all dom names ( http servlet request request ) throws exception { boolean responsible only = boolean parse boolean ( web utils optional ( request , " responsible only " , " false " ) ) ; map < string , set < string > > dom map = service manager get all service names ( ) ; object node result = jackson utils create empty json node ( ) ; / / for old dns - f client : string dnsf version = " 1 0 1 " ; string agent = web utils get user agent ( request ) ; client info client info = new client info ( agent ) ; if ( client info type = = client info client type dns & & client info version compare to ( version util parse version ( dnsf version ) ) < = 0 ) { list < string > doms = new array list < string > ( ) ; set < string > dom set = null ; if ( dom map contains key ( constants default namespace id ) ) { dom set = dom map get ( constants default namespace id ) ; } if ( collection utils is empty ( dom set ) ) { result put ( " count " , 0 ) ; result set ( " doms " , jackson utils transfer to json node ( new hash set < > ( ) ) ) ; return result ; } for ( string dom : dom set ) { if ( distro mapper responsible ( dom ) | | ! responsible only ) { doms add ( naming utils get service name ( dom ) ) ; } } result put ( " count " , doms size ( ) ) ; result set ( " doms " , jackson utils transfer to json node ( doms ) ) ; return result ; } map < string , set < string > > doms = new hash map < > ( 16 ) ; int count = 0 ; for ( string namespace id : dom map key set ( ) ) { doms put ( namespace id , new hash set < > ( ) ) ; for ( string dom : dom map get ( namespace id ) ) { if ( distro mapper responsible ( dom ) | | ! responsible only ) { doms get ( namespace id ) add ( naming utils get service name ( dom ) ) ; } } count + = doms get ( namespace id ) size ( ) ; } result put ( " count " , count ) ; result set ( " doms " , jackson utils transfer to json node ( doms ) ) ; return result ; }


merges all secondary compiled resources with the primary compiled resources , given that the primary resources have been separately compiled

static void merge compiled data ( final serialized android data primary , final path primary manifest , final list < ? extends serialized android data > direct , final list < ? extends serialized android data > transitive , @ nullable final android resource class writer rclass writer , @ nullable placeholder r txt writer r txt writer , boolean throw on resource conflict , listening executor service executor service ) { final parsed android data builder primary builder = parsed android data builder new builder ( ) ; final android data deserializer deserializer = android compiled data deserializer create ( / * include file contents for validation = * / true ) ; primary deserialize ( dependency info dependency type primary , deserializer , primary builder consumers ( ) ) ; parsed android data primary data = primary builder build ( ) ; stopwatch timer = stopwatch create started ( ) ; try { unwritten merged android data merged = merge data ( executor service , transitive , direct , primary data , primary manifest , false , deserializer , throw on resource conflict , android data merger noop source checker create ( ) ) ; timer reset ( ) start ( ) ; merged write resource class ( rclass writer ) ; if ( r txt writer ! = null ) { merged write r txt ( r txt writer ) ; } logger fine ( string format ( " write classes finished in % sms " , timer elapsed ( time unit milliseconds ) ) ) ; timer reset ( ) start ( ) ; } catch ( i o exception e ) { throw merging exception wrap exception ( e ) ; } finally { logger fine ( string format ( " write merge finished in % sms " , timer elapsed ( time unit milliseconds ) ) ) ; } }


public void clear ( ) { if ( size = = 0 ) return ; this head = 0 ; this tail = 0 ; this size = 0 ; }


restricted constructors to ensure v 1 or v 2 , not both

public static s 3 list result v 2 ( list objects v 2 result result ) { return new s 3 list result ( null , result ) ; }


checks that running a given command returns the expected map asserts that all specified keys are present with values of the specified types and that there are no extra entries

public void test command ( string cmd name , map < string , string > kwargs , field fields ) throws i o exception , interrupted exception { zoo keeper server zks = server factory get zoo keeper server ( ) ; map < string , object > result = commands run command ( cmd name , zks , kwargs ) to map ( ) ; assert true ( result contains key ( " command " ) ) ; / / this is only true because we ' re setting cmd name to the primary name assert equals ( cmd name , result remove ( " command " ) ) ; assert true ( result contains key ( " error " ) ) ; assert null ( result remove ( " error " ) , " error : " + result get ( " error " ) ) ; for ( field field : fields ) { string k = field key ; assert true ( result contains key ( k ) , " result from command " + cmd name + " missing field \ " " + k + " \ " " + " \ n " + result ) ; class < ? > t = field type ; object v = result remove ( k ) ; assert true ( t is assignable from ( v get class ( ) ) , " \ " " + k + " \ " field from command " + cmd name + " should be of type " + t + " , is actually of type " + v get class ( ) ) ; } assert true ( result is empty ( ) , " result from command " + cmd name + " contains extra fields : " + result ) ; }


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


retrieve the set of data nodes that look significantly slower than their peers

public map < string , double > get outliers ( ) { / / this maps the metric name to the aggregate latency / / the metric name is the datanode id final map < string , double > stats = send packet downstream rolling averages get stats ( min outlier detection samples ) ; log trace ( " data node peer metrics : got stats : { } " , stats ) ; return slow node detector get outliers ( stats ) ; }


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

default response entity < void > test group parameters ( @ not null @ api param ( value = " required string in group parameters " , required = true ) @ valid @ request param ( value = " required string group " , required = true ) integer required string group , @ api param ( value = " required boolean in group parameters " , required = true ) @ request header ( value = " required boolean group " , required = true ) boolean required boolean group , @ not null @ api param ( value = " required integer in group parameters " , required = true ) @ valid @ request param ( value = " required int 6 4 group " , required = true ) long required int 6 4 group , @ api param ( value = " string in group parameters " ) @ valid @ request param ( value = " string group " , required = false ) integer string group , @ api param ( value = " boolean in group parameters " ) @ request header ( value = " boolean group " , required = false ) boolean boolean group , @ api param ( value = " integer in group parameters " ) @ valid @ request param ( value = " int 6 4 group " , required = false ) long int 6 4 group ) { return get delegate ( ) test group parameters ( required string group , required boolean group , required int 6 4 group , string group , boolean group , int 6 4 group ) ; }


test that node manager can exit listening this is done by running a long running listener for 10000 seconds then we wait for 2 seconds and stop listening we do not use a script this time to avoid leaking the child process

public void test normal exit ( ) throws exception { conf set ( yarn configuration nm elastic memory control oom listener path , " sleep " ) ; executor service service = executors new fixed thread pool ( 1 ) ; try { c groups handler cgroups = mock ( c groups handler class ) ; / / this will be passed to sleep as an argument when ( cgroups get path for c group ( any ( ) , any ( ) ) ) then return ( " 10000 " ) ; when ( cgroups get c group param ( any ( ) , any ( ) , any ( ) ) ) then return ( " under oom 0 " ) ; runnable handler = mock ( runnable class ) ; do nothing ( ) when ( handler ) run ( ) ; c group elastic memory controller controller = new c group elastic memory controller ( conf , null , cgroups , true , false , 10000 , handler ) ; long start = system current time millis ( ) ; service submit ( ( ) - > { try { thread sleep ( 2000 ) ; } catch ( interrupted exception ex ) { assert true ( " wait interrupted " , false ) ; } log info ( string format ( " calling process destroy in % d ms " , system current time millis ( ) - start ) ) ; controller stop listening ( ) ; log info ( " called process destroy " ) ; } ) ; controller run ( ) ; } finally { service shutdown ( ) ; } }


activate this instance after this call { @ link # is active ( ) } will return { @ code true }

protected final void activate ( input stream is , output stream os ) { if ( this is ! = null ) { throw new illegal state exception ( " input was set already " ) ; } if ( this os ! = null ) { throw new illegal state exception ( " output was set already " ) ; } this is = object util check not null ( is , " is " ) ; this os = object util check not null ( os , " os " ) ; }


sets the default target it is only valid to call this method when all the non - default elements have been set

public void set default target ( int target ) { throw if immutable ( ) ; if ( target < 0 ) { throw new illegal argument exception ( " target < 0 " ) ; } if ( targets size ( ) ! = size ) { throw new runtime exception ( " non - default elements not all set " ) ; } targets add ( target ) ; }


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


returns the physical address offset this is the address at which the section should be loaded into memory and reflects a addressable word offset for linked executables , this is the absolute address within the program space for unlinked objects , this address is relative to the object ' s address space ( i e the first section is always at offset zero )

public int get physical address ( ) { return s paddr ; }


public void test running stats ( ) throws exception { final matrix stats results results = new matrix stats results ( create running stats ( field a , field b ) ) ; actual stats assert nearly equal ( results ) ; }


this is safe because all toolchain context in a toolchain collection should have the same target platform

public platform info get target platform ( ) { return get default toolchain context ( ) target platform ( ) ; }


public static string get form ( string data , string url ) { return do http action ( data , false , false , url ) ; }


create a default view to be used for tabs this is called if a custom tab view is not set via { @ link # set custom tab view ( int , int ) }

protected text view create default tab view ( context context ) { text view text view = new text view ( context ) ; text view set gravity ( gravity center ) ; text view set text size ( typed value complex unit sp , tab view text size sp ) ; text view set typeface ( typeface default bold ) ; text view set layout params ( new linear layout layout params ( view group layout params wrap content , view group layout params wrap content ) ) ; typed value out value = new typed value ( ) ; get context ( ) get theme ( ) resolve attribute ( android r attr selectable item background , out value , true ) ; text view set background resource ( out value resource id ) ; text view set all caps ( true ) ; int padding = ( int ) ( tab view padding dips * get resources ( ) get display metrics ( ) density ) ; text view set padding ( padding , padding , padding , padding ) ; return text view ; }


< code > required uint 3 2 year = 1 ; < code >


iterates over all units that are enemies of this team

public static void nearby enemies ( team team , float x , float y , float width , float height , cons < unit > cons ) { seq < team data > data = state teams present ; for ( int i = 0 ; i < data size ; i + + ) { if ( data items [ i ] team ! = team ) { nearby ( data items [ i ] team , x , y , width , height , cons ) ; } } }


convert the where clause if it contains invalid column names which conflict with s q lite keywords

public static string convert where clause to column name ( string where clause ) { if ( ! text utils is empty ( where clause ) ) { try { string buffer converted where clause = new string buffer ( ) ; pattern p = pattern compile ( " ( \ \ w + " + reg operator + " | \ \ w + " + reg fuzzy + " | \ \ w + " + reg collection + " ) " ) ; matcher m = p matcher ( where clause ) ; while ( m find ( ) ) { string matches = m group ( ) ; string column = matches replace all ( " ( " + reg operator + " | " + reg fuzzy + " | " + reg collection + " ) " , " " ) ; string rest = matches replace ( column , " " ) ; column = convert to valid column name ( column ) ; m append replacement ( converted where clause , column + rest ) ; } m append tail ( converted where clause ) ; return converted where clause to string ( ) ; } catch ( exception e ) { e print stack trace ( ) ; } } return where clause ; }


verify configuration for resource manager ha

public static void verify and set configuration ( configuration conf ) throws yarn runtime exception { verify and set r m h a ids list ( conf ) ; verify and set current r m h a id ( conf ) ; verify leader election ( conf ) ; verify and set all service addresses ( conf ) ; }


public static set < string > get string set ( @ non null final string key ) { return get string set ( key , get default s p utils ( ) ) ; }


handles non - phi uses of new objects checks to see how instruction is used and updates the escape state accordingly

private void process use ( register spec def , ssa insn use , escape set esc set , array list < register spec > reg worklist ) { int use opcode = use get opcode ( ) get opcode ( ) ; switch ( use opcode ) { case reg ops move : / / follow uses of the move by adding it to the worklist esc set reg set set ( use get result ( ) get reg ( ) ) ; reg worklist add ( use get result ( ) ) ; break ; case reg ops if eq : case reg ops if ne : case reg ops check cast : / / compared objects can ' t be replaced , so promote if necessary if ( esc set escape compare to ( escape state method ) < 0 ) { esc set escape = escape state method ; } break ; case reg ops aput : / / for array puts , check for a constant array index register spec put index = use get sources ( ) get ( 2 ) ; if ( ! put index get type bearer ( ) is constant ( ) ) { / / if not constant , array can ' t be replaced esc set replaceable array = false ; } / / intentional fallthrough case reg ops put field : / / skip non - object puts register spec put value = use get sources ( ) get ( 0 ) ; if ( put value get type bearer ( ) get basic type ( ) ! = type bt object ) { break ; } esc set replaceable array = false ; / / raise 1st object ' s escape state to 2nd if 2nd is higher register spec list sources = use get sources ( ) ; if ( sources get ( 0 ) get reg ( ) = = def get reg ( ) ) { int set index = find set index ( sources get ( 1 ) ) ; if ( set index ! = lattice values size ( ) ) { escape set parent set = lattice values get ( set index ) ; add edge ( parent set , esc set ) ; if ( esc set escape compare to ( parent set escape ) < 0 ) { esc set escape = parent set escape ; } } } else { int set index = find set index ( sources get ( 0 ) ) ; if ( set index ! = lattice values size ( ) ) { escape set child set = lattice values get ( set index ) ; add edge ( esc set , child set ) ; if ( child set escape compare to ( esc set escape ) < 0 ) { child set escape = esc set escape ; } } } break ; case reg ops aget : / / for array gets , check for a constant array index register spec get index = use get sources ( ) get ( 1 ) ; if ( ! get index get type bearer ( ) is constant ( ) ) { / / if not constant , array can ' t be replaced esc set replaceable array = false ; } break ; case reg ops put static : / / static puts cause an object to escape globally esc set escape = escape state global ; break ; case reg ops invoke static : case reg ops invoke virtual : case reg ops invoke super : case reg ops invoke direct : case reg ops invoke interface : case reg ops return : case reg ops throw : / / these operations cause an object to escape interprocedurally esc set escape = escape state inter ; break ; default : break ; } }


convert a global ordinal into a bucket ordinal

abstract long global ord to bucket ord ( long owning bucket ord , long global ord ) ;


returns an immutable array containing the same values as { @ code this } array this is logically a no - op , and in some circumstances { @ code this } itself is returned however , if this instance is a { @ link # sub array } view of a larger array , this method will copy only the appropriate range of values , resulting in an equivalent array with a smaller memory footprint

public immutable int array trimmed ( ) { return is partial view ( ) ? new immutable int array ( to array ( ) ) : this ; }


update the environment of the native module

void update native ( immutable map builder < string , object > env ) ;


set the uri scheme which may contain uri template variables , and may also be { @ code null } to clear the scheme of this builder

uri builder scheme ( @ nullable string scheme ) ;


calculate the beginning and ending address of the biggest region around addr that does not contain any symbol this was not working correctly and it is too difficult to find the biggest region for which there is no codeunit , and where the volatile and readonly properties don ' t vary so now we assume that biggest hole we can find is just 1 byte

private string build hole ( address addr ) { / / address space addrspace = addr get address space ( ) ; / / address before , after ; / / memory block block = program get memory ( ) get block ( addr ) ; / / boolean readonly ; / / boolean is volatile = is volatile no data ( addr ) ; / / if ( block ! = null ) { / / before = block get start ( ) ; / / after = block get end ( ) ; / / readonly = ! block is write ( ) ; / / } / / else { / / before = addrspace get address ( 0 ) ; / / after = addrspace get max address ( ) ; / / readonly = false ; / / } / / code unit cubefore = listing get defined code unit before ( addr ) ; / / if ( cubefore ! = null ) { / / address tmp = cubefore get max address ( ) ; / / if ( tmp get address space ( ) get base space i d ( ) = = addrspace get base space i d ( ) ) { / / tmp = tmp add ( 1 ) ; / / if ( tmp get offset ( ) < = addr get offset ( ) ) { / / if ( tmp get offset ( ) > before get offset ( ) ) / / before = tmp ; / / } / / else { / / address is inside codeunit / / tmp = cubefore get max address ( ) ; / / if ( tmp get offset ( ) < after get offset ( ) ) / / after = tmp ; / / tmp = cubefore get min address ( ) ; / / if ( tmp get offset ( ) > before get offset ( ) ) / / before = tmp ; / / } / / } / / } / / code unit cuafter = listing get defined code unit after ( addr ) ; / / if ( cuafter ! = null ) { / / address tmp = cuafter get min address ( ) ; / / if ( ( tmp get address space ( ) = = addrspace ) ) { / / tmp = tmp subtract ( 1 ) ; / / if ( tmp get offset ( ) < after get offset ( ) ) { / / after = tmp ; / / } / / } / / } / / return build hole x m l ( addrspace get physical space ( ) get name ( ) , before get offset ( ) , / / after get offset ( ) , readonly , is volatile ) ; boolean readonly = is read only no data ( addr ) ; boolean isvolatile = is volatile no data ( addr ) ; return build hole x m l ( addr get address space ( ) get physical space ( ) get name ( ) , addr get offset ( ) , addr get offset ( ) , readonly , isvolatile ) ; }


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


private int get key length ( int index ) throws i o exception { return key type read length ( buffer , buffer get int ( base + ( index * entry size ) ) ) ; }


required if mode is ` mutual ` the path to a file containing certificate authority certificates to use in verifying a presented client side certificate < code > string ca certificates = 5 ; < code >

public java lang string get ca certificates ( ) { java lang object ref = ca certificates ; if ( ! ( ref instanceof java lang string ) ) { com google protobuf byte string bs = ( com google protobuf byte string ) ref ; java lang string s = bs to string utf 8 ( ) ; ca certificates = s ; return s ; } else { return ( java lang string ) ref ; } }


test that ask directory method auto - populates dialog with value in properties file also test that subsequent calls to the dialog show the last - used value

public void test ask directory ( ) throws exception { / / create temporary directories , then create a temporary properties file that contains / / the path to one of the temporary directory string temp dir path = abstract g test get test directory path ( ) ; file temp dir = new file ( temp dir path ) ; file temp sub dir = new file ( temp dir , temp sub dir ) ; file another temp sub dir = new file ( temp dir , " another temp dir " ) ; file temp properties file = new file ( temp dir , " temp properties file properties " ) ; temp properties file delete on exit ( ) ; file utilities delete dir ( temp sub dir ) ; file utilities delete dir ( another temp sub dir ) ; temp properties file delete ( ) ; / / first , create temporary dirs assert true ( " directory ' " + temp sub dir get absolute path ( ) + " ' should have been created ! " , temp sub dir mkdir ( ) ) ; assert true ( " directory ' " + another temp sub dir get absolute path ( ) + " ' should have been created ! " , another temp sub dir mkdir ( ) ) ; / / next , create properties file that contains the path to one of the dirs assert true ( " file ' " + temp properties file get absolute path ( ) + " ' should have been created ! " , temp properties file create new file ( ) ) ; / / write the path to the file to the properties file file writer output = new file writer ( temp properties file ) ; buffered writer writer = new buffered writer ( output ) ; writer write ( " choose your directory : choose ! = " + temp sub dir get absolute path ( ) ) ; writer close ( ) ; create script ( ) ; final file [ ] my dir = new file [ 1 ] ; / / load properties value ( s ) script set properties file ( temp properties file ) ; execute on swing without blocking ( ( ) - > { try { my dir [ 0 ] = script ask directory ( " choose your directory : " , " choose ! " ) ; } catch ( exception e ) { fail with exception ( " exception was caught in this test : " + e get message ( ) , e ) ; } } ) ; ghidra file chooser file chooser = wait for dialog component ( ghidra file chooser class ) ; wait for update on directory ( file chooser ) ; assert not null ( file chooser ) ; press button by text ( file chooser , " choose ! " ) ; wait for swing ( ) ; / / compare default value to expected properties value assert equals ( temp sub dir , my dir [ 0 ] ) ; / / choose another directory execute on swing without blocking ( ( ) - > { try { my dir [ 0 ] = script ask directory ( " choose your directory : " , " choose ! " ) ; } catch ( exception e ) { fail with exception ( " exception was caught in this test : " + e get message ( ) , e ) ; } } ) ; file chooser = wait for dialog component ( ghidra file chooser class ) ; file chooser set selected file ( another temp sub dir ) ; wait for update on directory ( file chooser ) ; press button by text ( file chooser , " choose ! " ) ; wait for swing ( ) ; / / verify the directory we chose is auto - populated when the dialog comes up again execute on swing without blocking ( ( ) - > { try { my dir [ 0 ] = script ask directory ( " choose your directory : " , " choose ! " ) ; } catch ( exception e ) { fail with exception ( " exception was caught in this test : " + e get message ( ) , e ) ; } } ) ; file chooser = wait for dialog component ( ghidra file chooser class ) ; wait for update on directory ( file chooser ) ; press button by text ( file chooser , " choose ! " ) ; wait for swing ( ) ; assert equals ( another temp sub dir , my dir [ 0 ] ) ; file utilities delete dir ( temp sub dir ) ; file utilities delete dir ( another temp sub dir ) ; }


returns a { @ link disk validator } instance corresponding to the passed clazz

public static disk validator get instance ( class < ? extends disk validator > clazz ) { disk validator disk validator ; if ( instances contains key ( clazz ) ) { disk validator = instances get ( clazz ) ; } else { disk validator = reflection utils new instance ( clazz , null ) ; / / check the return of put if absent ( ) to see if any other thread have put / / the instance with the same key into instances disk validator disk validator ret = instances put if absent ( clazz , disk validator ) ; if ( disk validator ret ! = null ) { disk validator = disk validator ret ; } } return disk validator ; }


log an exception ( throwable ) at the warning level with an accompanying message

public void warn ( string msg , throwable t ) { if ( logger is loggable ( level warning ) ) { log ( self , level warning , msg , t ) ; } }


tests that choose target with consider load set to true correctly calculates load with decommissioned nodes

public void test choose target with decom nodes ( ) throws i o exception { namenode get namesystem ( ) write lock ( ) ; try { dn manager get heartbeat manager ( ) update heartbeat ( data nodes [ 3 ] , block manager test util get storage reports for datanode ( data nodes [ 3 ] ) , data nodes [ 3 ] get cache capacity ( ) , data nodes [ 3 ] get cache used ( ) , 2 , 0 , null ) ; dn manager get heartbeat manager ( ) update heartbeat ( data nodes [ 4 ] , block manager test util get storage reports for datanode ( data nodes [ 4 ] ) , data nodes [ 4 ] get cache capacity ( ) , data nodes [ 4 ] get cache used ( ) , 4 , 0 , null ) ; dn manager get heartbeat manager ( ) update heartbeat ( data nodes [ 5 ] , block manager test util get storage reports for datanode ( data nodes [ 5 ] ) , data nodes [ 5 ] get cache capacity ( ) , data nodes [ 5 ] get cache used ( ) , 4 , 0 , null ) ; / / value in the above heartbeats final int load = 2 + 4 + 4 ; assert equals ( ( double ) load / 6 , dn manager get f s cluster stats ( ) get in service xceiver average ( ) , epsilon ) ; / / decommission d ns so block placement policy default is good target ( ) / / returns false for ( int i = 0 ; i < 3 ; i + + ) { datanode descriptor d = data nodes [ i ] ; dn manager get datanode admin manager ( ) start decommission ( d ) ; d set decommissioned ( ) ; } assert equals ( ( double ) load / 3 , dn manager get f s cluster stats ( ) get in service xceiver average ( ) , epsilon ) ; datanode descriptor writer dn = data nodes [ 0 ] ; / / call choose target ( ) datanode storage info [ ] targets = namenode get namesystem ( ) get block manager ( ) get block placement policy ( ) choose target ( " test file txt " , 3 , writer dn , new array list < datanode storage info > ( ) , false , null , 1024 , test block storage policy default storage policy , null ) ; assert equals ( 3 , targets length ) ; set < datanode storage info > target set = new hash set < > ( arrays as list ( targets ) ) ; for ( int i = 3 ; i < storages length ; i + + ) { assert true ( target set contains ( storages [ i ] ) ) ; } } finally { data nodes [ 0 ] stop decommission ( ) ; data nodes [ 1 ] stop decommission ( ) ; data nodes [ 2 ] stop decommission ( ) ; namenode get namesystem ( ) write unlock ( ) ; } name node log info ( " done working on it " ) ; }


defines the size of a char ( char ) data type

public void set char size ( int char size ) { this char size = char size ; }


publishes the task event to all subscribed event listeners

public void publish ( task event event ) { synchronized ( listeners ) { for ( event listener < task event > listener : listeners get ( event get class ( ) ) ) { listener on event ( event ) ; } } }


creates list of users with given input array

public void create users with array input test ( ) { list < user > body = null ; / / api create users with array input ( body ) ; / / todo : test validations }


synchronized void retain jobs ( list < string > active jobs ) { jobs key set ( ) retain all ( active jobs ) ; }


should the node indices stats be returned

public nodes stats request builder set indices ( boolean indices ) { request indices ( indices ) ; return this ; }


public boolean advance next position ( ) { boolean need next rows = ! started | | ! next rows has next ( ) ; if ( ! started ) { started = true ; nano start = system nano time ( ) ; } if ( need next rows ) { current row = null ; try { do { if ( ! scanner has more rows ( ) ) { return false ; } next rows = scanner next rows ( ) ; } while ( ! next rows has next ( ) ) ; log debug ( " fetched " + next rows get num rows ( ) + " rows " ) ; } catch ( kudu exception e ) { throw new runtime exception ( e ) ; } } current row = next rows next ( ) ; total bytes + = get row length ( ) ; return true ; }


sets an offset that will be added to the timestamps ( and sub - sample timestamps ) of samples that are subsequently queued

public final void set sample offset us ( long sample offset us ) { if ( this sample offset us ! = sample offset us ) { this sample offset us = sample offset us ; invalidate upstream format adjustment ( ) ; } }


caches frequently used file names to reuse file name objects and reduce heap size

void cache name ( i node inode ) { / / name is cached only for files if ( ! inode is file ( ) ) { return ; } byte array name = new byte array ( inode get local name bytes ( ) ) ; name = name cache put ( name ) ; if ( name ! = null ) { inode set local name ( name get bytes ( ) ) ; } }


public string get global disassembler options ( ) { return global disassembler options ; }


projects a { @ link tuple } { @ link data set } to the previously selected fields

public < t0 , t1 , t2 , t3 , t4 > project operator < t , tuple 5 < t0 , t1 , t2 , t3 , t4 > > project tuple 5 ( ) { type information < ? > [ ] f types = extract field types ( field indexes , ds get type ( ) ) ; tuple type info < tuple 5 < t0 , t1 , t2 , t3 , t4 > > t type = new tuple type info < tuple 5 < t0 , t1 , t2 , t3 , t4 > > ( f types ) ; return new project operator < t , tuple 5 < t0 , t1 , t2 , t3 , t4 > > ( this ds , this field indexes , t type ) ; }


public static string get version ( ) { final idea plugin descriptor plugin = get plugin ( ) ; if ( plugin ! = null ) { return plugin get version ( ) ; } return material theme bundle message ( " plugin version " ) ; }


make the given constructor accessible , explicitly setting it accessible if necessary the { @ code set accessible ( true ) } method is only called when actually necessary , to avoid unnecessary conflicts with a jvm security manager ( if active )

public static void make accessible ( constructor < ? > ctor ) { if ( ( ! modifier is public ( ctor get modifiers ( ) ) | | ! modifier is public ( ctor get declaring class ( ) get modifiers ( ) ) ) & & ! ctor is accessible ( ) ) { ctor set accessible ( true ) ; } } / / method handling


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


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


triggers a connect round unless there is one running already if there is a connect round running , the listener will either be queued or rejected and failed

void connect ( action listener < void > connect listener ) { boolean run connect = false ; final action listener < void > listener = context preserving action listener wrap preserving context ( connect listener , transport service get thread pool ( ) get thread context ( ) ) ; boolean closed ; synchronized ( mutex ) { closed = this closed get ( ) ; if ( closed ) { assert listeners is empty ( ) ; } else { if ( listeners size ( ) > = max pending connection listeners ) { assert listeners size ( ) = = max pending connection listeners ; listener on failure ( new es rejected execution exception ( " connect listener queue is full " ) ) ; return ; } else { listeners add ( listener ) ; } run connect = listeners size ( ) = = 1 ; } } if ( closed ) { connect listener on failure ( new already closed exception ( " connect handler is already closed " ) ) ; return ; } if ( run connect ) { executor service executor = transport service get thread pool ( ) executor ( thread pool names management ) ; executor submit ( new abstract runnable ( ) { @ override public void on failure ( exception e ) { action listener on failure ( get and clear listeners ( ) , e ) ; } @ override protected void do run ( ) { connect impl ( new action listener < > ( ) { @ override public void on response ( void a void ) { action listener on response ( get and clear listeners ( ) , a void ) ; } @ override public void on failure ( exception e ) { action listener on failure ( get and clear listeners ( ) , e ) ; } } ) ; } } ) ; } }


creates a new { @ link ss chunk source }

ss chunk source create chunk source ( loader error thrower manifest loader error thrower , ss manifest manifest , int stream element index , track selection track selection , @ nullable transfer listener transfer listener ) ;


< code > optional second msg blah = 2 ; < code >

public second msg builder get blah builder ( ) { bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; on changed ( ) ; return get blah field builder ( ) get builder ( ) ; }


read in a file and convert to an ascii string , using the open file builder api and the file status if the status is an s3a file status , any etag or version id used will be picked up

public static string read with status ( final file system fs , final file status status ) throws i o exception { final completable future < f s data input stream > future = fs open file ( status get path ( ) ) with file status ( status ) build ( ) ; try ( f s data input stream in = await future ( future ) ) { byte [ ] buf = new byte [ ( int ) status get len ( ) ] ; in read fully ( 0 , buf ) ; return new string ( buf ) ; } }


public void put ( @ non null final string key , final object value ) { put ( key , value , - 1 ) ; }


walk each character of current string from right end , remove the character if it is in trim string stops at the first character which is not in trim string return the new substring

public static binary string data trim right ( binary string data str , binary string data trim str ) { str ensure materialized ( ) ; if ( trim str = = null ) { return null ; } trim str ensure materialized ( ) ; if ( is space string ( trim str ) ) { return trim right ( str ) ; } if ( str in first segment ( ) ) { int char idx = 0 ; int byte idx = 0 ; / / each element in char lens is length of character in the source string int [ ] char lens = new int [ str get size in bytes ( ) ] ; / / each element in char start pos is start position of first byte in the source string int [ ] char start pos = new int [ str get size in bytes ( ) ] ; while ( byte idx < str get size in bytes ( ) ) { char start pos [ char idx ] = byte idx ; char lens [ char idx ] = num bytes for first byte ( str get byte one segment ( byte idx ) ) ; byte idx + = char lens [ char idx ] ; char idx + + ; } / / search idx points to the first character which is not in trim string from the right / / end int search idx = str get size in bytes ( ) - 1 ; char idx - = 1 ; while ( char idx > = 0 ) { binary string data current char = str copy binary string in one seg ( char start pos [ char idx ] , char lens [ char idx ] ) ; if ( trim str contains ( current char ) ) { search idx - = char lens [ char idx ] ; } else { break ; } char idx - - ; } if ( search idx < 0 ) { / / empty string return empty utf8 ; } else { return str copy binary string in one seg ( 0 , search idx + 1 ) ; } } else { return trim right slow ( str , trim str ) ; } }


the number of times that a memory pressure warning notification has been seen

public static int warning count ( ) { return jni loader is jni available ( ) ? warning count j n i ( ) : 0 ; }


constructs a { @ link get privileges request } to request all the privileges defined for the specified { @ code application name }

public static get privileges request get application privileges ( string application name ) { if ( strings is null or empty ( application name ) ) { throw new illegal argument exception ( " application name is required " ) ; } return new get privileges request ( application name ) ; }


default collection < v > find all ( final predicate < v > filter ) { return new array list < > ( 0 ) ; }


create a { @ link marshaller } for protos of the same type as { @ code default instance }

public static < t extends message > marshaller < t > marshaller ( final t default instance ) { return proto lite utils marshaller ( default instance ) ; }


reconstitute the < code > tree map < code > instance from a stream ( i e , deserialize it )

private void read object ( final java io object input stream s ) throws java io i o exception , class not found exception { / / read in the comparator and any hidden stuff s default read object ( ) ; / / read in size size = s read int ( ) ; root = build from sorted ( 0 , 0 , size - 1 , compute red level ( size ) , s ) ; }


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


public string get username ( ) { return username ; }


public static elf symbol create global function symbol ( elf header header , int name , string name as string , long addr , int symbol index , elf symbol table symbol table ) { return new elf symbol ( header , name as string , name , addr , 0 , ( byte ) ( ( stb global < < 4 ) | stt func ) , ( byte ) 0 , ( short ) 0 , symbol index , symbol table ) ; }


clears prefix flags , as used by { @ link # find nal unit ( byte [ ] , int , int , boolean [ ] ) }

public static void clear prefix flags ( boolean [ ] prefix flags ) { prefix flags [ 0 ] = false ; prefix flags [ 1 ] = false ; prefix flags [ 2 ] = false ; }


adds a route to the given handler function that handles all http { @ code post } requests that match the given predicate

builder post ( request predicate predicate , handler function < server response > handler function ) ;


called by the filter after it decides that the request is a potential csrf attack and therefore must be rejected

void send error ( int code , string message ) throws i o exception ;


returns the { @ link file handle resolver } for which this asset manager was loaded with

public file handle resolver get file handle resolver ( ) { return resolver ; }


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

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


tests that the checkpoint does not exist in the store when we fail to add it into the store ( i e , there exists an exception thrown by the method )

public void test add checkpoint with failed remove ( ) throws exception { final curator framework client = mock ( curator framework class , mockito returns deep stubs ) ; final retrievable state storage helper < completed checkpoint > storage helper mock = mock ( retrievable state storage helper class ) ; zoo keeper state handle store < completed checkpoint > zookeeper state handle store mock = spy ( new zoo keeper state handle store < > ( client , storage helper mock ) ) ; do answer ( new answer < retrievable state handle < completed checkpoint > > ( ) { @ override public retrievable state handle < completed checkpoint > answer ( invocation on mock invocation on mock ) throws throwable { completed checkpoint checkpoint = ( completed checkpoint ) invocation on mock get arguments ( ) [ 1 ] ; retrievable state handle < completed checkpoint > retrievable state handle = mock ( retrievable state handle class ) ; when ( retrievable state handle retrieve state ( ) ) then return ( checkpoint ) ; return retrievable state handle ; } } ) when ( zookeeper state handle store mock ) add and lock ( any string ( ) , any ( completed checkpoint class ) ) ; do throw ( new exception ( ) ) when ( zookeeper state handle store mock ) release and try remove ( any string ( ) ) ; final int num checkpoints to retain = 1 ; completed checkpoint store zoo keeper completed checkpoint store = new default completed checkpoint store < > ( num checkpoints to retain , zookeeper state handle store mock , zoo keeper checkpoint store util , executors direct executor ( ) ) ; for ( long i = 0 ; i < = num checkpoints to retain ; + + i ) { completed checkpoint checkpoint to add = mock ( completed checkpoint class ) ; do return ( i ) when ( checkpoint to add ) get checkpoint i d ( ) ; do return ( collections empty map ( ) ) when ( checkpoint to add ) get operator states ( ) ; try { zoo keeper completed checkpoint store add checkpoint ( checkpoint to add , new checkpoints cleaner ( ) , ( ) - > { } ) ; / / the checkpoint should be in the store if we successfully add it into the store list < completed checkpoint > added checkpoints = zoo keeper completed checkpoint store get all checkpoints ( ) ; assert true ( added checkpoints contains ( checkpoint to add ) ) ; } catch ( exception e ) { / / the checkpoint should not be in the store if any exception is thrown list < completed checkpoint > added checkpoints = zoo keeper completed checkpoint store get all checkpoints ( ) ; assert false ( added checkpoints contains ( checkpoint to add ) ) ; } } }


the following tree should traverse in alphabetical order { @ code a | \ b c d | \ e f g \ h }

@ test public void traverses breadth first ( ) { span builder builder = span new builder ( ) trace id ( " a " ) ; span node a = new span node ( builder id ( " a " ) build ( ) ) ; span node b = new span node ( builder id ( " b " ) build ( ) ) ; span node c = new span node ( builder id ( " c " ) build ( ) ) ; span node d = new span node ( builder id ( " d " ) build ( ) ) ; / / root ( a ) has children b , c , d a add child ( b ) add child ( c ) add child ( d ) ; span node e = new span node ( builder id ( " e " ) build ( ) ) ; span node f = new span node ( builder id ( " f " ) build ( ) ) ; span node g = new span node ( builder id ( " 1 " ) build ( ) ) ; / / child ( b ) has children e , f , g b add child ( e ) add child ( f ) add child ( g ) ; span node h = new span node ( builder id ( " 2 " ) build ( ) ) ; / / f has no children / / child ( g ) has child h g add child ( h ) ; assert that ( a traverse ( ) ) to iterable ( ) extracting ( span node : : span ) extracting ( s - > s id ( ) replace all ( " 0 " , " " ) ) contains exactly ( " a " , " b " , " c " , " d " , " e " , " f " , " 1 " , " 2 " ) ; }


checks whether a contact is currently registered with the server

public optional < contact token details > get contact ( string e 1 6 4number ) throws i o exception { string contact token = create directory server token ( e 1 6 4number , true ) ; contact token details contact token details = this push service socket get contact token details ( contact token ) ; if ( contact token details ! = null ) { contact token details set number ( e 1 6 4number ) ; } return optional from nullable ( contact token details ) ; }


protected string determine consent event ( final request context request context ) { val web service = web utils get service ( request context ) ; val service = this authentication request service selection strategies resolve service ( web service ) ; if ( service = = null ) { return null ; } val registered service = get registered service for consent ( request context , service ) ; val authentication = web utils get authentication ( request context ) ; if ( authentication = = null ) { return null ; } return is consent required ( service , registered service , authentication , request context ) ; }


forcefully refreshes cache entry by ignoring the backoff timer

void force refresh ( ) { if ( scheduled handle is pending ( ) ) { scheduled handle cancel ( ) ; transition to pending ( ) ; } }


get or create a { @ link metric group } with the specified group name and the given tags each group is uniquely identified by the name and tags

public metric group group ( string group name , string tag key values ) { metric group id group id = group id ( group name , tag key values ) ; metric group group = groups by name get ( group id ) ; if ( group = = null ) { group = new metric group ( group id ) ; metric group previous = groups by name put if absent ( group id , group ) ; if ( previous ! = null ) group = previous ; } return group ; }


returns whether this integer value is less than the given particular integer value : < code > never < code > , < code > maybe < code > , or < code > always < code >

public int less than ( particular integer value other ) { return less than ( ( specific integer value ) other ) ; }


model tests for additional properties number

public void test additional properties number ( ) { / / todo : test additional properties number }


initializes fresco with the default drawee config

public static void initialize ( context context , @ nullable image pipeline config image pipeline config ) { initialize ( context , image pipeline config , null ) ; }


creates a new { @ code session windows } { @ link window assigner } that assigns elements to sessions based on the element timestamp

public static < t > dynamic processing time session windows < t > with dynamic gap ( session window time gap extractor < t > session window time gap extractor ) { return new dynamic processing time session windows < > ( session window time gap extractor ) ; }


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


returns the same range relative to the reversed comparator

general range < t > reverse ( ) { general range < t > result = reverse ; if ( result = = null ) { result = new general range < t > ( ordering from ( comparator ) reverse ( ) , has upper bound , get upper endpoint ( ) , get upper bound type ( ) , has lower bound , get lower endpoint ( ) , get lower bound type ( ) ) ; result reverse = this ; return this reverse = result ; } return result ; }


resolve the computed column ' s type for the given schema

public table schema resolve ( table schema table schema ) { final string rowtime ; if ( ! table schema get watermark specs ( ) is empty ( ) ) { / / todo : [ flink - 14473 ] we only support top - level rowtime attribute right now rowtime = table schema get watermark specs ( ) get ( 0 ) get rowtime attribute ( ) ; if ( rowtime contains ( " " ) ) { throw new validation exception ( string format ( " nested field ' % s ' as rowtime attribute is not supported right now " , rowtime ) ) ; } } else { rowtime = null ; } string [ ] field names = table schema get field names ( ) ; data type [ ] field types = table schema get field data types ( ) ; table schema builder builder = table schema builder ( ) ; for ( int i = 0 ; i < table schema get field count ( ) ; + + i ) { table column table column = table schema get table columns ( ) get ( i ) ; data type field type = field types [ i ] ; if ( table column instanceof computed column ) { final computed column computed column = ( computed column ) table column ; field type = resolve expression data type ( computed column get expression ( ) , table schema ) ; if ( is proctime ( field type ) ) { if ( field names [ i ] equals ( rowtime ) ) { throw new table exception ( " watermark can not be defined for a processing time attribute column " ) ; } } } if ( is streaming mode & & field names [ i ] equals ( rowtime ) ) { timestamp type original type = ( timestamp type ) field type get logical type ( ) ; logical type rowtime type = new timestamp type ( original type is nullable ( ) , timestamp kind rowtime , original type get precision ( ) ) ; field type = type conversions from logical to data type ( rowtime type ) ; } if ( table column instanceof physical column ) { builder add ( table column physical ( field names [ i ] , field type ) ) ; } else if ( table column instanceof computed column ) { final computed column computed column = ( computed column ) table column ; builder add ( table column computed ( field names [ i ] , field type , computed column get expression ( ) ) ) ; } else if ( table column instanceof metadata column ) { final metadata column metadata column = ( metadata column ) table column ; builder add ( table column metadata ( field names [ i ] , field type , metadata column get metadata alias ( ) or else ( null ) , metadata column is virtual ( ) ) ) ; } } table schema get watermark specs ( ) for each ( builder : : watermark ) ; table schema get primary key ( ) if present ( pk - > builder primary key ( pk get name ( ) , pk get columns ( ) to array ( new string [ 0 ] ) ) ) ; return builder build ( ) ; }


checks the number of dateline intersections detected for a component if there is only one , it clears it as it means that the component just touches the dateline

private static boolean clear component touching dateline ( edge [ ] edges , int component ) { edge intersection = null ; for ( int j = 0 ; j < edges length ; j + + ) { if ( edges [ j ] intersect ! = edge max coordinate & & edges [ j ] component = = component ) { if ( intersection = = null ) { intersection = edges [ j ] ; } else { return false ; } } } if ( intersection ! = null ) { intersection intersect = edge max coordinate ; } return intersection ! = null ; }


test that environment variables are not escaped or quoted

public void test extra action info environment variables ( ) throws exception { map < string , string > env = immutable map of ( " p1 " , " simple " , " p2 " , " spaces are not escaped " , " p3 " , " : " , " p4 " , " " , " nonsense variable " , " value " ) ; spawn info spawn info = create copy from welcome to destination ( env ) get extra action info ( action key context ) build ( ) get extension ( spawn info spawn info ) ; assert that ( env ) has size ( spawn info get variable count ( ) ) ; for ( environment variable variable : spawn info get variable list ( ) ) { assert that ( env ) contains entry ( variable get name ( ) , variable get value ( ) ) ; } }


public void test increment byte ( ) { assert equals ( ( byte ) 0 , exec ( " byte x = ( byte ) 0 ; return x + + ; " ) ) ; assert equals ( ( byte ) 0 , exec ( " byte x = ( byte ) 0 ; return x - - ; " ) ) ; assert equals ( ( byte ) 1 , exec ( " byte x = ( byte ) 0 ; return + + x ; " ) ) ; assert equals ( ( byte ) - 1 , exec ( " byte x = ( byte ) 0 ; return - - x ; " ) ) ; }


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


public void reset ( ) { stdout buffer reset ( ) ; stderr buffer reset ( ) ; text index = 0 ; text input clear ( ) ; secret index = 0 ; secret input clear ( ) ; }


for thermodynamic metrics , no single value field need to do nothing here


applies { @ link circle crop } to all default types and throws an exception if asked to transform an unknown type this will override previous calls to { @ link # dont transform ( ) }

public t circle crop ( ) { return transform ( downsample strategy center inside , new circle crop ( ) ) ; } / / calling optional transform ( ) on the result of clone ( ) requires greater access / / calling downsample is guaranteed to modify the current object by the is auto clone enabled check @ suppress warnings ( { " weaker access " , " check result " }


resolve the exception by iterating over the list of configured exception resolvers the first one to return a { @ link model and view } wins otherwise { @ code null } is returned

public model and view resolve exception ( http servlet request request , http servlet response response , @ nullable object handler , exception ex ) { if ( this resolvers ! = null ) { for ( handler exception resolver handler exception resolver : this resolvers ) { model and view mav = handler exception resolver resolve exception ( request , response , handler , ex ) ; if ( mav ! = null ) { return mav ; } } } return null ; }


get time for next login retry this will allow the thread to retry with exponential back - off , until tgt endtime last retry is { @ link # kerberos min seconds before relogin } before endtime

static long get next tgt renewal time ( final long tgt end time , final long now , final retry policy rp ) throws exception { final long last retry time = tgt end time - kerberos min seconds before relogin ; final retry policy retry action ra = rp should retry ( null , metrics renewal failures value ( ) , 0 , false ) ; return math min ( last retry time , now + ra delay millis ) ; }


check if the returned exception is caused by an standby namenode

private boolean is standby exception ( exception exception ) { if ( exception instanceof remote exception ) { return ( ( remote exception ) exception ) unwrap remote exception ( ) instanceof standby exception ; } return false ; }


sets the cluster builder for this sink a cluster builder is used to configure the connection to cassandra

public cassandra sink builder < in > set cluster builder ( cluster builder builder ) { if ( this builder ! = null ) { throw new illegal argument exception ( " builder was already set you must use either set host ( ) or set cluster builder ( ) " ) ; } this builder = builder ; return this ; }


transforms a set of imports to a map with key config to model import ( import ) and value the import string

private map < string , string > get all imports mappings ( set < string > all imports ) { map < string , string > result = new hash map < > ( ) ; all imports for each ( next import - > { string mapping = config import mapping ( ) get ( next import ) ; if ( mapping ! = null ) { result put ( mapping , next import ) ; } else { result put all ( config to model import map ( next import ) ) ; } } ) ; return result ; }


create a new { @ link local exporter } with the default exporter settings and name

protected local exporter create local exporter ( ) { return create local exporter ( exporter name , null , new monitoring migration coordinator ( ) ) ; }


return the file name of the api documentation

public string to api doc filename ( string name ) { return to api name ( name ) ; }


asserts that a message was propagated inbound through the channel

private static < t extends web socket frame > void assert propagated inbound ( t message , embedded channel channel ) { t propagated response = channel read inbound ( ) ; assert equals ( message , propagated response ) ; }


public void about ( ) { render ( about page ( ) ) ; }


public string get a t t n a m e ( ) { return att name ; }


views the array as an immutable list checks for nulls ; does not copy

private static < e > immutable list < e > construct ( object elements ) { return as immutable list ( check elements not null ( elements ) ) ; }


this test validates that an invalid program exception is thrown when min by is used on a custom data type

public void test custom key fields dataset ( ) { final execution environment env = execution environment get execution environment ( ) ; this custom type data add ( new custom type ( ) ) ; data set < custom type > custom ds = env from collection ( custom type data ) ; / / should not work : groups on custom type custom ds min by ( 0 ) ; }


returns pet inventories by status returns a map of status codes to quantities

public completable future < api response < map < string , integer > > > get inventory with http info ( ) throws api exception { try { http request builder local var request builder = get inventory request builder ( ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " get inventory " , local var response ) ) ; } try { return completable future completed future ( new api response < map < string , integer > > ( local var response status code ( ) , local var response headers ( ) map ( ) , member var object mapper read value ( local var response body ( ) , new type reference < map < string , integer > > ( ) { } ) ) ) ; } catch ( i o exception e ) { return completable future failed future ( new api exception ( e ) ) ; } } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


called by ghidra when bundle is activated

protected void start ( bundle context bundle context , object api ) { if ( stored action ! = null ) { msg show error ( this , null , " activator error ! " , " stored action non - null on bundle start ! " ) ; } }


this method convert domain model object to data transfer object


returns the cleanup time for a window , which is { @ code window max timestamp + allowed lateness } in case this leads to a value greated than { @ link long # max value } then a cleanup time of { @ link long # max value } is returned

private long cleanup time ( w window ) { if ( window assigner is event time ( ) ) { long cleanup time = math max ( 0 , window max timestamp ( ) + allowed lateness ) ; return cleanup time > = window max timestamp ( ) ? cleanup time : long max value ; } else { return math max ( 0 , window max timestamp ( ) ) ; } }


concatenates strings , using a separator

public static string join ( char sequence separator , string [ ] strings ) { / / ideally we don ' t have to duplicate the code here if array is iterable string builder sb = new string builder ( ) ; boolean first = true ; for ( string s : strings ) { if ( first ) { first = false ; } else { sb append ( separator ) ; } sb append ( s ) ; } return sb to string ( ) ; }


test if an engine - wide signal is thrown as response to a dispatched event

public void test global signal defined in process definition ( ) throws exception { process instance process instance = runtime service start process instance by key ( " global signal process " ) ; assert that ( process instance ) is not null ( ) ; process instance external process = runtime service start process instance by key ( " global signal process external " ) ; assert that ( process instance ) is not null ( ) ; / / make sure process is not ended yet by querying it again external process = runtime service create process instance query ( ) process instance id ( external process get id ( ) ) single result ( ) ; assert that ( external process ) is not null ( ) ; task task = task service create task query ( ) process instance id ( process instance get id ( ) ) single result ( ) ; assert that ( task ) is not null ( ) ; / / assign task to trigger signal task service set assignee ( task get id ( ) , " kermit " ) ; / / second process should have been signaled external process = runtime service create process instance query ( ) process instance id ( external process get id ( ) ) single result ( ) ; assert that ( external process ) is null ( ) ; / / task assignee should still be set task = task service create task query ( ) process instance id ( process instance get id ( ) ) single result ( ) ; assert that ( task ) is not null ( ) ; assert that ( task get assignee ( ) ) is equal to ( " kermit " ) ; }


set the container id - to - exception map in which the exception indicates error from each container for failed requests

public abstract void set failed requests ( map < container id , serialized exception > failed requests ) ;


return default value for the jmx field " currency time limit " , if any

protected integer get default currency time limit ( ) { return this default currency time limit ; }


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


creates an empty { @ code hash based table } with the specified map sizes

public static < r , c , v > hash based table < r , c , v > create ( int expected rows , int expected cells per row ) { check nonnegative ( expected cells per row , " expected cells per row " ) ; map < r , map < c , v > > backing map = maps new linked hash map with expected size ( expected rows ) ; return new hash based table < > ( backing map , new factory < c , v > ( expected cells per row ) ) ; }


creates a stream joined instance with the provided store suppliers the store suppliers must implement the { @ link window bytes store supplier } interface the store suppliers must provide unique names or a { @ link org apache kafka streams errors streams exception } is thrown

public static < k , v1 , v2 > stream joined < k , v1 , v2 > with ( final window bytes store supplier store supplier , final window bytes store supplier other store supplier ) { return new stream joined < > ( null , null , null , store supplier , other store supplier , null , null , true , new hash map < > ( ) ) ; }


build the hibernate { @ code session factory } through background bootstrapping , using the given executor for a parallel initialization phase ( e g a { @ link org springframework core task simple async task executor } ) { @ code session factory } initialization will then switch into background bootstrap mode , with a { @ code session factory } proxy immediately returned for injection purposes instead of waiting for hibernate ' s bootstrapping to complete however , note that the first actual call to a { @ code session factory } method will then block until hibernate ' s bootstrapping completed , if not ready by then for maximum benefit , make sure to avoid early { @ code session factory } calls in init methods of related beans , even for metadata introspection purposes

public session factory build session factory ( async task executor bootstrap executor ) { assert not null ( bootstrap executor , " async task executor must not be null " ) ; return ( session factory ) proxy new proxy instance ( this resource pattern resolver get class loader ( ) , new class < ? > [ ] { session factory implementor class , infrastructure proxy class } , new bootstrap session factory invocation handler ( bootstrap executor ) ) ; }


public void rename snapshot ( final i nodes in path iip , final string snapshot root , final string old snapshot name , final string new snapshot name , long now ) throws i o exception { final i node directory src root = get snapshottable root ( iip ) ; src root rename snapshot ( snapshot root , old snapshot name , new snapshot name , now ) ; }


public boolean create ( final string path , list < acl > zk acl ) throws exception { boolean created = false ; if ( ! exists ( path ) ) { curator create ( ) with mode ( create mode persistent ) with a c l ( zk acl ) for path ( path , null ) ; created = true ; } return created ; }


register a listener that will be called when this model visibility state has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public model with super attributes $ sub model with super attributes on visibility state changed ( on model visibility state changed listener < model with super attributes $ sub model with super attributes , object > listener ) { on mutation ( ) ; this on model visibility state changed listener epoxy generated model = listener ; return this ; }


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


push a token of two characters in length

private void push pair token ( token kind kind ) { this tokens add ( new token ( kind , this pos , this pos + 2 ) ) ; this pos + = 2 ; }


sets whether the tree should show pointers

public void set filter pointers ( boolean filter pointers ) { this filter pointers = filter pointers ; }


public single < map < string , integer > > rx get inventory ( ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate get inventory ( fut ) ) ) ; }


public boolean is enabled ( ) { return contact is enabled ( ) ; }


aggregates the given element see { @ link # get extreme elements ( ) }

public abstract void aggregate ( t element ) ;


combine the values of records in this stream by the grouped key and defined sessions note that sessions are generated on a per - key basis and records with different keys create independent sessions records with { @ code null } key or value are ignored combining implies that the type of the aggregate result is the same as the type of the input value ( c f { @ link # aggregate ( initializer , aggregator , merger ) } ) the result is written into a local { @ link session store } ( which is basically an ever - updating materialized view ) furthermore , updates to the store are sent downstream into a { @ link k table } changelog stream the default key and value serde from the config will be used for serializing the result if a different serde is required then you should use { @ link # reduce ( reducer , materialized ) } the value of the first record per session initialized the session result the specified { @ link reducer } is applied for each additional input record per session and computes a new aggregate using the current aggregate ( first argument ) and the record ' s value ( second argument ) : { @ code at the example of a reducer < long > new reducer < long > ( ) { public long apply ( long agg value , long curr value ) { return agg value + curr value ; } } } thus , { @ code reduce ( ) } can be used to compute aggregate functions like sum , min , or max not all updates might get sent downstream , as an internal cache is used to deduplicate consecutive updates to the same window and key the rate of propagated updates depends on your input data rate , the number of distinct keys , the number of parallel running kafka streams instances , and the { @ link streams config configuration } parameters for { @ link streams config # cache max bytes buffering config cache size } , and { @ link streams config # commit interval ms config commit interval } for failure and recovery the store will be backed by an internal changelog topic that will be created in kafka the changelog topic will be named " $ { application id } - $ { internal store name } - changelog " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " internal store name " is an internal name and " - changelog " is a fixed suffix you can retrieve all generated internal topic names via { @ link topology # describe ( ) }

k table < windowed < k > , v > reduce ( final reducer < v > reducer ) ;


parse a { @ link time value } with support for fractional values

public static time value parse time value supporting fractional ( @ nullable string s value , string setting name ) { / / todo we can potentially remove this in 6 x / / this code is lifted almost straight from 2 x ' s time value java objects require non null ( setting name ) ; if ( s value = = null ) { return null ; } try { long millis ; string lower s value = s value to lower case ( locale root ) trim ( ) ; if ( lower s value ends with ( " ms " ) ) { millis = ( long ) ( double parse double ( lower s value substring ( 0 , lower s value length ( ) - 2 ) ) ) ; } else if ( lower s value ends with ( " s " ) ) { millis = ( long ) ( double parse double ( lower s value substring ( 0 , lower s value length ( ) - 1 ) ) * 1000 ) ; } else if ( lower s value ends with ( " m " ) ) { millis = ( long ) ( double parse double ( lower s value substring ( 0 , lower s value length ( ) - 1 ) ) * 60 * 1000 ) ; } else if ( lower s value ends with ( " h " ) ) { millis = ( long ) ( double parse double ( lower s value substring ( 0 , lower s value length ( ) - 1 ) ) * 60 * 60 * 1000 ) ; } else if ( lower s value ends with ( " d " ) ) { millis = ( long ) ( double parse double ( lower s value substring ( 0 , lower s value length ( ) - 1 ) ) * 24 * 60 * 60 * 1000 ) ; } else if ( lower s value ends with ( " w " ) ) { millis = ( long ) ( double parse double ( lower s value substring ( 0 , lower s value length ( ) - 1 ) ) * 7 * 24 * 60 * 60 * 1000 ) ; } else if ( lower s value equals ( " - 1 " ) ) { / / allow this special value to be unit - less : millis = - 1 ; } else if ( lower s value equals ( " 0 " ) ) { / / allow this special value to be unit - less : millis = 0 ; } else { throw new elasticsearch parse exception ( " failed to parse setting [ { } ] with value [ { } ] as a time value : unit is missing or unrecognized " , setting name , s value ) ; } return new time value ( millis , time unit milliseconds ) ; } catch ( number format exception e ) { throw new elasticsearch parse exception ( " failed to parse [ { } ] " , e , s value ) ; } }


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


public authentication get authentication ( string auth name ) { return authentications get ( auth name ) ; }


gets the { @ link user code class loader } to load classes that are not in system ' s classpath , but are part of the jar file of a user job

user code class loader get user code class loader ( ) ;


public void post ( string path , template view route route , template engine engine ) { add route ( http method post , template view route impl create ( path , route , engine ) ) ; }


check whether this instance is the active one

public void do get ( final http servlet request req , final http servlet response resp ) throws i o exception { / / by default requests are persistent we don ' t want long - lived connections / / on server side resp add header ( " connection " , " close " ) ; if ( ! is active ( ) ) { / / report not sc ok resp send error ( http servlet response sc method not allowed , response not active ) ; return ; } resp set status ( http servlet response sc ok ) ; resp get writer ( ) write ( response active ) ; resp get writer ( ) flush ( ) ; }


get the { @ link key value store } or { @ link timestamped key value store } with the given name the store can be a " regular " or global store if the registered store is a { @ link timestamped key value store } this method will return a value - only query interface it is highly recommended to update the code for this case to avoid bugs and to use { @ link # get timestamped key value store ( string ) } for full store access instead this is often useful in test cases to pre - populate the store before the test case instructs the topology to { @ link # pipe input ( consumer record ) process an input message } , andor to check the store afterward

public < k , v > key value store < k , v > get key value store ( final string name ) { final state store store = get state store ( name , false ) ; if ( store instanceof timestamped key value store ) { log info ( " method # get timestamped key value store ( ) should be used to access a timestamped key value store " ) ; return new key value store facade < > ( ( timestamped key value store < k , v > ) store ) ; } return store instanceof key value store ? ( key value store < k , v > ) store : null ; }


make sure hdfs crypto - create zone command creates a trash directory with sticky bits

public void test trash sticky bit ( ) throws exception { / / create an ez / zones / zone 1 , make it world writable final path zone parent = new path ( " / zones " ) ; final path zone 1 = new path ( zone parent , " zone 1 " ) ; crypto admin crypto admin = new crypto admin ( conf ) ; fs wrapper mkdir ( zone 1 , fs permission get dir default ( ) , true ) ; fs wrapper set permission ( zone 1 , new fs permission ( fs action all , fs action all , fs action all ) ) ; string [ ] crypto argv = new string [ ] { " - create zone " , " - key name " , test key , " - path " , zone 1 to uri ( ) get path ( ) } ; crypto admin run ( crypto argv ) ; / / create a file in ez final path ezfile 1 = new path ( zone 1 , " file 1 " ) ; / / create the encrypted file in zone 1 final int len = 8192 ; d f s test util create file ( fs , ezfile 1 , len , ( short ) 1 , 0x f e e d ) ; / / enable trash , delete / zones / zone 1 / file 1 , / / which moves the file to / / / zones / zone 1 / trash / $ superuser / current / zones / zone 1 / file 1 configuration client conf = new configuration ( conf ) ; client conf set long ( fs trash interval key , 1 ) ; final fs shell shell = new fs shell ( client conf ) ; string [ ] argv = new string [ ] { " - rm " , ezfile 1 to string ( ) } ; int res = tool runner run ( shell , argv ) ; assert equals ( " can ' t remove a file in ez as superuser " , 0 , res ) ; final path trash dir = new path ( zone 1 , file system trash prefix ) ; assert true ( fs wrapper exists ( trash dir ) ) ; file status trash file status = fs wrapper get file status ( trash dir ) ; assert true ( trash file status get permission ( ) get sticky bit ( ) ) ; / / create a non - privileged user final user group information user = user group information create user for testing ( " user " , new string [ ] { " mygroup " } ) ; user do as ( new privileged exception action < object > ( ) { @ override public object run ( ) throws exception { final path ezfile 2 = new path ( zone 1 , " file 2 " ) ; final int len = 8192 ; / / create a file / zones / zone 1 / file 2 in ez / / this file is owned by user : mygroup file system fs 2 = file system get ( cluster get configuration ( 0 ) ) ; d f s test util create file ( fs 2 , ezfile 2 , len , ( short ) 1 , 0x f e e d ) ; / / delete / zones / zone 1 / file 2 , / / which moves the file to / / / zones / zone 1 / trash / user / current / zones / zone 1 / file 2 string [ ] argv = new string [ ] { " - rm " , ezfile 2 to string ( ) } ; int res = tool runner run ( shell , argv ) ; assert equals ( " can ' t remove a file in ez as user : mygroup " , 0 , res ) ; return null ; } } ) ; }


returns true if symbol is at a non - existent address

public boolean is bad reference symbol ( symbol s ) { if ( memory = = null ) { return true ; } address a = s get address ( ) ; if ( a is memory address ( ) ) { return ! memory contains ( s get address ( ) ) ; } return false ; }


focuses the given vertex , which means to trigger it to be pickedselected in the ui , causing it to be the focused vertex of the graph

protected void focus vertex ( abstract test vertex v ) { graph viewer < abstract test vertex , test edge > viewer = graph component get primary viewer ( ) ; g picked state < abstract test vertex > ps = viewer get g picked vertex state ( ) ; swing ( ( ) - > { ps clear ( ) ; ps pick ( v , true ) ; } ) ; abstract test vertex focused = swing ( ( ) - > graph get focused vertex ( ) ) ; assert equals ( v , focused ) ; }


public long get pet id ( ) { return pet id ; }


returns the { @ link texture atlas } passed to this skin constructor , or null

public @ null texture atlas get atlas ( ) { return atlas ; }


create a persistent { @ link window bytes store supplier } this store supplier can be passed into a { @ link # timestamped window store builder ( window bytes store supplier , serde , serde ) } if you want to create a { @ link window store } you should use { @ link # persistent window store ( string , duration , duration , boolean ) } to create a store supplier instead

public static window bytes store supplier persistent timestamped window store ( final string name , final duration retention period , final duration window size , final boolean retain duplicates ) throws illegal argument exception { return persistent window store ( name , retention period , window size , retain duplicates , true ) ; }


set the current list without performing any diffing cancels any diff in progress this can be used if you notified a change to the adapter manually and need this list to be synced

public synchronized boolean force list override ( @ nullable list < epoxy model < ? > > new list ) { / / we need to make sure that generation changes and list updates are synchronized final boolean interrupted diff = cancel diff ( ) ; int generation = generation tracker increment and get next scheduled ( ) ; try latch list ( new list , generation ) ; return interrupted diff ; }


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


static void check insert only ( row data current row ) { preconditions check argument ( current row get row kind ( ) = = row kind insert ) ; }


public string login user ( @ query param ( " username " ) @ not null string username , @ query param ( " password " ) @ not null string password ) ;


returns the number of files in this snapshot

public int size ( ) { return metadata size ( ) ; }


this implementation looks for a method with matching parameter types

protected method find matching method ( ) { method matching method = super find matching method ( ) ; / / second pass : look for method where arguments can be converted to parameter types if ( matching method = = null ) { / / interpret argument array as individual method arguments matching method = do find matching method ( get arguments ( ) ) ; } if ( matching method = = null ) { / / interpret argument array as single method argument of array type matching method = do find matching method ( new object [ ] { get arguments ( ) } ) ; } return matching method ; }


applies the given { @ link process function } on the input stream , thereby creating a transformed output stream the function will be called for every element in the input streams and can produce zero or more output elements contrary to the { @ link data stream # flat map ( flat map function ) } function , this function can also query the time and set timers when reacting to the firing of set timers the function can directly emit elements andor register yet more timers

public < r > single output stream operator < r > process ( process function < t , r > process function ) { type information < r > out type = type extractor get unary operator return type ( process function , process function class , 0 , 1 , type extractor no index , get type ( ) , utils get call location name ( ) , true ) ; return process ( process function , out type ) ; }


returns set of records that are selected in multi - select mode

set < conversation message > get selected items ( ) { return new hash set < > ( selected ) ; }


test what happens with the following sequence : thread a writes edit thread b calls log sync all calls close ( ) on stream thread a calls log sync this sequence is legal and can occur if enter safe mode ( ) is closely followed by save namespace

public void test batched sync with closed logs ( ) throws exception { / / start a cluster configuration conf = get conf ( ) ; mini d f s cluster cluster = null ; file system file sys = null ; executor service thread a = executors new single thread executor ( ) ; executor service thread b = executors new single thread executor ( ) ; try { cluster = new mini d f s cluster builder ( conf ) num data nodes ( num data nodes ) build ( ) ; cluster wait active ( ) ; file sys = cluster get file system ( ) ; final f s namesystem namesystem = cluster get namesystem ( ) ; f s image fsimage = namesystem get f s image ( ) ; final f s edit log edit log = fsimage get edit log ( ) ; / / log an edit from thread a do log edit ( thread a , edit log , " thread - a 1 " ) ; / / async log is doing batched syncs in background log sync just ensures / / the edit is durable , so the txid may increase prior to sync if ( ! use async edit log ) { assert equals ( " logging edit without syncing should do not affect txid " , 1 , edit log get sync tx id ( ) ) ; } / / log sync all in thread b do call log sync all ( thread b , edit log ) ; assert equals ( " log sync all should sync thread a ' s transaction " , 2 , edit log get sync tx id ( ) ) ; / / close edit log edit log close ( ) ; / / ask thread a to finish sync ( which should be a no - op ) do call log sync ( thread a , edit log ) ; } finally { thread a shutdown ( ) ; thread b shutdown ( ) ; if ( file sys ! = null ) file sys close ( ) ; if ( cluster ! = null ) cluster shutdown ( ) ; } }


full test of the expected lifecycle : start job , task , write , commit task , commit job

public void test commit lifecycle ( ) throws exception { describe ( " full test of the expected lifecycle : \ n " + " start job , task , write , commit task , commit job \ n " + " verify : \ n " + " * no files are visible after task commit \ n " + " * the expected file is visible after job commit \ n " + " * no outstanding m p us after job commit " ) ; job data job data = start job ( false ) ; job context j context = job data j context ; task attempt context t context = job data t context ; abstract s 3 a committer committer = job data committer ; validate task attempt working directory ( committer , t context ) ; / / write output describe ( " 1 writing output " ) ; write text output ( t context ) ; dump multipart uploads ( ) ; describe ( " 2 committing task " ) ; assert true ( " no files to commit were found by " + committer , committer needs task commit ( t context ) ) ; commit task ( committer , t context ) ; / / this is only task commit ; there must be no part - files in the dest dir wait for consistency ( ) ; try { apply located files ( get file system ( ) list files ( out dir , false ) , ( status ) - > assert false ( " task committed file to dest : " + status , status get path ( ) to string ( ) contains ( " part " ) ) ) ; } catch ( file not found exception ignored ) { log ( ) info ( " outdir { } is not created by task commit phase " , out dir ) ; } describe ( " 3 committing job " ) ; assert multipart uploads pending ( out dir ) ; commit job ( committer , j context ) ; / / validate output describe ( " 4 validating content " ) ; validate content ( out dir , should expect success marker ( ) , committer get u u i d ( ) ) ; assert no multipart uploads pending ( out dir ) ; }


parse the { @ link http servlet request # get request u r i ( ) request u r i } of the request and its { @ code context path } to create a { @ link request path } and cache it in the request attribute { @ link # path attribute } this method ignores the { @ link http servlet request # get servlet path ( ) servlet path } and the { @ link http servlet request # get path info ( ) path info } therefore in case of a servlet mapping by prefix , the { @ link request path # path within application ( ) } will always include the servlet prefix

public static request path parse and cache ( http servlet request request ) { string request uri = ( string ) request get attribute ( web utils include request uri attribute ) ; request uri = ( request uri ! = null ? request uri : request get request u r i ( ) ) ; request path request path = request path parse ( request uri , request get context path ( ) ) ; request set attribute ( path attribute , request path ) ; return request path ; }


returns the greatest value present in { @ code array } , treating values as unsigned

public static byte max ( byte array ) { check argument ( array length > 0 ) ; int max = to int ( array [ 0 ] ) ; for ( int i = 1 ; i < array length ; i + + ) { int next = to int ( array [ i ] ) ; if ( next > max ) { max = next ; } } return ( byte ) max ; }


public void test no space archive ( ) throws exception { log info ( " test no space archive " ) ; final path policy map path policy map = new path policy map ( 0 ) ; final namespace scheme ns scheme = path policy map new namespace scheme ( ) ; final cluster scheme cluster scheme = new cluster scheme ( default conf , num datanodes , repl , gen storage types ( num datanodes ) , null ) ; final migration test test = new migration test ( cluster scheme , ns scheme ) ; try { test run basic test ( false ) ; / / create 2 hot files with replication 3 final short replication = 3 ; for ( int i = 0 ; i < 2 ; i + + ) { final path p = new path ( path policy map cold , " file " + i ) ; d f s test util create file ( test dfs , p , block size , replication , 0l ) ; wait for all replicas ( replication , p , test dfs , 10 ) ; } / / set all the archive volume to full for ( data node dn : test cluster get data nodes ( ) ) { set volume full ( dn , storage type archive ) ; data node test utils trigger heartbeat ( dn ) ; } { / / test increasing replication but new replicas cannot be created / / since no more archive space final path file 0 = new path ( path policy map cold , " file 0 " ) ; final replication r = test get replication ( file 0 ) ; assert assert equals ( 0 , r disk ) ; final short new replication = ( short ) 5 ; test dfs set replication ( file 0 , new replication ) ; wait for all replicas ( r archive , file 0 , test dfs , 10 ) ; test verify replication ( file 0 , 0 , r archive ) ; } { / / test creating a hot file final path p = new path ( path policy map hot , " foo " ) ; d f s test util create file ( test dfs , p , block size , ( short ) 3 , 0l ) ; } { / / test move a cold file to warm final path file 1 = new path ( path policy map cold , " file 1 " ) ; test dfs rename ( file 1 , path policy map warm ) ; test migrate ( exit status success ) ; test verify ( true ) ; } } finally { test shutdown cluster ( ) ; } }


returns the files pointed to by the symlinks in the runfiles symlink farm this method is slow

public collection < artifact > get runfiles symlink targets ( ) { return get runfiles symlinks ( ) values ( ) ; }


this returns all columns known by this model , both visible and not seen

public list < table column > get all columns ( ) { return new array list < > ( complete list ) ; }


public integer get snake case ( ) { return snake case ; }


sorts java class names such that outer classes precede their inner classes and " package - info " precedes all other classes in its package

static int compare class names ( string a , string b ) { / / ensure inner classes sort second a = a replace ( ' $ ' , ' 0 ' ) ; b = b replace ( ' $ ' , ' 0 ' ) ; / * * assuming " package - info " only occurs at the end , ensures package - info * sorts first * / a = a replace ( " package - info " , " " ) ; b = b replace ( " package - info " , " " ) ; return a compare to ( b ) ; }


returns the mean play time between rebuffer events , in seconds this is equivalent to 1 0 { @ link # get rebuffer rate ( ) } note that this may return { @ link float # positive infinity }

public float get mean time between rebuffers ( ) { return 1f / get rebuffer rate ( ) ; }


the sibling column for this column if a normal column is included and the sibling is requested , then the sibling is included as well example : cat indices , requesting ` pri ` and wanting the ` cs ` columns ( which have a sibling , pri cs ) { @ code get catindices ? pri & h = cs & v } ss pri ss 2 9 0kb 2 9 0kb 2 3 0b 2 3 0b default : no sibling

public table column attribute builder set sibling ( string sibling ) { this sibling = sibling ; return this ; }


public jackson 2 object mapper builder features to disable ( object features to disable ) { for ( object feature : features to disable ) { this features put ( feature , boolean false ) ; } return this ; }


resolves the generated { @ link json adapter } fully qualified class name for a given { @ link json class json class - annotated } { @ code class name } this is the same lookup logic used by both the moshi code generation as well as lookup for any json class - annotated classes this can be useful if generating your own json adapters without using moshi ' s first party code gen

public static string generated json adapter name ( string class name ) { return class name replace ( " $ " , " " ) + " json adapter " ; }


gets service instance based on service type

public business service get business service ( service type service type ) { if ( service type equals ( service type ejb ) ) { return ejb service ; } else { return jms service ; } }


public result set get result set ( ) throws s q l exception { return new stub result set ( ) ; }