this test asserts that replicas failed to execute resync operations will be failed but not marked as stale

public void test primary replica resync failed ( ) throws exception { string master = internal cluster ( ) start master only node ( settings empty ) ; final int number of replicas = between ( 2 , 3 ) ; final string old primary = internal cluster ( ) start data only node ( ) ; assert acked ( prepare create ( " test " , settings builder ( ) put ( index settings ( ) ) put ( setting number of shards , 1 ) put ( setting number of replicas , number of replicas ) ) ) ; final shard id shard id = new shard id ( cluster service ( ) state ( ) metadata ( ) index ( " test " ) get index ( ) , 0 ) ; final set < string > replica nodes = new hash set < > ( internal cluster ( ) start data only nodes ( number of replicas ) ) ; ensure green ( ) ; string timeout = random from ( " 0s " , " 1s " , " 2s " ) ; assert acked ( client ( master ) admin ( ) cluster ( ) prepare update settings ( ) set transient settings ( settings builder ( ) put ( " cluster routing allocation enable " , " none " ) ) set persistent settings ( settings builder ( ) put ( " indices replication retry timeout " , timeout ) ) get ( ) ) ; logger info ( " - - > indexing with gap in seqno to ensure that some operations will be replayed in resync " ) ; long num docs = scaled random int between ( 5 , 50 ) ; for ( int i = 0 ; i < num docs ; i + + ) { index response index result = index doc ( " test " , long to string ( i ) ) ; assert that ( index result get shard info ( ) get successful ( ) , equal to ( number of replicas + 1 ) ) ; } final index shard old primary shard = internal cluster ( ) get instance ( indices service class , old primary ) get shard or null ( shard id ) ; engine test case generate new seq no ( index shard test case get engine ( old primary shard ) ) ; / / make gap in seqno long more docs = scaled random int between ( 1 , 10 ) ; for ( int i = 0 ; i < more docs ; i + + ) { index response index result = index doc ( " test " , long to string ( num docs + i ) ) ; assert that ( index result get shard info ( ) get successful ( ) , equal to ( number of replicas + 1 ) ) ; } final set < string > replicas side 1 = sets new hash set ( random subset of ( between ( 1 , number of replicas - 1 ) , replica nodes ) ) ; final set < string > replicas side 2 = sets difference ( replica nodes , replicas side 1 ) ; network disruption partition = new network disruption ( new two partitions ( replicas side 1 , replicas side 2 ) , network disruption disconnect ) ; internal cluster ( ) set disruption scheme ( partition ) ; logger info ( " - - > isolating some replicas during primary - replica resync " ) ; partition start disrupting ( ) ; internal cluster ( ) stop random node ( internal test cluster name filter ( old primary ) ) ; / / checks that we fails replicas in one side but not mark them as stale assert busy ( ( ) - > { cluster state state = client ( master ) admin ( ) cluster ( ) prepare state ( ) get ( ) get state ( ) ; final index shard routing table shard routing table = state routing table ( ) shard routing table ( shard id ) ; final string new primary node = state get routing nodes ( ) node ( shard routing table primary current node id ( ) ) node ( ) get name ( ) ; assert that ( new primary node , not ( equal to ( old primary ) ) ) ; set < string > selected partition = replicas side 1 contains ( new primary node ) ? replicas side 1 : replicas side 2 ; assert that ( shard routing table active shards ( ) , has size ( selected partition size ( ) ) ) ; for ( shard routing active shard : shard routing table active shards ( ) ) { assert that ( state get routing nodes ( ) node ( active shard current node id ( ) ) node ( ) get name ( ) , is ( in ( selected partition ) ) ) ; } assert that ( state metadata ( ) index ( " test " ) in sync allocation ids ( shard id id ( ) ) , has size ( number of replicas + 1 ) ) ; } , 1 , time unit minutes ) ; assert acked ( client ( master ) admin ( ) cluster ( ) prepare update settings ( ) set transient settings ( settings builder ( ) put ( " cluster routing allocation enable " , " all " ) ) get ( ) ) ; partition stop disrupting ( ) ; partition ensure healthy ( internal cluster ( ) ) ; logger info ( " - - > stop disrupting network and re - enable allocation " ) ; assert busy ( ( ) - > { cluster state state = client ( master ) admin ( ) cluster ( ) prepare state ( ) get ( ) get state ( ) ; assert that ( state routing table ( ) shard routing table ( shard id ) active shards ( ) , has size ( number of replicas ) ) ; assert that ( state metadata ( ) index ( " test " ) in sync allocation ids ( shard id id ( ) ) , has size ( number of replicas + 1 ) ) ; for ( string node : replica nodes ) { index shard shard = internal cluster ( ) get instance ( indices service class , node ) get shard or null ( shard id ) ; assert that ( shard get local checkpoint ( ) , equal to ( num docs + more docs ) ) ; } } , 30 , time unit seconds ) ; internal cluster ( ) assert consistent history between translog and lucene index ( ) ; }


returns true if this { @ code resource completable observer } has been disposedcancelled

public final boolean is disposed ( ) { return disposable helper is disposed ( upstream get ( ) ) ; }


returns a { @ link map } of { @ link pattern } to match against , and the rewriting changes to apply when matched

public map < pattern , collection < string > > get rewrites ( ) { return rewrites as map ( ) ; }


get an active shard count instance for the given value the value is first validated to ensure it is a valid shard count and throws an illegal argument exception if validation fails valid values are any non - negative number directly use { @ link active shard count # default } for the default value ( which is one shard copy ) or { @ link active shard count # all } to specify all the shards

public static active shard count from ( final int value ) { if ( value < 0 ) { throw new illegal argument exception ( " shard count cannot be a negative value " ) ; } return get ( value ) ; }


{ @ code true } to handle all requests , where uri path component starts from { @ link web socket server protocol config # websocket path ( ) } , { @ code false } for exact match ( default )

public builder check starts with ( boolean check starts with ) { this check starts with = check starts with ; return this ; }


{ @ link ip 4 subnet filter rule } or { @ link ip 6 subnet filter rule }

ip filter rule get filter rule ( ) { return filter rule ; }


the { @ link x content type } that was parsed from the { @ code content - type } header this value will be { @ code null } in the case of a request without a valid { @ code content - type } header , a request without content ( { @ link # has content ( ) } , or a plain text request

public final x content type get x content type ( ) { return x content type get ( ) ; }


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

public void update user ( @ path param ( " username " ) string username , @ valid user body ) ;


returns a client to the single - node cluster

public client client ( ) { return wrap client ( node client ( ) ) ; }


returns stored version if currently stored version is { @ link versions # match any } and op type is { @ link op type # create } , returns { @ link versions # match deleted }

public long version ( ) { return resolve version defaults ( ) ; }


marshals the object graph with the given root into the provided { @ code javax xml transform result } this implementation inspects the given result , and calls { @ code marshal dom result } , { @ code marshal sax result } , or { @ code marshal stream result }

public final void marshal ( object graph , result result ) throws i o exception , xml mapping exception { if ( result instanceof d o m result ) { marshal dom result ( graph , ( d o m result ) result ) ; } else if ( stax utils is stax result ( result ) ) { marshal stax result ( graph , result ) ; } else if ( result instanceof s a x result ) { marshal sax result ( graph , ( s a x result ) result ) ; } else if ( result instanceof stream result ) { marshal stream result ( graph , ( stream result ) result ) ; } else { throw new illegal argument exception ( " unknown result type : " + result get class ( ) ) ; } }


identify workers which we think should be running but do not appear in the agent ' s response we need to send start worker requests for those

private void handle missing workers ( agent status response agent status ) { for ( map entry < long , managed worker > entry : workers entry set ( ) ) { long worker id = entry get key ( ) ; if ( ! agent status workers ( ) contains key ( worker id ) ) { managed worker worker = entry get value ( ) ; if ( worker should run ) { worker try create ( ) ; } } } }


a broken package is one that exists but contains lexerparserevaluator errors the package cache only makes one attempt to parse each package once found depending on the strictness of the package factory , parsing a broken package may cause a package object to be returned ( possibly missing some rules ) or an exception to be thrown for this test we need that strict behavior note : since the package cache set strict package creation method was deleted ( since it wasn ' t used by any significant clients ) creating a " broken " build file got trickier - - syntax errors are not enough for now , we create an unreadable build file , which will cause an i o exception to be thrown this test seems less valuable than it once did

public void test parse broken package ( ) throws exception { reporter remove handler ( fail fast handler ) ; path broken build file = scratch file ( " broken / build " ) ; broken build file set readable ( false ) ; build file contains errors exception e = assert throws ( build file contains errors exception class , ( ) - > get package ( " broken " ) ) ; assert that ( e ) has message that ( ) contains ( " / workspace / broken / build ( permission denied ) " ) ; event collector clear ( ) ; / / update the build file on disk so " broken " is no longer broken : scratch overwrite file ( " broken / build " , " # an ok build file " ) ; invalidate packages ( ) ; / / resets cache of failures package broken = get package ( " broken " ) ; assert that ( broken get name ( ) ) is equal to ( " broken " ) ; assert no events ( ) ; }


this method is copied from calcite , and modify it to not rely on function todo flink table function need implement get element type

private static object [ ] convert arguments ( list < rel data type > operand types , list < object > arguments 0 ) { list < object > arguments = new array list < > ( arguments 0 size ( ) ) ; / / construct a list of arguments , if they are all constants for ( pair < rel data type , object > pair : pair zip ( operand types , arguments 0 ) ) { arguments add ( coerce ( pair right , pair left ) ) ; } return arguments to array ( ) ; }


returns the current es version as a string

public version es version ( ) { return client yaml test client get es version ( ) ; }


writes a float as a typed bytes sequence

public void write float ( float f ) throws i o exception { out write ( type float code ) ; out write float ( f ) ; }


the system is normally in a state in which every follower remains a follower of a stable leader in a single term for an extended period of time , and therefore our response to every follower check is the same we handle this case with a single volatile read entirely on the network thread , and only if the fast path fails do we perform some work in the background , by notifying the followers checker whenever our term or mode changes here

public void update fast response state ( final long term , final mode mode ) { fast response state = new fast response state ( term , mode ) ; }


reads optional restore info from { @ link stream input }

public static restore info read optional restore info ( stream input in ) throws i o exception { return in read optional writeable ( restore info : : new ) ; }


determine if the supplied { @ code test class } is enabled in the current environment , as specified by the { @ link if profile value & # 064 ; if profile value } annotation at the class level defaults to { @ code true } if no { @ link if profile value & # 064 ; if profile value } annotation is declared

public static boolean is test enabled in this environment ( class < ? > test class ) { if profile value if profile value = annotated element utils find merged annotation ( test class , if profile value class ) ; return is test enabled in this environment ( retrieve profile value source ( test class ) , if profile value ) ; }


return a reference to an existing jax - ws service instance , if any

public service get jax ws service ( ) { return this jax ws service ; }


called for every event fired < b > default implementation : < b > does nothing

public void mark event ( hystrix event type event type , hystrix command key key ) { / / do nothing }


reset start timestamp of current bucket to provided time

public window wrap < t > reset to ( long start time ) { this window start = start time ; return this ; }


append a new record at the next sequential offset

public long append ( simple record record ) { return append with offset ( next sequential offset ( ) , record ) ; }


get the name of the currently running task , if any

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


send an input record with the given key , value and timestamp on the topic and then commit the records does not auto advance internally tracked time

public void pipe input ( final k key , final v value , final long timestamp ms ) { pipe input ( new test record < > ( key , value , null , timestamp ms ) ) ; }


appends a pointer and a record call this function only if the write position is at the end !

public long no seek append pointer and record ( long pointer , t record ) throws i o exception { final long old last position = append position ; final long old position in segment = out view get current position in segment ( ) ; final long old segment index = out view current segment index ; out view write long ( pointer ) ; build side serializer serialize ( record , out view ) ; append position + = out view get current position in segment ( ) - old position in segment + out view get segment size ( ) * ( out view current segment index - old segment index ) ; return old last position ; }


process the given arg list as command line arguments to the data node to make sure we get the expected result if the expected result is success then further validate that the parsed startup option is the same as what was expected

private static void check expected ( boolean expect success , startup option expected option , configuration conf , string arg ) { string [ ] args = new string [ arg length ] ; int i = 0 ; for ( string current arg : arg ) { args [ i + + ] = current arg ; } boolean return value = data node parse arguments ( args , conf ) ; startup option option = data node get startup option ( conf ) ; assert that ( return value , is ( expect success ) ) ; if ( expect success ) { assert that ( option , is ( expected option ) ) ; } }


return whether the notifications enabled

public static boolean are notifications enabled ( ) { return notification manager compat from ( utils get app ( ) ) are notifications enabled ( ) ; }


creates a new instance of a generated { @ code glide request } class for an application

public static < t , y extends request builder < t > > y mock glide request ( class < ? > glide request ) { return ( y ) mock ( glide request , new answer self < y > ( ) ) ; }


retrieve and return an { @ link event trigger } based on the given key

public event trigger get event trigger ( string trigger key ) { return get event trigger internal ( trigger key ) ; }


function which returns { @ code null } ( type : void )

public static < t > function < t , void > null fn ( ) { return ( function < t , void > ) null fn ; }


returns the floor byte position of the range [ floor position , ceiling position ) for this seek operation

private long get floor byte position ( ) { return floor byte position ; }


get the default charset , used when the { @ linkplain # set supported media types ( list ) content type } does not contain one

public charset get default charset ( ) { return this default charset ; }


notifies listeners that data transfer for the specified { @ link data spec } started

protected final void transfer started ( data spec data spec ) { this data spec = data spec ; for ( int i = 0 ; i < listener count ; i + + ) { listeners get ( i ) on transfer start ( / * source = * / this , data spec , is network ) ; } }


add the given { @ link byte buf } and increase the { @ code writer index } if { @ code increase writer index } is { @ code true } { @ link byte buf # release ( ) } ownership of { @ code buffer } is transferred to this { @ link composite byte buf }

public composite byte buf add component ( boolean increase writer index , byte buf buffer ) { return add component ( increase writer index , component count , buffer ) ; }


schedule the given { @ link runnable } , starting as soon as possible and invoking it with the given period execution will end once the scheduler shuts down or the returned { @ link scheduled future } gets cancelled

default scheduled future < ? > schedule at fixed rate ( runnable task , duration period ) { return schedule at fixed rate ( task , period to millis ( ) ) ; }


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


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

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


removes the label or alias that the cursor is over from the current label field if an exception is caught during the removal of the label or alias , a message is written to the status area

protected void remove label callback ( listing action context context ) { symbol s = get symbol ( context ) ; if ( s ! = null ) { command cmd = new delete label cmd ( s get address ( ) , s get name ( ) , s get parent namespace ( ) ) ; if ( ! tool execute ( cmd , context get program ( ) ) ) { tool set status info ( cmd get status msg ( ) ) ; } } }


returns the current execution for this execution vertex

access execution get current execution attempt ( ) ;


test to verify that the checksum can be computed by giving bytes per c r c length of file range for checksum calculation 512 is the value of bytes per c r c

public void test striped file checksum with missed data blocks range query 3 ( ) throws exception { test striped file checksum with missed data blocks range query ( striped file 1 , bytes per c r c ) ; }


a query that allows to define a custom scoring function

public static function score query builder function score query ( query builder query builder , function score query builder filter function builder [ ] filter function builders ) { return new function score query builder ( query builder , filter function builders ) ; }


may be called on receipt of a publish response from the given source node

public optional < apply commit request > handle publish response ( discovery node source node , publish response publish response ) { if ( election won = = false ) { logger debug ( " handle publish response : ignored response as election not won " ) ; throw new coordination state rejected exception ( " election not won " ) ; } if ( publish response get term ( ) ! = get current term ( ) ) { logger debug ( " handle publish response : ignored publish response due to term mismatch ( expected : [ { } ] , actual : [ { } ] ) " , get current term ( ) , publish response get term ( ) ) ; throw new coordination state rejected exception ( " incoming term " + publish response get term ( ) + " does not match current term " + get current term ( ) ) ; } if ( publish response get version ( ) ! = last published version ) { logger debug ( " handle publish response : ignored publish response due to version mismatch ( expected : [ { } ] , actual : [ { } ] ) " , last published version , publish response get version ( ) ) ; throw new coordination state rejected exception ( " incoming version " + publish response get version ( ) + " does not match current version " + last published version ) ; } logger trace ( " handle publish response : accepted publish response for version [ { } ] and term [ { } ] from [ { } ] " , publish response get version ( ) , publish response get term ( ) , source node ) ; publish votes add vote ( source node ) ; if ( is publish quorum ( publish votes ) ) { logger trace ( " handle publish response : value committed for version [ { } ] and term [ { } ] " , publish response get version ( ) , publish response get term ( ) ) ; return optional of ( new apply commit request ( local node , publish response get term ( ) , publish response get version ( ) ) ) ; } return optional empty ( ) ; }


public http response do do delete ( ) throws i o exception { throw http responses status ( sc bad request ) ; }


set the time the resource was last changed , as specified by the { @ code last - modified } header

b last modified ( zoned date time last modified ) ;


reads a snapshot from the stream , performing resolving this method reads snapshots written by { @ link # write versioned snapshot ( data output view , type serializer snapshot ) }

static < t > type serializer snapshot < t > read versioned snapshot ( data input view in , class loader cl ) throws i o exception { final type serializer snapshot < t > snapshot = type serializer snapshot serialization util read and instantiate snapshot class ( in , cl ) ; int version = in read int ( ) ; if ( version = = adapter version & & ! ( snapshot instanceof type serializer config snapshot ) ) { / / the snapshot was upgraded directly in - place from a type serializer config snapshot ; / / read and drop the previously java - serialized serializer , and get the actual correct / / read version / / note : this implicitly assumes that the version was properly written before the actual / / snapshot content type serializer serialization util try read serializer ( in , cl , true ) ; version = in read int ( ) ; } snapshot read snapshot ( version , in , cl ) ; return snapshot ; }


this implementation returns the hash code of the underlying file reference

public int hash code ( ) { return this path hash code ( ) ; }


return default flow - type without terminator

private static flow type get default jump or call flow type ( instruction inst ) { flow type flow type = inst get flow type ( ) ; if ( flow type is conditional ( ) ) { if ( flow type is computed ( ) ) { if ( flow type is call ( ) ) { return ref type conditional computed call ; } else if ( flow type is jump ( ) ) { return ref type conditional computed jump ; } } else if ( flow type is call ( ) ) { return ref type conditional call ; } else if ( flow type is jump ( ) ) { return ref type conditional jump ; } } if ( flow type is computed ( ) ) { if ( flow type is call ( ) ) { return ref type computed call ; } else if ( flow type is jump ( ) ) { return ref type computed jump ; } } else if ( flow type is call ( ) ) { return ref type unconditional call ; } else if ( flow type is jump ( ) ) { return ref type unconditional jump ; } return null ; }


confirm that the requested number of errors are produced by { @ link embedded connect cluster # validate connector config }

protected optional < boolean > check validation errors ( string connector class , map < string , string > conn config , int num errors , bi function < integer , integer , boolean > comp ) { try { int num errors produced = connect validate connector config ( connector class , conn config ) error count ( ) ; return optional of ( comp apply ( num errors produced , num errors ) ) ; } catch ( exception e ) { log error ( " could not check config validation error count " , e ) ; return optional empty ( ) ; } }


moves the given provider to its own window , at its current location

public static window move provider to window ( final docking window manager dwm , final component provider provider ) { abstract generic test run swing ( ( ) - > { if ( ! dwm contains provider ( provider ) ) { return ; } component placeholder placeholder = dwm get active placeholder ( provider ) ; dockable component docking component = dwm get dockable component ( provider ) ; point point = new point ( 0 , 0 ) ; if ( docking component is showing ( ) ) { point = docking component get location on screen ( ) ; } dwm move placeholder ( placeholder , point ) ; } ) ; window w = abstract g test wait for value ( ( ) - > dwm get provider window ( provider ) ) ; return w ; }


test the use of chained - buffers for record storage chained - buffers will not utilize an index buffer

public void test get stored single chained buffer long key record ( ) throws i o exception { insert one long key record ( true , true , buffer size / 4 ) ; }


get the converter to convert from s to target type t , where t is also an instance of r

< t extends r > converter < s , t > get converter ( class < t > target type ) ;


tests that xattrs should be cleaned if satisfy storage policy called on ec file with unsuitable storage policy set

public void test s p s should not leak xattr if satisfy storage policy call on e c files ( ) throws exception { storage type [ ] [ ] disk types = new storage type [ ] [ ] { { storage type ssd , storage type disk } , { storage type ssd , storage type disk } , { storage type ssd , storage type disk } , { storage type ssd , storage type disk } , { storage type ssd , storage type disk } , { storage type disk , storage type ssd } , { storage type disk , storage type ssd } , { storage type disk , storage type ssd } , { storage type disk , storage type ssd } , { storage type disk , storage type ssd } } ; int default striped block size = striped file test util get default e c policy ( ) get cell size ( ) * 4 ; config set long ( d f s config keys dfs block size key , default striped block size ) ; config set long ( d f s config keys dfs heartbeat interval key , 1l ) ; config set long ( d f s config keys dfs namenode redundancy interval seconds key , 1l ) ; config set boolean ( d f s config keys dfs namenode redundancy considerload key , false ) ; try { hdfs cluster = start cluster ( config , disk types , disk types length , storages per datanode , capacity ) ; dfs = hdfs cluster get file system ( ) ; dfs enable erasure coding policy ( striped file test util get default e c policy ( ) get name ( ) ) ; / / set " / foo " directory with one ssd storage policy client protocol client = name node proxies create proxy ( config , hdfs cluster get file system ( 0 ) get uri ( ) , client protocol class ) get proxy ( ) ; string foo dir = " / foo " ; client mkdirs ( foo dir , new fs permission ( ( short ) 777 ) , true ) ; / / set an ec policy on " / foo " directory client set erasure coding policy ( foo dir , striped file test util get default e c policy ( ) get name ( ) ) ; / / write file to foo dir final string test file = " / foo / bar " ; long file len = 20 * default striped block size ; d f s test util create file ( dfs , new path ( test file ) , file len , ( short ) 3 , 0 ) ; / / onessd is unsuitable storage policy on ec files client set storage policy ( foo dir , hdfs constants onessd storage policy name ) ; dfs satisfy storage policy ( new path ( test file ) ) ; / / thread sleep ( 9000 ) ; / / to make sure sps triggered / / verify storage types and locations located blocks located blocks = client get block locations ( test file , 0 , file len ) ; for ( located block lb : located blocks get located blocks ( ) ) { for ( storage type type : lb get storage types ( ) ) { assert assert equals ( storage type disk , type ) ; } } / / make sure satisfy xattr has been removed d f s test util wait for xattr removed ( test file , xattr satisfy storage policy , hdfs cluster get namesystem ( ) , 30000 ) ; } finally { shutdown cluster ( ) ; } }


checks if cgroup stats are available by checking for the existence of { @ code procselfcgroup } , { @ code sysfscgroupcpu } , { @ code sysfscgroupcpuacct } and { @ code sysfscgroupmemory }

boolean are cgroup stats available ( ) { if ( ! files exists ( path utils get ( " / proc / self / cgroup " ) ) ) { return false ; } if ( ! files exists ( path utils get ( " / sys / fs / cgroup / cpu " ) ) ) { return false ; } if ( ! files exists ( path utils get ( " / sys / fs / cgroup / cpuacct " ) ) ) { return false ; } if ( ! files exists ( path utils get ( " / sys / fs / cgroup / memory " ) ) ) { return false ; } return true ; }


reverses the elements of { @ code array } this is equivalent to { @ code collections reverse ( booleans as list ( array ) ) } , but is likely to be more efficient

public static void reverse ( boolean [ ] array ) { check not null ( array ) ; reverse ( array , 0 , array length ) ; }


long key node remove leaf ( ) throws i o exception { long key = get key ( 0 ) ; int prev buffer id = buffer get int ( prev leaf id offset ) ; int next buffer id = buffer get int ( next leaf id offset ) ; if ( prev buffer id > = 0 ) { long key record node prev node = ( long key record node ) node mgr get long key node ( prev buffer id ) ; prev node get buffer ( ) put int ( next leaf id offset , next buffer id ) ; } if ( next buffer id > = 0 ) { long key record node next node = ( long key record node ) node mgr get long key node ( next buffer id ) ; next node get buffer ( ) put int ( prev leaf id offset , prev buffer id ) ; } node mgr delete node ( this ) ; if ( parent = = null ) { return null ; } return parent delete child ( key ) ; }


creates a new security manager with a standard set of test packages being the only packages that can exit or halt the virtual machine the packages that can exit are : < code > org apache maven surefire booter < code > < code > com carrotsearch ant tasks junit 4 < code > < code > org eclipse internal junit runner < code > < code > com intellij rt execution junit < code >

public static secure s m create test secure s m ( ) { return new secure s m ( test runner packages ) ; }


indicate that source should be returned with every hit , with an " include " andor " exclude " set which can include simple wildcard elements

public search request builder set fetch source ( @ nullable string [ ] includes , @ nullable string [ ] excludes ) { source builder ( ) fetch source ( includes , excludes ) ; return this ; }


convenience method to return a string array as a delimited ( e g csv ) string e g useful for < code > to string ( ) < code > implementations

public static string array to delimited string ( object [ ] arr , string delim ) { string builder sb = new string builder ( ) ; array to delimited string ( arr , delim , sb ) ; return sb to string ( ) ; }


resolves a file syntax tree in the specified environment and compiles it to a program this operation mutates the syntax tree , both by resolving identifiers and recording local variables , and in case of error , by appending to { @ code file errors ( ) }

public static program compile file ( starlark file file , resolver module env ) throws syntax error exception { resolver resolve file ( file , env ) ; if ( ! file ok ( ) ) { throw new syntax error exception ( file errors ( ) ) ; } / / extract load statements immutable list builder < string > loads = immutable list builder ( ) ; immutable list builder < location > load locations = immutable list builder ( ) ; for ( statement stmt : file get statements ( ) ) { if ( stmt instanceof load statement ) { load statement load = ( load statement ) stmt ; string module = load get import ( ) get value ( ) ; loads add ( module ) ; load locations add ( load get import ( ) get location ( ) ) ; } } return new program ( file get resolved function ( ) , loads build ( ) , load locations build ( ) ) ; }


public void array item test ( ) { / / todo : test array item }


set the jvm property to enable kerberos debugging

public static void enable kerberos debugging ( ) { system set property ( abstract secure registry test sun security krb5 debug , " true " ) ; }


get back fields that have been previously added with { @ link # add with key ( object , indexable field ) }

public indexable field get by key ( object key ) { return keyed fields = = null ? null : keyed fields get ( key ) ; }


gets the name of the strategy on which the action is scheduling

public string get strategy ( ) { return strategy ; }


this mount item represents the top - level root host ( litho view ) which is always mounted

static mount item create root host mount item ( litho view litho view ) { final view node info view node info = new view node info ( ) ; view node info set layout direction ( yoga direction inherit ) ; layout output output = new layout output ( null , null , view node info , host component create ( ) , null , litho view get previous mount bounds ( ) , 0 , 0 , 0 , 0 , important for accessibility auto , litho view get context ( ) get resources ( ) get configuration ( ) orientation , null ) ; mount item item = new mount item ( layout output create ( output , litho view get litho render unit factory ( ) , null , null ) , litho view , litho view ) ; item set mount data ( new litho mount data ( litho view ) ) ; return item ; }


public void write ( data output out ) throws i o exception { out write byte ( ordinal ( ) ) ; }


number of terms that must match the generated query expressed in the common syntax for minimum should match

public string get minimum should match ( ) { return minimum should match ; }


outbound flow control where the initial window size is increased before a stream is started

public void outbound flow control big window size ( ) throws exception { init transport ( ) ; int initial outbound window size = 131070 ; / / 65535 * 2 set initial window size ( initial outbound window size ) ; frame handler ( ) window update ( 0 , 65535 ) ; mock stream listener listener = new mock stream listener ( ) ; ok http client stream stream = client transport new stream ( method , new metadata ( ) , call options default ) ; stream start ( listener ) ; int message length = 100000 ; / / the first message should be sent out input stream input = new byte array input stream ( new byte [ message length ] ) ; stream write message ( input ) ; stream flush ( ) ; verify ( frame writer , timeout ( time out ms ) ) data ( eq ( false ) , eq ( 3 ) , any ( buffer class ) , eq ( message length + header length ) ) ; / / the second message should be partially sent out input = new byte array input stream ( new byte [ message length ] ) ; stream write message ( input ) ; stream flush ( ) ; int partially sent size = initial outbound window size - message length - header length ; verify ( frame writer , timeout ( time out ms ) ) data ( eq ( false ) , eq ( 3 ) , any ( buffer class ) , eq ( partially sent size ) ) ; / / get more credit so the rest of the data should be sent out frame handler ( ) window update ( 0 , initial outbound window size ) ; frame handler ( ) window update ( 3 , initial outbound window size ) ; verify ( frame writer , timeout ( time out ms ) ) data ( eq ( false ) , eq ( 3 ) , any ( buffer class ) , eq ( message length + header length - partially sent size ) ) ; stream cancel ( status cancelled ) ; listener wait until stream closed ( ) ; shutdown and verify ( ) ; }


sets { @ code visitor } as the visitor for all method instructions

public void set method visitor ( visitor visitor ) { method visitor = visitor ; }


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 the { @ code boolean } value that corresponds to this { @ link tri state } , if appropriate

public boolean as boolean ( boolean default value ) { switch ( this ) { case yes : return true ; case no : return false ; case unset : return default value ; default : throw new illegal state exception ( " unrecognized tri state value : " + this ) ; } }


( re ) compute cached mapping from bundleloc to bundlepath only used in testing

private void compute cache ( ) { bundle loc to status map clear ( ) ; for ( bundle status status : statuses ) { bundle loc to status map put ( status get location identifier ( ) , status ) ; } }


creates an android manifest object , with correct preprocessing , from explicit variables attributes included in the rule context will not be used ; use { @ link # from attributes ( rule context , android data context ) } instead in addition , the android semantics - specific manifest processing methods will not be applied in this method the manifest returned by this method will be the same regardless of the android semantics being used use { @ link # from attributes ( rule context , android data context , android semantics ) } instead if you want android semantics - specific behavior

public static android manifest from ( android data context data context , rule error consumer error consumer , @ nullable artifact raw manifest , @ nullable string pkg , boolean exports manifest ) throws interrupted exception { return from ( data context , error consumer , raw manifest , null , pkg , exports manifest ) ; }


if this storage corresponds to parameter which was forced by the associated calling convention to be passed as a pointer instead of its raw type

public boolean is forced indirect ( ) { return false ; }


remote namenode just has started a log segment , start log segment locally

public synchronized void start log segment ( long txid , boolean abort current log segment , int layout version ) throws i o exception { log info ( " started a new log segment at txid " + txid ) ; if ( is segment open ( ) ) { if ( get last written tx id ( ) = = txid - 1 ) { / / in sync with the nn , so end and finalize the current segment ` end current log segment ( false ) ; } else { / / missed some transactions : probably lost contact with nn temporarily final string mess = " cannot start a new log segment at txid " + txid + " since only up to txid " + get last written tx id ( ) + " have been written in the log segment starting at " + get cur segment tx id ( ) + " " ; if ( abort current log segment ) { / / mark the current segment as aborted log warn ( mess ) ; abort current log segment ( ) ; } else { throw new i o exception ( mess ) ; } } } set next tx id ( txid ) ; start log segment ( txid , layout version ) ; }


handle the case of an object property type

public void visit ( object value ) { throw new runtime exception ( ) ; }


sets the playback controls timeout the playback controls are automatically hidden after this duration of time has elapsed without user input and with playback or buffering in progress

public void set controller show timeout ms ( int controller show timeout ms ) { assertions check state not null ( controller ) ; this controller show timeout ms = controller show timeout ms ; if ( controller is fully visible ( ) ) { / / update the controller ' s timeout if necessary show controller ( ) ; } }


returns true if field direct is set ( has been assigned a value ) and false otherwise

public boolean is set direct ( ) { return isset bit vector get ( direct isset id ) ; }


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


return whether the http 1 0 expires header is used

public final boolean is use expires header ( ) { return this use expires header ; }


adds the entry to the exclusively owned queue if it is viable for eviction

private synchronized boolean maybe add to exclusives ( entry < k , v > entry ) { if ( ! entry is orphan & & entry client count = = 0 ) { m exclusive entries put ( entry key , entry ) ; return true ; } return false ; }


{ @ inherit doc } this implementation is correct for single consumer thread use only

public e poll ( ) { final e [ ] buffer = consumer buffer ; final long index = consumer index ; final long mask = consumer mask ; final long offset = modified calc element offset ( index , mask ) ; object e = lv element ( buffer , offset ) ; / / load load if ( e = = null ) { if ( index ! = lv producer index ( ) ) { / / poll ( ) = = null iff queue is empty , null element is not strong enough indicator , so we / / must / / check the producer index if the queue is indeed not empty we spin until element is / / visible do { e = lv element ( buffer , offset ) ; } while ( e = = null ) ; } else { return null ; } } if ( e = = jump ) { final e [ ] next buffer = get next buffer ( buffer , mask ) ; return new buffer poll ( next buffer , index ) ; } so element ( buffer , offset , null ) ; so consumer index ( index + 2 ) ; return ( e ) e ; }


defines whether the producer should fail on errors , or only log them if this is set to true , then exceptions will be only logged , if set to false , exceptions will be eventually thrown and cause the streaming program to fail ( and enter recovery )

public void set log failures only ( boolean log failures only ) { this log failures only = log failures only ; }


public string get tag ( ) { return tag ; }


apply the property values of the bean definition with the given name to the given bean instance the bean definition can either define a fully self - contained bean , reusing its property values , or just property values meant to be used for existing bean instances this method does not autowire bean properties ; it just applies explicitly defined property values use the { @ link # autowire bean properties } method to autowire an existing bean instance < b > note : this method requires a bean definition for the given name ! < b > does not apply standard { @ link bean post processor bean post processors } callbacks or perform any further initialization of the bean this interface offers distinct , fine - grained operations for those purposes , for example { @ link # initialize bean } however , { @ link instantiation aware bean post processor } callbacks are applied , if applicable to the configuration of the instance

void apply bean property values ( object existing bean , string bean name ) throws beans exception ;


creates a data set from the given iterator because the iterator will remain unmodified until the actual execution happens , the type of data returned by the iterator must be given explicitly in the form of the type information this method is useful for cases where the type is generic in that case , the type class ( as given in { @ link # from collection ( iterator , class ) } does not supply all type information note that this operation will result in a non - parallel data source , i e a data source with a parallelism of one

public < x > data source < x > from collection ( iterator < x > data , type information < x > type ) { return new data source < > ( this , new iterator input format < > ( data ) , type , utils get call location name ( ) ) ; }


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


submits a flink sql update statement such as insert into

program target descriptor execute update ( string session id , string statement ) throws sql execution exception ;


gets the segment size for this cie record

public int get segment size ( ) { return segment size ; }


called after { @ link field mapper # parse ( parse context ) } on the { @ link root object mapper }

public void post parse ( parse context context ) throws i o exception { / / do nothing }


public void add ( object args ) { for ( object arg : args ) { argument list add ( arg to string ( ) ) ; } }


tests functionality for big files ( > 5 gb ) upload

public void test file part upload no length check ( ) throws i o exception , u r i syntax exception { final path path = new path ( " / test / test file part upload length check " ) ; int len = 8192 ; final byte [ ] src = swift test utils dataset ( len , 32 , 144 ) ; f s data output stream out = fs create ( path , false , get buffer size ( ) , ( short ) 1 , block size ) ; try { int total partitions to write = len / part size bytes ; assert partitions written ( " startup " , out , 0 ) ; / / write 2048 int first write len = 2048 ; out write ( src , 0 , first write len ) ; / / assert long expected = get expected partitions written ( first write len , part size bytes , false ) ; swift utils debug ( log , " first write : predict % d partitions written " , expected ) ; assert partitions written ( " first write completed " , out , expected ) ; / / write the rest int remainder = len - first write len ; swift utils debug ( log , " remainder : writing : % d bytes " , remainder ) ; out write ( src , first write len , remainder ) ; expected = get expected partitions written ( len , part size bytes , false ) ; assert partitions written ( " remaining data " , out , expected ) ; out close ( ) ; expected = get expected partitions written ( len , part size bytes , true ) ; assert partitions written ( " stream closed " , out , expected ) ; header [ ] headers = fs get store ( ) get object headers ( path , true ) ; for ( header header : headers ) { log info ( header to string ( ) ) ; } byte [ ] dest = read dataset ( fs , path , len ) ; log info ( " read dataset from " + path + " : data length = " + len ) ; / / compare data swift test utils compare byte arrays ( src , dest , len ) ; file status status = fs get file status ( path ) ; / / now see what block location info comes back / / this will vary depending on the swift version , so the results / / aren ' t checked - merely that the test actually worked block location [ ] locations = fs get file block locations ( status , 0 , len ) ; assert not null ( " null get file block locations ( ) " , locations ) ; assert true ( " empty array returned for get file block locations ( ) " , locations length > 0 ) ; } finally { i o utils close stream ( out ) ; } }


overloaded version of { @ code add property value } that takes a property name and a property value note : as of spring 3 0 , we recommend using the more concise and chaining - capable variant { @ link # add }

public void add property value ( string property name , object property value ) { add property value ( new property value ( property name , property value ) ) ; }


public list < string > get array of string ( ) { return array of string ; }


assert that the string value of an object contains the expected text

protected void assert string value contains ( final object o , final string expected ) { assert that ( o to string ( ) ) described as ( " object string value " ) contains ( expected ) ; }


protected int get num connections ( ) { return this connections size ( ) ; }


void on status changed ( connectivity state new state ) ;


public static boolean require global lock ( ) { return context holder get ( key global lock flag ) ! = null ; }


returns { @ link # get pad top ( ) } plus { @ link # get pad bottom ( ) }

public float get pad y ( ) { return pad top get ( this ) + pad bottom get ( this ) ; }


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

public void create user test ( ) throws exception { user body = null ; response entity < void > response = api create user ( body , accept ) ; / / todo : test validations }


public void set paths ( string [ ] paths ) { table model set paths ( paths ) ; }


merges all secondary resources with the primary resources , given that the primary resources have been separately parsed and serialized

public static merged android data merge data and write ( final serialized android data primary , final path primary manifest , final list < ? extends serialized android data > direct , final list < ? extends serialized android data > transitive , final path resources out , final path assets out , @ nullable final png cruncher cruncher , final variant type type , @ nullable final path symbols out , @ nullable final android resource class writer rclass writer , boolean throw on resource conflict , listening executor service executor service ) { final parsed android data builder primary builder = parsed android data builder new builder ( ) ; final android parsed data deserializer deserializer = android parsed data deserializer create ( ) ; primary deserialize ( dependency info dependency type primary , deserializer , primary builder consumers ( ) ) ; parsed android data primary data = primary builder build ( ) ; return merge data and write ( primary data , primary manifest , direct , transitive , resources out , assets out , cruncher , type , symbols out , rclass writer , deserializer , throw on resource conflict , executor service ) ; }


public string get sql ( ) { return this sql ; }


set the { @ link dns server address stream provider } which is used to determine which dns server is used to resolve each hostname

public dns name resolver builder name server provider ( dns server address stream provider dns server address stream provider ) { this dns server address stream provider = check not null ( dns server address stream provider , " dns server address stream provider " ) ; return this ; }


testing { @ link weapon factory } to produce a spear asserting that the weapon is an instance of { @ link spear }

public void test spear weapon ( ) { var weapon = factory create ( weapon type spear ) ; verify weapon ( weapon , spear class ) ; }


public void set parent ( node parent ) { this parent = parent ; }


used for asynchronous execution with a callback by subscribing to the { @ link observable } this eagerly starts execution the same as { @ link # queue ( ) } and { @ link # execute ( ) } a lazy { @ link observable } can be obtained from { @ link # to observable ( ) } < b > callback scheduling < b > when using { @ link execution isolation strategy # thread } this defaults to using { @ link schedulers # computation ( ) } for callbacks when using { @ link execution isolation strategy # semaphore } this defaults to using { @ link schedulers # immediate ( ) } for callbacks use { @ link # to observable ( rx scheduler ) } to schedule the callback differently see https : github com netflix rx javawiki for more information

public observable < response type > observe ( ) { / / use a replay subject to buffer the eagerly subscribed - to observable replay subject < response type > subject = replay subject create ( ) ; / / eagerly kick off subscription final subscription underlying subscription = to observable ( ) subscribe ( subject ) ; / / return the subject that can be subscribed to later while the execution has already started return subject do on unsubscribe ( new action 0 ( ) { @ override public void call ( ) { underlying subscription unsubscribe ( ) ; } } ) ; }


sign extend the masked value , according to its mask , to a full long the leftmost defined bit is taken as the sign bit , and extended to the left

public masked long sign extend ( ) { int bits = 64 - long number of leading zeros ( this msk ) ; return sign extend ( bits ) ; }


returns the task ' s index in the subtask group

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


whether phrase queries should be automatically generated for multi terms synonyms defaults to { @ code true }

public boolean auto generate synonyms phrase query ( ) { return auto generate synonyms phrase query ; }


return the target type of this bean definition , if known ( either specified in advance or resolved on first instantiation )

public class < ? > get target type ( ) { if ( this resolved target type ! = null ) { return this resolved target type ; } resolvable type target type = this target type ; return ( target type ! = null ? target type resolve ( ) : null ) ; }


bind view annotated fields and methods in the specified { @ link activity } the current content view is used as the view root

public static unbinder bind ( @ non null activity target ) { view source view = target get window ( ) get decor view ( ) ; return bind ( target , source view ) ; }


verify that the block is in the declared state

protected final void verify state ( dest state expected ) throws illegal state exception { if ( expected ! = null & & state ! = expected ) { throw new illegal state exception ( " expected stream state " + expected + " - but actual state is " + state + " in " + this ) ; } }


the { @ code to string ( ) } of { @ link component } implementations appear in health check endpoints since these are likely to be exposed in logs and other monitoring tools , care should be taken to ensure { @ code to string ( ) } output is a reasonable length and does not contain sensitive information

@ test void to string contains only summary information ( ) { assert that ( storage ) has to string ( string format ( " elasticsearch storage { initial endpoints = % s , index = zipkin } " , server http uri ( ) ) ) ; }


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 , char p 1 , char p 2 ) { if ( ! expression ) { throw new verify exception ( lenient format ( error message template , p 1 , p 2 ) ) ; } }


deserializes a record for collection , and accordingly updates the shard state in the fetcher the last successfully collected sequence number in this shard consumer is also updated so that a { @ link record publisher } may be able to use the correct sequence number to refresh shard iterators if necessary note that the server - side kinesis timestamp is attached to the record when collected when the user programs uses { @ link time characteristic # event time } , this timestamp will be used by default

private void deserialize record for collection and update state ( final user record record ) { byte buffer record data = record get data ( ) ; byte [ ] data bytes = new byte [ record data remaining ( ) ] ; record data get ( data bytes ) ; final long approx arrival timestamp = record get approximate arrival timestamp ( ) get time ( ) ; final t value ; try { value = deserializer deserialize ( data bytes , record get partition key ( ) , record get sequence number ( ) , approx arrival timestamp , subscribed shard get stream name ( ) , subscribed shard get shard ( ) get shard id ( ) ) ; } catch ( i o exception e ) { throw new runtime exception ( e ) ; } sequence number collected sequence number = ( record is aggregated ( ) ) ? new sequence number ( record get sequence number ( ) , record get sub sequence number ( ) ) : new sequence number ( record get sequence number ( ) ) ; fetcher ref emit record and update state ( value , approx arrival timestamp , subscribed shard state index , collected sequence number ) ; this last sequence num = collected sequence number ; }


returns all variations of this policy based on the configuration parameters

public static set < policy > policies ( config config ) { s 4 window tiny lfu settings settings = new s 4 window tiny lfu settings ( config ) ; return settings percent main ( ) stream ( ) map ( percent main - > new s 4 window tiny lfu policy ( percent main , settings ) ) collect ( to set ( ) ) ; }


tries to coordinate async counting but it is flaky due to the low 1 0s of milliseconds

void ref count async actual ( ) { final atomic integer subscribe count = new atomic integer ( ) ; final atomic integer next count = new atomic integer ( ) ; observable < long > r = observable interval ( 0 , 25 , time unit milliseconds ) do on subscribe ( new consumer < disposable > ( ) { @ override public void accept ( disposable d ) { subscribe count increment and get ( ) ; } } ) do on next ( new consumer < long > ( ) { @ override public void accept ( long l ) { next count increment and get ( ) ; } } ) publish ( ) ref count ( ) ; final atomic integer received count = new atomic integer ( ) ; disposable d 1 = r subscribe ( new consumer < long > ( ) { @ override public void accept ( long l ) { received count increment and get ( ) ; } } ) ; disposable d 2 = r subscribe ( ) ; / / give time to emit try { thread sleep ( 260 ) ; } catch ( interrupted exception e ) { } / / now unsubscribe d 2 dispose ( ) ; / / unsubscribe s 2 first as we ' re counting in 1 and there can be a race between unsubscribe and one observer getting a value but not the other d 1 dispose ( ) ; system out println ( " on next : " + next count get ( ) ) ; / / should emit once for both subscribers assert equals ( next count get ( ) , received count get ( ) ) ; / / only 1 subscribe assert equals ( 1 , subscribe count get ( ) ) ; }


recommend to use { @ link nacos config properties # shared configs } and not use it at the same time

public void set shared dataids ( string shared dataids ) { if ( null ! = shared dataids & & shared dataids trim ( ) length ( ) > 0 ) { list < config > list = new array list < > ( ) ; stream of ( shared dataids split ( separator ) ) for each ( data id - > list add ( new config ( data id trim ( ) ) ) ) ; this compatible shared configs ( list ) ; } }


selects the row under the given mouse point this method is useful when the user triggers a popup mouse action and you would like to have the table select that row if it is not already selected this allows you to guarantee that there is always a selection when the user triggers a popup menu

public boolean select row ( mouse event event ) { if ( event get source ( ) ! = this ) { return false ; } int row = row at point ( event get point ( ) ) ; if ( row > = 0 ) { if ( ! is row selected ( row ) ) { set row selection interval ( row , row ) ; } return true ; } return false ; }


set the active animation , replacing any current animation

public animation desc set animation ( final string id , final animation listener listener ) { return set animation ( id , 1 , 1 0f , listener ) ; }


private synchronized boolean client requested ( int num messages ) { if ( closed ) { return false ; } boolean previously ready = client requested > 0 ; client requested + = num messages ; while ( client requested > 0 & & ! client receive queue is empty ( ) ) { client requested - - ; client stream listener messages available ( client receive queue poll ( ) ) ; } / / attempt being reentrant - safe if ( closed ) { return false ; } if ( client receive queue is empty ( ) & & client notify status ! = null ) { closed = true ; client stream stats trace ctx client inbound trailers ( client notify trailers ) ; client stream stats trace ctx stream closed ( client notify status ) ; client stream listener closed ( client notify status , client notify trailers ) ; } boolean now ready = client requested > 0 ; return ! previously ready & & now ready ; }


test the property ' quadrilateral type '

public void quadrilateral type test ( ) { / / todo : test quadrilateral type }


uses the symbolic propogator to attempt to determine the constant value in the syscall register at each system call instruction

private map < address , long > resolve constants ( map < function , set < address > > funcs to calls , program program , task monitor t monitor ) throws cancelled exception { map < address , long > addresses to syscalls = new hash map < > ( ) ; register syscall reg = program get language ( ) get register ( syscall register ) ; for ( function func : funcs to calls key set ( ) ) { address start = func get entry point ( ) ; context evaluator eval = new constant propagation context evaluator ( true ) ; symbolic propogator sym eval = new symbolic propogator ( program ) ; sym eval flow constants ( start , func get body ( ) , eval , true , t monitor ) ; for ( address call site : funcs to calls get ( func ) ) { value val = sym eval get register value ( call site , syscall reg ) ; if ( val = = null ) { create bookmark ( call site , " system call " , " couldn ' t resolve value of " + syscall reg ) ; printf ( " couldn ' t resolve value of " + syscall reg + " at " + call site + " \ n " ) ; continue ; } addresses to syscalls put ( call site , val get value ( ) ) ; } } return addresses to syscalls ; }


public void write ( configuration configuration ) throws i o exception { / / write the program class path ( input and output entries ) write jar options ( configuration constants injars option , configuration constants outjars option , configuration program jars ) ; writer println ( ) ; / / write the library class path ( output entries only ) write jar options ( configuration constants libraryjars option , configuration constants libraryjars option , configuration library jars ) ; writer println ( ) ; / / write the other options write option ( configuration constants skip non public library classes option , configuration skip non public library classes ) ; write option ( configuration constants dont skip non public library class members option , ! configuration skip non public library class members ) ; write option ( configuration constants keep directories option , configuration keep directories ) ; write option ( configuration constants target option , class util external class version ( configuration target class version ) ) ; write option ( configuration constants force processing option , configuration last modified = = long max value ) ; write option ( configuration constants dont shrink option , ! configuration shrink ) ; write option ( configuration constants print usage option , configuration print usage ) ; write option ( configuration constants dont optimize option , ! configuration optimize ) ; write option ( configuration constants optimizations , configuration optimizations ) ; write option ( configuration constants optimization passes , configuration optimization passes ) ; write option ( configuration constants allow access modification option , configuration allow access modification ) ; write option ( configuration constants merge interfaces aggressively option , configuration merge interfaces aggressively ) ; write option ( configuration constants dont obfuscate option , ! configuration obfuscate ) ; write option ( configuration constants print mapping option , configuration print mapping ) ; write option ( configuration constants apply mapping option , configuration apply mapping ) ; write option ( configuration constants obfuscation dictionary option , configuration obfuscation dictionary ) ; write option ( configuration constants class obfuscation dictionary option , configuration class obfuscation dictionary ) ; write option ( configuration constants package obfuscation dictionary option , configuration package obfuscation dictionary ) ; write option ( configuration constants overload aggressively option , configuration overload aggressively ) ; write option ( configuration constants use unique class member names option , configuration use unique class member names ) ; write option ( configuration constants dont use mixed case class names option , ! configuration use mixed case class names ) ; write option ( configuration constants keep package names option , configuration keep package names , true ) ; write option ( configuration constants flatten package hierarchy option , configuration flatten package hierarchy , true ) ; write option ( configuration constants repackage classes option , configuration repackage classes , true ) ; write option ( configuration constants keep attributes option , configuration keep attributes ) ; write option ( configuration constants keep parameter names option , configuration keep parameter names ) ; write option ( configuration constants rename source file attribute option , configuration new source file attribute ) ; write option ( configuration constants adapt class strings option , configuration adapt class strings , true ) ; write option ( configuration constants adapt resource file names option , configuration adapt resource file names ) ; write option ( configuration constants adapt resource file contents option , configuration adapt resource file contents ) ; write option ( configuration constants dont preverify option , ! configuration preverify ) ; write option ( configuration constants micro edition option , configuration micro edition ) ; write option ( configuration constants verbose option , configuration verbose ) ; write option ( configuration constants dont note option , configuration note , true ) ; write option ( configuration constants dont warn option , configuration warn , true ) ; write option ( configuration constants ignore warnings option , configuration ignore warnings ) ; write option ( configuration constants print configuration option , configuration print configuration ) ; write option ( configuration constants dump option , configuration dump ) ; write option ( configuration constants print seeds option , configuration print seeds ) ; writer println ( ) ; / / write the " why are you keeping " options write options ( configuration constants why are you keeping option , configuration why are you keeping ) ; / / write the keep options write options ( keep options , configuration keep ) ; / / write the " no side effect methods " options write options ( configuration constants assume no side effects option , configuration assume no side effects ) ; if ( writer check error ( ) ) { throw new i o exception ( " can ' t write configuration " ) ; } }


reconcile address space changes using associated address factory this method should be invoked following an undoredo ( if the associated address factory may have changed ) or removal of an overlay memory block

public void reconcile ( ) { if ( addr factory = = null ) { return ; } hash map < string , overlay address space > remap spaces = new hash map < string , overlay address space > ( ) ; iterator < string > iter = space map key set ( ) iterator ( ) ; while ( iter has next ( ) ) { string key = iter next ( ) ; address space space = space map get ( key ) ; if ( space instanceof obsolete overlay space ) { / / check for restored space overlay address space old overlay space = ( ( obsolete overlay space ) space ) get original space ( ) ; address space cur space = addr factory get address space ( old overlay space get name ( ) ) ; if ( cur space ! = null & & cur space equals ( old overlay space ) ) { remap spaces put ( space get name ( ) , ( overlay address space ) cur space ) ; iter remove ( ) ; } } else if ( space instanceof overlay address space ) { / / check for removed space address space cur space = addr factory get address space ( space get name ( ) ) ; if ( cur space = = null | | ! cur space equals ( space ) ) { obsolete overlay space obsolete space = new obsolete overlay space ( ( overlay address space ) space ) ; remap spaces put ( space get name ( ) , obsolete space ) ; iter remove ( ) ; } } } for ( address space space : remap spaces values ( ) ) { space map put ( space get name ( ) to upper case ( ) , space ) ; } for ( int i = 0 ; i < base addrs length ; i + + ) { address addr = base addrs [ i ] ; address space space = addr get address space ( ) ; overlay address space cur space = remap spaces get ( space get name ( ) ) ; if ( cur space ! = null ) { base addrs [ i ] = cur space get address in this space only ( addr get offset ( ) ) ; } } init ( ) ; }


unmarshal the given { @ link bytes message } into an object

protected object unmarshal from bytes message ( bytes message message , unmarshaller unmarshaller ) throws j m s exception , i o exception , xml mapping exception { byte [ ] bytes = new byte [ ( int ) message get body length ( ) ] ; message read bytes ( bytes ) ; byte array input stream bis = new byte array input stream ( bytes ) ; stream source source = new stream source ( bis ) ; return unmarshaller unmarshal ( source ) ; }


return whether we ' re strictly validating that all bean properties have been mapped from corresponding database fields

public boolean is check fully populated ( ) { return this check fully populated ; }


public list < list < read only first > > get array array of model ( ) { return array array of model ; }


check that a transaction is created and committed

public void transaction should succeed ( ) throws exception { transaction attribute txatt = new default transaction attribute ( ) ; map transaction attribute source tas = new map transaction attribute source ( ) ; tas register ( get name method , txatt ) ; reactive transaction status = mock ( reactive transaction class ) ; reactive transaction manager rtm = mock ( reactive transaction manager class ) ; / / expect a transaction given ( rtm get reactive transaction ( txatt ) ) will return ( mono just ( status ) ) ; given ( rtm commit ( status ) ) will return ( mono empty ( ) ) ; default test bean tb = new default test bean ( ) ; test bean itb = ( test bean ) advised ( tb , rtm , tas ) ; itb get name ( ) as ( step verifier : : create ) verify complete ( ) ; verify ( rtm ) commit ( status ) ; }


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

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


data output stream get buffered output stream ( ) { return new data output stream ( new buffered output stream ( get output stream ( ) , small buffer size ) ) ; }


public static extension list < console annotator factory > all ( ) { return extension list lookup ( console annotator factory class ) ; }


return the { @ code marshaller } used by this { @ code marshalling source }

public marshaller get marshaller ( ) { return this marshaller ; }


gets the merge filter for the default apply settings

public program merge filter get default apply filter ( ) { plugin tool tool = plugin get tool ( ) ; options options = tool get options ( diff options ) ; / / case program context : / / case bytes : / / case code units : / / case references : / / case bookmarks : / / case properties : / / case functions : / / get the current settings as options replace choice program context = options get enum ( option program context , replace choice replace ) ; replace choice bytes = options get enum ( option bytes , replace choice replace ) ; replace choice code units = options get enum ( option code units , replace choice replace ) ; replace choice references = options get enum ( option references , replace choice replace ) ; merge choice plate comments = options get enum ( option plate comments , merge choice merge ) ; merge choice pre comments = options get enum ( option pre comments , merge choice merge ) ; merge choice eol comments = options get enum ( option eol comments , merge choice merge ) ; merge choice repeatable comments = options get enum ( option repeatable comments , merge choice merge ) ; merge choice post comments = options get enum ( option post comments , merge choice merge ) ; symbol merge choice symbols = options get enum ( option symbols , symbol merge choice merge and set primary ) ; replace choice bookmarks = options get enum ( option bookmarks , replace choice replace ) ; replace choice properties = options get enum ( option properties , replace choice replace ) ; replace choice functions = options get enum ( option functions , replace choice replace ) ; merge choice function tags = options get enum ( option function tags , merge choice merge ) ; / / convert the options to a merge filter program merge filter filter = new program merge filter ( ) ; filter set filter ( program merge filter program context , program context ordinal ( ) ) ; filter set filter ( program merge filter bytes , bytes ordinal ( ) ) ; filter set filter ( program merge filter code units , code units ordinal ( ) ) ; filter set filter ( program merge filter references , references ordinal ( ) ) ; filter set filter ( program merge filter plate comments , plate comments ordinal ( ) ) ; filter set filter ( program merge filter pre comments , pre comments ordinal ( ) ) ; filter set filter ( program merge filter eol comments , eol comments ordinal ( ) ) ; filter set filter ( program merge filter repeatable comments , repeatable comments ordinal ( ) ) ; filter set filter ( program merge filter post comments , post comments ordinal ( ) ) ; filter set filter ( program merge filter symbols , convert symbol merge choice to merge choice ( symbols ) ordinal ( ) ) ; filter set filter ( program merge filter bookmarks , bookmarks ordinal ( ) ) ; filter set filter ( program merge filter properties , properties ordinal ( ) ) ; filter set filter ( program merge filter functions , functions ordinal ( ) ) ; filter set filter ( program merge filter function tags , function tags ordinal ( ) ) ; filter set filter ( program merge filter primary symbol , convert symbol merge choice to replace choice for primay ( symbols ) ordinal ( ) ) ; return filter ; }


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

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


an optional list of hex - encoded sha - 256 hashes of the authorized client certificates both simple and colon separated formats are acceptable note : when both verify certificate hash and verify certificate spki are specified , a hash matching either value will result in the certificate being accepted < code > repeated string verify certificate hash = 12 ; < code >

public builder add all verify certificate hash ( java lang iterable < java lang string > values ) { ensure verify certificate hash is mutable ( ) ; com google protobuf abstract message lite builder add all ( values , verify certificate hash ) ; on changed ( ) ; return this ; }


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

public completable future < api response < void > > test group parameters with http info ( integer required string group , boolean required boolean group , long required int 6 4 group , integer string group , boolean boolean group , long int 6 4 group ) throws api exception { try { http request builder local var request builder = test group parameters request builder ( required string group , required boolean group , required int 6 4 group , string group , boolean group , int 6 4 group ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " test group parameters " , local var response ) ) ; } return completable future completed future ( new api response < void > ( local var response status code ( ) , local var response headers ( ) map ( ) , null ) ) ; } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


void do global report ( global session global session , string xid , global status param ) throws transaction exception ;


set to true if all measurements ( like edit distance , transpositions and lengths ) are in unicode code points ( actual letters ) instead of bytes default is false

public builder set unicode aware ( boolean unicode aware ) { this unicode aware = unicode aware ; return this ; }


creates a { @ link type serializer } for internal data structures of the given { @ link logical type }

public static < t > type serializer < t > create ( logical type type ) { return ( type serializer < t > ) create internal ( type ) ; }


void remove from version ( ) { prev version next version = next version ; next version prev version = prev version ; next version = null ; prev version = null ; }


set additional interceptors ( or advisors ) to be applied before the remote endpoint , e g a performance monitor interceptor you may specify any aop alliance method interceptors or other spring aop advices , as well as spring aop advisors

public void set interceptors ( object [ ] interceptors ) { this interceptors = interceptors ; }


public static < t > t [ ] new array ( class < t > type , int length ) { return ( t [ ] ) array new instance ( type , length ) ; }


assert that two task statuses are equal after serialization

public static void assert task status equals ( version version , bulk by scroll task status expected , bulk by scroll task status actual ) { assert equals ( expected get total ( ) , actual get total ( ) ) ; assert equals ( expected get updated ( ) , actual get updated ( ) ) ; assert equals ( expected get created ( ) , actual get created ( ) ) ; assert equals ( expected get deleted ( ) , actual get deleted ( ) ) ; assert equals ( expected get batches ( ) , actual get batches ( ) ) ; assert equals ( expected get version conflicts ( ) , actual get version conflicts ( ) ) ; assert equals ( expected get noops ( ) , actual get noops ( ) ) ; assert equals ( expected get bulk retries ( ) , actual get bulk retries ( ) ) ; assert equals ( expected get search retries ( ) , actual get search retries ( ) ) ; assert equals ( expected get throttled ( ) , actual get throttled ( ) ) ; assert equals ( expected get requests per second ( ) , actual get requests per second ( ) , 0f ) ; assert equals ( expected get reason cancelled ( ) , actual get reason cancelled ( ) ) ; assert equals ( expected get throttled until ( ) , actual get throttled until ( ) ) ; assert that ( actual get slice statuses ( ) , matchers has size ( expected get slice statuses ( ) size ( ) ) ) ; for ( int i = 0 ; i < expected get slice statuses ( ) size ( ) ; i + + ) { bulk by scroll task status or exception slice status = expected get slice statuses ( ) get ( i ) ; if ( slice status = = null ) { assert null ( actual get slice statuses ( ) get ( i ) ) ; } else if ( slice status get exception ( ) = = null ) { assert null ( actual get slice statuses ( ) get ( i ) get exception ( ) ) ; assert task status equals ( version , slice status get status ( ) , actual get slice statuses ( ) get ( i ) get status ( ) ) ; } else { assert null ( actual get slice statuses ( ) get ( i ) get status ( ) ) ; / / just check the message because we ' re not testing exception serialization in general here assert equals ( slice status get exception ( ) get message ( ) , actual get slice statuses ( ) get ( i ) get exception ( ) get message ( ) ) ; } } }


called when done processing response to signal more data is needed

void done ( time value extra keep alive ) ;


sets the doc to use for updates when a script is not specified , the doc provided is a field and value pairs

public update request builder set doc ( x content type x content type , object source ) { request doc ( x content type , source ) ; return this ; }


asserts the x attrs returned by get x attrs for a specific path match an expected set of x attrs

public static void assert x attrs ( path path , file system fs , map < string , byte [ ] > expected x attrs ) throws exception { map < string , byte [ ] > x attrs = fs get x attrs ( path ) ; assert equals ( path to string ( ) , expected x attrs size ( ) , x attrs size ( ) ) ; iterator < entry < string , byte [ ] > > i = expected x attrs entry set ( ) iterator ( ) ; while ( i has next ( ) ) { entry < string , byte [ ] > e = i next ( ) ; string name = e get key ( ) ; byte [ ] value = e get value ( ) ; if ( value = = null ) { assert true ( x attrs contains key ( name ) & & x attrs get ( name ) = = null ) ; } else { assert array equals ( value , x attrs get ( name ) ) ; } } }


remove the given object from the data structure

public void remove ( t t ) { weak hash storage remove ( t ) ; }


this method takes a string for the resource being requested and sets up a proxy to make the request if http proxy andor https proxy environment variables are set , or if the standard ` https proxy ` and ` http proxy ` system properties are set

public proxy create proxy if needed ( url requested url ) throws i o exception { string proxy address = null ; string no proxy url = env get ( " no proxy " ) ; if ( strings is null or empty ( no proxy url ) ) { no proxy url = env get ( " no proxy " ) ; } if ( ! strings is null or empty ( no proxy url ) ) { string [ ] no proxy url array = no proxy url split ( " \ \ s * , \ \ s * " ) ; string requested host = requested url get host ( ) ; for ( int i = 0 ; i < no proxy url array length ; i + + ) { if ( no proxy url array [ i ] starts with ( " " ) ) { / / this entry applies to sub - domains only if ( requested host ends with ( no proxy url array [ i ] ) ) { return proxy no proxy ; } } else { / / this entry applies to the literal hostname and sub - domains if ( requested host equals ( no proxy url array [ i ] ) | | requested host ends with ( " " + no proxy url array [ i ] ) ) { return proxy no proxy ; } } } } if ( http utils is protocol ( requested url , " https " ) ) { proxy address = stream of ( ( supplier < string > ) ( ) - > env get ( " https proxy " ) , ( ) - > env get ( " https proxy " ) , ( ) - > { string host = system get property ( " https proxy host " ) ; if ( host = = null ) { return null ; } string port = system get property ( " https proxy port " ) ; return string format ( " % s % s " , host , port = = null ? " " : " : " + port ) ; } ) map ( supplier : : get ) filter ( objects : : non null ) find first ( ) or else ( null ) ; } else if ( http utils is protocol ( requested url , " http " ) ) { proxy address = stream of ( ( supplier < string > ) ( ) - > env get ( " http proxy " ) , ( ) - > env get ( " http proxy " ) , ( ) - > { string host = system get property ( " http proxy host " ) ; if ( host = = null ) { return null ; } string port = system get property ( " http proxy port " ) ; return string format ( " % s % s " , host , port = = null ? " " : " : " + port ) ; } ) map ( supplier : : get ) filter ( objects : : non null ) find first ( ) or else ( null ) ; } return create proxy ( proxy address ) ; }


sample all the sources for a snapshot of metricstags

public synchronized metrics buffer sample metrics ( ) { collector clear ( ) ; metrics buffer builder buffer builder = new metrics buffer builder ( ) ; for ( entry < string , metrics source adapter > entry : sources entry set ( ) ) { if ( source filter = = null | | source filter accepts ( entry get key ( ) ) ) { snapshot metrics ( entry get value ( ) , buffer builder ) ; } } if ( publish self metrics ) { snapshot metrics ( sys source , buffer builder ) ; } metrics buffer buffer = buffer builder get ( ) ; return buffer ; }


sets the content of this gif image view to the specified uri if uri destination is not a gif then { @ link android widget image view # set image u r i ( android net uri ) } is called as fallback for supported uri schemes see : { @ link android content content resolver # open asset file descriptor ( android net uri , string ) }

public void set image u r i ( uri uri ) { if ( ! gif view utils set gif image uri ( this , uri ) ) { super set image u r i ( uri ) ; } }


public big decimal get big decimal ( ) { return big decimal ; }


returns an instance that is just like this one , except that the register list is replaced by the given one , and its address is reset

public abstract dalv insn with registers ( register spec list registers ) ;


check the time remaining until the timeout expires

public long remaining election time ms ( long current time ms ) { election timer update ( current time ms ) ; return election timer remaining ms ( ) ; }


returns true if the field contains valid input

public boolean is field valid ( ) { if ( required & & get text ( ) is empty ( ) ) { return false ; } if ( verifier ! = null ) { if ( ! verifier verify ( this ) ) { return false ; } } return true ; }


sets the state of the split to { @ code null }

default void reset split state ( ) { this set split state ( null ) ; }


a builder for { @ link required providers } that accepts any dependency unless restriction provider sets are added

public static builder accept any builder ( ) { return new builder ( false ) ; }


check and add namespacestoragespacestoragetype consumed to itself and the ancestors

public void add space consumed ( quota counts counts ) { if ( parent ! = null ) { parent add space consumed ( counts ) ; } }


creates a { @ code listenable future task } that will upon running , execute the given { @ code callable }

public static < v > listenable future task < v > create ( callable < v > callable ) { return new listenable future task < v > ( callable ) ; }


public long get finish time ( ) throws i o exception , interrupted exception { ensure state ( job state running ) ; update status ( ) ; return status get finish time ( ) ; }


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


list < field error > get field errors ( ) ;


sets the starting position and the direction of this ray

public ray set ( vector 3 origin , vector 3 direction ) { this origin set ( origin ) ; this direction set ( direction ) nor ( ) ; return this ; }


set headers on the response called for both get and head requests

protected void set headers ( server web exchange exchange , resource resource , @ nullable media type media type ) throws i o exception { http headers headers = exchange get response ( ) get headers ( ) ; long length = resource content length ( ) ; headers set content length ( length ) ; if ( media type ! = null ) { headers set content type ( media type ) ; } if ( resource instanceof http resource ) { http headers resource headers = ( ( http resource ) resource ) get response headers ( ) ; exchange get response ( ) get headers ( ) put all ( resource headers ) ; } }


returns the timestamp before which data is not accepted by the job this is the latest record timestamp minus the job latency

public long earliest valid timestamp ( data counts data counts ) { long current time = 0 ; date latest record timestamp = data counts get latest record time stamp ( ) ; if ( latest record timestamp ! = null ) { time value latency = analysis config get latency ( ) ; long latency millis = latency = = null ? 0 : latency millis ( ) ; current time = latest record timestamp get time ( ) - latency millis ; } return current time ; }


this method is deprecated and will be removed in the future releases handle async db operation in your own logic instead

public static < t extends lite pal support > save executor save all async ( final collection < t > collection ) { final save executor executor = new save executor ( ) ; runnable runnable = new runnable ( ) { @ override public void run ( ) { synchronized ( lite pal support class ) { boolean success ; try { save all ( collection ) ; success = true ; } catch ( exception e ) { success = false ; } final boolean result = success ; if ( executor get listener ( ) ! = null ) { operator get handler ( ) post ( new runnable ( ) { @ override public void run ( ) { executor get listener ( ) on finish ( result ) ; } } ) ; } } } } ; executor submit ( runnable ) ; return executor ; }


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


set the { @ link unmarshaller } to be used by this message converter

public void set unmarshaller ( unmarshaller unmarshaller ) { this unmarshaller = unmarshaller ; }


test that it performs the correct lookup

public void test performs lookup ( ) throws exception { local interface with business methods ejb = mock ( local interface with business methods class ) ; string jndi name = " foobar " ; context mock context = mock context ( jndi name , ejb ) ; configured interceptor ( mock context , jndi name ) ; verify ( mock context ) close ( ) ; }


get the name of the state store that should be queried

public string store name ( ) { return store name ; }


gets all the { @ link top level item } s recursively in the { @ link item group } tree

public static list < top level item > get all top level items ( item group root ) { return root get all items ( top level item class ) ; }


helper to test that the { @ link blob server } recovery from its ha store works uploads two b l o bs to one { @ link blob server } via a { @ link blob cache service } and expects a second { @ link blob cache service } to be able to retrieve them from a second { @ link blob server } that is configured with the same ha store

public static void test blob cache recovery ( final configuration config , final blob store blob store ) throws i o exception { final string cluster id = config get string ( high availability options ha cluster id ) ; string storage path = config get string ( high availability options ha storage path ) + " / " + cluster id ; random rand = new random ( ) ; try ( blob server server 0 = new blob server ( config , blob store ) ; blob server server 1 = new blob server ( config , blob store ) ; / / use void blob store as the ha store to force download from each server ' s ha store blob cache service cache 0 = new blob cache service ( config , new void blob store ( ) , new inet socket address ( " localhost " , server 0 get port ( ) ) ) ; blob cache service cache 1 = new blob cache service ( config , new void blob store ( ) , new inet socket address ( " localhost " , server 1 get port ( ) ) ) ) { server 0 start ( ) ; server 1 start ( ) ; / / random data byte [ ] expected = new byte [ 1024 ] ; rand next bytes ( expected ) ; byte [ ] expected 2 = arrays copy of range ( expected , 32 , 288 ) ; blob key [ ] keys = new blob key [ 2 ] ; blob key non h a key ; / / put job - related ha data job i d [ ] job id = new job i d [ ] { new job i d ( ) , new job i d ( ) } ; keys [ 0 ] = put ( cache 0 , job id [ 0 ] , expected , permanent blob ) ; / / request 1 keys [ 1 ] = put ( cache 0 , job id [ 1 ] , expected 2 , permanent blob ) ; / / request 2 / / put non - ha data non h a key = put ( cache 0 , job id [ 0 ] , expected 2 , transient blob ) ; verify key different hash different ( keys [ 0 ] , non h a key ) ; verify key different hash equals ( keys [ 1 ] , non h a key ) ; / / check that the storage directory exists final path blob server path = new path ( storage path , " blob " ) ; file system fs = blob server path get file system ( ) ; assert true ( " unknown storage dir : " + blob server path , fs exists ( blob server path ) ) ; / / verify ha requests from cache 1 ( connected to server 1 ) with no immediate access to the / / file verify contents ( cache 1 , job id [ 0 ] , keys [ 0 ] , expected ) ; verify contents ( cache 1 , job id [ 1 ] , keys [ 1 ] , expected 2 ) ; / / verify non - ha file is not accessible from server 1 verify deleted ( cache 1 , job id [ 0 ] , non h a key ) ; } }


get the size of partitions written by an output stream this is for testing

public static long get partition size ( f s data output stream output stream ) { swift native output stream snos = get swift native output stream ( output stream ) ; return snos get file part size ( ) ; }


instructs the backend to drop its caches


gets the unique id that identifies the resource manager

public resource i d get resource manager id ( ) { return resource manager resource id ; }


returns a float ( 0 , + infinity ) indicating a scale factor to apply to the source width and height when displayed in the requested width and height the returned scale factor will be split into a power of two sample size applied via { @ link android graphics bitmap factory options # in sample size } and a float scale factor applied after downsampling via { @ link android graphics bitmap factory options # in target density } and { @ link android graphics bitmap factory options # in density } because of rounding errors the scale factor may not be applied precisely the float scaling factor will only be applied on kit kat + prior to kit kat , only the power of two downsampling will be applied

public abstract float get scale factor ( int source width , int source height , int requested width , int requested height ) ;


constructs an { @ link options data } object for a parser that knows about the given { @ link options base } classes in addition to the work done to construct the { @ link isolated options data } , this also computes expansion information if an option has static expansions or uses an expansion function that takes a void object , try to precalculate the expansion here

static options data from ( collection < class < ? extends options base > > classes ) { isolated options data isolated data = isolated options data from ( classes ) ; / / all that ' s left is to compute expansions immutable map builder < option definition , immutable list < string > > evaluated expansions builder = immutable map builder ( ) ; for ( map entry < string , option definition > entry : isolated data get all option definitions ( ) ) { option definition option definition = entry get value ( ) ; / / determine either the hard - coded expansion , or the expansion function class the / / option processor checks at compile time that these aren ' t used together string [ ] const expansion = option definition get option expansion ( ) ; class < ? extends expansion function > expansion function class = option definition get expansion function ( ) ; if ( const expansion length > 0 ) { evaluated expansions builder put ( option definition , immutable list copy of ( const expansion ) ) ; } else if ( option definition uses expansion function ( ) ) { if ( modifier is abstract ( expansion function class get modifiers ( ) ) ) { throw new assertion error ( " the expansion function type " + expansion function class + " must be a concrete type " ) ; } / / evaluate the expansion function expansion function instance ; try { constructor < ? > constructor = expansion function class get constructor ( ) ; instance = ( expansion function ) constructor new instance ( ) ; } catch ( exception e ) { / / this indicates an error in the expansion function , and should be discovered the first / / time it is used throw new assertion error ( e ) ; } immutable list < string > expansion = instance get expansion ( isolated data ) ; evaluated expansions builder put ( option definition , expansion ) ; } } return new options data ( isolated data , evaluated expansions builder build ( ) ) ; }


build call for fake outer boolean serialize

public okhttp 3 call fake outer boolean serialize call ( boolean body , final api callback callback ) throws api exception { object local var post body = body ; / / create path and map variables string local var path = " / fake / outer / boolean " ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " * / * " } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , " post " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


given a list of path components returns a byte array

public static byte [ ] byte array 2bytes ( byte [ ] [ ] path components ) { if ( path components length = = 0 | | ( path components length = = 1 & & ( path components [ 0 ] = = null | | path components [ 0 ] length = = 0 ) ) ) { return empty bytes ; } int length = 0 ; for ( int i = 0 ; i < path components length ; i + + ) { length + = path components [ i ] length ; if ( i < path components length - 1 ) { length + + ; / / for separator } } byte [ ] path = new byte [ length ] ; int index = 0 ; for ( int i = 0 ; i < path components length ; i + + ) { system arraycopy ( path components [ i ] , 0 , path , index , path components [ i ] length ) ; index + = path components [ i ] length ; if ( i < path components length - 1 ) { path [ index ] = ( byte ) path separator char ; index + + ; } } return path ; }


creates a new private child environment for bindings and other configuration the returned binder can be used to add and configuration information in this environment see { @ link private module } for details


hystrix concurrency strategy use default request context : true hystrix command use request cache : false use request log : false outcome : request log not set up in command , static access is null

public void test command does not require context concurrency strategy provides it context left uninitialized ( ) { hystrix concurrency strategy strategy = new custom concurrency strategy ( true ) ; hystrix plugins get instance ( ) register concurrency strategy ( strategy ) ; / / context is not set up hystrix request context set context on current thread ( null ) ; hystrix command < boolean > cmd = new test command ( false , false ) ; assert true ( cmd execute ( ) ) ; / / command execution not affected by missing context print request log ( ) ; assert null ( hystrix request log get current request ( ) ) ; assert null ( hystrix request log get current request ( strategy ) ) ; assert null ( cmd current request log ) ; }


gets the location where the latest completedcanceledfailed execution of the vertex ' s task happened

public task manager location get latest prior location ( ) { archived execution latest prior execution = get latest prior execution ( ) ; return latest prior execution ! = null ? latest prior execution get assigned resource location ( ) : null ; }


returns the common maximum argument count or null if undefined

private static @ nullable integer common max ( list < argument count > counts ) { / / max = 5 , max = 3 , max = 0 - > max = 5 / / max = 5 , max = 3 , max = 0 , max = null - > max = null int common max = integer min value ; for ( argument count count : counts ) { final optional < integer > max = count get max count ( ) ; if ( ! max is present ( ) ) { return null ; } common max = math max ( common max , max get ( ) ) ; } if ( common max = = integer min value ) { return null ; } return common max ; }


public static list < string > to upper list ( list < string > source list ) { if ( is empty ( source list ) ) { return source list ; } list < string > dest list = new array list < > ( source list size ( ) ) ; for ( string element : source list ) { if ( element ! = null ) { dest list add ( element to upper case ( ) ) ; } else { dest list add ( null ) ; } } return dest list ; }