generic method to create an input { @ link data set } with in { @ link input format } the data set will not be immediately created - instead , this method returns a data set that will be lazily created from the input format once the program is executed since all data sets need specific information about their types , this method needs to determine the type of the data produced by the input format it will attempt to determine the data type by reflection , unless the input format implements the { @ link result type queryable } interface in the latter case , this method will invoke the { @ link result type queryable # get produced type ( ) } method to determine data type produced by the input format

public < x > data source < x > create input ( input format < x , ? > input format ) { if ( input format = = null ) { throw new illegal argument exception ( " input format must not be null " ) ; } try { return create input ( input format , type extractor get input format types ( input format ) ) ; } catch ( exception e ) { throw new invalid program exception ( " the type returned by the input format could not be automatically determined " + " please specify the type information of the produced type explicitly by using the " + " ' create input ( input format , type information ) ' method instead " , e ) ; } }


get the correct number of transactions since last edit log roll this method holds a lock of f s edit log and must not be used for metrics

private long get correct transactions since last log roll ( ) { if ( is in standby state ( ) | | ! get edit log ( ) is segment open ( ) ) { return 0 ; } else { return get edit log ( ) get last written tx id ( ) - get edit log ( ) get cur segment tx id ( ) + 1 ; } } @ metric ( { " last written transaction id " , " transaction id written to the edit log " }


calculates the final mask and value byte streams these streams can then be used to search through memory to look for similar assembly instructions

private mask value get final mask and value ( ) { list < byte [ ] > masks = new array list < > ( ) ; list < byte [ ] > values = new array list < > ( ) ; int total length = 0 ; for ( int i = 0 ; i < mnemonics size ( ) ; i + + ) { mask value result = build single instruction mask ( mnemonics get ( i ) ) ; byte [ ] mask = result get mask ( ) ; byte [ ] value = result get value ( ) ; if ( value length = = mask length ) { masks add ( mask ) ; values add ( value ) ; total length + = value length ; } } return combine instruction masks ( masks , values , total length ) ; }


call { @ link # create ( string , fs permission , enum set , boolean , short , long , progressable , int , checksum opt ) } with < code > create parent < code > set to true

public d f s output stream create ( string src , fs permission permission , enum set < create flag > flag , short replication , long block size , progressable progress , int buffersize , checksum opt checksum opt ) throws i o exception { return create ( src , permission , flag , true , replication , block size , progress , buffersize , checksum opt , null ) ; }


test to verify if signals coming from an intermediate throw - event trigger the right events to be dispatched

public void test activity signal events within process ( ) throws exception { process instance process instance = runtime service start process instance by key ( " signal process " ) ; assert that ( process instance ) 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 ( ) ; execution execution with signal event = runtime service create execution query ( ) activity id ( " ship order " ) single result ( ) ; task service complete ( task get id ( ) ) ; assert that ( listener get events received ( ) ) has size ( 1 ) ; assert that ( listener get events received ( ) get ( 0 ) ) is instance of ( activiti signal event class ) ; activiti signal event signal event = ( activiti signal event ) listener get events received ( ) get ( 0 ) ; assert that ( signal event get type ( ) ) is equal to ( activiti event type activity signaled ) ; assert that ( signal event get activity id ( ) ) is equal to ( " ship order " ) ; assert that ( signal event get execution id ( ) ) is equal to ( execution with signal event get id ( ) ) ; assert that ( signal event get process instance id ( ) ) is equal to ( execution with signal event get process instance id ( ) ) ; assert that ( signal event get process definition id ( ) ) is equal to ( process instance get process definition id ( ) ) ; assert that ( signal event get signal name ( ) ) is equal to ( " alert " ) ; assert that ( signal event get signal data ( ) ) is null ( ) ; }


explicitly update the dependency tree this method is called independently of stream state changes

void update dependency tree ( int child stream id , int parent stream id , short weight , boolean exclusive ) ;


enables and disables the rendering of html content in this renderer if enabled , this renderer will interpret html content when the text this renderer is showing begins with { @ code < html > }

public void set h t m l rendering enabled ( boolean enable ) { if ( renderer instanceof j component ) { ( ( j component ) renderer ) put client property ( g component html disable string , ! enable ) ; } super set h t m l rendering enabled ( enable ) ; }


set the ( optional ) specification file associated with this language

public void set spec file ( resource file spec file ) { this spec file = spec file ; }


the namespace uri of this element < code > optional string namespace uri = 2 ; < code >

private void set namespace uri ( java lang string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; namespace uri = value ; }


removes the items between the specified indices , inclusive

public void remove range ( int start , int end ) { int n = size ; if ( end > = n ) throw new index out of bounds exception ( " end can ' t be > = size : " + end + " > = " + size ) ; if ( start > end ) throw new index out of bounds exception ( " start can ' t be > end : " + start + " > " + end ) ; int count = end - start + 1 , last index = n - count ; if ( ordered ) system arraycopy ( items , start + count , items , start , n - ( start + count ) ) ; else { int i = math max ( last index , end + 1 ) ; system arraycopy ( items , i , items , start , n - i ) ; } size = n - count ; }


set the open domain object ( opened for update ) associated with a file note : caller is responsible for setting domain file on domain object after invoking this method if a domain object save as was done , the previous file association will be removed

synchronized void set domain object ( string pathname , domain object adapter doa ) { if ( open domain objects contains key ( pathname ) ) { throw new runtime exception ( " attempted to re - open domain object : " + pathname ) ; } domain file df = doa get domain file ( ) ; if ( df instanceof ghidra file ) { open domain objects remove ( df get pathname ( ) ) ; } open domain objects put ( pathname , doa ) ; }


returns the url of this task relative to the context root of the application when the user clicks an item in the queue , this is the page where the user is taken to hudson expects the current instance to be bound to the url returned by this method


allocate a buffer for output or writing it can prepare for two kinds of data buffers : one with position as 0 , the other with position > 0

protected byte buffer allocate output buffer ( int buffer len ) {


tells whether the input has text selected

public boolean is text selected ( ) { if ( hex edit control = = null ) return false ; long [ ] selection = hex edit control get selection ( ) ; return selection [ 0 ] ! = selection [ 1 ] ; }


gets called when an animation is looped the { @ link animation desc # loop count } is updated prior to this call and can be read or written to alter the number of remaining loops

void on loop ( final animation desc animation ) ;


deserializes an { @ link abstract ms type } from the { @ link pdb byte reader } and returns it

public abstract ms type parse ( pdb byte reader reader ) throws pdb exception , cancelled exception { abstract ms type result = parse ( reader , abstract ms type class ) ; return result ; }


returns the vertex at the given column index or null if there is no vertex at that column

public v get vertex ( int column ) { return vertices by column get ( column ) ; }


sets the permitted time for new connections to complete negotiation handshakes before being killed

public t handshake timeout ( long timeout , time unit unit ) { throw new unsupported operation exception ( ) ; }


configure client keys to use for authorization in an ssl session use null to reset to default

public api client set key managers ( key manager [ ] managers ) { this key managers = managers ; apply ssl settings ( ) ; return this ; }


finds the next zip file entry , by first invoking { @ link # next header from ( com google devtools build android ziputils directory entry ) } to find its header

public zip entry next from ( directory entry entry ) throws i o exception { int offset = entry = = null ? - 1 : entry get ( cenoff ) ; map entry < integer , directory entry > map entry = cdir map by offset ( ) higher entry ( offset ) ; if ( map entry = = null ) { return entry with ( null ) ; } local file header header = local header at ( map entry get key ( ) ) ; return entry with ( header , map entry get value ( ) ) ; }


create an ingest pipeline definition appropriate for the file structure

public static map < string , object > make ingest pipeline definition ( string grok pattern , map < string , string > custom grok pattern definitions , map < string , object > csv processor settings , map < string , object > mappings for conversions , string timestamp field , list < string > timestamp formats , boolean need client timezone , boolean need nanosecond precision ) { if ( grok pattern = = null & & csv processor settings = = null & & timestamp field = = null ) { return null ; } map < string , object > pipeline = new linked hash map < > ( ) ; pipeline put ( pipeline description key , " ingest pipeline created by file structure finder " ) ; list < map < string , object > > processors = new array list < > ( ) ; if ( grok pattern ! = null ) { map < string , object > grok processor settings = new linked hash map < > ( ) ; grok processor settings put ( " field " , " message " ) ; grok processor settings put ( " patterns " , collections singleton list ( grok pattern ) ) ; if ( custom grok pattern definitions is empty ( ) = = false ) { grok processor settings put ( " pattern definitions " , custom grok pattern definitions ) ; } processors add ( collections singleton map ( " grok " , grok processor settings ) ) ; } else { assert custom grok pattern definitions is empty ( ) ; } if ( csv processor settings ! = null ) { processors add ( collections singleton map ( " csv " , csv processor settings ) ) ; } if ( timestamp field ! = null ) { map < string , object > date processor settings = new linked hash map < > ( ) ; date processor settings put ( " field " , timestamp field ) ; if ( need client timezone ) { date processor settings put ( " timezone " , " { { " + beat timezone field + " } } " ) ; } date processor settings put ( " formats " , timestamp formats ) ; if ( need nanosecond precision ) { date processor settings put ( " output format " , nanosecond date output format ) ; } processors add ( collections singleton map ( " date " , date processor settings ) ) ; } for ( map entry < string , object > mapping : mappings for conversions entry set ( ) ) { string field name = mapping get key ( ) ; object values = mapping get value ( ) ; if ( values instanceof map ) { object type = ( ( map < ? , ? > ) values ) get ( mapping type setting ) ; if ( convertible types contains ( type ) ) { map < string , object > convert processor settings = new linked hash map < > ( ) ; convert processor settings put ( " field " , field name ) ; convert processor settings put ( " type " , type ) ; convert processor settings put ( " ignore missing " , true ) ; processors add ( collections singleton map ( " convert " , convert processor settings ) ) ; } } } / / this removes the unparsed message field for delimited formats ( unless the same field name is used for one of the columns ) if ( csv processor settings ! = null ) { object field = csv processor settings get ( " field " ) ; assert field ! = null ; object target fields = csv processor settings get ( " target fields " ) ; assert target fields instanceof list ; if ( ( ( list < ? > ) target fields ) contains ( field ) = = false ) { processors add ( collections singleton map ( " remove " , collections singleton map ( " field " , field ) ) ) ; } } / / this removes the interim timestamp field used for semi - structured text formats if ( grok pattern ! = null & & timestamp field ! = null ) { processors add ( collections singleton map ( " remove " , collections singleton map ( " field " , timestamp field ) ) ) ; } pipeline put ( pipeline processors key , processors ) ; return pipeline ; }


creates a { @ link jdbc statement builder } for { @ link row } using the provided sql types array uses { @ link jdbc utils # set record to statement }

static jdbc statement builder < row > create row jdbc statement builder ( int [ ] types ) { return ( st , record ) - > set record to statement ( st , types , record ) ; }


to test data is partitioned to the right partition with time characteristic : event time producer parallelism = 2 ; kafka partition # = 3 ; consumer parallelism = 3

public void test assigned to partition event time ( ) throws exception { test assigned to partition ( 100000 , event time ) ; }


get the location of pending job attempts

private static path get pending job attempts path ( path out ) { check not null ( out , " null ' out ' path " ) ; return new path ( out , temporary ) ; }


returns inputs to this action , including inputs that may be pruned

nested set < artifact > get possible inputs for testing ( ) ;


this test fails because there ' s no double for 9223372036854775808 , and our long parsing uses double parse double ( ) for fractional values

public void disabled test peek larger than long max value ( ) throws i o exception { json reader reader = new json reader ( reader ( " [ 9223372036854775808 ] " ) ) ; reader set lenient ( true ) ; reader begin array ( ) ; assert equals ( number , reader peek ( ) ) ; try { reader next long ( ) ; fail ( ) ; } catch ( number format exception e ) { } }


get the types of parameters for { @ link android content content values # put } need two parameters first is string type for key second is depend on field for value

protected class < ? > [ ] get parameter types ( field field , object field value , object [ ] parameters ) { class < ? > [ ] parameter types ; if ( is char type ( field ) ) { parameters [ 1 ] = string value of ( field value ) ; parameter types = new class [ ] { string class , string class } ; } else { if ( field get type ( ) is primitive ( ) ) { parameter types = new class [ ] { string class , get object type ( field get type ( ) ) } ; } else if ( " java util date " equals ( field get type ( ) get name ( ) ) ) { parameter types = new class [ ] { string class , long class } ; } else { parameter types = new class [ ] { string class , field get type ( ) } ; } } return parameter types ; }


private void register n n s m x bean ( ) { name node status bean name = m beans register ( " name node " , " name node status " , this ) ; }


checks whether the provided status includes the ` is last ` flag , marking this as the last result the consumer will receive

public static boolean is not last ( @ consumer status int status ) { return ! is last ( status ) ; }


gets maximum disk errors to tolerate before we fail this copy step

public long get max disk errors ( ) { return max disk errors ; }


sort nodes array by network distance to reader with secondary sort using network location this is used when the reader is not a datanode sorting the nodes based on network distance from the reader reduces network traffic and improves performance

public void sort by distance using network location ( node reader , node [ ] nodes , int active len ) { / * * this method is called if the reader is not a datanode , * so non data node reader flag is set to true * / sort by distance using network location ( reader , nodes , active len , null ) ; }


whether the given { @ linkplain method parameter method parameter } is supported by any registered { @ link handler method argument resolver }

public boolean supports parameter ( method parameter parameter ) { return get argument resolver ( parameter ) ! = null ; }


public void write ( data output out ) throws i o exception { out write long ( offset ) ; out write int ( size ) ; }


returns a new supplier which is the composition of the provided function and supplier in other words , the new supplier ' s value will be computed by retrieving the value from { @ code supplier } , and then applying { @ code function } to that value note that the resulting supplier will not call { @ code supplier } or invoke { @ code function } until it is called

public static < f , t > supplier < t > compose ( function < ? super f , t > function , supplier < f > supplier ) { return new supplier composition < > ( function , supplier ) ; }


returns whether all maps are empty ; used for checking for resource leaks in case entries aren ' t properly removed

boolean are all maps empty ( ) { return task executor to data sets is empty ( ) & & data set to task executors is empty ( ) & & data set meta info is empty ( ) & & partition release completion futures is empty ( ) ; }


a checker on whether the give class is eligible as an inner class by its class internal name note : the reliable source of truth is to check the inner classes attribute however , the attribute may have not been visited yet

public static boolean is eligible as inner class ( string class name ) { return class name contains ( " $ " ) ; }


this tests whether the rocks d b backends uses the temp directories that are provided from the { @ link environment } when no db storage path is set

public void test use temp directories ( ) throws exception { string checkpoint path = temp folder new folder ( ) to u r i ( ) to string ( ) ; rocks d b state backend rocks db backend = new rocks d b state backend ( checkpoint path ) ; file dir 1 = temp folder new folder ( ) ; file dir 2 = temp folder new folder ( ) ; assert null ( rocks db backend get db storage paths ( ) ) ; final mock environment env = get mock environment ( dir 1 , dir 2 ) ; rocks d b keyed state backend < integer > keyed backend = ( rocks d b keyed state backend < integer > ) rocks db backend create keyed state backend ( env , env get job i d ( ) , " test op " , int serializer instance , 1 , new key group range ( 0 , 0 ) , env get task kv state registry ( ) , ttl time provider default , new unregistered metrics group ( ) , collections empty list ( ) , new closeable registry ( ) ) ; try { file instance base path = keyed backend get instance base path ( ) ; assert that ( instance base path get absolute path ( ) , any of ( starts with ( dir 1 get absolute path ( ) ) , starts with ( dir 2 get absolute path ( ) ) ) ) ; } finally { i o utils close quietly ( keyed backend ) ; keyed backend dispose ( ) ; env close ( ) ; } }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 0 : / / success return success ; default : return null ; } }


creates a deep copy of the first state object in the given collection , or null if the collection is empy

private static < t extends state object > state object collection < t > deep copy ( state object collection < t > original ) { if ( original = = null | | original is empty ( ) ) { return state object collection empty ( ) ; } return new state object collection < > ( original stream ( ) map ( prioritized operator subtask state test : : deep copy ) collect ( collectors to list ( ) ) ) ; }


requests ads , if they have not already been requested must be called on the main thread ads will be requested automatically when the player is prepared if this method has not been called , so it is only necessary to call this method if you want to request ads before preparing the player

public void request ads ( @ nullable view group ad view group ) { request ads ( ad tag data spec , ad view group ) ; }


adds a new violation to this collector this also sets { @ code violation occurred } to { @ code true }

public void add violation ( string property name , integer index , string message , map < string , object > message parameters ) { violation occurred = true ; get context with message parameters ( message parameters ) build constraint violation with template ( sanitize template ( message ) ) add property node ( property name ) add bean node ( ) in iterable ( ) at index ( index ) add constraint violation ( ) ; }


starts auto - analysis on the specified program and performs complete analysis of the entire program this is usually only necessary if full analysis was never performed this method will block until analysis completes

public void analyze ( program program ) { analyze all ( program ) ; }


creates list of users with given input array

completion stage < response < void > > create users with list input ( @ retrofit 2 http body list < user > body ) ;


gets the { @ link graph display provider } with the given name

public graph display provider get graph display provider ( string name ) ;


returns the value nearest to { @ code value } which is within the closed range { @ code [ min max ] } if { @ code value } is within the range { @ code [ min max ] } , { @ code value } is returned unchanged if { @ code value } is less than { @ code min } , { @ code min } is returned , and if { @ code value } is greater than { @ code max } , { @ code max } is returned

public static int constrain to range ( int value , int min , int max ) { check argument ( min < = max , " min ( % s ) must be less than or equal to max ( % s ) " , min , max ) ; return math min ( math max ( value , min ) , max ) ; }


gets the current field panel coordinator used to synchronize scrolling between the left and right view for this code comparison panel

protected t get field panel coordinator ( ) { return field panel coordinator ; }


defined as the ratio between the width and the height of a node see < a href = " https : yogalayout comdocsaspect - ratio " > https : yogalayout comdocsaspect - ratio for more information

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


returns an ( optionally cached ) project file instance if there is no such file , or if the file cannot be parsed , then it throws an exception

project file get project file ( path working directory , list < root > package path , path fragment path , options parser options parser ) throws options parsing exception , interrupted exception ;


test { @ code map file writer append ( ) } with wrong key class

public void test reader with wrong value class ( ) { final string test method key = " test reader with wrong value class mapfile " ; map file writer writer = null ; try { writer = create writer ( test method key , int writable class , text class ) ; writer append ( new int writable ( 0 ) , new int writable ( 0 ) ) ; fail ( " no excepted exception in test reader with wrong key class ! ! ! " ) ; } catch ( i o exception ex ) { / * should be thrown to pass the test * / } finally { i o utils cleanup with logger ( log , writer ) ; } }


creates a computed column that is computed from the given sql expression

public static computed column computed ( string name , data type type , string expression ) { preconditions check not null ( name , " column name can not be null " ) ; preconditions check not null ( type , " column type can not be null " ) ; preconditions check not null ( expression , " column expression can not be null " ) ; return new computed column ( name , type , expression ) ; }


prepare data chunks for each data unit , by generating random data

protected e c chunk [ ] prepare data chunks for encoding ( ) { if ( using fixed data ) { e c chunk [ ] chunks = new e c chunk [ num data units ] ; for ( int i = 0 ; i < chunks length ; i + + ) { chunks [ i ] = make chunk using data ( fixed data [ i ] ) ; } return chunks ; } return generate data chunks ( ) ; }


disable profiling and complete profile file creation subsequent calls to begin taskend task will no longer be recorded in the profile

public synchronized void stop ( ) throws i o exception { if ( ! is active ( ) ) { return ; } collect action counts ( ) ; if ( cpu usage thread ! = null ) { cpu usage thread stop collecting ( ) ; try { cpu usage thread join ( ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; } cpu usage thread log collected data ( ) ; cpu usage thread = null ; } / / log a final event to update the duration of profile phase finish log event ( profiler task info , " finishing " ) ; file writer writer = writer ref get and set ( null ) ; if ( writer ! = null ) { writer shutdown ( ) ; writer = null ; } init histograms ( ) ; profile start time = 0l ; profile cpu start time = null ; for ( slowest task aggregator aggregator : slowest tasks ) { if ( aggregator ! = null ) { aggregator clear ( ) ; } } }


lets the referenced class accept the given visitor

public void referenced class accept ( class visitor class visitor ) { if ( referenced class ! = null & & referenced member = = null ) { referenced class accept ( class visitor ) ; } }


< code > optional string product = 2 ; < code >

public java lang string get product ( ) { return instance get product ( ) ; }


updates the corresponding record by id with content values returns the number of affected rows content values cv = new content values ( ) ; cv put ( & quot ; name & quot ; , & quot ; jim & quot ; ) ; lite pal update ( person class , cv , 1 ) ; this means that the name of record 1 will be updated into jim < br >

public static int update ( class < ? > model class , content values values , long id ) { return operator update ( model class , values , id ) ; }


updated user this can only be done by the logged in user

public void update user test ( ) throws exception { string username = cache get string ( " / update user / username " ) ; user body = cache get object ( " / update user / body " , user class ) ; api update user ( username , body ) ; }


searches through the datatype manager of the current program and returns an array of datatypes that match the specified name the datatype manager supports datatypes of the same name in different categories a zero - length array indicates that no datatypes with the specified name exist

public final data type [ ] get data types ( string name ) { array list < data type > list = new array list < > ( ) ; current program get data type manager ( ) find data types ( name , list ) ; data type [ ] dtarr = new data type [ list size ( ) ] ; list to array ( dtarr ) ; return dtarr ; }


model tests for additional properties any type

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


sets the interpolating value value of 0 0 will produce the transform same as scale type from value of 1 0 will produce the transform same as scale type to inbetween values will produce a transform that is a linear combination between the two

public void set value ( float value ) { m interpolating value = value ; }


variation of { @ link # get } that throws an informative exception if the attribute can ' t be resolved due to intrinsic contradictions in the configuration

private < t > t get and validate ( string attribute name , type < t > type ) throws validation exception { selector list < t > selector list = get selector list ( attribute name , type ) ; if ( selector list = = null ) { / / this is a normal attribute return super get ( attribute name , type ) ; } list < t > resolved list = new array list < > ( ) ; for ( selector < t > selector : selector list get selectors ( ) ) { config key and value < t > resolved path = resolve selector ( attribute name , selector ) ; if ( ! selector is value set ( resolved path config key ) ) { / / use the default we don ' t have access to the rule here , so pass null to / / attribute get value ( ) this has the result of making attributes with condition / / predicates ineligible for " none " values but no user - facing attributes should / / do that anyway , so that isn ' t a loss attribute attr = get attribute definition ( attribute name ) ; if ( attr is mandatory ( ) ) { throw new validation exception ( string format ( " mandatory attribute ' % s ' resolved to ' none ' after evaluating ' select ' " + " expression " , attribute name ) ) ; } verify verify ( attr get condition ( ) = = predicates < attribute map > always true ( ) ) ; @ suppress warnings ( " unchecked " ) t default value = ( t ) attr get default value ( null ) ; resolved list add ( default value ) ; } else { resolved list add ( resolved path value ) ; } } return resolved list size ( ) = = 1 ? resolved list get ( 0 ) : type concat ( resolved list ) ; }


return the configured default destination

public d get default destination ( ) { return this default destination ; }


return the first complete url from the open a p i specification

public static string get host ( open a p i open a p i , final map < string , string > user defined variables ) { if ( open a p i get servers ( ) ! = null & & open a p i get servers ( ) size ( ) > 0 ) { url url = get server u r l ( open a p i get servers ( ) get ( 0 ) , user defined variables ) ; return url ! = null ? sanitize url ( url to string ( ) ) : " " ; } return local host ; }


updates the tree props map with outputs from all { @ link on create tree prop } methods

protected tree props get tree props for children ( section context c , @ nullable tree props previous tree props ) { return previous tree props ; }


get the view type to associate with this model in the recyclerview for models that use a layout resource , the view type is simply the layout resource value by default if this returns 0 epoxy will assign a unique view type for this model at run time

protected int get view type ( ) { return get layout ( ) ; }


returns an immutable collection of all key - value pairs in the multimap

public immutable collection < entry < k , v > > entries ( ) { return ( immutable collection < entry < k , v > > ) super entries ( ) ; }


get the list of acceptable charsets , as specified by the { @ code accept - charset } header


public int get sequence index ( ) { return sequence index ; }


test that denied operation puts proper entry in audit log

public void test audit denied ( ) throws exception { final path file = new path ( fnames [ 0 ] ) ; file system userfs = d f s test util get file system as ( user group info , conf ) ; fs set permission ( file , new fs permission ( ( short ) 0600 ) ) ; fs set owner ( file , " root " , null ) ; setup audit logs ( ) ; try { userfs open ( file ) ; fail ( " open must not succeed " ) ; } catch ( access control exception e ) { system out println ( " got access denied , as expected " ) ; } verify audit logs ( false ) ; }


string login user ( @ param ( " username " ) string username , @ param ( " password " ) string password ) ;


find the { @ link streams metadata } s for a given store name and key this method will use the { @ link default stream partitioner } to locate the store if a custom partitioner has been used please use { @ link streams metadata state # get metadata with key ( string , object , stream partitioner ) } note : the key may not exist in the { @ link org apache kafka streams processor state store } , this method provides a way of finding which { @ link streams metadata } it would exist on

public synchronized < k > streams metadata get metadata with key ( final string store name , final k key , final serializer < k > key serializer ) { objects require non null ( key serializer , " key serializer can ' t be null " ) ; objects require non null ( store name , " store name can ' t be null " ) ; objects require non null ( key , " key can ' t be null " ) ; if ( ! is initialized ( ) ) { return streams metadata not available ; } if ( global stores contains ( store name ) ) { / / global stores are on every node if we don ' t have the host info / / for this host then just pick the first metadata if ( this host equals ( unknown host ) ) { return all metadata get ( 0 ) ; } return local metadata get ( ) ; } final source topics info source topics info = get source topics info ( store name ) ; if ( source topics info = = null ) { return null ; } return get streams metadata for key ( store name , key , new default stream partitioner < > ( key serializer , cluster metadata ) , source topics info ) ; }


creates an xml item this route creates an xml item

public void create xml item ( xml item xml item ) { }


public int get objects found ( ) { return objects found ; }


returns the unique identifier of this jenkins that has been historically used to identify this jenkins to the outside world this form of identifier is weak in that it can be impersonated by others see https : wiki jenkins - ci orgdisplay j e n k i n s instance + identity for more modern form of instance id that can be challenged and verified

public string get legacy instance id ( ) { return util get digest of ( get secret key ( ) ) ; }


get a proxy connection to a remote server

public static < t > t wait for proxy ( class < t > protocol , long client version , inet socket address addr , configuration conf , long conn timeout ) throws i o exception { return wait for protocol proxy ( protocol , client version , addr , conf , conn timeout ) get proxy ( ) ; }


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


returns length of the input source obtained at the opening time or - 1 if length cannot be determined returned value does not change during runtime if gif drawable is constructed from { @ link input stream } - 1 is always returned in case of byte array and { @ link byte buffer } length is always known in other cases length - 1 can be returned if length cannot be determined

public long get input source byte count ( ) { return m native info handle get source length ( ) ; }


updates the { @ link rule configured target builder } that is used for this rule gen rule implementations can override this method to enhance and update the builder without needing to entirely override the { @ link com google devtools build lib packages rule class configured target factory # create } method

protected rule configured target builder update builder ( rule configured target builder builder , rule context rule context , nested set < artifact > files to build ) { return builder ; }


this implementation supports pattern matching in unexpanded w a rs too

protected resource pattern resolver get resource pattern resolver ( ) { return new servlet context resource pattern resolver ( this ) ; }


public string get origin ( ) { return this headers get origin ( ) ; }


returns a filesystem instance the fileystem instance is wired for release at the completion of the current servlet request via the { @ link file system release filter } if a do - as user is specified , the current user must be a valid proxyuser , otherwise an < code > access control exception < code > will be thrown

private file system create file system ( user group information ugi ) throws i o exception , file system access exception { string hadoop user = ugi get short user name ( ) ; file system access fs access = http f s server web app get ( ) get ( file system access class ) ; configuration conf = http f s server web app get ( ) get ( file system access class ) get file system configuration ( ) ; file system fs = fs access create file system ( hadoop user , conf ) ; file system release filter set file system ( fs ) ; return fs ; }


set the deadline or the latest time by when the resource ( s ) must be allocated time expressed as utc

public abstract void set deadline ( long latest end time ) ;


@ test public void annotation is nested class ( ) throws exception { string source = java file builder ( " com squareup tacos " , type spec class builder ( " test component " ) add annotation ( class name get ( " dagger " , " component " ) ) add type ( type spec class builder ( " builder " ) add annotation ( class name get ( " dagger " , " component " , " builder " ) ) build ( ) ) build ( ) ) build ( ) to string ( ) ; assert that ( source ) is equal to ( " " + " package com squareup tacos ; \ n " + " \ n " + " import dagger component ; \ n " + " \ n " + " @ component \ n " + " class test component { \ n " + " @ component builder \ n " + " class builder { \ n " + " } \ n " + " } \ n " ) ; }


a utility method to format a time duration in nano seconds into a human understandable stirng

public static string nano time to string ( long t ) { if ( t < 0 ) return " err " ; if ( t = = 0 ) return " 0 " ; if ( t < 1000 ) { return t + " ns " ; } double us = ( double ) t / 1000 ; if ( us < 1000 ) { return string format ( " % 2fus " , us ) ; } double ms = us / 1000 ; if ( ms < 1000 ) { return string format ( " % 2fms " , ms ) ; } double ss = ms / 1000 ; if ( ss < 1000 ) { return string format ( " % 2fs " , ss ) ; } long mm = ( long ) ss / 60 ; ss - = mm * 60 ; long hh = mm / 60 ; mm - = hh * 60 ; long dd = hh / 24 ; hh - = dd * 24 ; if ( dd > 0 ) { return string format ( " % dd % dh " , dd , hh ) ; } if ( hh > 0 ) { return string format ( " % dh % dm " , hh , mm ) ; } if ( mm > 0 ) { return string format ( " % dm % 1fs " , mm , ss ) ; } return string format ( " % 2fs " , ss ) ;


checks if the encoded image is valid i e is not null , and is not closed

public static boolean is valid ( @ nullable encoded image encoded image ) { return encoded image ! = null & & encoded image is valid ( ) ; }


this implementation returns the hash code of the underlying bean definition

public int hash code ( ) { return this bean definition hash code ( ) ; }


returns a string representation of the multimap , generated by calling { @ code to string } on the map returned by { @ link multimap # as map }

public string to string ( ) { return as map ( ) to string ( ) ; }


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


reads the first line of this source as a string returns { @ code null } if this source is empty like { @ link buffered reader # read line ( ) } , this method considers a line to be a sequence of text that is terminated by ( but does not include ) one of { @ code \ r \ n } , { @ code \ r } or { @ code \ n } if the source ' s content does not end in a line termination sequence , it is treated as if it does

public @ nullable string read first line ( ) throws i o exception { closer closer = closer create ( ) ; try { buffered reader reader = closer register ( open buffered stream ( ) ) ; return reader read line ( ) ; } catch ( throwable e ) { throw closer rethrow ( e ) ; } finally { closer close ( ) ; } }


performs k - dop ( k - discrete oriented polytope ) culling using the bullet method { @ link bt dbvt # collide k d o p } finds all collision objects inside the camera frustum , each of which will trigger a callback to { @ link # on object visible ( bt collision object ) } the process of finding objects in frustum is accelerated by the broadphase dynamic bounding volume tree ( { @ link bt dbvt } )

public void perform k d o p culling ( bt dbvt broadphase broadphase , camera camera ) { set frustum planes ( camera frustum ) ; bt dbvt collide k d o p ( broadphase get set 1 ( ) get root ( ) , frustum normals , frustum offsets , num planes , collider ) ; bt dbvt collide k d o p ( broadphase get set 0 ( ) get root ( ) , frustum normals , frustum offsets , num planes , collider ) ; }


returns the default registry that loads providers via the java service loader mechanism

public static synchronized server registry get default registry ( ) { if ( instance = = null ) { list < server provider > provider list = service providers load all ( server provider class , collections < class < ? > > empty list ( ) , server provider class get class loader ( ) , new server priority accessor ( ) ) ; instance = new server registry ( ) ; for ( server provider provider : provider list ) { logger fine ( " service loader found " + provider ) ; if ( provider is available ( ) ) { instance add provider ( provider ) ; } } instance refresh providers ( ) ; } return instance ; }


default response entity < void > add pet ( pet body ) { return new response entity < > ( http status not implemented ) ; }


public void logout user ( ) { / / todo : implement }


clear all events that are still announced ; events not naturally closed by the expected event normally only occur if the build is aborted

private synchronized void clear announced events ( collection < build event id > dontclear ) { if ( announced events ! = null ) { / / create a copy of the identifiers to clear , as the post method / / will change the set of already announced events set < build event id > ids ; synchronized ( this ) { ids = sets difference ( announced events , posted events ) ; } for ( build event id id : ids ) { if ( ! dontclear contains ( id ) ) { post ( new aborted event ( id , get last abort reason ( ) , get abort reason details ( ) ) ) ; } } } }


public string get sc a e t h flow points ( ) { return sc a e t h flow points ; }


public void set left offset ( float left offset ) { this left offset = left offset ; }


set a size limit for each outbound message

void set max outbound message size ( int max size ) ;


the current implementation does not include dependency aggregation it includes retrieval of pre - aggregated links , usually made via zipkin - dependencies

static void aggregate dependencies ( elasticsearch storage storage , list < span > spans ) { aggregate links ( spans ) for each ( ( midnight , links ) - > internal for tests write dependency links ( storage , links , midnight ) ) ; }


determine if an exception is security - related we need to handle these exceptions differently than other i o exceptions they don ' t indicate a communication problem instead , they mean that there is some action the client needs to take , such as refetching block tokens , renewing encryption keys , etc

private static boolean is security exception ( i o exception ioe ) { return ( ioe instanceof invalid token ) | | ( ioe instanceof invalid encryption key exception ) | | ( ioe instanceof invalid block token exception ) | | ( ioe instanceof access control exception ) ; }


deprecated : get method by inspecting the { @ link percentiles config } returned from { @ link percentiles aggregation builder # percentiles config ( ) } instead

public percentiles method method ( ) { return percentiles config = = null ? null : percentiles config get method ( ) ; }


returns all the { @ link view property descriptor } s that can be potentially configured on this view returns both { @ link view property descriptor } s visible and invisible for user , see { @ link view # get visible property descriptors } to filter invisible one

public list < view property descriptor > get applicable property descriptors ( ) { list < view property descriptor > r = new array list < > ( ) ; for ( view property descriptor pd : view property all ( ) ) { if ( pd is enabled for ( this ) ) r add ( pd ) ; } return r ; }


deletes multiple topics and blocks until all topics got deleted

public void delete topics and wait ( final long timeout ms , final string topics ) throws interrupted exception { for ( final string topic : topics ) { try { brokers [ 0 ] delete topic ( topic ) ; } catch ( final unknown topic or partition exception ignored ) { } } if ( timeout ms > 0 ) { test utils wait for condition ( new topics deleted condition ( topics ) , timeout ms , " topics not deleted after " + timeout ms + " milli seconds " ) ; } }


resume the request execution by invoking the next interceptor in the chain or executing the request to the remote service

listenable future < client http response > execute async ( http request request , byte [ ] body ) throws i o exception ;


helper methods that tests for a variety of { @ link mono } decoding scenarios this methods invokes : { @ link # test decode to mono ( publisher , resolvable type , consumer , mime type , map ) } { @ link # test decode to mono error ( publisher , resolvable type , mime type , map ) } { @ link # test decode to mono cancel ( publisher , resolvable type , mime type , map ) } { @ link # test decode to mono empty ( resolvable type , mime type , map ) }

protected < t > void test decode to mono all ( publisher < data buffer > input , class < ? extends t > output class , consumer < step verifier first step < t > > step consumer ) { test decode to mono all ( input , resolvable type for class ( output class ) , step consumer , null , null ) ; }


return the additional ( undeclared ) property with the specified name

public map get additional property ( string key ) { if ( this additional properties = = null ) { return null ; } return this additional properties get ( key ) ; }


marks the given seq no as seen and advances the max seq no of this engine to at least that value

protected final void mark seq no as seen ( long seq no ) { local checkpoint tracker advance max seq no ( seq no ) ; }


test the property ' object with no declared props nullable '

public void object with no declared props nullable test ( ) { / / todo : test object with no declared props nullable }


return true if this enum arrays object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } enum arrays enum arrays = ( enum arrays ) o ; return objects equals ( this just symbol , enum arrays just symbol ) & & objects equals ( this array enum , enum arrays array enum ) ; }


returns an immutable sorted set containing the given elements sorted by the given { @ code comparator } when multiple elements are equivalent according to { @ code compare to ( ) } , only the first one specified is included despite the method name , this method attempts to avoid actually copying the data when it is safe to do so the exact circumstances under which a copy will or will not be performed are undocumented and subject to change this method is safe to use even when { @ code elements } is a synchronized or concurrent collection that is currently being modified by another thread

public static < e > immutable sorted set < e > copy of ( comparator < ? super e > comparator , collection < ? extends e > elements ) { return copy of ( comparator , ( iterable < ? extends e > ) elements ) ; }


obtains basic file statistics containing only file size if the input is a directory , then the size is the sum of all contained files

public file base statistics get statistics ( base statistics cached stats ) throws i o exception { final file base statistics cached file stats = cached stats instanceof file base statistics ? ( file base statistics ) cached stats : null ; try { return get file stats ( cached file stats , get file paths ( ) , new array list < > ( get file paths ( ) length ) ) ; } catch ( i o exception ioex ) { if ( log is warn enabled ( ) ) { log warn ( " could not determine statistics for paths ' " + arrays to string ( get file paths ( ) ) + " ' due to an io error : " + ioex get message ( ) ) ; } } catch ( throwable t ) { if ( log is error enabled ( ) ) { log error ( " unexpected problem while getting the file statistics for paths ' " + arrays to string ( get file paths ( ) ) + " ' : " + t get message ( ) , t ) ; } } / / no statistics available return null ; }


adds a hint that data should be represented using the given class when entering or leaving the table ecosystem a supported conversion class depends on the logical type and its nullability property please see the implementation of { @ link logical type # supports input conversion ( class ) } , { @ link logical type # supports output conversion ( class ) } , or the documentation for more information about supported conversions

t bridged to ( class < ? > new conversion class ) ;


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

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


returns an immutable map containing the given entries , with keys sorted by the provided comparator

public static < k , v > immutable sorted map < k , v > copy of ( iterable < ? extends entry < ? extends k , ? extends v > > entries , comparator < ? super k > comparator ) { return from entries ( check not null ( comparator ) , false , entries ) ; }


returns { @ code true } if the type has been applied

boolean is applied ( ) { return applied ; }


the src file is on the local disk add it to the filesystem at the given dst name del src indicates if the source should be removed

public void copy from local file ( boolean del src , path src , path dst ) throws i o exception { copy from local file ( del src , true , src , dst ) ; }


returns the value of the mapping with the specified key

public v get ( long key ) { entry < v > m ; int hash = ( int ) ( key ) ; int index = ( hash & 0x 7 f f f f f f f ) % element data length ; m = find non null key entry ( key , index , hash ) ; if ( m ! = null ) { return m value ; } return null ; }


send a { @ link android util log # verbose } log message and log the exception

void v ( string tag , string msg , throwable tr ) ;


guaranteed to throw an exception and leave the { @ code range set } unmodified

public void add all ( range set < c > other ) { throw new unsupported operation exception ( ) ; }


invoked when a probe operator factory indicates that it will not create any more operators , for any lifespan it is expected that this method will only be invoked after { @ link # probe operator factory closed ( lifespan ) } has been invoked for every known lifespan

public void probe operator factory closed for all lifespans ( ) { initialize if necessary ( ) ; internal join bridge data manager probe operator factory closed for all lifespans ( ) ; }


returns the path this out err uses to buffer stdout without marking the file as " accessed " the user must ensure that no other process is writing to the files at time of creation

public path fragment get output path fragment ( ) { return get file output stream ( ) get file unsafe ( ) as fragment ( ) ; }


scan { @ code uri } for a session id this is identified by scanning for " { code session } " and then extracting the next fragment of the url this means that both " { @ code sessionfoo } " and " { @ code wdhubsessionfoobar } " would both identify the session id as being " foo "

public static optional < string > get session id ( string uri ) { int session index = uri index of ( " / session / " ) ; if ( session index ! = - 1 ) { session index + = " / session / " length ( ) ; int next slash = uri index of ( " / " , session index ) ; if ( next slash ! = - 1 ) { return optional of ( uri substring ( session index , next slash ) ) ; } return optional of ( uri substring ( session index ) ) ; } return optional empty ( ) ; }


test { @ link array writable } constructor with null

public void test null argument ( ) { new array writable ( ( class < ? extends writable > ) null ) ; }


inserts the specified element at the tail of this queue , waiting for space to become available if the queue is full

public void put ( e e ) throws interrupted exception { if ( e = = null ) throw new null pointer exception ( ) ; final monitor monitor = this monitor ; monitor enter when ( not full ) ; try { insert ( e ) ; } finally { monitor leave ( ) ; } }


cleans the resources and closes the instance of datanode

public void tear down ( ) throws i o exception { if ( ! tear down done & & dn ! = null ) { try { dn shutdown ( ) ; } catch ( exception e ) { log error ( " cannot close : " , e ) ; } finally { file dir = new file ( data dir ) ; if ( dir exists ( ) ) assert assert true ( " cannot delete data - node dirs " , file util fully delete ( dir ) ) ; } tear down done = true ; } }


checks if the given http message should be considered as a last spdy frame

private static boolean is last ( http message http message ) { if ( http message instanceof full http message ) { full http message full message = ( full http message ) http message ; if ( full message trailing headers ( ) is empty ( ) & & ! full message content ( ) is readable ( ) ) { return true ; } } return false ; }


sets the image on which the filter should be applied

public void set image ( final bitmap bitmap ) { current bitmap = bitmap ; renderer set image bitmap ( bitmap , false ) ; request render ( ) ; }


compares a { @ link producer record } with the provided key and value and throws an { @ link assertion error } if the { @ code producer record } ' s key or value is not equal to the expected key or value

public static < k , v > void compare key value ( final producer record < k , v > record , final k expected key , final v expected value ) throws assertion error { objects require non null ( record ) ; final k record key = record key ( ) ; final v record value = record value ( ) ; final assertion error error = new assertion error ( " expected < " + expected key + " , " + expected value + " > " + " but was < " + record key + " , " + record value + " > " ) ; if ( record key ! = null ) { if ( ! record key equals ( expected key ) ) { throw error ; } } else if ( expected key ! = null ) { throw error ; } if ( record value ! = null ) { if ( ! record value equals ( expected value ) ) { throw error ; } } else if ( expected value ! = null ) { throw error ; } }


analyzes all uninstrumented class files found in the given jar the uninstrumented classes are named using the class uninstrumented suffix

private void analyze uninstrumented classes from jar ( analyzer analyzer , file jar , set < string > already instrumented classes ) throws i o exception { jar file jar file = new jar file ( jar ) ; enumeration < jar entry > jar file entries = jar file entries ( ) ; while ( jar file entries has more elements ( ) ) { jar entry jar entry = jar file entries next element ( ) ; string jar entry name = jar entry get name ( ) ; if ( jar entry name ends with ( " class uninstrumented " ) & & ! already instrumented classes contains ( jar entry name ) ) { analyzer analyze all ( jar file get input stream ( jar entry ) , jar entry name ) ; already instrumented classes add ( jar entry name ) ; } } }


returns geo coordinate validation method to use

public geo validation method get validation method ( ) { return this validation method ; }


remove the result program ' s listing model as a listener to the result program for domain object events

public void remove domain object listener ( ) { domain object listener listing model = ( domain object listener ) multi model get model ( result ) ; programs [ result ] remove listener ( listing model ) ; }


creates inet socket address from the given rpc address

private static inet socket address get inet socket address ( string rpc addr ) { string [ ] rpc addr arr = rpc addr split ( " : " ) ; int port = integer parse int ( rpc addr arr [ 1 ] ) ; string hostname = rpc addr arr [ 0 ] ; return new inet socket address ( hostname , port ) ; }


public a p itest group parameters request boolean group ( boolean boolean group ) { this boolean group = boolean group ; return this ; }


puts all the entries in the map to the builder

public builder < v type > put all ( map < integer , v type > map ) { for ( map entry < integer , v type > entry : map entry set ( ) ) { this map put ( entry get key ( ) , entry get value ( ) ) ; } return this ; }


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


add interval ; i e , add all integers from a to b to set if b & lt ; a , do nothing keep list in sorted order ( by left range value ) if overlap , combine ranges for example , if this is { 1 5 , 10 20 } , adding 6 7 yields { 1 5 , 6 7 , 10 20 } adding 4 8 yields { 1 8 , 10 20 }

public void add ( int a , int b ) { add ( interval of ( a , b ) ) ; }


return the list of nodes whose connection setup has timed out

public list < string > nodes with connection setup timeout ( long now ) { return connecting nodes stream ( ) filter ( id - > is connection setup timeout ( id , now ) ) collect ( collectors to list ( ) ) ; }


gets a string representation of a collection of resources

public static string to string ( collection < protos resource > resources ) { check not null ( resources ) ; return resources stream ( ) map ( utils : : to string ) collect ( collectors joining ( " ; " , " [ " , " ] " ) ) ; }


deprecated : change usages of this to { @ link # on emit } if you want to write a hook that handles each emitted command value or to { @ link # on success } if you want to write a hook that handles success of the command invoked after completion of { @ link hystrix command } execution that results in a response the response can come either from { @ link hystrix command # run ( ) } or { @ link hystrix command # get fallback ( ) }

public < t > t on complete ( hystrix command < t > command instance , t response ) { / / pass - thru by default return response ; }


public static string generate parent id ( state instance state instance ) { return state instance get machine instance id ( ) + domain constants seperator parent id + state instance get id ( ) ; }


returns a { @ link query profile breakdown } for a scoring query scoring queries ( e g those that are past the rewrite phase and are now being wrapped by create weight ( ) ) follow a recursive progression we can track the dependency tree by a simple stack the only hiccup is that the first scoring query will be identical to the last rewritten query , so we need to take special care to fix that

public pb get profile breakdown ( e query ) { int token = current token ; boolean stack empty = stack is empty ( ) ; / / if the stack is empty , we are a new root query if ( stack empty ) { / / we couldn ' t find a rewritten query to attach to , so just add it as a / / top - level root this is just a precaution : it really shouldn ' t happen / / we would only get here if a top - level query that never rewrites for some reason roots add ( token ) ; / / increment the token since we are adding a new node , but notably , do not / / update parent ( ) because this was added as a root current token + = 1 ; stack add ( token ) ; return add dependency node ( query , token ) ; } update parent ( token ) ; / / increment the token since we are adding a new node current token + = 1 ; stack add ( token ) ; return add dependency node ( query , token ) ; }


public object get object ( int column index , map < string , class < ? > > map ) throws s q l exception { return null ; }


return whether the encoding should be forced on responses

public boolean is force response encoding ( ) { return this force response encoding ; }


source line and column info < code > optional aapt pb source position source = 3 ; < code >

public builder merge source ( com android aapt resources source position value ) { copy on write ( ) ; instance merge source ( value ) ; return this ; }


private void complete ( response response , config future config future ) { if ( response ! = null & & response get value ( ) ! = null ) { object value = response get value ( ) ; if ( value instanceof get value ) { config future set result ( ( ( get value ) value ) get decoded value ( ) ) ; } else { config future set result ( value ) ; } } }


converts each scenario into test case parameters supports injecting { @ link loading cache } , { @ link cache } , { @ link cache context } , the { @ link concurrent map } { @ link cache # as map ( ) } view , { @ link policy eviction } , and { @ link policy expiration }

private static iterator < object [ ] > as test cases ( method test method , stream < map entry < cache context , cache < integer , integer > > > scenarios ) { parameter [ ] parameters = test method get parameters ( ) ; cache context [ ] stashed = new cache context [ 1 ] ; return scenarios map ( entry - > { cache context context = entry get key ( ) ; cache < integer , integer > cache = entry get value ( ) ; / / retain a strong reference to the context throughout the test execution so that the / / cache entries are not collected due to the test not accepting the context parameter stashed [ 0 ] = context ; object [ ] params = new object [ parameters length ] ; for ( int i = 0 ; i < params length ; i + + ) { class < ? > clazz = parameters [ i ] get type ( ) ; if ( clazz is assignable from ( cache context class ) ) { params [ i ] = context ; } else if ( clazz is assignable from ( caffeine class ) ) { params [ i ] = context caffeine ; } else if ( clazz is assignable from ( cache get class ( ) ) ) { params [ i ] = cache ; } else if ( ( context async cache ! = null ) & & clazz is assignable from ( context async cache get class ( ) ) ) { params [ i ] = context async cache ; } else if ( clazz is assignable from ( map class ) ) { params [ i ] = cache as map ( ) ; } else if ( clazz is assignable from ( policy eviction class ) ) { params [ i ] = cache policy ( ) eviction ( ) get ( ) ; } else if ( clazz is assignable from ( policy expiration class ) ) { params [ i ] = expiration policy ( parameters [ i ] , cache ) ; } else if ( clazz is assignable from ( policy var expiration class ) ) { params [ i ] = cache policy ( ) expire variably ( ) get ( ) ; } if ( params [ i ] = = null ) { check not null ( params [ i ] , " unknown parameter type : % s " , clazz ) ; } } return params ; } ) filter ( objects : : non null ) iterator ( ) ; }


splitting fully qualified kerberos name into parts

public static string [ ] split kerberos name ( string full name ) { return full name split ( " [ / @ ] " ) ; }


registers ( 4 listeners ) ( 2 synchronous modes ) ( 3 filter modes ) = 24 configurations for simplicity , an event is published and ignored if the listener is of the wrong type for a single event , it should be consumed by ( 2 filter ) ( 2 synchronous ) = 4 listeners where only 2 are synchronous

private void register all ( ) { list < cache entry listener < integer , integer > > listeners = arrays as list ( created listener , updated listener , removed listener , expired listener ) ; for ( cache entry listener < integer , integer > listener : listeners ) { for ( boolean synchronous : arrays as list ( true , false ) ) { dispatcher register ( new mutable cache entry listener configuration < > ( ( ) - > listener , null , false , synchronous ) ) ; dispatcher register ( new mutable cache entry listener configuration < > ( ( ) - > listener , ( ) - > allow filter , false , synchronous ) ) ; dispatcher register ( new mutable cache entry listener configuration < > ( ( ) - > listener , ( ) - > reject filter , false , synchronous ) ) ; } } }


writes a vector as a typed bytes sequence

public void write vector ( array list vector ) throws i o exception { write vector header ( vector size ( ) ) ; for ( object obj : vector ) { write ( obj ) ; } }


create a new acl entry with scope , type and name ( no permission )

public static acl entry acl entry ( acl entry scope scope , acl entry type type , string name ) { return new acl entry builder ( ) set scope ( scope ) set type ( type ) set name ( name ) build ( ) ; }


the size of the expected results , including potential null values

public int length ( ) { return array length ( ) ; }


returns the largest key in the set that is less than the given key returns - 1 if there are not keys less than the given key

public short get previous ( short key ) { if ( ( key < 0 ) | | ( key > max key ) ) { throw new index out of bounds exception ( ) ; } boolean found value = false ; short bestkey = 0 ; r b node node = root ; while ( node ! = null ) { if ( key < = node key ) { node = node left ; } else { found value = true ; bestkey = node key ; node = node right ; } } if ( found value ) { return bestkey ; } return - 1 ; }


test that a collection of strings are written out correctly to the local file system

public void test write strings file system ( ) throws i o exception { uri uri = tmp to u r i ( ) ; configuration conf = new configuration ( ) ; file system fs = file system get ( uri , conf ) ; path test path = new path ( new path ( uri ) , " writestrings out " ) ; collection < string > write = arrays as list ( " over " , " the " , " lazy " , " dog " ) ; file util write ( fs , test path , write , standard charsets utf 8 ) ; list < string > read = file utils read lines ( new file ( test path to uri ( ) ) , standard charsets utf 8 ) ; assert equals ( write , read ) ; }


copies all the bytes from one file to another copying is not an atomic operation - in the case of an io error , power loss , process termination , or other problems , { @ code to } may not be a complete copy of { @ code from } if you need to guard against those conditions , you should employ other file - level synchronization < b > warning : < b > if { @ code to } represents an existing file , that file will be overwritten with the contents of { @ code from } if { @ code to } and { @ code from } refer to the same file , the contents of that file will be deleted < b > { @ link java nio file path } equivalent : < b > { @ link java nio file files # copy ( java nio file path , java nio file path , java nio file copy option ) }

public static void copy ( file from , file to ) throws i o exception { check argument ( ! from equals ( to ) , " source % s and destination % s must be different " , from , to ) ; as byte source ( from ) copy to ( as byte sink ( to ) ) ; }


a sensible definition of { @ link # contains } in terms of { @ link # count } if you override { @ link # count } , you may wish to override { @ link # contains } to forward to this implementation

protected boolean standard contains ( @ nullable object object ) { return count ( object ) > 0 ; }


there is only intended to be a single instance of the null object , so the clone method returns itself

protected final object clone ( ) { return this ; }


public void test select for update ( ) { root context bind global lock flag ( ) ; jdbc template query for row set ( " select a name from user 0 a where a id = ? for update " , new object [ ] { 1 } ) ; }


performs a selection operation after an aggregate operation the field expressions cannot contain table functions and aggregations example : { @ code aggregate function agg func = new my aggregate function ( ) ; table env register function ( " agg func " , agg func ) ; table group by ( $ ( " key " ) ) aggregate ( call ( " agg func " , $ ( " a " ) , $ ( " b " ) ) as ( " f 0 " , " f 1 " , " f 2 " ) ) select ( $ ( " key " ) , $ ( " f 0 " ) , $ ( " f 1 " ) ) ; } scala example : { @ code val agg func = new my aggregate function table group by ( $ " key " ) aggregate ( agg func ( $ " a " , $ " b " ) as ( " f 0 " , " f 1 " , " f 2 " ) ) select ( $ " key " , $ " f 0 " , $ " f 1 " ) }


public run t get first build ( ) { sorted map < integer , ? extends run t > runs = get runs ( ) ; if ( runs is empty ( ) ) return null ; return runs get ( runs last key ( ) ) ; }


register requestsession scopes , a { @ link servlet context aware processor } , etc

protected void post process bean factory ( configurable listable bean factory bean factory ) { bean factory add bean post processor ( new servlet context aware processor ( this servlet context , this servlet config ) ) ; bean factory ignore dependency interface ( servlet context aware class ) ; bean factory ignore dependency interface ( servlet config aware class ) ; web application context utils register web application scopes ( bean factory , this servlet context ) ; web application context utils register environment beans ( bean factory , this servlet context , this servlet config ) ; }


writes a sequence of bytes to this channel from the given buffer

public int write ( byte buffer src ) throws i o exception { return socket channel write ( src ) ; }


used by all constructors to finish initialization of the object

private void initialize ( ) { text area set line wrap ( false ) ; this set autoscrolls ( true ) ; this set viewport view ( text area ) ; final j popup menu popup = new j popup menu ( ) ; j menu item menu copy = new j menu item ( " copy " ) ; menu copy set action command ( ( string ) transfer handler get copy action ( ) get value ( action name ) ) ; menu copy add action listener ( new copy action listener ( ) ) ; menu copy set accelerator ( key stroke get key stroke ( key event vk c , docking utils control key modifier mask ) ) ; popup add ( menu copy ) ; text area add mouse listener ( new mouse adapter ( ) { @ override public void mouse pressed ( mouse event e ) { maybe show popup ( e ) ; } @ override public void mouse released ( mouse event e ) { maybe show popup ( e ) ; } private void maybe show popup ( mouse event e ) { if ( e is popup trigger ( ) ) { popup show ( e get component ( ) , e get x ( ) , e get y ( ) ) ; } } } ) ; }


get the encryption mechanism from the value provided

public static s 3 a encryption methods get method ( string name ) throws i o exception { if ( string utils is blank ( name ) ) { return none ; } for ( s 3 a encryption methods v : values ( ) ) { if ( v get method ( ) equals ( name ) ) { return v ; } } throw new i o exception ( unknown algorithm + name ) ; }


return unicode name string offset relative to parent structure start

public long get name relative offset ( ) { if ( child size = = 0 ) { return 0 ; } return 6 ; }


returns the column at the given point and a known item in the receiver or null if no such column exists the point is in the coordinate system of the receiver

private grid column get column ( point point ) { check widget ( ) ; if ( point = = null ) { swt error ( swt error null argument ) ; return null ; } int x 2 = 0 ; if ( row header visible ) { if ( point x < = row header width ) { return null ; } x 2 + = row header width ; } int pinned columns width = get pinned columns width ( ) ; if ( pinned columns width > 0 & & point x < = pinned columns width + row header width ) { return get column with offset ( point , x 2 , true ) ; } x 2 + = pinned columns width ; x 2 - = get h scroll selection in pixels ( ) ; return get column with offset ( point , x 2 , false ) ; }


a variant of { @ link # set allowed origins ( string ) } that accepts flexible domain patterns , e g { @ code " https : domain 1 com " } furthermore it always sets the { @ code access - control - allow - origin } response header to the matched origin and never to { @ code " " } , nor to any other pattern

stomp web socket endpoint registration set allowed origin patterns ( string origin patterns ) ;


sets a single { @ code reserved word mappings } and returns a reference to this builder so that the methods can be chained together

public builder with reserved word mapping ( string key , string value ) { if ( this reserved word mappings = = null ) { this reserved word mappings = new hash map < > ( ) ; } this reserved word mappings put ( key , value ) ; return this ; }


private void end task ( ) { synchronized ( lock ) { int num running = - - running tasks ; if ( num running = = 0 ) { lock notify all ( ) ; } } }


moves the viewport up the number of rows specified if moving up puts he view above the bounds of the first - visible chunk , load a previous chunk

public void move viewport up ( int rows , boolean selection ) { / / do some object checking up front and exit if these aren ' t set if ( ! is state valid ( ) ) { return ; } / / calculate the position of the viewport if we were to move it up the number of / / rows given point new viewport pos = new point ( 0 , ( int ) viewport get view position ( ) get y ( ) - ( table get row height ( ) * rows ) ) ; / / save off the new viewport pos ; this will be our new location unless we need to / / adjust it by adding / removing new chunks save position = new viewport pos y ; / / if our proposed new viewport position is less than zero , then we need to add a new / / previous chunk ( unless we ' re already at the beginning of the file ) if ( new viewport pos y < 0 ) { try { / / read in a previous chunk and make sure we get some valid lines if we don ' t get / / any valid lines , then we must be moving to the top of the file so just move / / the viewport to the top list < string > read lines = reader read previous chunk ( ) ; if ( read lines size ( ) > 0 ) { / / we have valid rows , so add them to the table ( at the top , because we ' re / / reading a previous chunk ) ( ( f v table model ) table get model ( ) ) add rows to top ( read lines ) ; / / if adding that chunk just put us over the chunk limit we want to show , we / / have to remove one from the bottom , and adjust our viewport accordingly / / / / otherwise , just move our viewport down the corresponding number of rows / / we just added if ( model get size ( ) > model max visible chunks ) { chunk chunk = model remove ( model get size ( ) - 1 ) ; new viewport pos = new point ( 0 , new viewport pos y + ( table get row height ( ) * chunk lines in chunk ) ) ; save position = new viewport pos y ; ( ( f v table model ) table get model ( ) ) remove rows from bottom ( chunk lines in chunk ) ; } else { save position + = table get row height ( ) * read lines size ( ) ; } } else { move viewport to top ( ) ; if ( selection ) { update selection to viewport top ( ) ; } return ; } } catch ( i o exception e ) { msg error ( this , " error creating loading new chunk for viewport decrement " , e ) ; } } / / at this point we should have a valid new viewport position , so set it set position ( new point ( 0 , save position ) ) ; / / and if necessary , set new selection to encompass the top row that ' s in the viewport if ( selection ) { update selection to viewport top ( ) ; } }


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

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


returns true if the data contained in the { @ link byte provider provider } contains a coff archive file

public static boolean is match ( byte provider provider ) throws i o exception { return ( provider length ( ) > 2 ) & & coff archive constants magic equals ( new string ( provider read bytes ( 0 , coff archive constants magic len ) ) ) ; }


public test map red ( int range , int counts , configuration conf ) throws i o exception { this range = range ; this counts = counts ; this conf = conf ; }

public void test mapred ( ) throws exception { launch ( ) ; }


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


public void set minimum idle ( int min idle ) { if ( min idle < 0 ) { throw new illegal argument exception ( " minimum idle cannot be negative " ) ; } this min idle = min idle ; }


public void set debug ( boolean debug f ) { this debug = debug f ; }


creates an xml item this route creates an xml item

public void create xml item ( xml item xml item ) throws api exception { create xml item with http info ( xml item ) ; }


location to write api files you can use the api package ( ) as defined when the class is instantiated

public string api file folder ( ) { return output folder + file separator + api package ( ) replace ( ' ' , file separator char ) ; }


public void acquire lock failed ( branch session branch session 1 , branch session branch session 2 ) throws exception { lock manager lock manager = new file lock manager for test ( ) ; assertions assert true ( lock manager acquire lock ( branch session 1 ) ) ; assertions assert false ( lock manager acquire lock ( branch session 2 ) ) ; }


use the natural weight of each edge the metric assumes every edge is a { @ link g weighted edge } if not , you will likely encounter a { @ link class cast exception }

public static < v , e extends g edge < v > > g edge weight metric < e > natural metric ( ) { return ( g edge weight metric < e > ) natural metric ; }


public abstract string get process tree dump ( ) ;


test transition to active when namenode in safemode

public void test transition to active when safe mode ( ) throws exception { configuration config = new configuration ( ) ; config set boolean ( dfs ha nn not become active in safemode , true ) ; try ( mini d f s cluster mini cluster = new mini d f s cluster builder ( config , new file ( generic test utils get randomized temp path ( ) ) ) nn topology ( mini d f s n n topology simple h a topology ( ) ) num data nodes ( 1 ) build ( ) ) { mini cluster wait active ( ) ; mini cluster transition to standby ( 0 ) ; mini cluster transition to standby ( 1 ) ; name node namenode 0 = mini cluster get name node ( 0 ) ; name node namenode 1 = mini cluster get name node ( 1 ) ; name node adapter enter safe mode ( namenode 0 , false ) ; name node adapter enter safe mode ( namenode 1 , false ) ; lambda test utils intercept ( service failed exception class , " name node still not leave safemode " , ( ) - > mini cluster transition to active ( 0 ) ) ; } }


post storeorder : place an order for a pet

default mono < response entity < order > > place order ( mono < order > body , server web exchange exchange ) { mono < void > result = mono empty ( ) ; exchange get response ( ) set status code ( http status not implemented ) ; for ( media type media type : exchange get request ( ) get headers ( ) get accept ( ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " pet id \ " : 6 , \ " quantity \ " : 1 , \ " id \ " : 0 , \ " ship date \ " : \ " 2000 - 01 - 23t04 : 56 : 07 000 + 00 : 00 \ " , \ " complete \ " : false , \ " status \ " : \ " placed \ " } " ; result = api util get example response ( exchange , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < order > < id > 123456789 < / id > < pet id > 123456789 < / pet id > < quantity > 123 < / quantity > < ship date > 2000 - 01 - 23t04 : 56 : 07 000z < / ship date > < status > aeiou < / status > < complete > true < / complete > < / order > " ; result = api util get example response ( exchange , example string ) ; break ; } } return result then ( mono empty ( ) ) ; }


public remove mount table entry response proto remove mount table entry ( rpc controller controller , remove mount table entry request proto request ) throws service exception { try { remove mount table entry request req = new remove mount table entry request p b impl ( request ) ; remove mount table entry response response = server remove mount table entry ( req ) ; remove mount table entry response p b impl response p b = ( remove mount table entry response p b impl ) response ; return response p b get proto ( ) ; } catch ( i o exception e ) { throw new service exception ( e ) ; } }


get the directories where the namenode stores its edits

public collection < uri > get name edits dirs ( int nn index ) throws i o exception { return f s namesystem get namespace edits dirs ( get n n ( nn index ) conf ) ; }


< code > required string method name = 1 ; < code > name of the rpc method

public builder set method name ( java lang string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; method name = value ; on changed ( ) ; return this ; }


private void do copy ( set < task attempt i d > maps ) throws i o exception { iterator < task attempt i d > iter = maps iterator ( ) ; while ( iter has next ( ) ) { task attempt i d map = iter next ( ) ; log debug ( " local fetcher " + id + " going to fetch : " + map ) ; if ( copy map output ( map ) ) { / / successful copy remove this from our worklist iter remove ( ) ; } else { / / we got back a wait command ; go back to the outer loop / / and block for in memory merge break ; } } }


creates a new { @ link cli command } instance

public static cli command get instance ( command command ) { return command get instance ( ) ; }


wait for < code > check < code > to return true for each 1000 ms see also { @ link # wait for ( java util function supplier , int ) } and { @ link # wait for ( java util function supplier , int , int ) }

public void wait for ( supplier < boolean > check ) throws interrupted exception { wait for ( check , 1000 ) ; }


returns a run - time setting from diskbalancer like bandwidth

public disk balancer setting response proto get disk balancer setting ( rpc controller controller , disk balancer setting request proto request ) throws service exception { try { string val = impl get disk balancer setting ( request get key ( ) ) ; return disk balancer setting response proto new builder ( ) set value ( val ) build ( ) ; } catch ( exception e ) { throw new service exception ( e ) ; } }


build the { @ link url u r ls } from the specified { @ link service instance }

list < url > build ( service instance service instance ) ;


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


enter a parse tree produced by the { @ code null literal } labeled alternative in { @ link eql base parser # constant }

void enter null literal ( eql base parser null literal context ctx ) ;


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


returns true if the two f s r ls are the same , excluding any md5 values

public boolean is equivalent ( string fsrl str ) { if ( fsrl str = = null ) { return false ; } string s = to string ( ) ; return s equals ( fsrl str ) | | ( get m d 5 ( ) ! = null & & s starts with ( fsrl str ) & & s substring ( fsrl str length ( ) ) starts with ( " ? md5 = " ) & & s length ( ) = = fsrl str length ( ) + 37 ) | | ( get m d 5 ( ) = = null & & fsrl str starts with ( s ) & & fsrl str substring ( s length ( ) ) starts with ( " ? md5 = " ) & & fsrl str length ( ) = = s length ( ) + 37 ) ; }


put user { username } : updated user this can only be done by the logged in user

default response entity < void > update user ( @ api param ( value = " name that need to be deleted " , required = true ) @ path variable ( " username " ) string username , @ api param ( value = " updated user object " , required = true ) @ valid @ request body user body ) { return new response entity < > ( http status not implemented ) ; }


whether or not any results associated with this test were cached locally or remotely

public boolean is cached ( ) { return num cached > 0 ; }


get network interceptor to add it to the http client to track download progress for async requests

private interceptor get progress interceptor ( ) { return new interceptor ( ) { @ override public response intercept ( interceptor chain chain ) throws i o exception { final request request = chain request ( ) ; final response original response = chain proceed ( request ) ; if ( request tag ( ) instanceof api callback ) { final api callback callback = ( api callback ) request tag ( ) ; return original response new builder ( ) body ( new progress response body ( original response body ( ) , callback ) ) build ( ) ; } return original response ; } } ; }


public container < t > clip ( ) { set clip ( true ) ; return this ; }


set the sleep state of the body a sleeping body has very low cpu cost

public void set awake ( boolean flag ) { jni set awake ( addr , flag ) ; }


helper method to handle schedulabes with fixed fairshares returns the resources taken by fixed fairshare schedulables , and adds the remaining to the passed non fixed schedulables

private static long handle fixed fair shares ( collection < ? extends schedulable > schedulables , collection < schedulable > non fixed schedulables , boolean is steady share , string type ) { long total resource = 0 ; for ( schedulable sched : schedulables ) { long fixed share = get fair share if fixed ( sched , is steady share , type ) ; if ( fixed share < 0 ) { non fixed schedulables add ( sched ) ; } else { resource target ; if ( is steady share ) { target = ( ( f s queue ) sched ) get steady fair share ( ) ; } else { target = sched get fair share ( ) ; } target set resource value ( type , fixed share ) ; total resource = safe add ( total resource , fixed share ) ; } } return total resource ; }


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


get the { @ link feign request } from { @ link enhanced instance } , then create { @ link abstract span } and set host , port , kind , component , url from { @ link feign request } through the reflection of the way , set the http header of context data into { @ link feign request # headers }

public void before method ( enhanced instance obj inst , method method , object [ ] all arguments , class < ? > [ ] arguments types , method intercept result result ) throws throwable { request request = ( request ) all arguments [ 0 ] ; url url = new url ( request url ( ) ) ; context carrier context carrier = new context carrier ( ) ; int port = url get port ( ) = = - 1 ? 80 : url get port ( ) ; string remote peer = url get host ( ) + " : " + port ; string operation name = url get path ( ) ; feign resolved u r l feign resolved u r l = path var interceptor url context get ( ) ; if ( feign resolved u r l ! = null ) { try { operation name = operation name replace ( feign resolved u r l get url ( ) , feign resolved u r l get origin url ( ) ) ; } finally { path var interceptor url context remove ( ) ; } } if ( operation name length ( ) = = 0 ) { operation name = " / " ; } abstract span span = context manager create exit span ( operation name , context carrier , remote peer ) ; span set component ( components define feign ) ; tags http method set ( span , request method ( ) ) ; tags url set ( span , request url ( ) ) ; span layer as http ( span ) ; if ( feign plugin config plugin feign collect request body ) { boolean need collect http body = false ; iterator < string > string iterator = values or empty ( request headers ( ) , content type header ) iterator ( ) ; string content type header value = string iterator has next ( ) ? string iterator next ( ) : " " ; for ( string content type : feign plugin config plugin feign supported content types prefix split ( " , " ) ) { if ( content type header value starts with ( content type ) ) { need collect http body = true ; break ; } } if ( need collect http body ) { collect http body ( request , span ) ; } } field headers field = request class get declared field ( " headers " ) ; headers field set accessible ( true ) ; map < string , collection < string > > headers = new linked hash map < string , collection < string > > ( ) ; carrier item next = context carrier items ( ) ; while ( next has next ( ) ) { next = next next ( ) ; list < string > context collection = new array list < string > ( 1 ) ; context collection add ( next get head value ( ) ) ; headers put ( next get head key ( ) , context collection ) ; } headers put all ( request headers ( ) ) ; headers field set ( request , collections unmodifiable map ( headers ) ) ; }


assert the response status code is in the 2xx range

public web test client response spec is 2xx successful ( ) { return assert series and return ( http status series successful ) ; }


returns true if this section is writable

public boolean is writable ( ) { return header get load adapter ( ) is section writable ( this ) ; }


public static string int to ipv 4 string ( int i ) { return new string builder ( 15 ) append ( ( i > > 24 ) & 0xff ) append ( ' ' ) append ( ( i > > 16 ) & 0xff ) append ( ' ' ) append ( ( i > > 8 ) & 0xff ) append ( ' ' ) append ( i & 0xff ) to string ( ) ; }


delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors

public void delete order test ( ) throws api exception { string order id = null ; completable future < void > response = api delete order ( order id ) ; / / todo : test validations }


for name node , verify that the current andor previous exist as indicated by the method parameters if previous exists , verify that it hasn ' t been modified by comparing the checksum of all it ' s containing files with their original checksum it is assumed that the server has recovered

void check result name node ( string [ ] base dirs , boolean current should exist , boolean previous should exist ) throws i o exception { if ( current should exist ) { for ( int i = 0 ; i < base dirs length ; i + + ) { assert true ( new file ( base dirs [ i ] , " current " ) is directory ( ) ) ; assert true ( new file ( base dirs [ i ] , " current / version " ) is file ( ) ) ; assert not null ( f s image test util find newest image file ( base dirs [ i ] + " / current " ) ) ; assert true ( new file ( base dirs [ i ] , " current / seen txid " ) is file ( ) ) ; } } if ( previous should exist ) { for ( int i = 0 ; i < base dirs length ; i + + ) { assert true ( new file ( base dirs [ i ] , " previous " ) is directory ( ) ) ; assert equals ( upgrade utilities checksum contents ( name node , new file ( base dirs [ i ] , " previous " ) , false ) , upgrade utilities checksum master name node contents ( ) ) ; } } }


gets the task ids allocated for the given component id the task ids are always returned in ascending order

public list < integer > get component tasks ( string component id ) { list < integer > ret = component to tasks get ( component id ) ; if ( ret = = null ) return new array list < integer > ( ) ; else return new array list < integer > ( ret ) ; }


public static void build ( mesh part builder builder , float width , float height , float inner width , float inner height , int divisions , vector 3 center , vector 3 normal ) { build ( builder , width , height , inner width , inner height , divisions , center x , center y , center z , normal x , normal y , normal z , 0f , 3 6 0f ) ; }


get the aggregate of all the fulfilled reservations count

public long get aggregate ful filled reservations count ( ) { return get aggregate operation count ( operation fulfilled reservation ) ; }


handles failed extraction of an authentication token this can happen in a few different scenarios : this is an initial request from a client without preemptive authentication , so we must return an authentication challenge this is a request that contained an authorization header that we can ' t validate this is a request made internally within a node and there is a fallback user , which is typically the { @ link system user } anonymous access is enabled and this will be considered an anonymous request regardless of the scenario , this method will call the listener with either failure or success

void handle null token ( ) { list < realm > unlicensed realms = realms get unlicensed realms ( ) ; if ( unlicensed realms is empty ( ) = = false ) { logger warn ( " no authentication credential could be extracted using realms [ { } ] " + " realms [ { } ] were skipped because they are not permitted on the current license " , strings collection to comma delimited string ( default ordered realm list ) , strings collection to comma delimited string ( unlicensed realms ) ) ; } final authentication authentication ; if ( fallback user ! = null ) { logger trace ( " no valid credentials found in request [ { } ] , using fallback [ { } ] " , request , fallback user principal ( ) ) ; realm ref authenticated by = new realm ref ( " fallback " , " fallback " , node name ) ; authentication = new authentication ( fallback user , authenticated by , null , version current , authentication type internal , collections empty map ( ) ) ; } else if ( fallback to anonymous ) { logger trace ( " no valid credentials found in request [ { } ] , using anonymous [ { } ] " , request , anonymous user principal ( ) ) ; realm ref authenticated by = new realm ref ( " anonymous " , " anonymous " , node name ) ; authentication = new authentication ( anonymous user , authenticated by , null , version current , authentication type anonymous , collections empty map ( ) ) ; } else { authentication = null ; } runnable action ; if ( authentication ! = null ) { action = ( ) - > write auth to context ( authentication ) ; } else { action = ( ) - > { logger debug ( " no valid credentials found in request [ { } ] , rejecting " , request ) ; listener on failure ( request anonymous access denied ( ) ) ; } ; } / / we assign the listener call to an action to avoid calling the listener within a try block and auditing the wrong thing when / / an exception bubbles up even after successful authentication action run ( ) ; }


http : gbiv comprotocolsurirfcrfc 3 9 8 6 html # relative - normal

public void test rfc 3 9 8 6 normal ( ) { assert equals ( " / a / b / c / g " , simplify path ( " / a / b / c / g " ) ) ; assert equals ( " / a / b / c / g " , simplify path ( " / a / b / c / / g " ) ) ; assert equals ( " / a / b / c / g " , simplify path ( " / a / b / c / g / " ) ) ; assert equals ( " / a / b / c / g ? y " , simplify path ( " / a / b / c / g ? y " ) ) ; assert equals ( " / a / b / c / g # s " , simplify path ( " / a / b / c / g # s " ) ) ; assert equals ( " / a / b / c / g ? y # s " , simplify path ( " / a / b / c / g ? y # s " ) ) ; assert equals ( " / a / b / c / ; x " , simplify path ( " / a / b / c / ; x " ) ) ; assert equals ( " / a / b / c / g ; x " , simplify path ( " / a / b / c / g ; x " ) ) ; assert equals ( " / a / b / c / g ; x ? y # s " , simplify path ( " / a / b / c / g ; x ? y # s " ) ) ; assert equals ( " / a / b / c " , simplify path ( " / a / b / c / " ) ) ; assert equals ( " / a / b / c " , simplify path ( " / a / b / c / / " ) ) ; assert equals ( " / a / b " , simplify path ( " / a / b / c / " ) ) ; assert equals ( " / a / b " , simplify path ( " / a / b / c / / " ) ) ; assert equals ( " / a / b / g " , simplify path ( " / a / b / c / / g " ) ) ; assert equals ( " / a " , simplify path ( " / a / b / c / / " ) ) ; assert equals ( " / a " , simplify path ( " / a / b / c / / / " ) ) ; assert equals ( " / a / g " , simplify path ( " / a / b / c / / / g " ) ) ; }


to test the collection format in query parameters < b > 200 < b > - success

public void test query parameter collection format ( list < string > pipe , list < string > ioutil , list < string > http , list < string > url , list < string > context ) throws rest client exception { test query parameter collection format with http info ( pipe , ioutil , http , url , context ) ; }


waits until the given latch has { @ linkplain count down latch # count down counted down } to zero , invoking the garbage collector as necessary to try to ensure that this will happen

public static void await ( count down latch latch ) { if ( latch get count ( ) = = 0 ) { return ; } final long timeout seconds = timeout seconds ( ) ; final long deadline = system nano time ( ) + seconds to nanos ( timeout seconds ) ; do { system run finalization ( ) ; if ( latch get count ( ) = = 0 ) { return ; } system gc ( ) ; try { if ( latch await ( 1l , seconds ) ) { return ; } } catch ( interrupted exception ie ) { throw new runtime exception ( " unexpected interrupt while waiting for latch " , ie ) ; } } while ( system nano time ( ) - deadline < 0 ) ; throw format runtime exception ( " latch failed to count down within % d second timeout " , timeout seconds ) ; }


set the fetch first rows variable string ( e g { @ code " # { fetch first rows } " } )

public t fetch first rows only ( string variable ) { sql ( ) limit = variable ; sql ( ) limiting rows strategy = s q l statement limiting rows strategy iso ; return get self ( ) ; }


iterates over the specified area of this buffer with the specified { @ code processor } in ascending order ( i e { @ code index } , { @ code ( index + 1 ) } , { @ code ( index + length - 1 ) } )

public int for each byte ( int index , int length , byte processor visitor ) throws exception { if ( is out of bounds ( index , length , length ( ) ) ) { throw new index out of bounds exception ( " expected : " + " 0 < = index ( " + index + " ) < = start + length ( " + length + " ) < = " + " length ( " + length ( ) + ' ) ' ) ; } return for each byte 0 ( index , length , visitor ) ; }


return the minimum count of documents that buckets need to have in order to be included in the response

public long min doc count ( ) { return min doc count ; }


public int get min decode interval ms ( ) { return m min decode interval ms ; }


a timeout to wait if the index operation can ' t be performed immediately defaults to { @ code 1m }

public final bulk request builder set timeout ( string timeout ) { request timeout ( timeout ) ; return this ; }


sets whether animation position is saved in { @ link # on save instance state ( ) } and restored in { @ link # on restore instance state ( parcelable ) }

public void set freezes animation ( boolean freezes animation ) { m freezes animation = freezes animation ; }


add a context to the cache and return it if the context already exists , return that one instead and do not add a new context to the cache protect shared cache from unsafe thread access

public prediction context add ( prediction context ctx ) { if ( ctx = = prediction context empty ) return prediction context empty ; prediction context existing = cache get ( ctx ) ; if ( existing ! = null ) { / / system out println ( name + " reuses " + existing ) ; return existing ; } cache put ( ctx , ctx ) ; return ctx ; }


graph exploration can be set to timeout after the given period search operations involved in each hop are limited to the remaining time available but can still overrun due to the nature of their " best efforts " timeout support when a timeout occurs partial results are returned

public graph explore request timeout ( time value timeout ) { if ( timeout = = null ) { throw new illegal argument exception ( " timeout must not be null " ) ; } this timeout = timeout ; return this ; }


check the field is a non primitive field or not

private boolean is non primitive ( field field ) { return ! field get type ( ) is primitive ( ) ; }


private void dispose node list ( buffer node head ) { buffer node node = head next in checkpoint ; while ( node id ! = tail ) { buffer node next node = node next in checkpoint ; dispose node ( node , false ) ; node = next node ; } }