unwrap the source behind this error : possibly an { @ link exception } ( typically { @ link org springframework beans property access exception } ) or a bean validation { @ link javax validation constraint violation } the cause of the outermost exception will be introspected as well , e g the underlying conversion exception or exception thrown from a setter ( instead of having to unwrap the { @ code property access exception } in turn )

public < t > t unwrap ( class < t > source type ) { if ( source type is instance ( this source ) ) { return source type cast ( this source ) ; } else if ( this source instanceof throwable ) { throwable cause = ( ( throwable ) this source ) get cause ( ) ; if ( source type is instance ( cause ) ) { return source type cast ( cause ) ; } } throw new illegal argument exception ( " no source object of the given type available : " + source type ) ; }


parse the dense vector from a formatted string the format of a dense vector is space separated values such as " 1 2 3 4 "

public static dense vector parse dense ( string str ) { if ( org apache flink util string utils is null or whitespace only ( str ) ) { return new dense vector ( ) ; } int len = str length ( ) ; int in data buff pos = 0 ; boolean is in buff = false ; for ( int i = 0 ; i < len ; + + i ) { char c = str char at ( i ) ; if ( c = = element delimiter / / to be compatible with previous delimiter | | c = = ' , ' ) { if ( is in buff ) { in data buff pos + + ; } is in buff = false ; } else { is in buff = true ; } } if ( is in buff ) { in data buff pos + + ; } double [ ] data = new double [ in data buff pos ] ; int lastest in char buff pos = 0 ; in data buff pos = 0 ; is in buff = false ; for ( int i = 0 ; i < len ; + + i ) { char c = str char at ( i ) ; if ( c = = element delimiter ) { if ( is in buff ) { data [ in data buff pos + + ] = double parse double ( string utils substring ( str , lastest in char buff pos , i ) trim ( ) ) ; lastest in char buff pos = i + 1 ; } is in buff = false ; } else { is in buff = true ; } } if ( is in buff ) { data [ in data buff pos ] = double value of ( string utils substring ( str , lastest in char buff pos ) trim ( ) ) ; } return new dense vector ( data ) ; }


assert whether the cookie must be http only

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


create a test { @ link class loader } that disable the use of the index , even if resources are present at the standard location

public static class loader disable index ( class loader class loader ) { return new candidate components test class loader ( class loader , collections enumeration ( collections empty list ( ) ) ) ; }


we use a fairly generic error message here the motivation is to share the same message for both bind time errors : < code > guice create injector ( new abstract module ( ) { public void configure ( ) { bind ( runnable class ) ; } } < code > and at provide - time errors : < code > guice create injector ( ) get instance ( runnable class ) ; < code > otherwise we need to know who ' s calling when resolving a just - in - time binding , which makes things unnecessarily complex

public errors missing implementation ( key key ) { return add message ( " no implementation for % s was bound " , key ) ; }


returns a copy of the model ' s current field selection

public field selection get selection ( ) { return new field selection ( this selection ) ; }


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


set the number of results cached , locally or remotely

public builder set num cached ( int num cached ) { check mutation ( ) ; summary num cached = num cached ; return this ; }


set a parameter value if parameter space is expanded to accommodate this parameter , all allocated parameters will be initialized to - 1

void set ( int parm , int value ) throws i o exception { data buffer buffer = buffer mgr get buffer ( 0 ) ; try { store parm ( parm , value , buffer ) ; if ( parm > = size ) { / / initialize unused parameters parameter space for ( int i = size ; i < parm ; i + + ) { cache put ( i , 0 ) ; } size = parm + 1 ; } cache put ( parm , value ) ; } finally { buffer mgr release buffer ( buffer ) ; } }


quick validation on the input to check some obvious fail conditions ( fail fast ) the input and returns the appropriate { @ link plan } associated with the specified { @ link queue } or throws an exception message illustrating the details of any validation check failures

public plan validate reservation update request ( reservation system reservation system , reservation update request request ) throws yarn exception { reservation id reservation id = request get reservation id ( ) ; plan plan = validate reservation ( reservation system , reservation id , audit constants update reservation request ) ; validate reservation definition ( reservation id , request get reservation definition ( ) , plan , audit constants update reservation request ) ; return plan ; }


the default implementation is empty can be overridden by subclasses as necessary

public void after test method ( test context test context ) throws exception { / * no - op * / }


sets rotation options for the image , whether to rotate by a multiple of 90 degrees , use the exif metadata ( relevant to j p e gs only ) or to not rotate this also specifies whether the rotation should be left until the bitmap is rendered ( as the gpu can do this more efficiently than the effort to change the bitmap object )

public image request builder set rotation options ( @ nullable rotation options rotation options ) { m rotation options = rotation options ; return this ; }


test that rounded values are always greater or equal to last rounded value if date is increasing the example covers an interval around 2011 - 10 - 30t02 : 10 : 00 + 01 : 00 , time zone cet , interval : 2 7 0 0 0 0 0ms

public void test interval rounding monotonic cet ( ) { long interval = time unit minutes to millis ( 45 ) ; zone id tz = zone id of ( " cet " ) ; rounding rounding = new rounding time interval rounding ( interval , tz ) ; list < tuple < string , string > > expected dates = new array list < > ( ) ; / / first date is the date to be rounded , second the expected result expected dates add ( new tuple < > ( " 2011 - 10 - 30t01 : 40 : 00 000 + 02 : 00 " , " 2011 - 10 - 30t01 : 30 : 00 000 + 02 : 00 " ) ) ; expected dates add ( new tuple < > ( " 2011 - 10 - 30t02 : 02 : 30 000 + 02 : 00 " , " 2011 - 10 - 30t01 : 30 : 00 000 + 02 : 00 " ) ) ; expected dates add ( new tuple < > ( " 2011 - 10 - 30t02 : 25 : 00 000 + 02 : 00 " , " 2011 - 10 - 30t02 : 15 : 00 000 + 02 : 00 " ) ) ; expected dates add ( new tuple < > ( " 2011 - 10 - 30t02 : 47 : 30 000 + 02 : 00 " , " 2011 - 10 - 30t02 : 15 : 00 000 + 02 : 00 " ) ) ; expected dates add ( new tuple < > ( " 2011 - 10 - 30t02 : 10 : 00 000 + 01 : 00 " , " 2011 - 10 - 30t02 : 15 : 00 000 + 02 : 00 " ) ) ; expected dates add ( new tuple < > ( " 2011 - 10 - 30t02 : 32 : 30 000 + 01 : 00 " , " 2011 - 10 - 30t02 : 15 : 00 000 + 01 : 00 " ) ) ; expected dates add ( new tuple < > ( " 2011 - 10 - 30t02 : 55 : 00 000 + 01 : 00 " , " 2011 - 10 - 30t02 : 15 : 00 000 + 01 : 00 " ) ) ; expected dates add ( new tuple < > ( " 2011 - 10 - 30t03 : 17 : 30 000 + 01 : 00 " , " 2011 - 10 - 30t03 : 00 : 00 000 + 01 : 00 " ) ) ; long previous date = long min value ; for ( tuple < string , string > dates : expected dates ) { final long rounded date = rounding round ( time ( dates v 1 ( ) ) ) ; assert that ( dates to string ( ) , rounded date , is date ( time ( dates v 2 ( ) ) , tz ) ) ; assert that ( dates to string ( ) , rounded date , greater than or equal to ( previous date ) ) ; previous date = rounded date ; } / / here ' s what this means for interval widths assert equals ( time unit minutes to millis ( 45 ) , time ( " 2011 - 10 - 30t02 : 15 : 00 000 + 02 : 00 " ) - time ( " 2011 - 10 - 30t01 : 30 : 00 000 + 02 : 00 " ) ) ; assert equals ( time unit minutes to millis ( 60 ) , time ( " 2011 - 10 - 30t02 : 15 : 00 000 + 01 : 00 " ) - time ( " 2011 - 10 - 30t02 : 15 : 00 000 + 02 : 00 " ) ) ; assert equals ( time unit minutes to millis ( 45 ) , time ( " 2011 - 10 - 30t03 : 00 : 00 000 + 01 : 00 " ) - time ( " 2011 - 10 - 30t02 : 15 : 00 000 + 01 : 00 " ) ) ; }


gets all the project tags currently held in memory

public map < string , integer > get all project tags ( ) { return projects tags ; }


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


closes all state maintained by the mesos services implementation

void close ( boolean cleanup ) throws exception ;


get a { @ link sequence mining params } object populated with values from the dialog

public sequence mining params get sequence mining params ( ) { string percentage string = percentage box get text ( ) ; double parsed percentage ; try { parsed percentage = double parse double ( percentage string ) ; preferences set property ( percentage property , double to string ( parsed percentage ) ) ; } catch ( number format exception e ) { parsed percentage = double parse double ( default percentage ) ; } if ( parsed percentage < = 0 0 | | parsed percentage > = 100 0 ) { parsed percentage = double parse double ( default percentage ) ; } string min fixed bits string = min fixed bits box get text ( ) ; int parsed min fixed bits ; try { parsed min fixed bits = integer parse int ( min fixed bits string ) ; preferences set property ( min fixed bits property , integer to string ( parsed min fixed bits ) ) ; } catch ( number format exception e ) { parsed min fixed bits = integer parse int ( default min fixed bits ) ; } if ( parsed min fixed bits < 0 ) { parsed min fixed bits = integer parse int ( default min fixed bits ) ; } boolean use binary = false ; if ( b group get selection ( ) get mnemonic ( ) = = binary mnemonic ) { use binary = true ; preferences set property ( binary sequences property , boolean to string ( true ) ) ; } else { preferences set property ( binary sequences property , boolean to string ( false ) ) ; } preferences store ( ) ; return new sequence mining params ( parsed percentage / 100 0 , parsed min fixed bits , use binary ) ; }


synchronized void status update ( task status status ) { set progress ( status get progress ( ) ) ; this run state = status get run state ( ) ; set state string ( status get state string ( ) ) ; this next record range = status get next record range ( ) ; set diagnostic info ( status get diagnostic info ( ) ) ; if ( status get start time ( ) > 0 ) { this set start time ( status get start time ( ) ) ; } if ( status get finish time ( ) > 0 ) { this set finish time ( status get finish time ( ) ) ; } this phase = status get phase ( ) ; this counters = status get counters ( ) ; this output size = status output size ; }


this test shows that updating a view using an xml that will be converted by x stream via an alias will rightfully succeed

@ test public void update view with renamed class ( ) throws exception { list view tv = new list view ( " t view " ) ; j jenkins add view ( tv ) ; jenkins xstream2 add compatibility alias ( " org acme old foo " , list view class ) ; final c l i command invoker result result = command authorized to ( view read , view configure , jenkins read ) with stdin ( this get class ( ) get resource as stream ( " / hudson / cli / testview - foo xml " ) ) invoke with args ( " t view " ) ; assert that ( result , succeeded silently ( ) ) ; }


public album page change artist ( string artist ) { var artist input text field = ( html text input ) page get element by id ( " album artist " ) ; artist input text field set text ( artist ) ; return this ; }


tests that we never get an optimal hashes number of zero

public void test optimal hashes ( ) { for ( int n = 1 ; n < 1000 ; n + + ) { for ( int m = 0 ; m < 1000 ; m + + ) { assert true ( bloom filter optimal num of hash functions ( n , m ) > 0 ) ; } } }


highlights any y - value at the given x - value in the given data set provide - 1 as the data set index to undo all highlighting this method will call the listener

public void highlight value ( float x , int data set index ) { highlight value ( x , data set index , - 1 , true ) ; }


protected list < string > flat user data ( user data user data ) { list < string > result = new array list < > ( ) ; map < string , list < string > > zone data = user data get zone data ( ) ; for ( map entry < string , list < string > > entry : zone data entry set ( ) ) { result add all ( entry get value ( ) ) ; } return result ; }


finds all the circuits , or cycles , in the given graph

public static < v , e extends g edge < v > > list < list < v > > find circuits ( g directed graph < v , e > g , boolean unique circuits , task monitor monitor ) throws cancelled exception { list accumulator < list < v > > accumulator = new list accumulator < > ( ) ; johnson circuits algorithm < v , e > algorithm = new johnson circuits algorithm < > ( g , accumulator ) ; algorithm compute ( unique circuits , monitor ) ; return accumulator as list ( ) ; }


update the environment of the native module

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


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


returns the custom token filters used for analysis , if defined

public list < name or definition > token filters ( ) { return this token filters ; }


public int get symbol data 2 ( ) { lock acquire ( ) ; try { check is valid ( ) ; if ( record ! = null ) { return record get int value ( symbol database adapter symbol data2 col ) ; } return 0 ; } finally { lock release ( ) ; } }


opens an f s data input stream at the indicated path

public f s data input stream open ( path f , int buffer size ) throws i o exception { return open ( f , optional empty ( ) , optional empty ( ) ) ; }


the total size of the log segments in this replica in bytes


public void set angular damping ( float angular damping ) { jni set angular damping ( addr , angular damping ) ; }


generate a string to be used as the key for the given priority in the lb policy config

private static string priority name ( int priority ) { return " priority " + priority ; }


transfers this buffer ' s data to the specified destination starting at the specified absolute { @ code index } this method does not modify { @ code reader index } or { @ code writer index } of this buffer

public abstract byte buf get bytes ( int index , byte [ ] dst ) ;


protected boolean contains p k ( list < string > columns ) { if ( columns = = null | | columns is empty ( ) ) { return false ; } list < string > new columns = column utils del escape ( columns , get db type ( ) ) ; return get table meta ( ) contains p k ( new columns ) ; }


set the temporary folder path ( for downloading files )

public api client set temp folder path ( string temp folder path ) { this temp folder path = temp folder path ; return this ; }


maps the specified class to the specified value does not associate this value with any of the class ' s supertypes

< t extends b > t put instance ( class < t > type , @ nullable t value ) ;


test for { @ link default bean } that does not define the container factory to use as a default is registered with an explicit default

protected void test explicit container factory configuration ( application context context ) { jms listener container test factory default factory = context get bean ( " simple factory " , jms listener container test factory class ) ; assert that ( default factory get listener containers ( ) size ( ) ) is equal to ( 1 ) ; }


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


create a single image source for a given image request

public static image source for image request ( @ nullable image request image request , image request request level request level for fetch ) { if ( image request = = null ) { return empty source ( ) ; } return get ( ) single image request ( image request , request level for fetch ) ; }


returns the default description for the given { @ code detector }

public static string of ( detector detector ) { string builder sb = new string builder ( ) ; append on ( detector , sb ) ; return sb to string ( ) ; }


remove the first item from the queue ( dequeue from head ) always o ( 1 )

public long remove first ( ) { if ( size = = 0 ) { / / underflow throw new no such element exception ( " queue is empty " ) ; } final long [ ] values = this values ; final long result = values [ head ] ; head + + ; if ( head = = values length ) { head = 0 ; } size - - ; return result ; }


performs the maintenance work , blocking until the lock is acquired any exception thrown , such as by { @ link cache writer # delete } , is propagated to the caller

void perform clean up ( @ nullable runnable task ) { eviction lock lock ( ) ; try { maintenance ( task ) ; } finally { eviction lock unlock ( ) ; } if ( ( drain status ( ) = = required ) & & ( executor = = fork join pool common pool ( ) ) ) { schedule drain buffers ( ) ; } }


private void stop ( int num of services started , boolean stop only started services ) { / / stop in reverse order of start exception first exception = null ; list < service > services = get services ( ) ; for ( int i = num of services started - 1 ; i > = 0 ; i - - ) { service service = services get ( i ) ; if ( log is debug enabled ( ) ) { log debug ( " stopping service # " + i + " : " + service ) ; } state state = service get service state ( ) ; / / depending on the stop police if ( state = = state started | | ( ! stop only started services & & state = = state inited ) ) { exception ex = service operations stop quietly ( log , service ) ; if ( ex ! = null & & first exception = = null ) { first exception = ex ; } } } / / after stopping all services , rethrow the first exception raised if ( first exception ! = null ) { throw service state exception convert ( first exception ) ; } }


test { @ code set file reader } methods next ( ) , get ( ) in combination

public void test set file access methods ( ) { try { file system fs = file system get local ( conf ) ; int size = 10 ; write data ( fs , size ) ; set file reader reader = create reader ( fs ) ; assert true ( " test set file with construction 1 error ! ! ! " , reader next ( new int writable ( 0 ) ) ) ; / / don ' t know why reader get ( i ) return i + 1 assert equals ( " test set file with construction 2 error ! ! ! " , new int writable ( size / 2 + 1 ) , reader get ( new int writable ( size / 2 ) ) ) ; assert null ( " test set file with construction 3 error ! ! ! " , reader get ( new int writable ( size * 2 ) ) ) ; } catch ( exception ex ) { fail ( " test set file with construction error ! ! ! " ) ; } }


generates all test cases appropriate for the given method

private static void add tests ( test suite suite , method method ) { if ( is guarded ( method ) ) { for ( boolean fair 1 : new boolean [ ] { true , false } ) { for ( boolean fair 2 : new boolean [ ] { true , false } ) { suite add test ( generate guard with wrong monitor test case ( method , fair 1 , fair 2 ) ) ; } } } if ( is any enter ( method ) ) { add tests ( suite , method , scenario satisfied and unoccupied before entering , timeouts to use any , outcome success ) ; add tests ( suite , method , scenario unsatisfied and unoccupied before entering , timeouts to use finite , is guarded ( method ) ? ( is boolean ( method ) ? outcome failure : outcome hang ) : outcome success ) ; add tests ( suite , method , scenario unsatisfied and unoccupied before entering , timeouts to use infinite , is guarded ( method ) ? ( is try enter ( method ) | | is enter if ( method ) ? outcome failure : outcome hang ) : outcome success ) ; add tests ( suite , method , scenario satisfied and occupied before entering , timeouts to use finite , is boolean ( method ) ? outcome failure : outcome hang ) ; add tests ( suite , method , scenario satisfied and occupied before entering , timeouts to use infinite , is guarded ( method ) ? outcome hang : ( is try enter ( method ) ? outcome failure : outcome hang ) ) ; add tests ( suite , method , scenario satisfied unoccupied and interrupted before entering , timeouts to use any , is interruptible ( method ) ? outcome interrupt : outcome success ) ; } else { / / any wait for xxx method suite add test ( generate wait for when not occupying test case ( method , true ) ) ; suite add test ( generate wait for when not occupying test case ( method , false ) ) ; add tests ( suite , method , scenario satisfied before waiting , timeouts to use any , outcome success ) ; add tests ( suite , method , scenario satisfied while waiting , timeouts to use infinite , outcome success ) ; add tests ( suite , method , scenario satisfied while waiting , timeouts to use past , outcome failure ) ; add tests ( suite , method , scenario satisfied and interrupted before waiting , timeouts to use any , outcome success ) ; add tests ( suite , method , scenario unsatisfied before and while waiting , timeouts to use finite , outcome failure ) ; add tests ( suite , method , scenario unsatisfied before and while waiting , timeouts to use infinite , outcome hang ) ; add tests ( suite , method , scenario unsatisfied and interrupted before waiting , timeouts to use past , / / prefer responding to interrupt over timing out is interruptible ( method ) ? outcome interrupt : outcome failure ) ; add tests ( suite , method , scenario unsatisfied and interrupted before waiting , timeouts to use small , is interruptible ( method ) ? outcome interrupt : outcome failure ) ; add tests ( suite , method , scenario unsatisfied and interrupted before waiting , timeouts to use infinite , is interruptible ( method ) ? outcome interrupt : outcome hang ) ; } }


schedules a clear media items action to be created

public builder clear media items ( ) { return apply ( new action clear media items ( tag ) ) ; }


return the level at which we are allowed to schedule containers given the thresholds indicating how much time passed before relaxing scheduling constraints

node type get allowed locality level by time ( scheduler request key scheduler key , long node locality delay ms , long rack locality delay ms , long current time ms ) { / / if not being used , can schedule anywhere if ( node locality delay ms < 0 | | rack locality delay ms < 0 ) { return node type off switch ; } write lock lock ( ) ; try { / / default level is node local if ( ! allowed locality level contains key ( scheduler key ) ) { / / add the initial time of priority to prevent comparing with fs app / / start time and allowed locality level degrade last scheduled container put ( scheduler key , current time ms ) ; log debug ( " init the last scheduled container time , priority : { } , " + " time : { } " , scheduler key get priority ( ) , current time ms ) ; allowed locality level put ( scheduler key , node type node local ) ; return node type node local ; } node type allowed = allowed locality level get ( scheduler key ) ; / / if level is already most liberal , we ' re done if ( allowed equals ( node type off switch ) ) { return node type off switch ; } / / check waiting time long wait time = current time ms ; if ( last scheduled container contains key ( scheduler key ) ) { wait time - = last scheduled container get ( scheduler key ) ; } else { wait time - = get start time ( ) ; } long threshold time = allowed equals ( node type node local ) ? node locality delay ms : rack locality delay ms ; if ( wait time > threshold time ) { if ( allowed equals ( node type node local ) ) { if ( log is trace enabled ( ) ) { log trace ( " waiting time : " + wait time + " ms , node locality delay time : " + node locality delay ms + " ms " + " , change allowed locality from node local to rack local " + " , priority : " + scheduler key get priority ( ) + " , app attempt id : " + this attempt id ) ; } allowed locality level put ( scheduler key , node type rack local ) ; reset scheduling opportunities ( scheduler key , current time ms ) ; } else if ( allowed equals ( node type rack local ) ) { if ( log is trace enabled ( ) ) { log trace ( " waiting time : " + wait time + " ms , node locality delay time : " + node locality delay ms + " ms " + " , change allowed locality from rack local to off switch " + " , priority : " + scheduler key get priority ( ) + " , app attempt id : " + this attempt id ) ; } allowed locality level put ( scheduler key , node type off switch ) ; reset scheduling opportunities ( scheduler key , current time ms ) ; } } return allowed locality level get ( scheduler key ) ; } finally { write lock unlock ( ) ; } }


implement of { @ link base view # get context ( ) } ( ) }

public context get context ( ) { return this ; }


public void test row time left temporal join ( ) throws exception { list < object > expected output = new array list < > ( ) ; expected output add ( new watermark ( 1 ) ) ; expected output add ( insert record ( 1l , " k 1 " , " 1a 1 " , null , null , null ) ) ; expected output add ( new watermark ( 2 ) ) ; expected output add ( insert record ( 1l , " k 1 " , " 1a 1 " , null , null , null ) ) ; expected output add ( insert record ( 3l , " k 1 " , " 1a 3 " , 2l , " k 1 " , " 1a 2 " ) ) ; expected output add ( new watermark ( 5 ) ) ; expected output add ( insert record ( 6l , " k 2 " , " 2a 3 " , 4l , " k 2 " , " 2a 4 " ) ) ; expected output add ( new watermark ( 8 ) ) ; expected output add ( insert record ( 9l , " k 2 " , " 5a 1 1 " , null , null , null ) ) ; expected output add ( new watermark ( 9 ) ) ; expected output add ( insert record ( 11l , " k 2 " , " 5a 1 2 " , 10l , " k 2 " , " 2a 6 " ) ) ; expected output add ( new watermark ( 13 ) ) ; test row time temporal join ( true , expected output ) ; }


delete a list of model snapshots and their corresponding state documents

public void delete model snapshots ( list < model snapshot > model snapshots , action listener < bulk by scroll response > listener ) { if ( model snapshots is empty ( ) ) { listener on response ( new bulk by scroll response ( time value zero , new bulk by scroll task status ( collections empty list ( ) , null ) , collections empty list ( ) , collections empty list ( ) , false ) ) ; return ; } string state index name = anomaly detectors index job state index pattern ( ) ; list < string > ids to delete = new array list < > ( ) ; set < string > indices = new hash set < > ( ) ; indices add ( state index name ) ; indices add ( annotation index read alias name ) ; for ( model snapshot model snapshot : model snapshots ) { ids to delete add all ( model snapshot state document ids ( ) ) ; ids to delete add ( model snapshot document id ( model snapshot ) ) ; ids to delete add ( model snapshot annotation document id ( model snapshot ) ) ; indices add ( anomaly detectors index job results aliased name ( model snapshot get job id ( ) ) ) ; } delete by query request delete by query request = new delete by query request ( indices to array ( new string [ 0 ] ) ) set refresh ( true ) set indices options ( indices options lenient expand open ( ) ) set query ( query builders ids query ( ) add ids ( ids to delete to array ( new string [ 0 ] ) ) ) ; / / doc is the most efficient sort order and will also disable scoring delete by query request get search request ( ) source ( ) sort ( elasticsearch mappings es doc ) ; execute async with origin ( client , ml origin , delete by query action instance , delete by query request , listener ) ; }


schedules a build of this project , and returns a { @ link future } object to wait for the completion of the build

public queue task future < r > schedule build 2 ( int quiet period , cause c ) { return schedule build 2 ( quiet period , c , new action [ 0 ] ) ; }


visits a non standard attribute of the class

public void visit attribute ( final attribute attribute ) { if ( cv ! = null ) { cv visit attribute ( attribute ) ; } }


called to record the currentnext content for a transition key

private void record layout outputs group diff ( transition id transition id , output units affinity group < animatable item > current layout outputs group , output units affinity group < animatable item > next layout outputs group ) { animation state animation state = m animation states get ( transition id ) ; if ( animation state = = null ) { animation state = new animation state ( ) ; m animation states put ( transition id , animation state ) ; } if ( current layout outputs group = = null & & next layout outputs group = = null ) { throw new runtime exception ( " both current and next layout output groups were null ! " ) ; } if ( current layout outputs group = = null & & next layout outputs group ! = null ) { animation state change type = change type appeared ; } else if ( current layout outputs group ! = null & & next layout outputs group ! = null ) { animation state change type = change type changed ; } else { if ( ( animation state change type = = change type appeared | | animation state change type = = change type changed ) & & ! animation state has disappearing animation ) { animation state should finish undeclared animation = true ; } animation state change type = change type disappeared ; } animation state current layout outputs group = current layout outputs group ; animation state next layout outputs group = next layout outputs group ; record last mounted values ( animation state ) ; animation state seen in last transition = true ; if ( m debug tag ! = null ) { log d ( m debug tag , " saw transition id " + transition id + " which is " + change type to string ( animation state change type ) ) ; } }


closing the block will release the buffer

protected void inner close ( ) { if ( block buffer ! = null ) { byte buffer block factory release buffer ( block buffer ) ; block buffer = null ; } if ( input stream ! = null ) { input stream close ( ) ; input stream = null ; } }


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


returns the { @ code writer index } of this buffer


set up two services and their failover controllers svc 1 is started first , so that it enters active state , and then svc 2 is started , which enters standby

public void start ( ) throws exception { start ( 2 ) ; }


gets the originating " x - forwarded - " header from the request if there are multiple headers the originating header is the first header if the originating header contains a comma separated list , the originating entry is the first one

private static string get x forwarded header ( stapler request req , string header , string default value ) { string value = req get header ( header ) ; if ( value ! = null ) { int index = value index of ( ' , ' ) ; return index = = - 1 ? value trim ( ) : value substring ( 0 , index ) trim ( ) ; } return default value ; }


create a composite record writer that can write keyvalue data to different output files

public record writer < k , v > get record writer ( file system fs , job conf job , string name , progressable arg 3 ) throws i o exception { final file system my f s = fs ; final string my name = generate leaf file name ( name ) ; final job conf my job = job ; final progressable my progressable = arg 3 ; return new record writer < k , v > ( ) { / / a cache storing the record writers for different output files tree map < string , record writer < k , v > > record writers = new tree map < string , record writer < k , v > > ( ) ; public void write ( k key , v value ) throws i o exception { / / get the file name based on the key string key based path = generate file name for key value ( key , value , my name ) ; / / get the file name based on the input file name string final path = get input file based output file name ( my job , key based path ) ; / / get the actual key k actual key = generate actual key ( key , value ) ; v actual value = generate actual value ( key , value ) ; record writer < k , v > rw = this record writers get ( final path ) ; if ( rw = = null ) { / / if we don ' t have the record writer yet for the final path , create / / one / / and add it to the cache rw = get base record writer ( my f s , my job , final path , my progressable ) ; this record writers put ( final path , rw ) ; } rw write ( actual key , actual value ) ; } ; public void close ( reporter reporter ) throws i o exception { iterator < string > keys = this record writers key set ( ) iterator ( ) ; while ( keys has next ( ) ) { record writer < k , v > rw = this record writers get ( keys next ( ) ) ; rw close ( reporter ) ; } this record writers clear ( ) ; } ; } ; }


current registry center configuration , to replace xml config : < prev > & lt ; dubbo : registry address = " na " & gt ; < prev >

public registry config registry config ( ) { registry config registry config = new registry config ( ) ; registry config set address ( " n / a " ) ; return registry config ; }


determine if additional instruction sets may be produced if true is returned , this queue will be ready to produce instruction set blocks

boolean continue producing instruction sets ( task monitor monitor ) { current branch queue clear ( ) ; processed branch flows clear ( ) ; last block = null ; last block addr = null ; last flow from = null ; if ( monitor ! = null & & monitor is cancelled ( ) ) { return false ; } if ( ! priority queue is empty ( ) ) { return true ; } if ( ordered seed queue is empty ( ) ) { return false ; } instruction block flow flow = ordered seed queue first ( ) ; ordered seed queue remove ( flow ) ; priority queue add ( flow ) ; return true ; }


whether this update applied to the given source config requires analytics task restart

public boolean requires restart ( data frame analytics config source ) { return ( get model memory limit ( ) ! = null & & get model memory limit ( ) equals ( source get model memory limit ( ) ) = = false ) | | ( get max num threads ( ) ! = null & & get max num threads ( ) equals ( source get max num threads ( ) ) = = false ) ; }


perform serializationdeserialization checks for several simple nested set examples

public static void check codec ( object codecs object codecs , boolean allow future blocking , boolean assert symmetric equality ) throws exception { new serialization tester ( nested set builder empty set ( order stable order ) , nested set builder empty set ( order naive link order ) , nested set builder create ( order stable order , " a " ) , nested set builder create ( order stable order , " a " , " b " , " c " ) , nested set builder < string > stable order ( ) add ( " a " ) add ( " b " ) add transitive ( nested set builder < string > stable order ( ) add ( " c " ) add transitive ( shared nested set ) build ( ) ) add transitive ( nested set builder < string > stable order ( ) add ( " d " ) add transitive ( shared nested set ) build ( ) ) add transitive ( nested set builder empty set ( order stable order ) ) build ( ) , nested set builder create ( order stable order , new has nested set ( nested set builder create ( order stable order , " a " ) ) ) ) set object codecs ( object codecs ) make memoizing and allow future blocking ( allow future blocking ) set verification function ( verification function ( assert symmetric equality ) ) run tests ( ) ; }


this test validates the correctness of { @ link r m web service protocol # get activities ( ) } inside router

public void test activies x m l ( ) throws exception { list < activities info > responses = perform get calls ( rm web service path + scheduler activities , activities info class , null , null ) ; activities info router response = responses get ( 0 ) ; activities info rm response = responses get ( 1 ) ; assert not null ( router response ) ; assert not null ( rm response ) ; }


return the associated { @ link javax servlet servlet context }

public final servlet context get servlet context ( ) { return this servlet context ; }


private void close socket ( socket sock ) { if ( sock = = null ) { return ; } try { sock close ( ) ; } catch ( i o exception ie ) { log error ( " exception while closing " , ie ) ; } }


processes key stroke entry from the text field

private void process key stroke entry ( key stroke ks ) { clear info panel ( ) ; / / an action must be selected if ( selection model is selection empty ( ) ) { status label set text ( " no action is selected " ) ; return ; } if ( ks ! = null & & reserved key bindings is reserved keystroke ( ks ) ) { status label set text ( key entry text field parse key stroke ( ks ) + " is a reserved keystroke " ) ; ks field clear field ( ) ; return ; } string selected action name = get selected action name ( ) ; if ( selected action name ! = null ) { if ( process key stroke ( selected action name , ks ) ) { string key stroke text = key entry text field parse key stroke ( ks ) ; show actions mapped to key stroke ( key stroke text ) ; table model fire table data changed ( ) ; } } }


public static void put ( long flow id , integer now calls ) { now calls map put ( flow id , new atomic integer ( now calls ) ) ; }


given a map of old - > new , cancel medias that were changed and upload their replacements will also upload any media in the map that wasn ' t yet uploaded

void apply media updates ( @ non null map < media , media > old to new , @ nullable recipient recipient ) { executor execute ( ( ) - > { for ( map entry < media , media > entry : old to new entry set ( ) ) { boolean same = entry get key ( ) equals ( entry get value ( ) ) & & ( ! entry get value ( ) get transform properties ( ) is present ( ) | | ! entry get value ( ) get transform properties ( ) get ( ) is video edited ( ) ) ; if ( ! same | | ! upload results contains key ( entry get value ( ) ) ) { cancel upload internal ( entry get key ( ) ) ; upload media internal ( entry get value ( ) , recipient ) ; } } } ) ; }


set the default merge setting for the document that ' s currently parsed

public void set merge ( @ nullable string merge ) { this merge = merge ; }


check if the any child components stored in { @ link layout state } have enteredexited the working range , and dispatch the event to trigger the corresponding registered methods

public synchronized void check working range and dispatch ( int position , int first visible index , int last visible index , int first fully visible index , int last fully visible index ) { if ( m committed layout state ! = null ) { m committed layout state check working range and dispatch ( position , first visible index , last visible index , first fully visible index , last fully visible index , m working range status handler ) ; } }


public static void verify mkdirs invoked ( file system mock s 3 , path path ) throws i o exception { verify ( mock s 3 ) mkdirs ( path ) ; }


returns whether the shared slot has no assigned logical slot requests

boolean is empty ( ) { return requested logical slots size ( ) = = 0 ; }


tries to retrieve the maximum number of open file handles this method will only work on unix - based operating systems with sun oracle java versions if the number of max open file handles cannot be determined , this method returns { @ code - 1 }

public static long get open file handles limit ( ) { if ( operating system is windows ( ) ) { / / get max file descriptor count method is not available on windows return - 1l ; } class < ? > sun bean class ; try { sun bean class = class for name ( " com sun management unix operating system m x bean " ) ; } catch ( class not found exception e ) { return - 1l ; } try { method fh limit method = sun bean class get method ( " get max file descriptor count " ) ; object result = fh limit method invoke ( management factory get operating system m x bean ( ) ) ; return ( long ) result ; } catch ( throwable t ) { log warn ( " unexpected error when accessing file handle limit " , t ) ; return - 1l ; } }


public void test add and get latest checkpoint ( ) throws exception { shared state registry shared state registry = new shared state registry ( ) ; completed checkpoint store checkpoints = create completed checkpoints ( 4 ) ; / / empty state assert equals ( 0 , checkpoints get number of retained checkpoints ( ) ) ; assert equals ( 0 , checkpoints get all checkpoints ( ) size ( ) ) ; test completed checkpoint [ ] expected = new test completed checkpoint [ ] { create checkpoint ( 0 , shared state registry ) , create checkpoint ( 1 , shared state registry ) } ; / / add and get latest checkpoints add checkpoint ( expected [ 0 ] , new checkpoints cleaner ( ) , ( ) - > { } ) ; assert equals ( 1 , checkpoints get number of retained checkpoints ( ) ) ; verify checkpoint ( expected [ 0 ] , checkpoints get latest checkpoint ( false ) ) ; checkpoints add checkpoint ( expected [ 1 ] , new checkpoints cleaner ( ) , ( ) - > { } ) ; assert equals ( 2 , checkpoints get number of retained checkpoints ( ) ) ; verify checkpoint ( expected [ 1 ] , checkpoints get latest checkpoint ( false ) ) ; }


the list of string that presents all dubbo subscribed { @ link url urls }

default sorted set < string > get subscribed u r ls ( ) { throw new unsupported operation exception ( " this operation is not supported for consumer " ) ; }


whether or not any action was taken for this test , that is there was some result that was not cached

public boolean action ran ( ) { return action ran ; }


process the result of the asynchronous call on success , rc is { @ link keeper exception code # ok } on failure , rc is set to the corresponding failure code in { @ link keeper exception } { @ link keeper exception code # nonode } - the node on given path doesn ' t exist for some api calls

void process result ( int rc , string path , object ctx , list < acl > acl , stat stat ) ;


verify failure on invalid ssl configuration

public void test invalid ssl configuration ( ) throws exception { netty protocol protocol = new no op protocol ( ) ; configuration config = create ssl config ( ) ; / / modify the keystore password to an incorrect one config set string ( security options ssl internal keystore password , " invalidpassword " ) ; netty config netty config = create netty config ( config ) ; netty test util netty server and client server and client = null ; try { server and client = netty test util init server and client ( protocol , netty config ) ; assert fail ( " created server and client from invalid configuration " ) ; } catch ( exception e ) { / / exception should be thrown as expected } netty test util shutdown ( server and client ) ; }


maximum number of connections allowed from particular host ( ip )

public int get max client cnxns per host ( ) { if ( cnxn factory ! = null ) { return cnxn factory get max client cnxns per host ( ) ; } if ( secure cnxn factory ! = null ) { return secure cnxn factory get max client cnxns per host ( ) ; } return - 1 ; }


decreases the reference counter for the given event so that it can be removed once the reference counter reaches 0

public void release event ( event id event id ) throws exception { lockable < v > event wrapper = shared buffer get event ( event id ) ; if ( event wrapper ! = null ) { if ( event wrapper release ( ) ) { shared buffer remove event ( event id ) ; } else { shared buffer upsert event ( event id , event wrapper ) ; } } }


public void test enum subclass ( ) { assert false ( roshambo class = = roshambo rock get class ( ) ) ; assert equals ( " \ " rock \ " " , gson to json ( roshambo rock ) ) ; assert equals ( " [ \ " rock \ " , \ " paper \ " , \ " scissors \ " ] " , gson to json ( enum set all of ( roshambo class ) ) ) ; assert equals ( roshambo rock , gson from json ( " \ " rock \ " " , roshambo class ) ) ; assert equals ( enum set all of ( roshambo class ) , gson from json ( " [ \ " rock \ " , \ " paper \ " , \ " scissors \ " ] " , new type token < set < roshambo > > ( ) { } get type ( ) ) ) ; }


public synchronized void init last reset time ( ) { if ( initialized ) { return ; } last reset time = system current time millis ( ) ; initialized = true ; }


test for the deprecated apply ( reducer , window function )

public void test apply with pre reducer event time ( ) throws exception { stream execution environment env = stream execution environment get execution environment ( ) ; data stream < tuple 2 < string , integer > > source = env from elements ( tuple 2 of ( " hello " , 1 ) , tuple 2 of ( " hello " , 2 ) ) ; dummy reducer reducer = new dummy reducer ( ) ; data stream < tuple 3 < string , string , integer > > window = source key by ( new tuple key selector ( ) ) window ( tumbling event time windows of ( time of ( 1 , time unit seconds ) ) ) apply ( reducer , new window function < tuple 2 < string , integer > , tuple 3 < string , string , integer > , string , time window > ( ) { private static final long serial version u i d = 1l ; @ override public void apply ( string key , time window window , iterable < tuple 2 < string , integer > > values , collector < tuple 3 < string , string , integer > > out ) throws exception { for ( tuple 2 < string , integer > in : values ) { out collect ( new tuple 3 < > ( in f 0 , in f 0 , in f 1 ) ) ; } } } ) ; one input transformation < tuple 2 < string , integer > , tuple 3 < string , string , integer > > transform = ( one input transformation < tuple 2 < string , integer > , tuple 3 < string , string , integer > > ) window get transformation ( ) ; one input stream operator < tuple 2 < string , integer > , tuple 3 < string , string , integer > > operator = transform get operator ( ) ; assert assert true ( operator instanceof window operator ) ; window operator < string , tuple 2 < string , integer > , ? , ? , ? > win operator = ( window operator < string , tuple 2 < string , integer > , ? , ? , ? > ) operator ; assert assert true ( win operator get trigger ( ) instanceof event time trigger ) ; assert assert true ( win operator get window assigner ( ) instanceof tumbling event time windows ) ; assert assert true ( win operator get state descriptor ( ) instanceof reducing state descriptor ) ; process element and ensure output ( operator , win operator get key selector ( ) , basic type info string type info , new tuple 2 < > ( " hello " , 1 ) ) ; }


this test ensures the consistency between primary and replica when non - append - only ( eg index request with id or delete ) operation of the same document is processed before the original append - only request on replicas the append - only document can be exposed and deleted on the primary before it is added to replica replicas should treat a late append - only request as a regular index request

public void test out of order delivery for append only operations ( ) throws exception { try ( replication group shards = create group ( 1 ) ) { shards start all ( ) ; final index shard primary = shards get primary ( ) ; final index shard replica = shards get replicas ( ) get ( 0 ) ; / / append - only request - without id final bulk shard request index request = index on primary ( new index request ( index get name ( ) ) source ( " { } " , x content type json ) , primary ) ; final string doc id = iterables get ( get shard doc u i ds ( primary ) , 0 ) ; final bulk shard request delete request = delete on primary ( new delete request ( index get name ( ) ) id ( doc id ) , primary ) ; delete on replica ( delete request , shards , replica ) ; index on replica ( index request , shards , replica ) ; shards assert all equal ( 0 ) ; } }


returns the expression text for this execution listener comes in handy if you want to check which listeners you already have

public string get expression text ( ) { return expression get expression text ( ) ; }


configure custom deserializers each deserializer is registered for the type returned by { @ link json deserializer # handled type ( ) } , which must not be { @ code null }

public void set deserializers ( json deserializer < ? > deserializers ) { this builder deserializers ( deserializers ) ; }


construct a { @ code serialized } instance with the provided key { @ link serde } if the { @ link serde } params are null the default serdes defined in the configs will be used

public serialized < k , v > with key serde ( final serde < k > key serde ) { return new serialized < > ( key serde , null ) ; }


performs an bitwise or on the given arrays

public static byte [ ] byte array or ( byte [ ] arr 1 , byte [ ] arr 2 ) { byte [ ] result = new byte [ arr 1 length ] ; if ( arr 1 length ! = arr 2 length ) { return null ; } for ( int x = 0 ; x < arr 1 length ; x + + ) { result [ x ] = ( byte ) ( arr 1 [ x ] | arr 2 [ x ] ) ; } return result ; }


supply the { @ link async uncaught exception handler } to use to handle exceptions thrown by invoking asynchronous methods with a { @ code void } return type

public void set exception handler ( async uncaught exception handler exception handler ) { this exception handler = singleton supplier of ( exception handler ) ; }


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


returns the equate at this operand field location

public equate get equate ( ) { return equate ; }


peeks the amr header from the beginning of the input , and consumes it if it exists

private boolean read amr header ( extractor input input ) throws i o exception { if ( peek amr signature ( input , amr signature nb ) ) { is wide band = false ; input skip fully ( amr signature nb length ) ; return true ; } else if ( peek amr signature ( input , amr signature wb ) ) { is wide band = true ; input skip fully ( amr signature wb length ) ; return true ; } return false ; }


called by workspace impl when it is restoring its state

public plugin tool get tool ( string tool name ) { tool template template = tool services get tool chest ( ) get tool template ( tool name ) ; if ( template = = null ) { return null ; } plugin tool tool = template create tool ( project ) ; if ( tool ! = null ) { register tool ( tool name , tool ) ; } return tool ; }


remove resources ( already identified by { @ link # shrink ( path ) } ) this task will copy all remaining used resources over from the full resource directory to a new reduced resource directory and removes unused values from all value xml files

private void remove unused ( path destination ) throws i o exception , parser configuration exception , s a x exception { assert unused ! = null ; / / should always call analyze ( ) first int resource count = unused size ( ) * 4 ; / / * 4 : account for some resource folder repetition set < file > skip = sets new hash set with expected size ( resource count ) ; set < file > rewrite = sets new hash set with expected size ( resource count ) ; set < resource > deleted = sets new hash set with expected size ( resource count ) ; for ( resource resource : unused ) { if ( resource declarations ! = null ) { for ( file file : resource declarations ) { string folder = file get parent file ( ) get name ( ) ; resource folder type folder type = resource folder type get folder type ( folder ) ; if ( folder type ! = null & & folder type ! = resource folder type values ) { list < resource type > types = folder type relationship get related resource types ( folder type ) ; resource type type = types get ( 0 ) ; assert type ! = resource type id : folder type ; resource file resource = model get resource ( type , lint utils get base name ( file get name ( ) ) ) ; / / only delete the file if there is no owning resource or this is the owning resource of / / the file , i e not an id declared within it , because id declarations are not / / considered uses and would otherwise cause deletion of the file if ( file resource = = null | | file resource equals ( resource ) ) { logger fine ( " deleted unused file " + file + " for resource " + resource ) ; assert skip ! = null ; skip add ( file ) ; deleted add ( resource ) ; } } else { / / can ' t delete values immediately ; there can be many resources / / in this file , so we have to process them all rewrite add ( file ) ; } } } else { / / not declared anywhere ; mark as deleted covers the case of inline resources / / https : / / developer android com / guide / topics / resources / complex - xml - resources html deleted add ( resource ) ; } } / / special case the base values xml folder file values = new file ( merged resource dir to file ( ) , fd res values + file separator char + " values xml " ) ; if ( values exists ( ) ) { rewrite add ( values ) ; } map < file , string > rewritten = maps new hash map with expected size ( rewrite size ( ) ) ; rewrite xml ( rewrite , rewritten , deleted ) ; / / todo ( apell ) : the graph traversal does not mark i ds as reachable or not , so they cannot be / / accurately removed from public xml , but the definitions may be deleted if they occur in / / other files i ds should be added to values xml so that there are no declarations in / / public xml without definitions file public xml = new file ( merged resource dir to file ( ) , fd res values + file separator char + " public xml " ) ; create stub ids ( values , rewritten , public xml ) ; trim public resources ( public xml , deleted , rewritten ) ; filtered copy ( merged resource dir to file ( ) , destination , skip , rewritten ) ; }


public static string generate flow name tag ( string flow name ) { return flow name tag prefix + " : " + flow name ; }


private void delete indices ( final cluster changed event event ) { final cluster state previous state = event previous state ( ) ; final cluster state state = event state ( ) ; final string local node id = state nodes ( ) get local node id ( ) ; assert local node id ! = null ; for ( index index : event indices deleted ( ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " [ { } ] cleaning index , no longer part of the metadata " , index ) ; } allocated index < ? extends shard > index service = indices service index service ( index ) ; final index settings index settings ; if ( index service ! = null ) { index settings = index service get index settings ( ) ; indices service remove index ( index , deleted , " index no longer part of the metadata " ) ; } else if ( previous state metadata ( ) has index ( index ) ) { / / the deleted index was part of the previous cluster state , but not loaded on the local node final index metadata metadata = previous state metadata ( ) index ( index ) ; index settings = new index settings ( metadata , settings ) ; indices service delete unassigned index ( " deleted index was not assigned to local node " , metadata , state ) ; } else { / / the previous cluster state ' s metadata also does not contain the index , / / which is what happens on node startup when an index was deleted while the / / node was not part of the cluster in this case , try reading the index / / metadata from disk if its not there , there is nothing to delete / / first , though , verify the precondition for applying this case by / / asserting that either this index is already in the graveyard , or the / / previous cluster state is not initialized / recovered assert state metadata ( ) index graveyard ( ) contains index ( index ) | | previous state blocks ( ) has global block ( gateway service state not recovered block ) ; final index metadata metadata = indices service verify index is deleted ( index , event state ( ) ) ; if ( metadata ! = null ) { index settings = new index settings ( metadata , settings ) ; } else { index settings = null ; } } if ( index settings ! = null ) { thread pool generic ( ) execute ( new abstract runnable ( ) { @ override public void on failure ( exception e ) { logger warn ( ( ) - > new parameterized message ( " [ { } ] failed to complete pending deletion for index " , index ) , e ) ; } @ override protected void do run ( ) throws exception { try { / / we are waiting until we can lock the index / all shards on the node and then we ack the delete of the store / / to the master if we can ' t acquire the locks here immediately there might be a shard of this index still / / holding on to the lock due to a " currently canceled recovery " or so the shard will delete itself before the / / lock is released so it ' s guaranteed to be deleted by the time we get the lock indices service process pending deletes ( index , index settings , new time value ( 30 , time unit minutes ) ) ; } catch ( shard lock obtain failed exception exc ) { logger warn ( " [ { } ] failed to lock all shards for index - timed out after 30 seconds " , index ) ; } catch ( interrupted exception e ) { logger warn ( " [ { } ] failed to lock all shards for index - interrupted " , index ) ; } } } ) ; } } }


fake endpoint for testing various parameters 가짜 엔드 포인트 fake endpoint for testing various parameters 가짜 엔드 포인트

public void test endpoint parameters ( big decimal number , double double , string pattern without delimiter , byte [ ] byte , integer integer , integer int 3 2 , long int 6 4 , float float , string string , attachment binary detail , local date date , date date time , string password , string param callback ) { }


public void set digest ( string hex ) { if ( hex length ( ) ! = md5 len * 2 ) throw new illegal argument exception ( " wrong length : " + hex length ( ) ) ; byte [ ] digest = new byte [ md5 len ] ; for ( int i = 0 ; i < md5 len ; i + + ) { int j = i < < 1 ; digest [ i ] = ( byte ) ( char to nibble ( hex char at ( j ) ) < < 4 | char to nibble ( hex char at ( j + 1 ) ) ) ; } this digest = digest ; }


public synchronized void restart name node ( int nn index ) throws i o exception { restart name node ( nn index , true ) ; }


releases resources used to display the image the containing view must call this method from both { @ link view # on start temporary detach ( ) } and { @ link view # on detached from window ( ) }

public void on detach ( ) { if ( ! m is attached ) { return ; } m is attached = false ; for ( int i = 0 ; i < m holders size ( ) ; + + i ) { m holders get ( i ) on detach ( ) ; } }


removes a listener from the list of provider activation event subscribers

public void remove function comparison provider listener ( component provider activation listener listener ) ;


public void remove cached statement ( ) { my s q l binary statement registry get instance ( ) remove ( statement id ) ; }


registers a { @ link org apache flink metrics counter } with flink

< c extends counter > c counter ( string name , c counter ) ;


add an args definition for a define with arguments # define bubba ( a , b ) ( a or b )

public void put arg ( string string , vector < p p token > val ) { args put ( string , val ) ; }


returns true , if and only if the given package identifier corresponds to a package , i e , a file with the name { @ code package name b u i l d } exists in the appropriate repository

public abstract boolean is package ( package identifier package identifier ) throws interrupted exception ;


inner entry point , with no logging or system exits

public static int exec ( configuration conf , string argv ) throws exception { try ( k diag kdiag = new k diag ( ) ) { return tool runner run ( conf , kdiag , argv ) ; } }


see original { @ link stubber # do return ( object ) }

b d d stubber will return ( object to be returned ) ;


generate an address set which only includes initialized memory

protected address set view get searchable address set ( program program , address start address , program selection selection ) { if ( start address = = null ) { return new address set ( ) ; / / special case if we are at the first address going backwards / / or the last address going forwards } memory memory = program get memory ( ) ; address set view set = include non loaded blocks ? memory get all initialized address set ( ) : memory get loaded and initialized address set ( ) ; if ( search selection & & selection ! = null & & ! selection is empty ( ) ) { set = set intersect ( selection ) ; } address start = forward search ? start address : memory get min address ( ) ; address end = forward search ? memory get max address ( ) : start address ; if ( start compare to ( end ) > 0 ) { return new address set ( ) ; } address set address set = program get address factory ( ) get address set ( start , end ) ; return set intersect ( address set ) ; }


find all subscriptions that should receive the given message the map returned is safe to iterate and will never be modified

multi value map < string , string > find subscriptions ( message < ? > message ) ;


creates an empty token id to be used for de - serializing an { @ link a m r m token identifier } by the rpc layer

public a m r m token identifier create identifier ( ) { return new a m r m token identifier ( ) ; }


close all running tools ; called from the close ( ) method in tool manager impl which is called from the project ' s close ( )

void close ( ) { for ( plugin tool tool : running tools ) { try { tool exit ( ) ; } finally { tool manager tool removed ( this , tool ) ; } } running tools clear ( ) ; }


getter for the { @ link # elf original image base property } property

public static long get elf original image base ( program program ) { options props = program get options ( program program info ) ; string oib str = props get string ( elf loader elf original image base property , null ) ; return ( oib str ! = null ) ? numeric utilities parse hex long ( oib str ) : null ; }


reads the entire { @ link readable buffer } to a new { @ link string } with the given charset

public static string read as string ( readable buffer buffer , charset charset ) { preconditions check not null ( charset , " charset " ) ; byte [ ] bytes = read array ( buffer ) ; return new string ( bytes , charset ) ; }


public start message deployment definition impl build ( ) { return new start message deployment definition impl ( this ) ; }


public static < t > consumer < t > do if ( final boolean condition , final consumer < t > true function , final consumer < t > false function ) { return account - > { if ( condition ) { true function accept ( account ) ; } else { false function accept ( account ) ; } } ; }


observes and then instantly un - observes the supplied live data this will therefore only work in conjunction with { @ link live data rule }

public static < t > t observe and get one value ( final live data < t > live data ) { atomic reference < t > data = new atomic reference < > ( ) ; observer < t > observer = data : : set ; live data observe forever ( observer ) ; live data remove observer ( observer ) ; return data get ( ) ; }


updates a pet in the store with form data

public void update pet with form test ( ) { long pet id = null ; string name = null ; string status = null ; / / api update pet with form ( pet id , name , status ) ; / / todo : test validations }


returns a new { @ link collection } containing < tt > a - b < tt > the cardinality of each element e in the returned { @ link collection } will be the cardinality of e in a minus the cardinality of e in b , or zero , whichever is greater

public static collection subtract ( final collection a , final collection b ) { array list list = new array list ( a ) ; for ( iterator it = b iterator ( ) ; it has next ( ) ; ) { list remove ( it next ( ) ) ; } return list ; }


returns { @ link proxy async configuration } or { @ code aspect j async configuration } for { @ code proxy } and { @ code aspectj } values of { @ link enable async # mode ( ) } , respectively

public string [ ] select imports ( advice mode advice mode ) { switch ( advice mode ) { case proxy : return new string [ ] { proxy async configuration class get name ( ) } ; case aspectj : return new string [ ] { async execution aspect configuration class name } ; default : return null ; } }


returns the deprecations provided by the update site

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


public builder add transitive tools ( nested set < artifact > artifacts ) { tools builder add transitive ( artifacts ) ; return this ; }


perform a binary search to locate the specified key and derive an index into the buffer id storage this method is intended to locate the child node which contains the specified key the returned index corresponds to a child ' s stored buffernode id and may correspond to another interior node or a leaf record node each stored key within this interior node effectively identifies the maximum key contained within the corresponding child node

int get id index ( long key ) { int min = 1 ; int max = key count - 1 ; while ( min < = max ) { int i = ( min + max ) / 2 ; long k = get key ( i ) ; if ( k = = key ) { return i ; } else if ( k < key ) { min = i + 1 ; } else { max = i - 1 ; } } return max ; }


return the configured handlers , or possibly { @ code null } if not initialized yet via { @ link # after properties set ( ) }

public handler method return value handler composite get return value handlers ( ) { return this return value handlers ; }


invoke a callable ; wrap all checked exceptions with an assertion error

public static < t > t eval ( callable < t > closure ) { try { return closure call ( ) ; } catch ( runtime exception e ) { throw e ; } catch ( exception e ) { throw new assertion error ( e to string ( ) , e ) ; } }


decode the body to the given target type for an error response ( status code of 4xx or 5xx ) , the { @ code mono } emits a { @ link web client exception } use { @ link # on status ( predicate , function ) } to customize error response handling

< t > mono < t > body to mono ( class < t > element class ) ;


the bytes array contains the bytes of the string no byte may have the value ( byte ) 0 or lie in the range ( byte ) 0xf 0 - ( byte ) 0xff

public byte [ ] get bytes ( ) { return bytes ; }


set the given class as the { @ link compression codec } for the map outputs

public void set map output compressor class ( class < ? extends compression codec > codec class ) { set compress map output ( true ) ; set class ( job context map output compress codec , codec class , compression codec class ) ; }


public object get table data source ( ) ;


returns true if this symbol defines an object

public boolean is object ( ) { return get type ( ) = = stt object ; }


escapes a reserved word as defined in the ` reserved words ` array handle escaping those terms here this logic is only called if a variable matches the reserved words

public string escape reserved word ( string name ) { if ( this reserved words mappings ( ) contains key ( name ) ) { return this reserved words mappings ( ) get ( name ) ; } return " " + name ; }


updates an object as if by the starlark statement { @ code object [ key ] = value }

static void set index ( object object , object key , object value ) throws eval exception { if ( object instanceof dict ) { @ suppress warnings ( " unchecked " ) dict < object , object > dict = ( dict < object , object > ) object ; dict put entry ( key , value ) ; } else if ( object instanceof starlark list ) { @ suppress warnings ( " unchecked " ) starlark list < object > list = ( starlark list < object > ) object ; int index = starlark to int ( key , " list index " ) ; index = eval utils get sequence index ( index , list size ( ) ) ; list set element at ( index , value ) ; } else { throw starlark errorf ( " can only assign an element in a dictionary or a list , not in a ' % s ' " , starlark type ( object ) ) ; } }


all the registered { @ link computer listener } s

public static extension list < computer listener > all ( ) { return extension list lookup ( computer listener class ) ; }


tests that the simple escaper treats 0 - 9 , a - z and a - z as safe

public void test simple escaper ( ) { unicode escaper e = new percent escaper ( " " , false ) ; for ( char c = 0 ; c < 128 ; c + + ) { if ( ( c > = ' 0 ' & & c < = ' 9 ' ) | | ( c > = ' a ' & & c < = ' z ' ) | | ( c > = ' a ' & & c < = ' z ' ) ) { assert unescaped ( e , c ) ; } else { assert escaping ( e , escape ascii ( c ) , c ) ; } } / / testing mutlibyte escape sequences assert escaping ( e , " % 00 " , ' \ u 0 0 0 0 ' ) ; / / nul assert escaping ( e , " % 7f " , ' \ u 0 0 7f ' ) ; / / del assert escaping ( e , " % c2 % 80 " , ' \ u 0 0 8 0 ' ) ; / / xx - 00010 , x - 000000 assert escaping ( e , " % df % bf " , ' \ u 0 7ff ' ) ; / / xx - 11111 , x - 111111 assert escaping ( e , " % e0 % a0 % 80 " , ' \ u 0 8 0 0 ' ) ; / / xxx - 0000 , x - 100000 , x - 00 , 0000 assert escaping ( e , " % ef % bf % bf " , ' \ uffff ' ) ; / / xxx - 1111 , x - 111111 , x - 11 , 1111 assert unicode escaping ( e , " % f0 % 90 % 80 % 80 " , ' \ u d 8 0 0 ' , ' \ u d c 0 0 ' ) ; assert unicode escaping ( e , " % f4 % 8f % bf % bf " , ' \ u d b f f ' , ' \ u d f f f ' ) ; / / simple string tests assert equals ( " " , e escape ( " " ) ) ; assert equals ( " safestring " , e escape ( " safestring " ) ) ; assert equals ( " embedded % 0 0null " , e escape ( " embedded \ 0null " ) ) ; assert equals ( " max % ef % bf % b fchar " , e escape ( " max \ uffffchar " ) ) ; }


public void install actions ( ) { if ( actions = = null ) { return ; } for ( docking action if action : actions ) { tool add action ( action ) ; } }


http : code google compgoogle - gsonissuesdetail ? id = 342

public void test array elements are arrays ( ) { object [ ] string arrays = { new string [ ] { " test 1 " , " test 2 " } , new string [ ] { " test 3 " , " test 4 " } } ; assert equals ( " [ [ \ " test 1 \ " , \ " test 2 \ " ] , [ \ " test 3 \ " , \ " test 4 \ " ] ] " , new gson ( ) to json ( string arrays ) ) ; }


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

public single < void > rx update user ( string username , user body ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate update user ( username , body , fut ) ) ) ; }


the evaluate function performs the core authorization mechanism of cel - based authorization engine it determines whether a g r p c call is allowed , denied , or unable to be decided

public authorization decision evaluate ( evaluate args args ) { list < string > unknown policy names = new array list < > ( ) ; / / set up activation used in cel library ' s eval function activation activation = activation copy of ( args generate envoy attributes ( ) ) ; / / iterate through deny engine ' s map / / if there is match , immediately return deny / / if there are unknown conditions , return unknown / / if all non - match , then iterate through allow engine if ( deny engine ! = null ) { authorization decision authz decision = evaluate engine ( deny engine conditions entry set ( ) , authorization decision output deny , unknown policy names , activation ) ; if ( authz decision ! = null ) { return authz decision ; } if ( ! unknown policy names is empty ( ) ) { return new authorization decision ( authorization decision output unknown , unknown policy names ) ; } } / / once we enter allow engine , if there is a match , immediately return allow / / in the end of iteration , if there are unknown conditions , return unknown / / if all non - match , return deny if ( allow engine ! = null ) { authorization decision authz decision = evaluate engine ( allow engine conditions entry set ( ) , authorization decision output allow , unknown policy names , activation ) ; if ( authz decision ! = null ) { return authz decision ; } if ( ! unknown policy names is empty ( ) ) { return new authorization decision ( authorization decision output unknown , unknown policy names ) ; } } / / return allow if it only has a deny engine and it ’ s unmatched if ( this allow engine = = null & & this deny engine ! = null ) { return new authorization decision ( authorization decision output allow , new array list < string > ( ) ) ; } / / return deny if none of deny engine and allow engine matched , / / or the single allow engine is unmatched when there is only one allow engine return new authorization decision ( authorization decision output deny , new array list < string > ( ) ) ; }


returns { @ code true } when the conscrypt java classes are available does not imply it actually works on this platform

public static boolean is present ( ) { return new provider method ! = null ; }


performs base 6 4 encoding on the < code > raw < code > byte buffer , writing it to the < code > encoded < code > byte buffer this is an experimental feature currently it does not pass along any options ( such as { @ link # do break lines } or { @ link # gzip }

public static void encode ( java nio byte buffer raw , java nio byte buffer encoded ) { byte [ ] raw 3 = new byte [ 3 ] ; byte [ ] enc 4 = new byte [ 4 ] ; while ( raw has remaining ( ) ) { int rem = math min ( 3 , raw remaining ( ) ) ; raw get ( raw 3 , 0 , rem ) ; base 6 4 encode 3to 4 ( enc 4 , raw 3 , rem , base 6 4 no options ) ; encoded put ( enc 4 ) ; } / / end input remaining }


register that a target has been configured

void done configure target ( ) { configured targets completed increment and get ( ) ; }


public void map number test ( ) { / / todo : test map number }


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

public all types model view model on unbind ( on model unbound listener < all types model view model , all types model view > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


get the associated model ' s map of self model it can be used for associations actions of crud the key is the name of associated model ' s table the value is the id of associated model

map < string , long > get associated models map without f k ( ) { if ( associated models map without f k = = null ) { associated models map without f k = new hash map < string , long > ( ) ; } return associated models map without f k ; }


public synchronized mutable stat new stat ( string name , string desc , string sample name , string value name , boolean extended ) { check metric name ( name ) ; mutable stat ret = new mutable stat ( name , desc , sample name , value name , extended ) ; metrics map put ( name , ret ) ; return ret ; }


public map < string , scheduler assignment > get assignments ( ) { map < string , scheduler assignment > ret = new hash map < string , scheduler assignment > ( this assignments size ( ) ) ; for ( string topology id : this assignments key set ( ) ) { ret put ( topology id , this assignments get ( topology id ) ) ; } return ret ; }


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


create an exception ( or throw one , if desired )

throwable evaluate ( int timeout millis , throwable caught ) throws throwable ;


binds the texture to the given texture unit sets the currently active texture unit via { @ link gl20 # gl active texture ( int ) }

public void bind ( int unit ) { gdx gl gl active texture ( gl20 gl texture0 + unit ) ; gdx gl gl bind texture ( gl target , gl handle ) ; }


gets direct access to the underlying { @ code binder }

protected binder binder ( ) { return binder ; }


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

public list < pet > find pets by status ( @ query param ( " status " ) @ not null list < string > status ) ;


called once a write operation is made the write operation will write the messages through the { @ link channel pipeline } those are then ready to be flushed to the actual { @ link channel } once { @ link channel # flush ( ) } is called

void write ( channel handler context ctx , object msg , channel promise promise ) throws exception ;


see { @ link file status # has acl ( ) }


public auth filter builder < c , p , t > set prefix ( string prefix ) { this prefix = prefix ; return this ; }


public short get type i d ( ) { return type i d ; }


generates a javadoc block for generated methods that delegate to other methods the generated block looks something like this : < code > { @ literal

code block generate see method javadoc ( type name name of class containing method , string method simple name , list < ? extends variable element > method parameters ) { return generate see method javadoc internal ( name of class containing method , method simple name , lists transform ( method parameters , new function < variable element , object > ( ) { @ override public object apply ( variable element input ) { return get javadoc safe name ( input ) ; } } ) ) ; }


< code > optional aapt pb style style = 2 ; < code >

private void set style ( com android aapt resources style value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } style = value ; bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; }


return the permissions used in application

public static list < string > get permissions ( final string package name ) { package manager pm = utils get app ( ) get package manager ( ) ; try { string [ ] permissions = pm get package info ( package name , package manager get permissions ) requested permissions ; if ( permissions = = null ) return collections empty list ( ) ; return arrays as list ( permissions ) ; } catch ( package manager name not found exception e ) { e print stack trace ( ) ; return collections empty list ( ) ; } }


check that the expected targets were exactly those visited , and that the packages of these expected targets were exactly those packages visited

protected void assert expected targets ( set < string > expected labels , set < label > starting labels ) throws exception { set < label > visited labels = get visited labels ( starting labels , get skyframe executor ( ) ) ; assert that ( visited labels ) contains exactly elements in ( as label set ( expected labels ) ) ; }


checks if the hadoop dependency is at least the given version

public static boolean is min hadoop version ( int major , int minor ) throws flink runtime exception { final tuple 2 < integer , integer > hadoop version = get major minor bundled hadoop version ( ) ; int maj = hadoop version f 0 ; int min = hadoop version f 1 ; return maj > major | | ( maj = = major & & min > = minor ) ; }


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

public static boolean kill background processes ( @ non null final string package name ) { activity manager am = ( activity manager ) utils get app ( ) get system service ( context activity service ) ; list < activity manager running app process info > info = am get running app processes ( ) ; if ( info = = null | | info size ( ) = = 0 ) return true ; for ( activity manager running app process info a info : info ) { if ( arrays as list ( a info pkg list ) contains ( package name ) ) { am kill background processes ( package name ) ; } } info = am get running app processes ( ) ; if ( info = = null | | info size ( ) = = 0 ) return true ; for ( activity manager running app process info a info : info ) { if ( arrays as list ( a info pkg list ) contains ( package name ) ) { return false ; } } return true ; }


tests that the rpc is not running if it is being stopped

public void test not running state ( ) throws interrupted exception , execution exception , timeout exception { completable future < void > stop future = new completable future < > ( ) ; running state testing endpoint endpoint = new running state testing endpoint ( rpc service , stop future ) ; running state testing endpoint gateway gateway = endpoint get self gateway ( running state testing endpoint gateway class ) ; endpoint start ( ) ; completable future < void > termination future = endpoint close and wait until on stop called ( ) ; assert that ( gateway query is running flag ( ) get ( ) , is ( false ) ) ; stop future complete ( null ) ; termination future get ( timeout to milliseconds ( ) , time unit milliseconds ) ; }


same test case as before , but now with all automatic steps

public void test simple automatic sub process ( ) { process instance pi = runtime service start process instance by key ( " simple sub process automatic " ) ; assert that ( pi is ended ( ) ) is true ( ) ; assert process ended ( pi get id ( ) ) ; }


void on patch dex opt fail ( file patch file , list < file > dex files , throwable t ) ;


test large headers that exceed { @ link default http 2 frame writer # max frame size } the remaining headers will be sent in a continuation frame

public void write large headers ( ) throws exception { int stream id = 1 ; http 2 headers headers = new default http 2 headers ( ) method ( " get " ) path ( " / " ) authority ( " foo com " ) scheme ( " https " ) ; headers = dummy headers ( headers , 20 ) ; http 2 headers encoder configuration ( ) max header list size ( integer max value ) ; frame writer headers configuration ( ) max header list size ( integer max value ) ; frame writer max frame size ( http 2 codec util max frame size lower bound ) ; frame writer write headers ( ctx , stream id , headers , 0 , true , promise ) ; byte [ ] expected payload = header payload ( stream id , headers ) ; / / first frame : header ( length = 0x 4 0 0 0 , flags = 0x 0 1 ) assert equals ( http 2 codec util max frame size lower bound , outbound read unsigned medium ( ) ) ; assert equals ( 0x 0 1 , outbound read byte ( ) ) ; assert equals ( 0x 0 1 , outbound read byte ( ) ) ; assert equals ( stream id , outbound read int ( ) ) ; byte [ ] first payload = new byte [ http 2 codec util max frame size lower bound ] ; outbound read bytes ( first payload ) ; int remain payload length = expected payload length - http 2 codec util max frame size lower bound ; / / second frame : continuation ( length = remain payload length , flags = 0x 0 4 ) assert equals ( remain payload length , outbound read unsigned medium ( ) ) ; assert equals ( 0x 0 9 , outbound read byte ( ) ) ; assert equals ( 0x 0 4 , outbound read byte ( ) ) ; assert equals ( stream id , outbound read int ( ) ) ; byte [ ] second payload = new byte [ remain payload length ] ; outbound read bytes ( second payload ) ; assert array equals ( arrays copy of range ( expected payload , 0 , first payload length ) , first payload ) ; assert array equals ( arrays copy of range ( expected payload , first payload length , expected payload length ) , second payload ) ; }


sets the distance from the center using the default distance unit

public geo distance query builder distance ( string distance ) { return distance ( distance , distance unit default ) ; }


checks if image header bytes starts with soi ( start of image ) marker , followed by 0x f f if header size is lower than 3 false is returned description of jpeg format can be found here : < a href = " http : www w 3 org graphics j p e gitu - t 8 1 pdf " > http : www w 3 org graphics j p e gitu - t 8 1 pdf annex b deals with compressed data format

private static boolean is jpeg header ( final byte [ ] image header bytes , final int header size ) { return header size > = jpeg header length & & image format checker utils starts with pattern ( image header bytes , jpeg header ) ; }


get all the stack variables in the postive portion of the stack this excludes any variables defined before the parameter offset if the parameter offset is positive

private int get positive count ( ) { if ( variables is empty ( ) ) { return 0 ; } int length = variables size ( ) ; / / find the end of the negatives int index = 0 ; for ( index = 0 ; index < length ; index + + ) { variable var = variables get ( index ) ; int stack offset = var get stack offset ( ) ; if ( stack offset > = 0 & & stack offset > = param start ) { break ; } } if ( index = = length ) { return 0 ; } return length - index ; }


creates a blocking stub for csi controller plugin on the given channel

public controller grpc controller blocking stub create controller blocking stub ( ) { return controller grpc new blocking stub ( channel ) ; }


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


figure out the best ( most common ) format for the set of files , select all files which match that format , and return the format found

static public string auto select files ( importing job job , object node retrieval record , array node file selection indexes ) { final map < string , integer > format to count = new hash map < string , integer > ( ) ; list < string > formats = new array list < string > ( ) ; array node file records = j s o n utilities get array ( retrieval record , " files " ) ; int count = file records size ( ) ; for ( int i = 0 ; i < count ; i + + ) { object node file record = j s o n utilities get object element ( file records , i ) ; string format = j s o n utilities get string ( file record , " format " , null ) ; if ( format ! = null ) { if ( format to count contains key ( format ) ) { format to count put ( format , format to count get ( format ) + 1 ) ; } else { format to count put ( format , 1 ) ; formats add ( format ) ; } } } collections sort ( formats , new comparator < string > ( ) { @ override public int compare ( string o 1 , string o 2 ) { return format to count get ( o 2 ) - format to count get ( o 1 ) ; } } ) ; / / default to " text " to to avoid parsing as " binary / excel " / / " text " is more general than " text / line - based " , so a better starting point string best format = formats size ( ) > 0 ? formats get ( 0 ) : " text " ; if ( j s o n utilities get int ( retrieval record , " archive count " , 0 ) = = 0 ) { / / if there ' s no archive , then select everything for ( int i = 0 ; i < count ; i + + ) { j s o n utilities append ( file selection indexes , i ) ; } } else { / / otherwise , select files matching the best format for ( int i = 0 ; i < count ; i + + ) { object node file record = j s o n utilities get object element ( file records , i ) ; string format = j s o n utilities get string ( file record , " format " , null ) ; if ( format ! = null & & format equals ( best format ) ) { j s o n utilities append ( file selection indexes , i ) ; } } / / if nothing matches the best format but we have some files , / / then select them all if ( file selection indexes size ( ) = = 0 & & count > 0 ) { for ( int i = 0 ; i < count ; i + + ) { j s o n utilities append ( file selection indexes , i ) ; } } } return best format ; }


return the underlying { @ link path matcher } delegate

public path matcher get path matcher ( ) { return this path matcher ; }


generate the stream of bytes as hex pairs separated by ' '

public string to string ( ) { return int stream range ( 0 , size ) map to obj ( idx - > string format ( " % 0 2x " , bytes [ idx ] ) ) collect ( collectors joining ( " " ) ) ; }


take a snapshot of the uncheckpointed split assignments

public void snapshot state ( long checkpoint id , simple versioned serializer < split t > split serializer , data output stream out ) throws exception { / / include the uncheckpointed assignments to the snapshot assignments by checkpoint id put ( checkpoint id , uncheckpointed assignments ) ; uncheckpointed assignments = new hash map < > ( ) ; write assignments by checkpoint id ( assignments by checkpoint id , split serializer , out ) ; }


returns an instance of < code > argb evaluator < code > that may be used in { @ link android animation value animator # set evaluator ( type evaluator ) } the same instance may be used in multiple < code > animator < code > s because it holds no state

public static argb evaluator get instance ( ) { return s instance ; }


returns the results from default dfs ( fallback ) if you want the results from specific clusters , please invoke them on child fs instance directly

public remote iterator < zone reencryption status > list reencryption status ( ) throws i o exception { if ( this vfs = = null ) { return super list reencryption status ( ) ; } check default d f s ( default d f s , " list reencryption status " ) ; return default d f s list reencryption status ( ) ; }


invoked before transaction commitrollback can perform resource cleanup before transaction completion this method will be invoked after { @ code before commit } , even when { @ code before commit } threw an exception this callback allows for closing resources before transaction completion , for any outcome

default mono < void > before completion ( ) { return mono empty ( ) ; }


hijack the current instance of this field < b > the instance must not be null at the time of hijacking < b > , or an illegal state exception will be thrown

public void hijack ( final c instance , final interception handler < ? > handler ) { final object delegatee = get ( instance ) ; if ( delegatee = = null ) throw new illegal state exception ( " cannot hijack null " ) ; final class < ? > [ ] interfaces = delegatee get class ( ) get interfaces ( ) ; set ( instance , interception proxy ( delegatee , handler , interfaces ) ) ; }


use { @ link # get annotations map ( ) } instead

public java util map < java lang string , java lang string > get annotations ( ) { return get annotations map ( ) ; }


convert from the universal java util date format to the type - specific format

object to type ( config config , date orig ) ;


public list < integer > get namespace wrapped array ( ) { return namespace wrapped array ; }


returns the first function in the current program

public final function get first function ( ) { function iterator iterator = current program get listing ( ) get functions ( true ) ; if ( iterator has next ( ) ) { return iterator next ( ) ; } return null ; }


the flag is volatile to avoid synchronization here re - entrancy is unlikely except in failure mode ( and inexpensive )

static checksum new crc 3 2 c ( ) { try { return use java 9 crc 3 2 c ? java 9 crc 3 2 c factory create checksum ( ) : new pure java crc 3 2 c ( ) ; } catch ( exception in initializer error | runtime exception e ) { / / should not happen log error ( " crc32c creation failed , switching to pure java crc 3 2 c " , e ) ; use java 9 crc 3 2 c = false ; return new pure java crc 3 2 c ( ) ; } }


the allocation status status of the store { @ link allocation status # primary } indicates a primary shard copy { @ link allocation status # replica } indicates a replica shard copy { @ link allocation status # unused } indicates an unused shard copy

public allocation status get allocation status ( ) { return allocation status ; }


determine whether an annotation of the specified { @ code annotation type } is declared locally ( i e directly present ) on the supplied { @ code clazz } the supplied { @ link class } may represent any type meta - annotations will not be searched note : this method does not determine if the annotation is { @ linkplain java lang annotation inherited inherited }

public static boolean is annotation declared locally ( class < ? extends annotation > annotation type , class < ? > clazz ) { return merged annotations from ( clazz ) get ( annotation type ) is directly present ( ) ; }


public string insn arg string ( dalv insn insn ) { return branch string ( insn ) ; }


add files in the input path recursively into the results

protected void add input path recursively ( list < file status > result , file system fs , path path , path filter input filter ) throws i o exception { remote iterator < located file status > iter = fs list located status ( path ) ; while ( iter has next ( ) ) { located file status stat = iter next ( ) ; if ( input filter accept ( stat get path ( ) ) ) { if ( stat is directory ( ) ) { add input path recursively ( result , fs , stat get path ( ) , input filter ) ; } else { result add ( shrink status ( stat ) ) ; } } } }


emits a record attaching a timestamp to it

protected void emit records with timestamps ( queue < t > records , kafka topic partition state < t , kph > partition state , long offset , long kafka event timestamp ) { / / emit the records , using the checkpoint lock to guarantee / / atomicity of record emission and offset state update synchronized ( checkpoint lock ) { t record ; while ( ( record = records poll ( ) ) ! = null ) { long timestamp = partition state extract timestamp ( record , kafka event timestamp ) ; source context collect with timestamp ( record , timestamp ) ; / / this might emit a watermark , so do it after emitting the record partition state on event ( record , timestamp ) ; } partition state set offset ( offset ) ; } }


returns the value for the cumulative total number of statements that can be made in all loops in a script before an exception is thrown this attempts to prevent infinite loops note if the counter is set to 0 , no loop counter will be written

public int get max loop counter ( ) { return max loop counter ; }


creates a new default data organization this has a mapping which defines the alignment of a data type based on its size the map defines pairs for data types that are 1 , 2 , 4 , and 8 bytes in length

public static data organization impl get default organization ( language language ) { data organization impl data organization = new data organization impl ( ) ; data organization set size alignment ( 1 , 1 ) ; data organization set size alignment ( 2 , 2 ) ; data organization set size alignment ( 4 , 4 ) ; data organization set size alignment ( 8 , 4 ) ; if ( language ! = null ) { data organization set pointer size ( language get default space ( ) get pointer size ( ) ) ; data organization set big endian ( language is big endian ( ) ) ; } return data organization ; }


verify quota when using the preferred block size for uc block this is usually used by append and truncate

private static quota counts verify quota for u c block ( f s namesystem fsn , i node file file , i nodes in path iip ) throws quota exceeded exception { f s directory fsd = fsn get f s directory ( ) ; if ( ! fsn is image loaded ( ) | | fsd should skip quota checks ( ) ) { / / do not check quota if editlog is still being processed return null ; } if ( file get last block ( ) ! = null ) { final quota counts delta = compute quota delta for u c block ( fsn , file ) ; fsd read lock ( ) ; try { f s directory verify quota ( iip , iip length ( ) - 1 , delta , null ) ; return delta ; } finally { fsd read unlock ( ) ; } } return null ; }


call refresh on the indexes we ' ve written to after the request ends ?

public self refresh ( boolean refresh ) { request set refresh ( refresh ) ; return self ( ) ; }


the control group for the { @ code cpu } subsystem

public string get cpu control group ( ) { return cpu control group ; }


public boolean is code ( ) { return ! is data ( ) ; }


attempt to parse group names given that some names are not resolvable use the group id list to identify those that are not resolved

private set < string > parse partial group names ( string group names , string group i ds ) throws partial group name exception { string tokenizer name tokenizer = new string tokenizer ( group names , shell token separator regex ) ; string tokenizer id tokenizer = new string tokenizer ( group i ds , shell token separator regex ) ; set < string > groups = new linked hash set < > ( ) ; while ( name tokenizer has more tokens ( ) ) { / / check for unresolvable group names if ( ! id tokenizer has more tokens ( ) ) { throw new partial group name exception ( " number of group names and ids do " + " not match group name = " + group names + " , group id = " + group i ds ) ; } string group name = name tokenizer next token ( ) ; string group i d = id tokenizer next token ( ) ; if ( ! string utils is numeric ( group name ) | | ! group name equals ( group i d ) ) { / / if the group name is non - numeric , it is resolved / / if the group name is numeric , but is not the same as group id , / / regard it as a group name / / if unfortunately , some group names are not resolvable , and / / the group name is the same as the group id , regard it as not / / resolved groups add ( group name ) ; } } return groups ; }


a convenience method to force the image denoted by < code > filename < code > to be read from disk and to not use the cached version

public static image icon reload image ( string filename ) { icon map remove ( filename ) ; return load image ( filename ) ; }


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit when clause ( sql base parser when clause context ctx ) { return visit children ( ctx ) ; }


specify which { @ link application context initializer } instances should be used to initialize the application context used by this { @ code framework servlet }

public void set context initializers ( @ nullable application context initializer < ? > initializers ) { if ( initializers ! = null ) { for ( application context initializer < ? > initializer : initializers ) { this context initializers add ( ( application context initializer < configurable application context > ) initializer ) ; } } }


public integer get int 3 2 ( ) { return int 3 2 ; }


set the type of this body this may alter the mass and velocity

public void set type ( body type type ) { org jbox 2d dynamics body type t = org jbox 2d dynamics body type dynamic ; if ( type = = body type dynamic body ) t = org jbox 2d dynamics body type dynamic ; if ( type = = body type kinematic body ) t = org jbox 2d dynamics body type kinematic ; if ( type = = body type static body ) t = org jbox 2d dynamics body type static ; body set type ( t ) ; }


enqueues an event to be run on currently known listeners the { @ code to string } method of the event itself will be used to describe the event in the case of an error

public void enqueue ( event < l > event ) { enqueue helper ( event , event ) ; }


for a given output base directory , returns the command log file path

static path get command log path ( path output base ) { return output base get relative ( " command log " ) ; }


public static void mock resource manager ( branch type branch type , resource manager rm ) { resource managers put ( branch type , rm ) ; }


delegates execution to the underlying runnable

public void timer expired ( timer timer ) { this runnable run ( ) ; }


default implementation always returns false

public boolean attempt allocation on node ( scheduler application attempt app attempt , scheduling request scheduling request , scheduler node scheduler node ) { return false ; }