checks how many of the files given by blob keys are accessible

public static void check file count for job ( int expected count , job i d job id , permanent blob service blob service ) throws i o exception { final file job dir ; if ( blob service instanceof blob server ) { blob server server = ( blob server ) blob service ; job dir = server get storage location ( job id , new permanent blob key ( ) ) get parent file ( ) ; } else { permanent blob cache cache = ( permanent blob cache ) blob service ; job dir = cache get storage location ( job id , new permanent blob key ( ) ) get parent file ( ) ; } file [ ] blobs for job = job dir list files ( ) ; if ( blobs for job = = null ) { if ( expected count ! = 0 ) { throw new i o exception ( " file " + job dir + " does not exist " ) ; } } else { assert equals ( " too many / few files in job dir : " + arrays as list ( blobs for job ) to string ( ) , expected count , blobs for job length ) ; } }


patch another - fakedummy : to test special tags to test special tags and operation id starting with number

response entity < client > call 1 2 3test special tags ( client body ) ;


filters out unreliable numeric shard generations read from { @ link repository data } or { @ link index shard snapshot status } , returning { @ code null } in their place

public static string fix shard generation ( @ nullable string shard generation ) { if ( shard generation = = null ) { return null ; } return is number matcher ( shard generation ) matches ( ) ? null : shard generation ; }


public string get task name ( ) { return this task name ; }


adds an an input that will be return from { @ link # read secret ( string ) } values are read in fifo order

public void add secret input ( string input ) { secret input add ( input ) ; }


provide a custom flash map manager this is delegated to { @ link standalone mock mvc builder # set flash map manager ( flash map manager ) }

controller spec flash map manager ( flash map manager flash map manager ) ;


void set callback ( mqtt client callback callback ) ;


parse and read all settings available under the azure client namespace

public static map < string , azure storage settings > load ( settings settings ) { / / get the list of existing named configurations final map < string , azure storage settings > storage settings = new hash map < > ( ) ; for ( final string client name : account setting get namespaces ( settings ) ) { storage settings put ( client name , get client settings ( settings , client name ) ) ; } if ( false = = storage settings contains key ( " default " ) & & false = = storage settings is empty ( ) ) { / / in case no setting named " default " has been set , let ' s define our " default " / / as the first named config we get final azure storage settings default settings = storage settings values ( ) iterator ( ) next ( ) ; storage settings put ( " default " , default settings ) ; } assert storage settings contains key ( " default " ) | | storage settings is empty ( ) : " always have ' default ' if any " ; return collections unmodifiable map ( storage settings ) ; }


evaluate the condition and if true evaluate the first alternative , otherwise evaluate the second alternative

public typed value get value internal ( expression state state ) throws evaluation exception { boolean value = this children [ 0 ] get value ( state , boolean class ) ; if ( value = = null ) { throw new spel evaluation exception ( get child ( 0 ) get start position ( ) , spel message type conversion error , " null " , " boolean " ) ; } typed value result = this children [ value ? 1 : 2 ] get value internal ( state ) ; compute exit type descriptor ( ) ; return result ; }


public static < t > t get parcelable ( @ non null final string key , @ non null final parcelable creator < t > creator , @ non null final cache disk utils cache disk utils ) { return cache disk utils get parcelable ( key , creator ) ; }


releases an output buffer back to the decoder

protected void release output buffer ( o output buffer ) { synchronized ( lock ) { release output buffer internal ( output buffer ) ; maybe notify decode loop ( ) ; } }


whether this column will be shown by default the default implementation is true

public boolean shown by default ( ) { return true ; }


get the group memberships of a given user if the user ' s group is not cached , this method may block note this method can be expensive as it involves set { @ literal - > } list conversion for user with large group membership ( i e , { @ literal > } 1000 groups ) , we recommend using get group set to avoid the conversion and fast membership look up via contains ( )

public list < string > get groups ( final string user ) throws i o exception { return collections unmodifiable list ( new array list < > ( get group internal ( user ) ) ) ; }


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


get information ( { @ link queue info } ) about all queues , recursively if there is a hierarchy

public abstract list < queue info > get all queues ( ) throws yarn exception , i o exception ;


public static string encode map ( map < string , string > map ) { if ( map = = null ) { return null ; } if ( map is empty ( ) ) { return string utils empty ; } string builder sb = new string builder ( ) ; for ( map entry < string , string > entry : map entry set ( ) ) { sb append ( entry get key ( ) ) append ( kv split ) append ( entry get value ( ) ) append ( pair split ) ; } return sb substring ( 0 , sb length ( ) - 1 ) ; }


sets an integer attribute on the specified element

public static void set int attr ( element ele , string attr name , int attr value ) { ele set attribute ( attr name , integer to string ( attr value ) ) ; }


set the global filters to use in order to support { @ link json filter @ json filter } annotated pojo

public jackson 2 object mapper builder filters ( filter provider filters ) { this filters = filters ; return this ; }


public void set cancel tool tip text ( string tool tip ) { set cancel tool tip ( tool tip ) ; }


ensures that { @ code index } specifies a valid position in an array , list or string of size { @ code size } a position index may range from zero to { @ code size } , inclusive

public static int check position index ( int index , int size , @ nullable decl string desc ) { / / carefully optimized for execution by hotspot ( explanatory comment above ) if ( index < 0 | | index > size ) { throw new index out of bounds exception ( bad position index ( index , size , desc ) ) ; } return index ; }


returns the code revision ( commit and commit date ) of flink , as generated by the maven builds

public static revision information get revision information ( ) { return new revision information ( get git commit id abbrev ( ) , get git commit time string ( ) ) ; }


set bit to ' 0 ' or ' 1 ' in the given int

public static int set bit ( int value , int bit number , boolean bit value ) { if ( bit value ) { return set bit on ( value , bit number ) ; } else { return set bit off ( value , bit number ) ; } }


call this after the performing the ingest action , even if the action failed

void post ingest ( long ingest time in nanos ) { ingest current decrement and get ( ) ; this ingest time in nanos inc ( ingest time in nanos ) ; ingest count inc ( ) ; }


fires off a notification indicating that the given tag has been deleted

private void fire tag deleted notification ( int type , function tag tag ) { program tag changed ( tag , type , tag , null ) ; }


public float get float ( ) { return float ; }


initialize the given bean instance , applying factory callbacks as well as init methods and bean post processors called from { @ link # create bean } for traditionally defined beans , and from { @ link # initialize bean } for existing bean instances

protected object initialize bean ( string bean name , object bean , @ nullable root bean definition mbd ) { if ( system get security manager ( ) ! = null ) { access controller do privileged ( ( privileged action < object > ) ( ) - > { invoke aware methods ( bean name , bean ) ; return null ; } , get access control context ( ) ) ; } else { invoke aware methods ( bean name , bean ) ; } object wrapped bean = bean ; if ( mbd = = null | | ! mbd is synthetic ( ) ) { wrapped bean = apply bean post processors before initialization ( wrapped bean , bean name ) ; } try { invoke init methods ( bean name , wrapped bean , mbd ) ; } catch ( throwable ex ) { throw new bean creation exception ( ( mbd ! = null ? mbd get resource description ( ) : null ) , bean name , " invocation of init method failed " , ex ) ; } if ( mbd = = null | | ! mbd is synthetic ( ) ) { wrapped bean = apply bean post processors after initialization ( wrapped bean , bean name ) ; } return wrapped bean ; }


when drawing the overall load statistics , use the total queue length , not { @ link # queue length } , which just shows jobs that are to be run on the master

protected trend chart create overall trend chart ( time scale time scale ) { return multi stage time series create trend chart ( time scale , busy executors , online executors , queue length , available executors ) ; }


public abstract void set request ( scheduling request request ) ;


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


the set of values defined for this entry , each corresponding to a different configurationvariant < code > repeated aapt pb config value config value = 4 ; < code >

private void set config value ( int index , com android aapt resources config value value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } ensure config value is mutable ( ) ; config value set ( index , value ) ; }


deletes a range of addresses from this set

public final void delete range ( address start , address end ) { delete ( start , end ) ; }


public metrics registry tag ( string name , string description , string value ) { return tag ( name , description , value , false ) ; }


returns an array of the dynamics defined this dynamic header with the specified ( enum ) type

public elf dynamic [ ] get dynamics ( elf dynamic type type ) { return get dynamics ( type value ) ; }


{ @ inherit doc } gets the remote ip from the request , and invokes spnego if it isn ' t filtered

protected event do execute ( final request context context ) { val remote ip = get remote ip ( context ) ; logger debug ( " current user ip [ { } ] " , remote ip ) ; if ( should do spnego ( remote ip ) ) { logger info ( " spnego should be activated for [ { } ] " , remote ip ) ; return yes ( ) ; } logger info ( " spnego should is skipped for [ { } ] " , remote ip ) ; return no ( ) ; }


checks whether reduce does behave as expected if both values are the same object

public void test min by comparison multiple ( ) { select by min function < tuple 5 < integer , long , string , long , integer > > min by tuple = new select by min function < tuple 5 < integer , long , string , long , integer > > ( tuple type info , new int [ ] { 0 , 1 , 2 , 3 , 4 } ) ; try { assert assert same ( " select by min must return smaller tuple " , smaller , min by tuple reduce ( smaller , bigger ) ) ; assert assert same ( " select by min must return smaller tuple " , smaller , min by tuple reduce ( bigger , smaller ) ) ; } catch ( exception e ) { assert fail ( " no exception should be thrown while comparing both tuples " ) ; } }


writes the map entries to the specified data output stream

private void write entries ( data output stream out , map < k , v > map ) throws i o exception { for ( map entry < k , v > entry : map entry set ( ) ) { out write byte ( entry magic ) ; write key ( entry get key ( ) , out ) ; v value = entry get value ( ) ; boolean is entry = ( value ! = null ) ; out write boolean ( is entry ) ; if ( is entry ) { write value ( value , out ) ; } } }


creates list of users with given input array

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


tests that server certificate with invalid host name is accepted by a client that has disabled endpoint validation

public void test endpoint identification disabled ( args args ) throws exception { args server cert stores = cert builder ( true , " server " , args use inline pem ) add host name ( " notahost " ) build ( ) ; args client cert stores = cert builder ( false , " client " , args use inline pem ) add host name ( " localhost " ) build ( ) ; args ssl server configs = args get trusting config ( args server cert stores , args client cert stores ) ; args ssl client configs = args get trusting config ( args client cert stores , args server cert stores ) ; server = create echo server ( args , security protocol ssl ) ; inet socket address addr = new inet socket address ( " localhost " , server port ( ) ) ; / / disable endpoint validation , connection should succeed string node = " 1 " ; args ssl client configs put ( ssl configs ssl endpoint identification algorithm config , " " ) ; create selector ( args ssl client configs ) ; selector connect ( node , addr , buffer size , buffer size ) ; network test utils check client connection ( selector , node , 100 , 10 ) ; / / disable endpoint validation using null value , connection should succeed string node 2 = " 2 " ; args ssl client configs put ( ssl configs ssl endpoint identification algorithm config , null ) ; create selector ( args ssl client configs ) ; selector connect ( node 2 , addr , buffer size , buffer size ) ; network test utils check client connection ( selector , node 2 , 100 , 10 ) ; / / connection should fail with endpoint validation enabled string node 3 = " 3 " ; args ssl client configs put ( ssl configs ssl endpoint identification algorithm config , " https " ) ; create selector ( args ssl client configs ) ; selector connect ( node 3 , addr , buffer size , buffer size ) ; network test utils wait for channel close ( selector , node 3 , channel state state authentication failed ) ; selector close ( ) ; }


return a { @ link socket input wrapper } for the socket and set the given timeout if the socket does not have an associated channel , then its socket timeout will be set to the specified value otherwise , a { @ link socket input stream } will be created which reads with the configured timeout any socket created using socket factories returned by { @ link # net utils } , must use this interface instead of { @ link socket # get input stream ( ) } in general , this should be called only once on each socket : see the note in { @ link socket input wrapper # set timeout ( long ) } for more information

public static socket input wrapper get input stream ( socket socket , long timeout ) throws i o exception { input stream stm = ( socket get channel ( ) = = null ) ? socket get input stream ( ) : new socket input stream ( socket ) ; socket input wrapper w = new socket input wrapper ( socket , stm ) ; w set timeout ( timeout ) ; return w ; }


async observable and semaphore isolation with functioning request context use hystrix context scheduler to make the user provided scheduler capture context

public void test short circuited with fallback request context with thread isolated asynchronous observable and captured context scheduler ( ) { request context test results results = test request context on short circuited with fallback ( execution isolation strategy thread , new hystrix context scheduler ( schedulers new thread ( ) ) ) ; assert true ( results is context initialized get ( ) ) ; / / the user scheduler captures context assert true ( results origin thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / the user provided thread / scheduler assert true ( results is context initialized observe on get ( ) ) ; / / the user scheduler captures context assert true ( results observe on thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / the user provided thread / scheduler from get fallback / / thread isolated but rejected so not executed in a thread assert false ( results command is executed in thread ( ) ) ; }


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


returns a freshly created entry , typed at the { @ code e } type , for the given { @ code segment } , that is a copy of the given { @ code entry }

e copy ( s segment , e entry , @ nullable decl e new next ) ;


public void set datanode info ( int num live , int num dead , int num stale , int num decom , int num live decom , int num dead decom , int num in maintenance live , int num in maintenance dead , int num entering maintenance , long num scheduled replication blocks ) { this live datanodes = num live ; this dead datanodes = num dead ; this stale datanodes = num stale ; this decom datanodes = num decom ; this live decom datanodes = num live decom ; this dead decom datanodes = num dead decom ; this in maintenance live data nodes = num in maintenance live ; this in maintenance dead data nodes = num in maintenance dead ; this entering maintenance data nodes = num entering maintenance ; this stats valid = true ; this scheduled replication blocks = num scheduled replication blocks ; }


todo nacos does not support atomic update of the value mapped to a key

public sorted set < string > get config keys ( string group ) { / / todo use nacos client api to replace http open api sorted set < string > keys = new tree set < > ( ) ; try { list < string > params values = as list ( " search " , " accurate " , " data id " , " " , " group " , resolve group ( group ) , " page no " , " 1 " , " page size " , string value of ( integer max value ) ) ; string encoding = get property ( encode , " utf - 8 " ) ; http simple client http result result = http agent http get ( get config keys path , empty list ( ) , params values , encoding , 5 * 1000 ) ; stream < string > keys stream = to keys stream ( result content ) ; keys stream for each ( keys : : add ) ; } catch ( i o exception e ) { if ( logger is error enabled ( ) ) { logger error ( e get message ( ) , e ) ; } } return keys ; }


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


public nodes stats request builder set discovery ( boolean discovery ) { add or remove metric ( discovery , nodes stats request metric discovery ) ; return this ; }


initializes loader with given ` context ` subsequent calls should have no effect since application context is retrieved libraries will not be loaded immediately but only when needed

public static void initialize ( @ non null final context context ) { s app context = context get application context ( ) ; }


guaranteed to throw an exception and leave the map unmodified

public < t extends b > t put instance ( class < t > type , t value ) { throw new unsupported operation exception ( ) ; }


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

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


return a read - only list with the registered handlers , or an empty list

public list < handler method return value handler > get handlers ( ) { return collections unmodifiable list ( this return value handlers ) ; }


close the services used for leader election


returns a rule context which is the same as the original rule context of the target parameter

public rule context get rule context for testing ( configured target target , stored event handler event handler , build configuration collection configurations ) throws dependency resolver failure , invalid configuration exception , interrupted exception , inconsistent aspect order exception , toolchain exception , starlark transition transition exception , invalid exec group exception { build configuration target config = skyframe executor get configuration ( event handler , target get configuration key ( ) ) ; sky function environment skyframe env = skyframe executor get sky function environment for testing ( event handler ) ; starlark builtins value starlark builtins value = ( starlark builtins value ) preconditions check not null ( skyframe env get value ( starlark builtins value key ( ) ) ) ; caching analysis environment analysis env = new caching analysis environment ( get artifact factory ( ) , skyframe executor get action key context ( ) , configured target key builder ( ) set label ( target get label ( ) ) set configuration ( target config ) build ( ) , / * is system env = * / false , target config extended sanity checks ( ) , target config allow analysis failures ( ) , event handler , skyframe env , starlark builtins value ) ; return get rule context for testing ( event handler , target , analysis env , configurations ) ; }


locates the first occurrence of the specified { @ code value } in this buffer the search starts from the specified { @ code index } ( inclusive ) and lasts for the specified { @ code length } this method does not modify { @ code reader index } or { @ code writer index } of this buffer

public abstract int bytes before ( int index , int length , byte value ) ;


calls thread fail with message " should throw exception "

public void thread should throw ( ) { thread fail ( " should throw exception " ) ; }


perform the second query to get the groups of the user if posix groups is enabled , use use posix giduid to find otherwise , use the general group member attribute to find it

private set < string > lookup group ( search result result , dir context c , int go up hierarchy ) throws naming exception { set < string > groups = new linked hash set < > ( ) ; set < string > group d ns = new hash set < > ( ) ; naming enumeration < search result > group results ; / / perform the second ldap query if ( is posix ) { group results = lookup posix group ( result , c ) ; } else { string user dn = result get name in namespace ( ) ; group results = c search ( groupbase d n , " ( & " + group search filter + " ( " + group member attr + " = { 0 } ) ) " , new object [ ] { user dn } , search controls ) ; } / / if the second query is successful , group objects of the user will be / / returned get group names from the returned objects if ( group results ! = null ) { while ( group results has more elements ( ) ) { search result group result = group results next element ( ) ; get group names ( group result , groups , group d ns , go up hierarchy > 0 ) ; } if ( go up hierarchy > 0 & & ! is posix ) { go up group hierarchy ( group d ns , go up hierarchy , groups ) ; } } return groups ; }


long and ( long mask ) { return d 0 & mask ; }


public void add text ( glyph layout layout , float x , float y ) { add to cache ( layout , x , y + font data ascent ) ; }


returns the fully - qualified domain name of the task manager provided by { @ link # host name supplier }

public string get f q d n hostname ( ) { return host name supplier get fqdn host name ( ) ; }


public static string generate token ( string server ) throws i o exception , interrupted exception { user group information current user = user group information get current user ( ) ; log debug ( " the user credential is { } " , current user ) ; string challenge = current user do as ( new privileged exception action < string > ( ) { @ override public string run ( ) throws exception { try { / / this oid for kerberos gss - api mechanism oid mech oid = kerberos util get oid instance ( " gss krb5 mech oid " ) ; g s s manager manager = g s s manager get instance ( ) ; / / gss name for server g s s name server name = manager create name ( " http @ " + server , g s s name nt hostbased service ) ; / / create a g s s context for authentication with the service / / we ' re passing client credentials as null since we want them to / / be read from the subject g s s context gss context = manager create context ( server name canonicalize ( mech oid ) , mech oid , null , g s s context default lifetime ) ; gss context request mutual auth ( true ) ; gss context request cred deleg ( true ) ; / / establish context byte [ ] in token = new byte [ 0 ] ; byte [ ] out token = gss context init sec context ( in token , 0 , in token length ) ; gss context dispose ( ) ; / / base 6 4 encoded and stringified token for server log debug ( " got valid challenge for host { } " , server name ) ; return new string ( base 64 codec encode ( out token ) , standard charsets us ascii ) ; } catch ( g s s exception | illegal access exception | no such field exception | class not found exception e ) { log error ( " error : { } " , e ) ; throw new authentication exception ( e ) ; } } } ) ; return challenge ; }


returns a string representation of this { @ code char matcher } , such as { @ code char matcher or ( whitespace , java digit ) }

public string to string ( ) { return super to string ( ) ; }


return the initial stack size , if not zero

public long get stack size ( ) { return stack size ; }


wait until the cached live nodes value is updated

private static void wait update live nodes ( final string old value , final namenode bean metrics metrics ) throws exception { wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { return ! old value equals ( metrics get live nodes ( ) ) ; } } , 500 , 5 * 1000 ) ; }


this method will initialise the sync method by setting initial values for sleep durationsyield durations and next frame if running on windows it will start the sleep timer fix

private void initialise ( ) { initialised = true ; sleep durations init ( 1000 * 1000 ) ; yield durations init ( ( int ) ( - ( get time ( ) - get time ( ) ) * 1 333 ) ) ; next frame = get time ( ) ; string os name = system get property ( " os name " ) ; if ( os name starts with ( " win " ) ) { / / on windows the sleep functions can be highly inaccurate by / / over 1 0ms making in unusable however it can be forced to / / be a bit more accurate by running a separate sleeping daemon / / thread thread timer accuracy thread = new thread ( new runnable ( ) { public void run ( ) { try { thread sleep ( long max value ) ; } catch ( exception e ) { } } } ) ; timer accuracy thread set name ( " lwjgl3 timer " ) ; timer accuracy thread set daemon ( true ) ; timer accuracy thread start ( ) ; } }


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

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


returns true if the address input field contains text the get address ( ) method will return null if text is not a valid address

public boolean has input ( ) { return text field get text ( ) length ( ) ! = 0 ; }


find a { @ link method } to handle the given exception type this can be useful if an { @ link exception } instance is not available ( e g for tools ) uses { @ link exception depth comparator } if more than one match is found

public method resolve method by exception type ( class < ? extends throwable > exception type ) { method method = this exception lookup cache get ( exception type ) ; if ( method = = null ) { method = get mapped method ( exception type ) ; this exception lookup cache put ( exception type , method ) ; } return ( method ! = no matching exception handler method ? method : null ) ; }


determine whether the run is being build right now

protected boolean is in progress ( ) { return state equals ( state building ) | | state equals ( state post production ) ; }


when position increments are counted , we ' re looking to make sure that we : - don ' t count tokens without an increment - count normal tokens with one increment - count funny tokens with more than one increment - count the final token increments on the rare token streams that have them

public void test count positions with increments ( ) throws i o exception { analyzer analyzer = create mock analyzer ( ) ; assert that ( token count field mapper count positions ( analyzer , " " , " " , true ) , equal to ( 7 ) ) ; }


sets an external < code > delegation token secret manager < code > instance to manage creation and verification of delegation tokens this is useful for use cases where secrets must be shared across multiple services

public void set external delegation token secret manager ( abstract delegation token secret manager secret manager ) { this secret manager stop threads ( ) ; this secret manager = secret manager ; managed secret manager = false ; }


creates a symbolic link see { @ link path # create symbolic link ( path ) } for specification note : for { @ link file system } s where { @ link # supports symbolic links natively ( path ) } returns false , this method will throw an { @ link unsupported operation exception }

protected abstract void create symbolic link ( path link path , path fragment target fragment ) throws i o exception ;


resolves a relative or absolute label name if given name is absolute , then this method calls { @ link # parse absolute } otherwise , it calls { @ link # get local target label } for example : { @ code : quux } relative to { @ code foobar : baz } is { @ code foobar : quux } ; { @ code wiz : quux } relative to { @ code foobar : baz } is { @ code wiz : quux } ; { @ code @ repofoo : bar } relative to anything will be { @ code @ repofoo : bar } if { @ code @ repo } is not in { @ code repository mapping } but will be { @ code @ other repofoo : bar } if there is an entry { @ code @ repo - > @ other repo } in { @ code repository mapping }

public label get relative with remapping ( string rel name , immutable map < repository name , repository name > repository mapping ) throws label syntax exception { preconditions check not null ( repository mapping ) ; if ( rel name length ( ) = = 0 ) { throw new label syntax exception ( " empty package - relative label " ) ; } if ( label validator is absolute ( rel name ) ) { return resolve repository relative ( parse absolute ( rel name , false , repository mapping ) ) ; } else if ( rel name equals ( " : " ) ) { throw new label syntax exception ( " ' : ' is not a valid package - relative label " ) ; } else if ( rel name char at ( 0 ) = = ' : ' ) { return get local target label ( rel name substring ( 1 ) ) ; } else { return get local target label ( rel name ) ; } }


public string get erasure coding policy name ( i node inode ) { if ( inode is file ( ) ) { i node file i node file = inode as file ( ) ; if ( i node file is striped ( ) ) { byte ec policy id = i node file get erasure coding policy i d ( ) ; return fsn get erasure coding policy manager ( ) get by i d ( ec policy id ) get name ( ) ; } else { return replicated ; } } if ( inode is symlink ( ) ) { return " " ; } try { final x attr feature xaf = inode get x attr feature ( ) ; if ( xaf ! = null ) { x attr xattr = xaf get x attr ( xattr erasurecoding policy ) ; if ( xattr ! = null ) { byte array input stream bins = new byte array input stream ( xattr get value ( ) ) ; data input stream din = new data input stream ( bins ) ; string ec policy name = writable utils read string ( din ) ; return dir get f s namesystem ( ) get erasure coding policy manager ( ) get erasure coding policy by name ( ec policy name ) get name ( ) ; } } else if ( inode get parent ( ) ! = null ) { return get erasure coding policy name ( inode get parent ( ) ) ; } } catch ( i o exception ioe ) { log warn ( " encountered error getting ec policy for " + inode get full path name ( ) , ioe ) ; return " " ; } return " " ; }


hides the playback controls does nothing if playback controls are disabled

public void hide controller ( ) { if ( controller ! = null ) { controller hide ( ) ; } }


create a clone of this object if cloning is done before { @ code proceed ( ) } is invoked on this object , { @ code proceed ( ) } can be invoked once per clone to invoke the joinpoint ( and the rest of the advice chain ) more than once


sets the original first thunk to the specifed value

public void set original first thunk ( int i ) { original first thunk = i ; }


clone the supplied configuration but remove the shared edits dirs

private static configuration get configuration without shared edits ( configuration conf ) throws i o exception { list < uri > edits dirs = f s namesystem get namespace edits dirs ( conf , false ) ; string edits dirs string = joiner on ( " , " ) join ( edits dirs ) ; configuration conf without shared = new configuration ( conf ) ; conf without shared unset ( d f s config keys dfs namenode shared edits dir key ) ; conf without shared set strings ( d f s config keys dfs namenode edits dir key , edits dirs string ) ; return conf without shared ; }


resets variables maintaining the sum to zero this method may be a useful alternative to creating a new adder , but is only effective if there are no concurrent updates because this method is intrinsically racy , it should only be used when it is known that no threads are concurrently updating

public void reset ( ) { internal reset ( 0l ) ; }


testing time taken by abfs input stream to complete a get request

public void test action http get request ( ) throws i o exception { describe ( " test to check the correct value of time taken by http get " + " request in abfs input stream " ) ; azure blob file system fs = get file system ( ) ; azure blob file system store abfss = fs get abfs store ( ) ; path action http get request path = path ( get method name ( ) ) ; abfs input stream abfs input stream = null ; abfs output stream abfs output stream = null ; try { abfs output stream = create abfs output stream with flush enabled ( fs , action http get request path ) ; abfs output stream write ( ' a ' ) ; abfs output stream hflush ( ) ; abfs input stream = abfss open file for read ( action http get request path , fs get fs statistics ( ) ) ; abfs input stream read ( ) ; abfs input stream statistics impl abfs input stream statistics = ( abfs input stream statistics impl ) abfs input stream get stream statistics ( ) ; log info ( " abfs input stream stats info : { } " , abfs input stream statistics to string ( ) ) ; assertions assert that ( abfs input stream statistics get action http get request ( ) ) described as ( " mismatch in time taken by a get request " ) is greater than ( 0 0 ) ; } finally { i o utils cleanup with logger ( log , abfs input stream , abfs output stream ) ; } }


remove recovery attempt for the given block

synchronized void remove ( block info block ) { recovery timeouts remove ( new block recovery attempt ( block ) ) ; }


converts a value into a notification value

public static < t > object next ( t value ) { return value ; }


destroy particles in a group without enabling the destruction callback for destroyed particles this function is locked during callbacks

public void destroy particles in group ( particle group group ) { destroy particles in group ( group , false ) ; }


returns the width that will satisfy the width to height aspect ratio , keeping the given height fixed

int calculate width ( int height , double ratio ) { return ( int ) math round ( height * ratio ) ; }


initialize the default settings assuming a { @ code null } parent delegate

public void init defaults ( element root ) { init defaults ( root , null ) ; }


set the program after all the managers have been created

public void set program ( program d b program ) { this program = program ; equate table = program get equate table ( ) ; symbol table = ( symbol manager ) program get symbol table ( ) ; context mgr = program get program context ( ) ; ref manager = program get reference manager ( ) ; property map mgr = program get usr property manager ( ) ; data manager = program get data type manager ( ) ; proto mgr set program ( program ) ; }


method to properly set action enablement based upon appropriate business logic

private void enable actions ( ) { boolean at least one user fid db = fid file manager get user added files ( ) size ( ) > 0 ; create raw file action set enabled ( at least one user fid db ) ; }


sets the correct { @ code content type } and encodes the given content object via { @ link # json } , then sets it as the content

public http request builder json content ( object content ) { validate ( ) ; http request set header ( http request header content type , " application / json " ) ; string json content = json to json ( content ) ; http request set content ( json content ) ; return this ; }


associates a double value with the given name

public void put double ( string name , double value ) { map put ( name , double value of ( value ) ) ; }


test serialization of outer number types

big decimal fake outer number serialize ( big decimal body ) ;


close this interface to the resource calls on the interface are no longer value after this call


returns the last ( tail ) item in the queue ( without removing it )

public t last ( ) { if ( size = = 0 ) { / / underflow throw new no such element exception ( " queue is empty " ) ; } final t [ ] values = this values ; int tail = this tail ; tail - - ; if ( tail = = - 1 ) { tail = values length - 1 ; } return values [ tail ] ; }


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

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


protected void validate id token if any ( final o auth 2 0 access token access token , final common profile profile ) throws malformed claim exception { if ( string utils is not blank ( access token get id token ( ) ) ) { val service = o auth 2 0 utils get registered o auth service by client id ( this services manager , access token get client id ( ) ) ; val id token result = id token signing and encryption service decode ( access token get id token ( ) , optional of nullable ( service ) ) ; profile set id ( id token result get subject ( ) ) ; profile add attributes ( id token result get claims map ( ) ) ; } }


creates a { @ link conversation message } wrapping the provided message record no database or heavy work performed as the message is assumed to not have any mentions

public static @ non null conversation message create with resolved data ( @ non null message record message record ) { return new conversation message ( message record ) ; }


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

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


adds the next flag to the builder only if the variant type is the passed - in type

public conditional aapt command builder when variant is ( variant type variant type ) { preconditions check not null ( variant type ) ; return when ( this variant type = = variant type ) ; }


returns uid of the period in the child timeline from a concatenated period uid

public static object get child period uid from concatenated uid ( object concatenated uid ) { return ( ( pair < ? , ? > ) concatenated uid ) second ; }


shows a dialog asking the user if they really , really want to cancel the task

private boolean prompt to verify cancel ( ) { boolean user says yes = option dialog show yes no dialog ( get component ( ) , " cancel ? " , " do you really want to cancel \ " " + get title ( ) + " \ " ? " ) = = option dialog option one ; return user says yes ; }


returns command - line arguments used in the android compiled resource merger action

private list < string > get r class generation args ( configured target android library ) throws exception { return get generating spawn action args ( get validated android resources ( android library ) get java class jar ( ) ) ; }


ensures it will only return a uniquely generated names , contains a dupe checker to be sure

public static string get randomized name ( ) { boolean generated = false ; string name = " " ; while ( ! generated ) { string randomized name = misc utils random string ( 25 ) ; if ( ! created randomized names contains ( randomized name ) ) { created randomized names add ( randomized name ) ; name = randomized name ; generated = true ; } } return name ; }


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


set the date format used to parseformat { @ code offset date time } parameters

public void set offset date time formatter ( date time formatter offset date time formatter ) { this offset date time formatter = offset date time formatter ; }


the test server will not implement this method it will be used to test the behavior when clients call unimplemented methods

public io grpc testing integration empty protos empty unimplemented call ( io grpc testing integration empty protos empty request ) { return io grpc stub client calls blocking unary call ( get channel ( ) , get unimplemented call method ( ) , get call options ( ) , request ) ; }


applies the rotation by the given angle around the given axis to the current transformation matrix of each controller

public void rotate ( vector 3 axis , float angle ) { for ( int i = 0 , n = controllers size ; i < n ; i + + ) controllers get ( i ) rotate ( axis , angle ) ; }


modifies the result of the previously executed search ( { @ link top docs } ) in place based on the given { @ link rescore context }

top docs rescore ( top docs top docs , index searcher searcher , rescore context rescore context ) throws i o exception ;


public string get detail message ( ) { string builder builder = new string builder ( ) ; builder append ( " id = " ) append ( id ) ; if ( first procedure ! = null ) { builder append ( " , first procedure = " ) append ( first procedure ) ; } if ( cur procedure ! = null ) { builder append ( " , current procedure = " ) append ( cur procedure ) ; } builder append ( " , job done = " ) append ( job done ) ; if ( error ! = null ) { builder append ( " , error = " ) append ( error get message ( ) ) ; } return builder to string ( ) ; }


close the connection , unless a { @ link smart data source } doesn ' t want us to

public static void do close connection ( connection con , @ nullable data source data source ) throws s q l exception { if ( ! ( data source instanceof smart data source ) | | ( ( smart data source ) data source ) should close ( con ) ) { con close ( ) ; } }


waits until the latch file is created when this method returns , subsequent invocations will not block even after the latch file is deleted note that this method may not return if the latch file is deleted before this method returns

public void await ( ) throws interrupted exception { if ( is released or releasable ( ) ) { return ; } await latch file ( watch service ) ; }


returns a reference to a type parameter bound of a generic class or method

public static type reference new type parameter bound reference ( final int sort , final int param index , final int bound index ) { return new type reference ( ( sort < < 24 ) | ( param index < < 16 ) | ( bound index < < 8 ) ) ; }


overload of { @ link # add value callback ( key path , object , lottie value callback ) } that takes an interface this allows you to use a single abstract method code block in kotlin such as : drawable add value callback ( your key path , lottie property color ) { your color }

public < t > void add value callback ( key path key path , t property , final simple lottie value callback < t > callback ) { add value callback ( key path , property , new lottie value callback < t > ( ) { @ override public t get value ( lottie frame info < t > frame info ) { return callback get value ( frame info ) ; } } ) ; }


returns an immutable sorted set containing the elements of a sorted set , sorted by the same { @ code comparator } that behavior differs from { @ link # copy of ( iterable ) } , which always uses the natural ordering of the elements despite the method name , this method attempts to avoid actually copying the data when it is safe to do so the exact circumstances under which a copy will or will not be performed are undocumented and subject to change this method is safe to use even when { @ code sorted set } is a synchronized or concurrent collection that is currently being modified by another thread

public static < e > immutable sorted set < e > copy of sorted ( sorted set < e > sorted set ) { comparator < ? super e > comparator = sorted iterables comparator ( sorted set ) ; immutable list < e > list = immutable list copy of ( sorted set ) ; if ( list is empty ( ) ) { return empty set ( comparator ) ; } else { return new regular immutable sorted set < e > ( list , comparator ) ; } }


ensures that { @ code expression } is { @ code true } , throwing a { @ code verify exception } with a custom message otherwise see { @ link # verify ( boolean , string , object ) } for details

public static void verify ( boolean expression , @ nullable decl string error message template , int p 1 , int p 2 ) { if ( ! expression ) { throw new verify exception ( lenient format ( error message template , p 1 , p 2 ) ) ; } }


identifying certificate for this host { @ code key cert chain file } and { @ code key file } may be { @ code null } for client contexts , which disables mutual authentication

public ssl context builder key manager ( file key cert chain file , file key file ) { return key manager ( key cert chain file , key file , null ) ; }


creates a new blocking - style stub that supports unary and streaming output calls on the service

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


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

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


find or create a node with the specified label this is the only factory of nodes the null pointer is not a valid label

public node < t > create node ( t label ) { return nodes compute if absent ( label , digraph : : create node native ) ; }


if < code > true < code > the analysis component created by this provider requires certain settings to be instantiated it can ' t be created with defaults the default is < code > false < code >

default boolean requires analysis settings ( ) { return false ; }


this is a regression test for bug # 823077 , in which presence of artifacts with null generating action caused targets always to be reported as failed

public void test keep going result with null actions ( ) throws exception { write ( " foo / build " , " sh test ( name = ' test bar ' , srcs = [ ' test bar sh ' ] ) \ n " + " sh test ( name = ' test foo ' , srcs = [ ' test foo sh ' ] ) \ n " ) ; write ( " foo / test bar sh " , " echo bar is fine " ) set executable ( true ) ; add options ( " - - keep going " ) ; build ( true , " no - error " , " / / foo : test foo " , " / / foo : test bar " ) ; string stderr = rec out err err as latin 1 ( ) ; assert that ( stderr ) contains ( " target / / foo : test bar up - to - date : \ n " ) ; assert that ( stderr ) contains match ( " \ n * / foo / test bar \ n " ) ; assert that ( stderr ) does not contain match ( " \ n * / foo / test bar \ \ sh \ n " ) ; assert that ( stderr ) contains ( " target / / foo : test foo failed to build \ n " ) ; }


finds the child with the specified index and returns it as a long

public long get long ( int index ) { json value child = get ( index ) ; if ( child = = null ) throw new illegal argument exception ( " indexed value not found : " + name ) ; return child as long ( ) ; }


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


a notification that the bean definition for the specified name has been reset , and that this post - processor should clear any metadata for the affected bean the default implementation is empty

default void reset bean definition ( string bean name ) { }


set the type of the constructor argument

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


finish up any processing on { @ link # prepare ( ) } failure

void complete close on authentication failure ( ) throws i o exception { transport layer add interest ops ( selection key op write ) ; / / invoke the underlying handler to finish up any processing on authentication failure authenticator handle authentication failure ( ) ; }


this method is called when the reducer moves from one key to another

void reset backup store ( ) throws i o exception ;


protected membership store get membership store ( ) { state store service state store = router get state store ( ) ; if ( state store = = null ) { return null ; } return state store get registered record store ( membership store class ) ; }


public synchronized void clear ( ) { package roots = null ; source artifact cache clear ( ) ; }


given a character position from 0 to data unit symbol size - 1 it returns a number from 0 to unit byte size - 1 indicating which byte the character position was obtained from

public int get byte offset ( byte block block , int position ) { return 0 ; }


an expectation for checking child web element as a part of parent element to be visible

public static expected condition < list < web element > > visibility of nested elements located by ( final by parent , final by child locator ) { return new expected condition < list < web element > > ( ) { @ override public list < web element > apply ( web driver driver ) { web element current = driver find element ( parent ) ; list < web element > all children = current find elements ( child locator ) ; / / the original code only checked the first element fair enough if ( ! all children is empty ( ) & & all children get ( 0 ) is displayed ( ) ) { return all children ; } return null ; } @ override public string to string ( ) { return string format ( " visibility of elements located by % s - > % s " , parent , child locator ) ; } } ; }


waits for threads to finish or error out

public synchronized void wait for ( long millis ) throws exception { long end time = time now ( ) + millis ; while ( should run ( ) & & finished threads size ( ) < test threads size ( ) ) { long left = end time - time now ( ) ; if ( left < = 0 ) break ; check exception ( ) ; wait ( left ) ; } check exception ( ) ; }


public standalone mock mvc builder set content negotiation manager ( content negotiation manager manager ) { this content negotiation manager = manager ; return this ; }


public static void setup with values ( ) { register t m request = new register t m request ( app id , tsg , ed ) ; air = mockito mock ( abstract identify request class , mockito calls real methods ) ; }


static short read short ( data input in ) throws i o exception { short writable u short = tl data get ( ) u short ; u short read fields ( in ) ; return u short get ( ) ; }


record statistics and perform rule checking for the given method

entry entry ( method method , entry type traffic type ) throws block exception ;


exempts rules of this type from the constraint enforcement system this should only be applied to rules that are intrinsically incompatible with constraint checking ( any application of this method weakens the reach and strength of the system )

public < type > builder exempt from constraint checking ( string reason ) { preconditions check state ( this supports constraint checking ) ; this supports constraint checking = false ; attributes remove ( rule class compatible environment attr ) ; attributes remove ( rule class restricted environment attr ) ; attributes remove ( rule class target restricted to attr ) ; return this ; }


< code > optional bool sex = 5 ; < code >


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


sets the dex file to be included in the apk can be either a plain classes dex or a zip file containing dexes

public apk actions builder set classes dex ( artifact classes dex ) { preconditions check argument ( classes dex get filename ( ) ends with ( " zip " ) | | classes dex get filename ( ) equals ( " classes dex " ) ) ; this classes dex = classes dex ; return this ; }


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


public duration get search timeout ( ) { return beans new duration ( properties get search timeout ( ) ) ; }


parse the supplied { @ link element } and populate the supplied { @ link bean definition builder } as required the default implementation delegates to the { @ code do parse } version without parser context argument

protected void do parse ( element element , parser context parser context , bean definition builder builder ) { do parse ( element , builder ) ; }


stores the servlet context that the bean factory runs in only relevant in case of initialization as bean , to have a servlet context as fallback to the context usually provided by a filter config instance

public void set servlet context ( servlet context servlet context ) { this servlet context = servlet context ; }


gets the { @ link standard socket options # so reuseaddr } option


adds an alias that will be added when the index gets created

public put index template request alias ( alias alias ) { aliases add ( alias ) ; return this ; }


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


pings a remote endpoint when an acknowledgement is received , the given callback will be invoked using the given executor pings are not necessarily sent to the same endpont , thus a successful ping only means at least one endpoint responded , but doesn ' t imply the availability of other endpoints ( if there is any ) this is an optional method transports that do not have any mechanism by which to ping the remote endpoint may throw { @ link unsupported operation exception }

void ping ( ping callback callback , executor executor ) ;


returns a new , empty builder for { @ link immutable long array } instances , sized to hold up to { @ code initial capacity } values without resizing the returned builder is not thread - safe < b > performance note : < b > when feasible , { @ code initial capacity } should be the exact number of values that will be added , if that knowledge is readily available it is better to guess a value slightly too high than slightly too low if the value is not exact , the { @ link immutable long array } that is built will very likely occupy more memory than strictly necessary ; to trim memory usage , build using { @ code builder build ( ) trimmed ( ) }

public static builder builder ( int initial capacity ) { check argument ( initial capacity > = 0 , " invalid initial capacity : % s " , initial capacity ) ; return new builder ( initial capacity ) ; }


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


returns the ratio of cache requests which were misses this is defined as { @ code miss count request count } , or { @ code 0 0 } when { @ code request count = = 0 } note that { @ code hit rate + miss rate = ~ 1 0 } cache misses include all requests which weren ' t cache hits , including requests which resulted in either successful or failed loading attempts , and requests which waited for other threads to finish loading it is thus the case that { @ code miss count & gt ; = load success count + load exception count } multiple concurrent misses for the same key will result in a single load operation

public double miss rate ( ) { long request count = request count ( ) ; return ( request count = = 0 ) ? 0 0 : ( double ) miss count / request count ; }


url based { @ link redirect view } provider which can be used to provide , for example , redirect views with a custom default status code

public void set redirect view provider ( function < string , redirect view > redirect view provider ) { this redirect view provider = redirect view provider ; }


this method clears the input data type list and marks the data as dirty ( all must need recalculated )

public void clear ( ) { input set clear ( ) ; processed = false ; }


writes this instance to the given raw data object

public final void write to ( annotated output out ) { throw if not prepared ( ) ; align ( out ) ; int cursor = out get cursor ( ) ; if ( file offset < 0 ) { file offset = cursor ; } else if ( file offset ! = cursor ) { throw new runtime exception ( " alignment mismatch : for " + this + " , at " + cursor + " , but expected " + file offset ) ; } if ( out annotates ( ) ) { if ( name ! = null ) { out annotate ( 0 , " \ n " + name + " : " ) ; } else if ( cursor ! = 0 ) { out annotate ( 0 , " \ n " ) ; } } write to 0 ( out ) ; }


update the given picker to the helper if it ' s different from the current one

private void maybe update picker ( connectivity state state , round robin picker picker ) { / / discard the new picker if we are sure it won ' t make any difference , in order to save / / re - processing pending streams , and avoid unnecessary resetting of the pointer in / / round robin picker if ( picker drop list equals ( current picker drop list ) & & picker pick list equals ( current picker pick list ) ) { return ; } current picker = picker ; logger log ( channel log level info , " [ grpclb - < { 0 } > ] update balancing state to { 1 } : picks = { 2 } , drops = { 3 } " , service name , state , picker pick list , picker drop list ) ; helper update balancing state ( state , picker ) ; }


releases the loader this method should be called when the loader is no longer required

public void release ( @ nullable release callback callback ) { if ( current task ! = null ) { current task cancel ( true ) ; } if ( callback ! = null ) { download executor service execute ( new release task ( callback ) ) ; } download executor service shutdown ( ) ; }


client invoked methods are invoked over rpc and will be in rpc call context even if the client exits

boolean is external invocation ( ) { return server is rpc invocation ( ) ; }


this test iterates over the test cases table for datanode storage and attempts to startup the data node normally

public void test d n storage states ( ) throws exception { string [ ] base dirs ; / / first setup the datanode storage directory for ( int num dirs = 1 ; num dirs < = 2 ; num dirs + + ) { conf = new hdfs configuration ( ) ; conf set int ( d f s config keys dfs datanode scan period hours key , - 1 ) ; conf = upgrade utilities initialize storage state conf ( num dirs , conf ) ; for ( int i = 0 ; i < num dn test cases ; i + + ) { boolean [ ] test case = test cases [ i ] ; boolean should recover = test case [ should recover ] ; boolean cur after recover = test case [ current should exist after recover ] ; boolean prev after recover = test case [ previous should exist after recover ] ; log ( " data node recovery " , num dirs , i , test case ) ; create name node storage state ( new boolean [ ] { true , true , false , false , false } ) ; cluster = create cluster ( conf ) ; base dirs = create data node storage state ( test case ) ; if ( ! test case [ current exists ] & & ! test case [ previous exists ] & & ! test case [ previous tmp exists ] & & ! test case [ removed tmp exists ] ) { / / data node will create and format current if no directories exist cluster start data nodes ( conf , 1 , false , startup option regular , null ) ; } else { if ( should recover ) { cluster start data nodes ( conf , 1 , false , startup option regular , null ) ; check result data node ( base dirs , cur after recover , prev after recover ) ; } else { cluster start data nodes ( conf , 1 , false , startup option regular , null ) ; assert false ( cluster get data nodes ( ) get ( 0 ) is datanode up ( ) ) ; } } cluster shutdown ( ) ; } / / end test cases loop } / / end num dirs loop }


void deframer closed ( boolean has partial message ) ;


creates action config for { @ code action name } action using dummy tool that doesn ' t imply any features

private static string empty action config for ( string action name ) { return string format ( " action config { " + " config name : ' % s ' " + " action name : ' % s ' " + " tool { " + " tool path : ' dummy tool ' " + " } " + " } " , action name , action name ) ; }


contains graphical user authentication image boolean

public static boolean contains graphical user authentication image ( final request context request context ) { return request context get flow scope ( ) contains ( " gua user image " ) ; }


visit a parse tree produced by the { @ code value expression default } labeled alternative in { @ link eql base parser # value expression }

t visit value expression default ( eql base parser value expression default context ctx ) ;


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


same as { @ link # create stub action ( rule context , java common , list , artifact , string , string ) } in experimental coverage mode creates a txt file containing the runtime jars names { @ code jacoco coverage runner } will use it to retrieve the name of the jars considered for collecting coverage { @ code jacoco coverage runner } will not collect coverage implicitly for all the runtime jars , only for those that pack a file ending in " - paths - for - coverage txt "

public artifact create stub action ( rule context rule context , java common java common , list < string > jvm flags , artifact executable , string java start class , string coverage start class , nested set builder < artifact > files builder , string java executable , boolean create coverage metadata jar ) throws interrupted exception ;


parse an unsigned short from a byte array

public static int read unsigned short ( byte [ ] bytes , int start ) { return ( ( ( bytes [ start ] & 0xff ) < < 8 ) + ( ( bytes [ start + 1 ] & 0xff ) ) ) ; }


reports the result of < code > blaze config < config hash 1 > < config hash 2 > < code > and returns the appropriate command exit code

private static blaze command result report configuration diff ( collection < build configuration > all configs , string config hash 1 , string config hash 2 , config command output formatter writer , command environment env ) { env get reporter ( ) handle ( event info ( string format ( " displaying diff between configs " + " % s and " + " % s " , config hash 1 , config hash 2 ) ) ) ; try { build configuration config 1 = get configuration ( all configs , c - > c checksum ( ) , config hash 1 ) ; build configuration config 2 = get configuration ( all configs , c - > c checksum ( ) , config hash 2 ) ; table < class < ? extends fragment options > , string , pair < object , object > > diffs = diff configurations ( config 1 , config 2 ) ; writer write configuration diff ( get configuration diff for output ( config hash 1 , config hash 2 , diffs ) ) ; return blaze command result success ( ) ; } catch ( invalid configuration exception e ) { env get reporter ( ) handle ( event error ( e get message ( ) ) ) ; return create failure result ( e get message ( ) , code configuration not found ) ; } }


add an attachment to the mime message , taking the content from an { @ code org springframework core io input stream resource } note that the input stream returned by the input stream source implementation needs to be a fresh one on each call , as java mail will invoke { @ code get input stream ( ) } multiple times

public void add attachment ( string attachment filename , input stream source input stream source , string content type ) throws messaging exception { assert not null ( input stream source , " input stream source must not be null " ) ; if ( input stream source instanceof resource & & ( ( resource ) input stream source ) is open ( ) ) { throw new illegal argument exception ( " passed - in resource contains an open stream : invalid argument " + " java mail requires an input stream source that creates a fresh stream for every call " ) ; } data source data source = create data source ( input stream source , content type , attachment filename ) ; add attachment ( attachment filename , data source ) ; }


get the runtime for the < b > map < b > phase of the map - task attempt

public long get map runtime ( ) { return runtime ; }


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

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


returns an array type whose elements are all instances of { @ code component type }

public static array type name of ( type component type ) { return of ( type name get ( component type ) ) ; }


public void test wrap normal bean ( object bean , string bean name , object cache key ) { object result = global transaction scanner wrap if necessary ( bean , bean name , cache key ) ; assertions assert not same ( result , bean ) ; }


returns the x500 distinguished name for the specified user

public synchronized x 5 0 0 principal get distinguished name ( string username ) throws i o exception { update user list ( true ) ; user entry entry = user list get ( username ) ; if ( entry ! = null ) { return entry x 5 0 0 user ; } return null ; }


public void test collide space station iss ( ) { test collision ( new space station iss ( 1 , 1 , 3 , 4 ) , true , true , false , true ) ; }


creates a test instant with a monotonic timestamp that is offset from the wall time

public static test instant test instant ( instant wall time ) { return new test instant ( wall time , duration of millis ( initial relative timestamp + wall time to epoch milli ( ) ) ) ; }


public boolean is flushed ( ) { return flushed ; }


get the motor speed , usually in meters per second

public float get motor speed ( ) { return jni get motor speed ( addr ) ; }


public model api response upload file with required file ( long pet id , file required file , string additional metadata ) throws api exception { api response < model api response > local var resp = upload file with required file with http info ( pet id , required file , additional metadata ) ; return local var resp get data ( ) ; }


protected synchronized void set state ( state state ) { this run state = state ; }


tests that the { @ code - - output directory name } option cannot be used on the command line

public void test configuration short name ( ) throws exception { / / check that output directory name is still the name , otherwise this test is not testing what / / we expect core options options = options get defaults ( core options class ) ; options output directory name = " / home / wonkaw / wonka chocolate / factory / out " ; assert with message ( " the flag ' s name may have been changed ; this test may need to be updated " ) that ( options as map ( ) get ( " output directory name " ) ) is equal to ( " / home / wonkaw / wonka chocolate / factory / out " ) ; options parsing exception e = assert throws ( options parsing exception class , ( ) - > use configuration ( " - - output directory name = foo " ) ) ; assert that ( e ) has message that ( ) is equal to ( " unrecognized option : - - output directory name = foo " ) ; }


the number of missing fields that had been configured for analysis

public long get missing field count ( ) { return missing field count ; }


set the body of the response to the given { @ code object } and return it the parameter { @ code body type } is used to capture the generic type

< t > server response body ( t body , parameterized type reference < t > body type ) ;


clears the code units defined in the given memory block

public static void clear ( objective c 2 state state , memory block block ) throws exception { state program get listing ( ) clear code units ( block get start ( ) , block get end ( ) , false , state monitor ) ; }


adds a route to the given handler function that handles all http { @ code get } requests that match the given pattern and predicate for instance , the following example routes get requests for " user " that accept json to the { @ code list users } method in { @ code user controller } : < pre class = " code " > router function & lt ; server response & gt ; route = router functions route ( ) get ( " user " , request predicates accept ( media type application json ) , user controller : : list users ) build ( ) ;

builder get ( string pattern , request predicate predicate , handler function < server response > handler function ) ;


this implementation returns the name of the file that this external resource refers to

public string get filename ( ) { return string utils get filename ( get path ( ) ) ; }


gets all the project tags currently held in memory

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


default u 2 f device registration decode ( u 2 f device registration registration ) { val record = registration clone ( ) ; val data = get cipher executor ( ) decode ( record get record ( ) ) ; record set record ( data ) ; return record ; }


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


get the value for a known password configuration element in order to enable the elimination of clear text passwords in config , this method attempts to resolve the property name as an alias through the credential provider api and conditionally fallsback to config

public char [ ] get password ( string name ) throws i o exception { char [ ] pass = null ; pass = get password from credential providers ( name ) ; if ( pass = = null ) { pass = get password from config ( name ) ; } return pass ; }


get a list of block lists without sufficient redundancy the index of block lists represents its replication priority iterates each block list in priority order beginning with the highest priority list iterators use a bookmark to resume where the previous iteration stopped returns when the block count is met or iteration reaches the end of the lowest priority list , in which case bookmarks for each block list are reset to the heads of their respective lists if a block is deleted ( has invalid bc id ) , it will be removed from the low redundancy queues

synchronized list < list < block info > > choose low redundancy blocks ( int blocks to process , boolean reset iterators ) { final list < list < block info > > blocks to reconstruct = new array list < > ( level ) ; int count = 0 ; int priority = 0 ; hash set < block info > to remove = new hash set < > ( ) ; for ( ; count < blocks to process & & priority < level ; priority + + ) { / / go through all blocks that need reconstructions with current priority / / set the iterator to the first unprocessed block at this priority level / / we do not want to skip queue with corrupt blocks because we still need / / to look for deleted blocks if any final boolean in corrupt level = ( queue with corrupt blocks = = priority ) ; final iterator < block info > i = priority queues get ( priority ) get bookmark ( ) ; final list < block info > blocks = new linked list < > ( ) ; if ( ! in corrupt level ) { blocks to reconstruct add ( blocks ) ; } for ( ; count < blocks to process & & i has next ( ) ; count + + ) { block info block = i next ( ) ; if ( block is deleted ( ) ) { to remove add ( block ) ; continue ; } if ( ! in corrupt level ) { blocks add ( block ) ; } } for ( block info b info : to remove ) { remove ( b info , priority ) ; } to remove clear ( ) ; } if ( priority = = level | | reset iterators ) { / / reset all bookmarks because there were no recently added blocks for ( light weight linked set < block info > q : priority queues ) { q reset bookmark ( ) ; } } return blocks to reconstruct ; }


visit a parse tree produced by { @ link sql base parser # pattern }

t visit pattern ( sql base parser pattern context ctx ) ;


return the { @ link jms listener endpoint registry } instance for this registrar , may be { @ code null }

public jms listener endpoint registry get endpoint registry ( ) { return this endpoint registry ; }


parse the given string to a java { @ link duration } the string is in format " { length value } { time unit label } " , e g " 1 2 3ms " , " 321 s " if no time unit label is specified , it will be considered as milliseconds supported time unit labels are : days ： " d " , " day " hours ： " h " , " hour " minutes ： " min " , " minute " seconds ： " s " , " sec " , " second " milliseconds ： " ms " , " milli " , " millisecond " microseconds ： " µs " , " micro " , " microsecond " nanoseconds ： " ns " , " nano " , " nanosecond "

public static duration parse duration ( string text ) { check not null ( text ) ; final string trimmed = text trim ( ) ; check argument ( ! trimmed is empty ( ) , " argument is an empty - or whitespace - only string " ) ; final int len = trimmed length ( ) ; int pos = 0 ; char current ; while ( pos < len & & ( current = trimmed char at ( pos ) ) > = ' 0 ' & & current < = ' 9 ' ) { pos + + ; } final string number = trimmed substring ( 0 , pos ) ; final string unit label = trimmed substring ( pos ) trim ( ) to lower case ( locale us ) ; if ( number is empty ( ) ) { throw new number format exception ( " text does not start with a number " ) ; } final long value ; try { value = long parse long ( number ) ; / / this throws a number format exception on overflow } catch ( number format exception e ) { throw new illegal argument exception ( " the value ' " + number + " ' cannot be re represented as 6 4bit number ( numeric overflow ) " ) ; } if ( unit label is empty ( ) ) { return duration of ( value , chrono unit millis ) ; } chrono unit unit = label to unit map get ( unit label ) ; if ( unit ! = null ) { return duration of ( value , unit ) ; } else { throw new illegal argument exception ( " time interval unit label ' " + unit label + " ' does not match any of the recognized units : " + time unit get all units ( ) ) ; } }


provides the file name and byte array for a class path element

boolean process file bytes ( string name , long last modified , byte [ ] bytes ) ;


creates a new bundle using the specified < code > base file handle < code > and < code > encoding < code > ; the default locale is used

public static i 1 8 n bundle create bundle ( file handle base file handle , string encoding ) { return create bundle impl ( base file handle , locale get default ( ) , encoding ) ; }


public drawable get default artwork ( ) { return default artwork ; }


public http method get method ( ) { return this method ; }


tests a file uploaded with multi - part upload to ensure e tag is captured and used on file read

public void test create and read file multi part ( ) throws exception { string bucket = " s 3a : / / mock - bucket / " ; string file = " multi - part - file " ; path path = new path ( bucket , file ) ; byte [ ] content = new byte [ constants multipart min size + 1 ] ; string e tag = " abc " ; string version id = " def " ; multipart upload ( file , path , content , e tag , version id ) ; / / make sure the e tag and version id were put into the metadata store assert version attributes ( path , e tag , version id ) ; / / ensure underlying s3 get object call uses the stored e tag or version id / / when reading data back if it doesn ' t , the read won ' t work and the / / assert will fail assert content ( file , path , content , e tag , version id ) ; / / test overwrite byte [ ] new content = new byte [ constants multipart min size + 1 ] ; arrays fill ( new content , ( byte ) 1 ) ; string new e tag = " new e tag " ; string new version id = " new version id " ; multipart upload ( file , path , new content , new e tag , new version id ) ; assert version attributes ( path , new e tag , new version id ) ; assert content ( file , path , new content , new e tag , new version id ) ; }


corrupt an edit log file after the start segment transaction

private void corrupt after start segment ( file f ) throws i o exception { random access file raf = new random access file ( f , " rw " ) ; raf seek ( 0x 2 0 ) ; / / skip version and first tranaction and a bit of next transaction for ( int i = 0 ; i < 1000 ; i + + ) { raf write int ( 0xdeadbeef ) ; } raf close ( ) ; }


returns true if a particular item may be added to this group

boolean can add ( top level item item ) ;


public void reset ( ) throws i o exception ;


adds command - line options for a static library or non - library input into options

private void add static input link options ( linker input input , sequence builder libraries to link , nested set builder < linker input > expanded linker inputs builder ) { artifact category artifact category = input get artifact category ( ) ; preconditions check argument ( artifact category equals ( artifact category object file ) | | artifact category equals ( artifact category static library ) | | artifact category equals ( artifact category alwayslink static library ) ) ; boolean is always link static library = artifact category = = artifact category alwayslink static library ; / / input disable whole archive ( ) should only be true for libstdc + + / libc + + etc boolean input is whole archive = ! input disable whole archive ( ) & & ( is always link static library | | need whole archive ) ; / / if we had any lto artifacts , lto map whould be non - null in that case , / / we should have created a thinlto param file which the lto indexing / / step will populate with the exec paths that correspond to the lto / / artifacts that the linker decided to include based on symbol resolution / / those files will be included directly in the link ( and not wrapped / / in - - start - lib / - - end - lib ) to ensure consistency between the two link / / steps preconditions check state ( lto map = = null | | thinlto param file ! = null | | ! allow lto indexing ) ; / / start - lib / end - lib library : adds its input object files if ( link use start end lib ( input , cpp helper get archive type ( cpp configuration , cc toolchain provider , feature configuration ) ) ) { iterable < artifact > archive members = input get object files ( ) ; if ( ! iterables is empty ( archive members ) ) { immutable list builder < artifact > non lto archive members builder = immutable list builder ( ) ; for ( artifact member : archive members ) { artifact a ; if ( lto map ! = null & & ( a = lto map remove ( member ) ) ! = null ) { / / when lto map is non - null the backend artifact may be missing due to libraries that / / list o files explicitly , or generate o files from assembler if ( handled by lto indexing ( a , allow lto indexing ) ) { / / the lto artifacts that should be included in the final link / / are listed in the thinlto param file , generated by the lto indexing / / even if this object file is being skipped for exposure as a build variable , it ' s / / still an input to this action expanded linker inputs builder add ( linker inputs simple linker input ( a , artifact category object file , / * disable whole archive = * / false , a get root relative path string ( ) ) ) ; continue ; } / / no lto indexing step , so use the lto backend ' s generated artifact directly / / instead of the bitcode object member = a ; } non lto archive members builder add ( member ) ; expanded linker inputs builder add ( linker inputs simple linker input ( member , artifact category object file , / * disable whole archive = * / false , member get root relative path string ( ) ) ) ; } immutable list < artifact > non lto archive members = non lto archive members builder build ( ) ; if ( ! non lto archive members is empty ( ) ) { if ( input is whole archive ) { for ( artifact member : non lto archive members ) { if ( member is tree artifact ( ) ) { / / todo ( b / 78189629 ) : this object filegroup is expanded at action time but wrapped / / with - - start / - - end - lib there ' s currently no way to force these objects to be / / linked in libraries to link add value ( library to link value for object file group ( immutable list < artifact > of ( member ) , / * is whole archive = * / true ) ) ; } else { / / todo ( b / 78189629 ) : these each need to be their own library to link value so they ' re / / not wrapped in - - start / - - end - lib ( which lets the linker leave out objects with / / unreferenced code ) libraries to link add value ( library to link value for object file ( member get exec path string ( ) , / * is whole archive = * / true ) ) ; } } } else { libraries to link add value ( library to link value for object file group ( non lto archive members , / * is whole archive = * / false ) ) ; } } } } else { artifact input artifact = input get artifact ( ) ; artifact a ; if ( lto map ! = null & & ( a = lto map remove ( input artifact ) ) ! = null ) { if ( handled by lto indexing ( a , allow lto indexing ) ) { / / the lto artifacts that should be included in the final link / / are listed in the thinlto param file , generated by the lto indexing / / even if this object file is being skipped for exposure as a build variable , it ' s / / still an input to this action expanded linker inputs builder add ( linker inputs simple linker input ( a , artifact category object file , / * disable whole archive = * / false , a get root relative path string ( ) ) ) ; return ; } / / no lto indexing step , so use the lto backend ' s generated artifact directly / / instead of the bitcode object input artifact = a ; } if ( artifact category equals ( artifact category object file ) ) { if ( input artifact is tree artifact ( ) ) { libraries to link add value ( library to link value for object file group ( immutable list < artifact > of ( input artifact ) , input is whole archive ) ) ; } else { libraries to link add value ( library to link value for object file ( input artifact get exec path string ( ) , input is whole archive ) ) ; } if ( ! input is linkstamp ( ) ) { expanded linker inputs builder add ( input ) ; } } else { libraries to link add value ( library to link value for static library ( input artifact get exec path string ( ) , input is whole archive ) ) ; expanded linker inputs builder add ( input ) ; } } }


public void close ( ) throws exception { for ( state < t > state : get states ( ) ) { for ( state transition < t > transition : state get state transitions ( ) ) { iterative condition condition = transition get condition ( ) ; function utils close function ( condition ) ; } } }


checks whether the metadata version supports writing { @ link shard generations } to the repository

public static boolean use index generations ( version repository meta version ) { return repository meta version on or after ( index gen in repo data version ) ; }


deletes this key ( and disposes the key )

public void delete ( ) { check ( advapi 3 2 instance reg delete key ( handle , path ) ) ; dispose ( ) ; }


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

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


the doc lookup for the lucene segment this script was created for

public final map < string , script doc values < ? > > get doc ( ) { return leaf lookup doc ( ) ; }


public int get debug directory size ( ) { return debug directory size ; }


switch the using database to default with configuration by litepal xml

public static void use default ( ) { operator use default ( ) ; }


checks that at least one bit is available for reading

boolean is readable ( ) { return bit count > 0 | | in is readable ( ) ; }


public final long get id ( ) { return task id ; }


returns the value of this { @ code unsigned long } as a { @ code double } , analogous to a widening primitive conversion from { @ code long } to { @ code double } , and correctly rounded

public double double value ( ) { @ suppress warnings ( " cast " ) double d value = ( double ) ( value & unsigned mask ) ; if ( value < 0 ) { d value + = 0x 1 0p 6 3 ; } return d value ; }


updates the min and max x and y value of this data set based on the given entry

protected void calc min max ( t e ) { if ( e = = null ) return ; calc min max x ( e ) ; calc min max y ( e ) ; }


creates a parse - tree node representing an occurrence of this keyword at a particular position in the parsed text

public sql literal symbol ( sql parser pos pos ) { return sql literal create symbol ( this , pos ) ; }


create a builder for an { @ link i o statistics store }

public static i o statistics store builder iostatistics store ( ) { return new i o statistics store builder impl ( ) ; }


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


set the view names ( or name patterns ) that can be handled by this view resolver view names can contain simple wildcards such that ' my ' , ' report ' and ' repo ' will all match the view name ' my report '

public url based view resolver registration view names ( string view names ) { this view resolver set view names ( view names ) ; return this ; }


@ serial data expected values per key , number of distinct keys , and then for each distinct key : the key , number of values for that key , and the key ' s values

private void write object ( object output stream stream ) throws i o exception { stream default write object ( ) ; serialization write multimap ( this , stream ) ; }


public void set sql undo logs ( list < s q l undo log > sql undo logs ) { this sql undo logs = sql undo logs ; }


indicates whether the cached has unsaved changes


creates a memory with the provided attributes the block we wish to create may reside inside an already - created block if this is the case , we split the outer block ( s ) that encompass our desired new block this is the nature of mach - o segments and sections ( sections are contained in segments )

private memory block create memory block ( string name , address start , long data offset , long data length , string comment , string source , boolean r , boolean w , boolean x , boolean zero fill ) throws exception { / / i o s 12 chained pointer address fixup ( does not apply to x 8 6 ) if ( ! program get language i d ( ) get id as string ( ) starts with ( " x 8 6 " ) & & ( start get offset ( ) & 0xfff 0 0 0 0 0 0 0 0 0 l ) ! = 0 ) { start = space get address ( start get offset ( ) | 0xffff 0 0 0 0 0 0 0 0 0 0 0 0 l ) ; } / / get a list of all blocks that intersect with the block we wish to create there may be / / more that one if the containing memory has both initialized and uninitialized pieces list < memory block > intersecting blocks = new array list < > ( ) ; address set range = new address set ( start , start add ( data length - 1 ) ) ; for ( memory block block : memory get blocks ( ) ) { if ( range intersects ( block get start ( ) , block get end ( ) ) ) { intersecting blocks add ( block ) ; } } / / if we have no intersecting blocks , create a new block we are assuming that if we do / / intersect with at least one block , we will be completely contained in that block ( s ) / / if that assumption is wrong , the mach - o headers may be malformed ( or we don ' t fully / / understand them ) if ( intersecting blocks is empty ( ) ) { if ( zero fill ) { / / treat zero - fill blocks as uninitialized to save space return memory block utils create uninitialized block ( program , false , name , start , data length , comment , source , r , w , x , log ) ; } return memory block utils create initialized block ( program , false , name , start , file bytes , data offset , data length , comment , source , r , w , x , log ) ; } / / split the starting block ( if necessary ) splitting is not necessary if the start of our / / new block begins exactly where the starting block begins memory block starting block = intersecting blocks get ( 0 ) ; if ( start compare to ( starting block get start ( ) ) > 0 ) { memory split ( starting block , start ) ; } / / split the ending block ( if necessary ) splitting is not necessary if the end of our new / / block ends exactly where the ending block ends we need to fix up the name of the split / / block so it doesn ' t end in " split " memory block ending block = intersecting blocks get ( intersecting blocks size ( ) - 1 ) ; if ( start add ( data length - 1 ) compare to ( ending block get end ( ) ) < 0 ) { memory split ( ending block , start add ( data length ) ) ; memory block new ending block = memory get block ( start add ( data length ) ) ; new ending block set name ( ending block get name ( ) ) ; new ending block set source name ( ending block get source name ( ) ) ; new ending block set comment ( ending block get comment ( ) ) ; } / / change the attributes of all the blocks that intersect with the block we wish to create for ( memory block block : memory get blocks ( ) ) { if ( range intersects ( block get start ( ) , block get end ( ) ) ) { block set name ( name ) ; block set permissions ( r , w , x ) ; block set source name ( source ) ; block set comment ( comment ) ; } } return memory get block ( start ) ; }


tests querying a random geometry collection with a point

public void test point query ( ) throws exception { / / create a random geometry collection to index geometry collection builder gcb = random shape generator create geometry collection ( random ( ) ) ; double [ ] pt = new double [ ] { geo test util next longitude ( ) , geo test util next latitude ( ) } ; point builder pb = new point builder ( pt [ 0 ] , pt [ 1 ] ) ; gcb shape ( pb ) ; / / create mapping string mapping = strings to string ( create random mapping ( ) ) ; client ( ) admin ( ) indices ( ) prepare create ( " test " ) set mapping ( mapping ) get ( ) ; ensure green ( ) ; x content builder doc source = gcb to x content ( json builder ( ) start object ( ) field ( " geo " ) , null ) end object ( ) ; client ( ) prepare index ( " test " ) set id ( " 1 " ) set source ( doc source ) set refresh policy ( immediate ) get ( ) ; geo shape query builder geo shape query builder = query builders geo shape query ( " geo " , pb ) ; geo shape query builder relation ( shape relation intersects ) ; search response result = client ( ) prepare search ( " test " ) set query ( geo shape query builder ) get ( ) ; assert search response ( result ) ; assert hit count ( result , 1 ) ; }


provides a reproducible source of randomness seeded by a long seed in the settings with the key setting

public static random get ( settings settings , setting < long > setting ) { if ( setting exists ( settings ) ) { return new random ( setting get ( settings ) ) ; } else { return get ( ) ; } }


returns the number of the section that contains the system loader information

public short get section number for loader ( ) { return o snloader ; }


indicates whether { @ link org elasticsearch search search hit } s should be returned with the sequence number and primary term of the last modification of the document

public boolean seq no and primary term ( ) { return seq no and primary term ; }


private column info query table structure ( final string table name , string col name ) { try ( connection conn = log store data source get connection ( ) ) { database meta data dbmd = conn get meta data ( ) ; string schema = get schema ( conn ) ; result set table rs = dbmd get tables ( null , schema , " % " , new string [ ] { " table " } ) ; while ( table rs next ( ) ) { string table = table rs get string ( " table name " ) ; if ( string utils equals ignore case ( table , table name ) ) { result set column rs = conn get meta data ( ) get columns ( null , schema , table name , null ) ; while ( column rs next ( ) ) { column info info = new column info ( ) ; string column name = column rs get string ( " column name " ) ; info set column name ( column name ) ; string type name = column rs get string ( " type name " ) ; info set type name ( type name ) ; int column size = column rs get int ( " column size " ) ; info set column size ( column size ) ; string remarks = column rs get string ( " remarks " ) ; info set remarks ( remarks ) ; if ( string utils equals ignore case ( column name , col name ) ) { return info ; } } break ; } } } catch ( s q l exception e ) { logger error ( " query transaction name size fail , { } " , e get message ( ) , e ) ; } return null ; }


public static void main ( string [ ] args ) { var king joffrey = new king joffrey ( ) ; var kings hand = new kings hand ( king joffrey ) ; var emitters = list of ( kings hand , new lord baelish ( kings hand ) , new lord varys ( kings hand ) , new scout ( kings hand ) ) ; arrays stream ( weekday values ( ) ) < consumer < ? super event emitter > > map ( day - > emitter - > emitter time passes ( day ) ) for each ordered ( emitters : : for each ) ; }


sets < code > this = this & gt ; & gt ; n < code > using 0 as the fill bit

public scalar shift right ( int n ) { if ( n < 0 | | n > bit length - 1 ) { throw new illegal argument exception ( ) ; } return new scalar ( bit length , value > > > n ) ; }


a method to produce a color ( either black or white ) that contrasts with the given color this is useful for finding a readable foreground color for a given background

public static color contrast foreground color ( color color ) { float [ ] rgbs = new float [ 3 ] ; color get r g b color components ( rgbs ) ; int f r = rgbs [ 0 ] > 0 5 ? 0 : 1 ; int f g = rgbs [ 1 ] > 0 5 ? 0 : 1 ; int f b = rgbs [ 2 ] > 0 5 ? 0 : 1 ; / / note : the more accurate operation for calculating luminance is : / / float gamma = 2 2 ; / / float luminance = 0 2126 * pow ( r , gamma ) + / / 0 7152 * pow ( g , gamma ) + / / 0 0722 * pow ( b , gamma ) ; / / less precise , faster calculation double luminance = 0 2126 * ( f r * f r ) + 0 7152 * ( f g * f g ) + 0 0722 * ( f b * f b ) ; color foreground = color white ; if ( luminance < 0 54 ) { / / about half ( a bit fudge , since we are approximating the pow ( ) ) foreground = color black ; } return foreground ; }


get the offset of the next record that will be fetched ( if a record with that offset exists ) this method may issue a remote call to the server if there is no current position for the given partition this call will block until the position can be determined , an unrecoverable error is encountered ( in which case it is thrown to the caller ) , or the timeout expires

public long position ( topic partition partition , final duration timeout ) { acquire and ensure open ( ) ; try { if ( ! this subscriptions is assigned ( partition ) ) throw new illegal state exception ( " you can only check the position for partitions assigned to this consumer " ) ; timer timer = time timer ( timeout ) ; do { subscription state fetch position position = this subscriptions valid position ( partition ) ; if ( position ! = null ) return position offset ; update fetch positions ( timer ) ; client poll ( timer ) ; } while ( timer not expired ( ) ) ; throw new timeout exception ( " timeout of " + timeout to millis ( ) + " ms expired before the position " + " for partition " + partition + " could be determined " ) ; } finally { release ( ) ; } }


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

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


add an edge if successful ( i e that edge does not already appear in the graph ) , set the weight to the default value

public boolean add ( edge e ) { double wt = get weight ( e ) ; boolean return value = super add ( e ) ; if ( return value ) set weight ( e , default value ) ; else set weight ( e , wt + default value ) ; return true ; }


public string get capital camel ( ) { return capital camel ; }


creates a function at entry point with the specified name

public final function create function ( address entry point , string name ) { create function cmd cmd = new create function cmd ( name , entry point , null , name ! = null ? source type user defined : source type default ) ; if ( cmd apply to ( current program , monitor ) ) { return current program get listing ( ) get function at ( entry point ) ; } return null ; }


public void inject ( object thiz ) { a router inject ( thiz ) ; }


gets whether or not a complete parse tree will be constructed while parsing this property is { @ code true } for a newly constructed parser

public boolean get build parse tree ( ) { return build parse trees ; }


find a unique argument matching the given type

public method parameter arg ( class < ? > type , class < ? > generics ) { return new arg resolver ( ) arg ( type , generics ) ; }