connect to the server and set up the io streams it then sends a header to the server and starts the connection thread that waits for responses

private synchronized void setup i ostreams ( atomic boolean fallback to simple auth ) { if ( socket ! = null | | should close connection get ( ) ) { return ; } user group information ticket = remote id get ticket ( ) ; if ( ticket ! = null ) { final user group information real user = ticket get real user ( ) ; if ( real user ! = null ) { ticket = real user ; } } try { connecting thread set ( thread current thread ( ) ) ; if ( log is debug enabled ( ) ) { log debug ( " connecting to " + server ) ; } span span = tracer get current span ( ) ; if ( span ! = null ) { span add timeline annotation ( " ipc client connecting to " + server ) ; } short num retries = 0 ; random rand = null ; while ( true ) { setup connection ( ticket ) ; ipc streams = new ipc streams ( socket , max response length ) ; write connection header ( ipc streams ) ; if ( auth protocol = = auth protocol sasl ) { try { auth method = ticket do as ( new privileged exception action < auth method > ( ) { @ override public auth method run ( ) throws i o exception , interrupted exception { return setup sasl connection ( ipc streams ) ; } } ) ; } catch ( i o exception ex ) { if ( sasl rpc client = = null ) { / / whatever happened - it can ' t be handled , so rethrow throw ex ; } / / otherwise , assume a connection problem auth method = sasl rpc client get auth method ( ) ; if ( rand = = null ) { rand = new random ( ) ; } handle sasl connection failure ( num retries + + , max retries on sasl , ex , rand , ticket ) ; continue ; } if ( auth method ! = auth method simple ) { / / sasl connect is successful let ' s set up sasl i / o streams ipc streams set sasl client ( sasl rpc client ) ; / / for testing remote id sasl qop = ( string ) sasl rpc client get negotiated property ( sasl qop ) ; log debug ( " negotiated qop is : " + remote id sasl qop ) ; if ( fallback to simple auth ! = null ) { fallback to simple auth set ( false ) ; } } else if ( user group information is security enabled ( ) ) { if ( ! fallback allowed ) { throw new access control exception ( " server asks us to fall back to simple " + " auth , but this client is configured to only allow secure " + " connections " ) ; } if ( fallback to simple auth ! = null ) { fallback to simple auth set ( true ) ; } } } if ( do ping ) { ipc streams set input stream ( new ping input stream ( ipc streams in ) ) ; } write connection context ( remote id , auth method ) ; / / update last activity time touch ( ) ; span = tracer get current span ( ) ; if ( span ! = null ) { span add timeline annotation ( " ipc client connected to " + server ) ; } / / start the receiver thread after the socket connection has been set / / up start ( ) ; return ; } } catch ( throwable t ) { if ( t instanceof i o exception ) { mark closed ( ( i o exception ) t ) ; } else { mark closed ( new i o exception ( " couldn ' t set up io streams : " + t , t ) ) ; } close ( ) ; } finally { connecting thread set ( null ) ; } }


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


list < t > find all by app ( string app name ) ; / /


gets the { @ link security realm } descriptors by name primarily used for making them web - visible

public descriptor < security realm > get security realms ( string short class name ) { return find descriptor ( short class name , security realm all ( ) ) ; }


place { @ link console note } s and make sure it works

@ test public void console annotation ( ) throws exception { final sequence lock lock = new sequence lock ( ) ; jenkins rule web client wc = r create web client ( ) ; free style project p = r create free style project ( ) ; p get builders list ( ) add ( new test builder ( ) { public boolean perform ( abstract build < ? , ? > build , launcher launcher , build listener listener ) throws interrupted exception , i o exception { lock phase ( 0 ) ; / / make sure the build is now properly started lock phase ( 2 ) ; listener get logger ( ) print ( " abc " ) ; listener annotate ( new dollar mark ( ) ) ; listener get logger ( ) println ( " def " ) ; lock phase ( 4 ) ; listener get logger ( ) print ( " 123 " ) ; listener annotate ( new dollar mark ( ) ) ; listener get logger ( ) print ( " 456 " ) ; listener annotate ( new dollar mark ( ) ) ; listener get logger ( ) println ( " 789 " ) ; lock phase ( 6 ) ; return true ; } } ) ; future < free style build > f = p schedule build 2 ( 0 ) ; / / discard the initial header portion lock phase ( 1 ) ; free style build b = p get build by number ( 1 ) ; progressive log client plc = new progressive log client ( wc , b ) ; plc next ( ) ; lock phase ( 3 ) ; assert equals ( " abc $ $ $ def \ r \ n " , plc next ( ) ) ; lock phase ( 5 ) ; assert equals ( " 123 $ $ $ 456 $ $ $ 789 \ r \ n " , plc next ( ) ) ; lock done ( ) ; / / should complete successfully r assert build status success ( f ) ; }


return { @ link http message writer http message writers } to write and encode the request body with

list < http message writer < ? > > message writers ( ) ;


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


returns whether a spawn claims to support being executed with the persistent worker strategy according to its execution info tags

public static boolean supports workers ( spawn spawn ) { return " 1 " equals ( spawn get execution info ( ) get ( execution requirements supports workers ) ) ; }


reports bytes consumed by the inflater since the last invocation of this method , then resets the count to zero

int get and reset deflated bytes consumed ( ) { int saved deflated bytes consumed = deflated bytes consumed ; deflated bytes consumed = 0 ; return saved deflated bytes consumed ; }


advances the internally tracked event time of this input topic each time a record without explicitly defined timestamp is piped , the current topic event time is used as record timestamp note : advancing the event time on the input topic , does not advance the tracked stream time in { @ link topology test driver } as long as no new input records are piped furthermore , it does not advance the wall - clock time of { @ link topology test driver }

public void advance time ( final duration advance ) { if ( advance is negative ( ) ) { throw new illegal argument exception ( " advance must be positive " ) ; } current time = current time plus ( advance ) ; }


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

public boolean is set success ( ) { return this success ! = null ; }


resets the native decompiler process call this method when the decompiler ' s view of a program has been invalidated , such as when a new overlay space has been added

public void reset decompiler ( ) { if ( cached decomp interface ! = null ) { cached decomp interface reset decompiler ( ) ; } }


the { @ link big arrays } to use for this index

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


get latch that is released if a task is interrupted used only in tests

count down latch get interruption latch for testing only ( ) ;


< code > optional string name = 6 ; < code >

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


reset this monitor so that it can be reused

public synchronized void reset ( ) { is cancelled = false ; task i d increment and get ( ) ; }


configure custom return value handlers for handler methods

public void add custom handler ( handler method return value handler handlers ) { assert not null ( handlers , " ' handlers ' must not be null " ) ; this custom handlers add all ( arrays as list ( handlers ) ) ; }


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


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


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


invokes { @ code future } { @ link future # get ( ) get ( ) } uninterruptibly similar methods : to retrieve a result from a { @ code future } that is already done , use { @ link futures # get done futures get done } to treat { @ link interrupted exception } uniformly with other exceptions , use { @ link futures # get checked ( future , class ) futures get checked } to get uninterruptibility and remove checked exceptions , use { @ link futures # get unchecked }

public static < v > v get uninterruptibly ( future < v > future ) throws execution exception { boolean interrupted = false ; try { while ( true ) { try { return future get ( ) ; } catch ( interrupted exception e ) { interrupted = true ; } } } finally { if ( interrupted ) { thread current thread ( ) interrupt ( ) ; } } }


return total number of replicated blocks


post - process the given persistence unit info , for example registering further entity classes and jar files

void post process persistence unit info ( mutable persistence unit info pui ) ;


called by the drag gesture adapter and the drag source adapter to know what actions this component allows

public int get drag action ( ) { return dn d constants action copy or move ; }


specifies the expected number of nodes in the graph

public graph builder < n > expected node count ( int expected node count ) { this expected node count = optional of ( check non negative ( expected node count ) ) ; return this ; }


public boolean is pool lifo ( ) { return default pool lifo ; }


reverses the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive this is equivalent to { @ code collections reverse ( doubles as list ( array ) sub list ( from index , to index ) ) } , but is likely to be more efficient

public static void reverse ( double [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; for ( int i = from index , j = to index - 1 ; i < j ; i + + , j - - ) { double tmp = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = tmp ; } }


get app placement allocator related to the placement type requested

public static app placement allocator < scheduler node > get app placement allocator ( string app placement allocator name , app scheduling info app scheduling info , scheduler request key scheduler request key , r m context rm context ) { class < ? > policy class ; try { if ( app placement allocator name = = null ) { policy class = application scheduling config default application placement type class ; } else { policy class = class for name ( app placement allocator name ) ; } } catch ( class not found exception e ) { policy class = application scheduling config default application placement type class ; } if ( ! app placement allocator class is assignable from ( policy class ) ) { policy class = application scheduling config default application placement type class ; } @ suppress warnings ( " unchecked " ) app placement allocator < scheduler node > placement allocator instance = ( app placement allocator < scheduler node > ) reflection utils new instance ( policy class , null ) ; placement allocator instance initialize ( app scheduling info , scheduler request key , rm context ) ; return placement allocator instance ; }


returns a unique id for this worker this is used to distinguish different worker processes in logs and messages

int get worker id ( ) { return this worker id ; }


login from keytab using the mini k d c and verify the ugi can successfully relogin from keytab as well this will catch regressions like hadoop - 10786

public void test u g i re login from keytab ( ) throws exception { string principal = " foo " ; file keytab = new file ( work dir , " foo keytab " ) ; kdc create principal ( keytab , principal ) ; user group information login user from keytab ( principal , keytab get path ( ) ) ; user group information ugi = user group information get login user ( ) ; assert assert true ( " ugi should be configured to login from keytab " , ugi is from keytab ( ) ) ; / / verify relogin from keytab user user = get user ( ugi get subject ( ) ) ; final long first login = user get last login ( ) ; final login context login 1 = user get login ( ) ; assert assert not null ( login 1 ) ; / / sleep for 2 secs to have a difference between first and second login thread sleep ( 2000 ) ; ugi relogin from keytab ( ) ; final long second login = user get last login ( ) ; final login context login 2 = user get login ( ) ; assert assert true ( " user should have been able to relogin from keytab " , second login > first login ) ; assert assert not null ( login 2 ) ; assert assert not same ( login 1 , login 2 ) ; }


test { @ link dataset volume checker # check volume } propagates the check to the delegate checker

public void test check one volume ( ) throws exception { log info ( " executing { } " , test name get method name ( ) ) ; final fs volume spi volume = make volumes ( 1 , expected volume health ) get ( 0 ) ; final dataset volume checker checker = new dataset volume checker ( new hdfs configuration ( ) , new fake timer ( ) ) ; checker set delegate checker ( new dummy checker ( ) ) ; final atomic long num callback invocations = new atomic long ( 0 ) ; / * * * request a check and ensure it triggered { @ link fs volume spi # check } * / boolean result = checker check volume ( volume , new dataset volume checker callback ( ) { @ override public void call ( set < fs volume spi > healthy volumes , set < fs volume spi > failed volumes ) { num callback invocations increment and get ( ) ; if ( expected volume health ! = null & & expected volume health ! = failed ) { assert that ( healthy volumes size ( ) , is ( 1 ) ) ; assert that ( failed volumes size ( ) , is ( 0 ) ) ; } else { assert that ( healthy volumes size ( ) , is ( 0 ) ) ; assert that ( failed volumes size ( ) , is ( 1 ) ) ; } } } ) ; generic test utils wait for ( ( ) - > num callback invocations get ( ) > 0 , 5 , 10000 ) ; / / ensure that the check was invoked at least once verify ( volume , times ( 1 ) ) check ( any ( ) ) ; if ( result ) { assert that ( num callback invocations get ( ) , is ( 1l ) ) ; } }


map from the given { @ link message headers } to the specified target message

void from headers ( message headers headers , t target ) ;


r m d t secret manager call this to remove the state of a master key

public void remove r m d t master key ( delegation key delegation key ) { handle store event ( new r m state store r m d t master key event ( delegation key , r m state store event type remove masterkey ) ) ; }


this method will be removed in a certain version after april 5 , 2020 , so please do not use this method

public long earliest msg store time ( message queue mq ) throws m q client exception { return this default m q pull consumer impl earliest msg store time ( queue with namespace ( mq ) ) ; }


set the schema resource to use for validation

public void set schema ( resource schema resource ) { this schema resources = new resource [ ] { schema resource } ; }


public void test dynamic owner fails ( ) { try { test hystrix observable command < boolean > command = new dynamic owner test command ( null ) ; assert equals ( true , command observe ( ) to blocking ( ) single ( ) ) ; fail ( " we should have thrown an exception as we need an owner " ) ; / / semaphore isolated assert false ( command is executed in thread ( ) ) ; assert equals ( 0 , hystrix request log get current request ( ) get all executed commands ( ) size ( ) ) ; } catch ( exception e ) { / / success if we get here } }


returns a new copy of the specified byte { @ code array } with the elements in reversed order

public static byte [ ] reverse ( byte [ ] array ) { byte [ ] reversed = new byte [ array length ] ; for ( int i = 0 ; i < reversed length ; i + + ) { reversed [ i ] = array [ array length - 1 - i ] ; } return reversed ; }


enter a parse tree produced by { @ link eql base parser # comparison operator }

void enter comparison operator ( eql base parser comparison operator context ctx ) ;


tool was added to the workspace ; update the display

void tool added ( plugin tool tool ) { string [ ] consumed events = tool get consumed tool event names ( ) ; string [ ] produced events = tool get tool event names ( ) ; if ( consumed events length > 0 ) { consumer model add element ( tool ) ; } if ( produced events length > 0 ) { producer model add element ( tool ) ; } validate ( ) ; }


finds the variable or rule with the name < code > name < code > , defined in the current scope before the < code > offset < code > ( ninja allows to re - define the values of rules and variables )

private static < t > pair < long , t > find by name and offset ( long offset , string name , ninja scope scope , function < ninja scope , map < string , list < pair < long , t > > > > map function ) { list < pair < long , t > > pairs = preconditions check not null ( map function apply ( scope ) ) get ( name ) ; if ( pairs = = null ) { / / we may want to search in the parent scope return null ; } int insertion point = collections binary search ( pairs , pair of ( offset , null ) , comparator comparing ( pair : : get first ) ) ; if ( insertion point > = 0 ) { / / can not be , variable can not be defined in exactly same place throw new illegal state exception ( " trying to interpret declaration as reference " ) ; } / / we need to access the previous element , before the insertion point int idx = - insertion point - 2 ; if ( idx < 0 ) { / / check the parent scope return null ; } pair < long , t > pair = pairs get ( idx ) ; return pair of ( pair get first ( ) , pair get second ( ) ) ; }


find intersection candidates for ` query ` rectangle this will feed to ` consumer ` each object in the rtree whose bounding rectangle intersects the query rectangle the actual intersection check will need to be performed by the caller

public void find intersections ( rectangle query , consumer < t > consumer ) { int array list todo nodes = new int array list ( level offsets length * degree ) ; int array list todo levels = new int array list ( level offsets length * degree ) ; int root level = level offsets length - 1 ; int root index = level offsets [ root level ] ; if ( does intersect ( query , root index ) ) { todo nodes push ( root index ) ; todo levels push ( root level ) ; } while ( ! todo nodes is empty ( ) ) { int node index = todo nodes pop int ( ) ; int level = todo levels pop int ( ) ; if ( level = = 0 ) { / / this is a leaf node consumer accept ( items [ node index / envelope size ] ) ; } else { int children offset = get children offset ( node index , level ) ; for ( int i = 0 ; i < degree ; i + + ) { int child index = children offset + envelope size * i ; if ( does intersect ( query , child index ) ) { todo nodes push ( child index ) ; todo levels push ( level - 1 ) ; } } } } }


test if the given { @ link file status } user , group owner and its permission are expected , throw { @ link assertion error } if any value is not expected

public static void verify file permission ( file status stat , string owner , string group , fs action u , fs action g , fs action o ) { if ( stat ! = null ) { if ( ! strings is null or empty ( owner ) ) { assert equals ( owner , stat get owner ( ) ) ; } if ( ! strings is null or empty ( group ) ) { assert equals ( group , stat get group ( ) ) ; } fs permission permission = stat get permission ( ) ; if ( u ! = null ) { assert equals ( u , permission get user action ( ) ) ; } if ( g ! = null ) { assert equals ( g , permission get group action ( ) ) ; } if ( o ! = null ) { assert equals ( o , permission get other action ( ) ) ; } } }


sets a descriptive report about why the tasktracker was blacklisted

void set black list report ( string black list report ) { this black list report = black list report ; }


creates an { @ link extrema } that can aggregate { @ code n } elements into the { @ code min ( k , n ) } largest , per the given { @ code comparator }

public static < t > extrema < t > max ( int k , comparator < t > comparator ) { return create ( k , comparator reversed ( ) ) ; }


determines whether the two memory blocks are the same

private boolean same memory block ( memory block block 1 , memory block block 2 ) { if ( block 1 = = null ) { return ( block 2 = = null ) ; } else if ( block 2 = = null ) { return false ; } if ( ! block 1 get name ( ) equals ( block 2 get name ( ) ) ) { return false ; } if ( ! block 1 get start ( ) equals ( block 2 get start ( ) ) ) { return false ; } if ( ! block 1 get end ( ) equals ( block 2 get end ( ) ) ) { return false ; } if ( block 1 get size ( ) ! = block 2 get size ( ) ) { return false ; } if ( block 1 get permissions ( ) ! = block 2 get permissions ( ) ) { return false ; } if ( ! block 1 get type ( ) equals ( block 2 get type ( ) ) ) { return false ; } if ( block 1 is initialized ( ) ! = block 2 is initialized ( ) ) { return false ; } if ( ! system utilities is equal ( block 1 get source name ( ) , block 2 get source name ( ) ) ) { return false ; } if ( ! system utilities is equal ( block 1 get comment ( ) , block 2 get comment ( ) ) ) { return false ; } if ( block 1 is mapped ( ) ! = block 2 is mapped ( ) ) { return false ; } return true ; }


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

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


the configuration for which the resource is defined < code > optional aapt pb config description config = 2 ; < code >

private void set config ( com android aapt resources config description builder builder for value ) { config = builder for value build ( ) ; bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; }


tests handling of buffer underflow during unwrap when network read buffer is smaller than ssl session packet buffer size

public void test net read buffer resize ( args args ) throws exception { string node = " 0 " ; server = create echo server ( args , security protocol ssl ) ; create selector ( args ssl client configs , 10 , null , null ) ; inet socket address addr = new inet socket address ( " localhost " , server port ( ) ) ; selector connect ( node , addr , buffer size , buffer size ) ; network test utils check client connection ( selector , node , 64000 , 10 ) ; }


explicitly release the write suspended status

void release write suspended ( channel handler context ctx ) { set user defined writability ( ctx , true ) ; }


float argument less than the given value see examples in javadoc for { @ link additional matchers } class

public static float lt ( float value ) { report matcher ( new less than < float > ( value ) ) ; return 0 ; }


finds the layout containing the given point

anchored layout find layout at ( int y ) { for ( anchored layout layout : layouts ) { if ( layout contains ( y ) ) { return layout ; } } return null ; }


return the type of { @ code raw type } with the { @ code type arguments }

public static type get type ( @ non null final type raw type , @ non null final type type arguments ) { return type token get parameterized ( raw type , type arguments ) get type ( ) ; }


public void set log query limit ( int log query limit ) { this log query limit = log query limit ; }


test how block location offsets and lengths are fixed

public void test fix block locations ( ) { / / do some tests where start = = 0 { / / case 1 : range starts before current har block and ends after block location [ ] b = { new block location ( null , null , 10 , 10 ) } ; har file system fix block locations ( b , 0 , 20 , 5 ) ; assert that ( b [ 0 ] get offset ( ) ) is equal to ( 5 ) ; assert that ( b [ 0 ] get length ( ) ) is equal to ( 10 ) ; } { / / case 2 : range starts in current har block and ends after block location [ ] b = { new block location ( null , null , 10 , 10 ) } ; har file system fix block locations ( b , 0 , 20 , 15 ) ; assert that ( b [ 0 ] get offset ( ) ) is zero ( ) ; assert that ( b [ 0 ] get length ( ) ) is equal to ( 5 ) ; } { / / case 3 : range starts before current har block and ends in / / current har block block location [ ] b = { new block location ( null , null , 10 , 10 ) } ; har file system fix block locations ( b , 0 , 10 , 5 ) ; assert that ( b [ 0 ] get offset ( ) ) is equal to ( 5 ) ; assert that ( b [ 0 ] get length ( ) ) is equal to ( 5 ) ; } { / / case 4 : range starts and ends in current har block block location [ ] b = { new block location ( null , null , 10 , 10 ) } ; har file system fix block locations ( b , 0 , 6 , 12 ) ; assert that ( b [ 0 ] get offset ( ) ) is zero ( ) ; assert that ( b [ 0 ] get length ( ) ) is equal to ( 6 ) ; } / / now try a range where start = = 3 { / / case 5 : range starts before current har block and ends after block location [ ] b = { new block location ( null , null , 10 , 10 ) } ; har file system fix block locations ( b , 3 , 20 , 5 ) ; assert that ( b [ 0 ] get offset ( ) ) is equal to ( 5 ) ; assert that ( b [ 0 ] get length ( ) ) is equal to ( 10 ) ; } { / / case 6 : range starts in current har block and ends after block location [ ] b = { new block location ( null , null , 10 , 10 ) } ; har file system fix block locations ( b , 3 , 20 , 15 ) ; assert that ( b [ 0 ] get offset ( ) ) is equal to ( 3 ) ; assert that ( b [ 0 ] get length ( ) ) is equal to ( 2 ) ; } { / / case 7 : range starts before current har block and ends in / / current har block block location [ ] b = { new block location ( null , null , 10 , 10 ) } ; har file system fix block locations ( b , 3 , 7 , 5 ) ; assert that ( b [ 0 ] get offset ( ) ) is equal to ( 5 ) ; assert that ( b [ 0 ] get length ( ) ) is equal to ( 5 ) ; } { / / case 8 : range starts and ends in current har block block location [ ] b = { new block location ( null , null , 10 , 10 ) } ; har file system fix block locations ( b , 3 , 3 , 12 ) ; assert that ( b [ 0 ] get offset ( ) ) is equal to ( 3 ) ; assert that ( b [ 0 ] get length ( ) ) is equal to ( 3 ) ; } / / test case from jira mapreduce - 1752 { block location [ ] b = { new block location ( null , null , 512 , 512 ) , new block location ( null , null , 1024 , 512 ) } ; har file system fix block locations ( b , 0 , 512 , 896 ) ; assert that ( b [ 0 ] get offset ( ) ) is zero ( ) ; assert that ( b [ 0 ] get length ( ) ) is equal to ( 128 ) ; assert that ( b [ 1 ] get offset ( ) ) is equal to ( 128 ) ; assert that ( b [ 1 ] get length ( ) ) is equal to ( 384 ) ; } }


public string get session id ( ) { return ( string ) get header ( session id header ) ; }


return an { @ linkplain enumeration enumeration } of the preferred { @ linkplain locale locales } configured in this mock request if no locales have been explicitly configured , the default , preferred { @ link locale } for the server mocked by this request is { @ link locale # english } in contrast to the servlet specification , this mock implementation does not take into consideration any locales specified via the { @ code accept - language } header

public enumeration < locale > get locales ( ) { return collections enumeration ( this locales ) ; }


default completable future < response entity < void > > delete pet ( @ api param ( value = " pet id to delete " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " " ) @ request header ( value = " api key " , required = false ) string api key ) { return completable future completed future ( new response entity < > ( http status not implemented ) ) ; }


get the attribute at the specified index

method get ( int index ) { return this attribute methods [ index ] ; }


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

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


reads and parses the blob with given name , applying name translation using the { link # blob name } method

public t read ( blob container blob container , string name , named x content registry named x content registry , big arrays big arrays ) throws i o exception { string blob name = blob name ( name ) ; try ( releasable bytes stream output out = new releasable bytes stream output ( big arrays ) ; input stream in = blob container read blob ( blob name ) ) { streams copy ( in , out , false ) ; return deserialize ( blob name , named x content registry , out bytes ( ) ) ; } }


closes the socket ignoring { @ link i o exception }

public static void close socket ( final socket sock ) { / / avoids try { close ( ) } dance if ( sock ! = null ) { try { sock close ( ) ; } catch ( i o exception ignored ) { } } }


echoes request headers with the specified key ( s ) from a client into response headers only

private static server interceptor echo request metadata in headers ( final metadata key < ? > keys ) { final set < metadata key < ? > > key set = new hash set < > ( arrays as list ( keys ) ) ; return new server interceptor ( ) { @ override public < req t , resp t > server call listener < req t > intercept call ( server call < req t , resp t > call , final metadata request headers , server call handler < req t , resp t > next ) { return next start call ( new simple forwarding server call < req t , resp t > ( call ) { @ override public void send headers ( metadata response headers ) { response headers merge ( request headers , key set ) ; super send headers ( response headers ) ; } @ override public void close ( status status , metadata trailers ) { super close ( status , trailers ) ; } } , request headers ) ; } } ; }


returns an instance which is the result of merging the two given instances , where one instance should have only type descriptors and the other only type signatures the merged result is identical to the one with descriptors , except that any element whose { name , index , start , length } matches an element in the signature list gets augmented with the corresponding signature the result is immutable

public static local variable list merge descriptors and signatures ( local variable list descriptor list , local variable list signature list ) { int descriptor size = descriptor list size ( ) ; local variable list result = new local variable list ( descriptor size ) ; for ( int i = 0 ; i < descriptor size ; i + + ) { item item = descriptor list get ( i ) ; item signature item = signature list item to local ( item ) ; if ( signature item ! = null ) { cst string signature = signature item get signature ( ) ; item = item with signature ( signature ) ; } result set ( i , item ) ; } result set immutable ( ) ; return result ; }


sets the pop - up menu path for the action setting this attribute is what causes the action to appear on the tool ' s pop - up menu ( assuming it is applicable for the context )

public b popup menu path ( string path element ) { popup path = path element ; return self ( ) ; }


specify subscriber ' s ip and look up whether data is lastest group key - > is uptodate

public static map < string , boolean > is client uptodate ( string ip ) { map < string , boolean > result = new hash map < string , boolean > ( 100 ) ; for ( map entry < string , string > entry : get client record ( ip ) get group key 2md 5 map ( ) entry set ( ) ) { string group key = entry get key ( ) ; string client md 5 = entry get value ( ) ; boolean isuptodate = config cache service is uptodate ( group key , client md 5 ) ; result put ( group key , isuptodate ) ; } return result ; }


extracts all the sequences of events from the start to the given computation state an event sequence is returned as a map which contains the events and the names of the states to which the events were mapped

private map < string , list < event id > > extract current matches ( final shared buffer accessor < t > shared buffer accessor , final computation state computation state ) throws exception { if ( computation state get previous buffer entry ( ) = = null ) { return new hash map < > ( ) ; } list < map < string , list < event id > > > paths = shared buffer accessor extract patterns ( computation state get previous buffer entry ( ) , computation state get version ( ) ) ; if ( paths is empty ( ) ) { return new hash map < > ( ) ; } / / for a given computation state , we cannot have more than one matching patterns preconditions check state ( paths size ( ) = = 1 ) ; return paths get ( 0 ) ; }


public mutable counter long new counter ( string name , string desc , long i val ) { return new counter ( interns info ( name , desc ) , i val ) ; }


workaround to clear all legacy data , like the artifact factory we need to clear them to avoid conflicts todo ( bazel - team ) : remove this workaround [ skyframe - execution ]

void clear legacy data ( ) { artifact factory clear ( ) ; }


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


returns all parents of the vertices in the given set

public set < vertex > get parents ( set < vertex > vs ) { set < vertex > parents = new hash set < vertex > ( ) ; edge e ; vertex v ; iterator < vertex > i = vs iterator ( ) ; while ( i has next ( ) ) { v = i next ( ) ; e = vertices get first incoming edge ( v ) ; while ( e ! = null ) { parents add ( e from ( ) ) ; e = edges get next edge with same to ( e ) ; } } return parents ; }


public void start element ( string name ) { start element ( name , null , null ) ; }


public void close animate ( int position ) { touch listener close animate ( position ) ; }


protected map < string , object > decrypt properties ( final map properties ) { return configuration cipher executor decode ( properties , array utils empty object array ) ; }


try to call { @ link reference counted # release ( ) } if the specified message implements { @ link reference counted } if the specified message doesn ' t implement { @ link reference counted } , this method does nothing

public static boolean release ( object msg ) { if ( msg instanceof reference counted ) { return ( ( reference counted ) msg ) release ( ) ; } return false ; }


public bit set compatible regs ( dalv insn insn ) { register spec list regs = insn get registers ( ) ; bit set bits = new bit set ( 2 ) ; int r 0 = regs get ( 0 ) get reg ( ) ; int r 1 = regs get ( 1 ) get reg ( ) ; switch ( regs size ( ) ) { case 2 : { bits set ( 0 , unsigned fits in nibble ( r 0 ) ) ; bits set ( 1 , unsigned fits in nibble ( r 1 ) ) ; break ; } case 3 : { if ( r 0 ! = r 1 ) { bits set ( 0 , false ) ; bits set ( 1 , false ) ; } else { boolean dst reg comp = unsigned fits in nibble ( r 1 ) ; bits set ( 0 , dst reg comp ) ; bits set ( 1 , dst reg comp ) ; } bits set ( 2 , unsigned fits in nibble ( regs get ( 2 ) get reg ( ) ) ) ; break ; } default : { throw new assertion error ( ) ; } } return bits ; }


verify permission for a mount point when the actual destination present it returns the permissions of the actual destination pointed by the mount point

public void test mount table permissions with dest ( ) throws i o exception { try { mount table add entry = mount table new instance ( " / testdir " , collections singleton map ( " ns 0 " , " / tmp / testdir " ) ) ; assert true ( add mount table ( add entry ) ) ; nn fs 0 mkdirs ( new path ( " / tmp / testdir " ) ) ; nn fs 0 set owner ( new path ( " / tmp / testdir " ) , " aowner " , " agroup " ) ; nn fs 0 set permission ( new path ( " / tmp / testdir " ) , fs permission create immutable ( ( short ) 775 ) ) ; file status [ ] list = router fs list status ( new path ( " / " ) ) ; assert equals ( " agroup " , list [ 0 ] get group ( ) ) ; assert equals ( " aowner " , list [ 0 ] get owner ( ) ) ; assert equals ( ( short ) 775 , list [ 0 ] get permission ( ) to short ( ) ) ; } finally { nn fs 0 delete ( new path ( " / tmp " ) , true ) ; } }


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


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


sets the name of the target generator the generator ' s name is used to uniquely identify the generator as a mechanism to lookup the desired implementation at runtime

public codegen configurator set generator name ( final string generator name ) { this generator name = generator name ; generator settings builder with generator name ( generator name ) ; return this ; }


public void set n character stream ( int parameter index , reader value , long length ) throws s q l exception { }


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

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


sets the settings to be updated ( either json or yaml format )

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


returns a { @ link input stream } for a file that might be compressed

static input stream get possibly decompressed input stream ( path file , configuration conf , long offset ) throws i o exception { file system fs = file get file system ( conf ) ; if ( is compression emulation enabled ( conf ) & & is input compression emulation enabled ( conf ) ) { compression codec factory compression codecs = new compression codec factory ( conf ) ; compression codec codec = compression codecs get codec ( file ) ; if ( codec ! = null ) { decompressor decompressor = codec pool get decompressor ( codec ) ; if ( decompressor ! = null ) { compression input stream in = codec create input stream ( fs open ( file ) , decompressor ) ; / / todo seek doesnt work with compressed input stream / / use splittable compression codec ? return ( input stream ) in ; } } } f s data input stream in = fs open ( file ) ; in seek ( offset ) ; return ( input stream ) in ; }


public void test inline additional properties ( map < string , string > param , handler < async result < void > > result handler ) { test inline additional properties ( param , null , result handler ) ; }


during import , the default behavior is to skip the import if a conflict occurs within the destination folder this method can be used to force the original conflicting file to be removed prior to import if the pre - existing file is versioned , the commit option must also be enabled to have the overwrite remove the versioned file

public void enable overwrite on conflict ( boolean enabled ) { this overwrite = enabled ; }


block waiting on the metadata refresh with a timeout

public boolean await metadata update ( timer timer ) { int version = this metadata request update ( ) ; do { poll ( timer ) ; } while ( this metadata update version ( ) = = version & & timer not expired ( ) ) ; return this metadata update version ( ) > version ; }


checks if the server should shut down due to a low memory condition

final boolean should shutdown ( ) { check state ( last idle time nanos > 0 , " reset ( ) ought to have been called before this " ) ; if ( blaze clock nano time ( ) - last idle time nanos < time idle before memory check to nanos ( ) ) { / / only run memory check if the server has been idle for longer than / / time idle before memory check return false ; } return check ( ) ; }


get the active topics of a connector running in this cluster

public active topics info connector topics ( string connector name ) { object mapper mapper = new object mapper ( ) ; string url = endpoint for resource ( string format ( " connectors / % s / topics " , connector name ) ) ; response response = request get ( url ) ; try { if ( response get status ( ) < response status bad request get status code ( ) ) { map < string , map < string , list < string > > > active topics = mapper reader for ( new type reference < map < string , map < string , list < string > > > > ( ) { } ) read value ( response to string ( response ) ) ; return new active topics info ( connector name , active topics get ( connector name ) get or default ( " topics " , collections empty list ( ) ) ) ; } } catch ( i o exception e ) { log error ( " could not read connector state from response : { } " , response to string ( response ) , e ) ; throw new connect exception ( " could not not parse connector state " , e ) ; } throw new connect rest exception ( response get status ( ) , " could not read connector state error response : " + response to string ( response ) ) ; }


public string get diagnostic ( ) { return diagnostic ; }


this is a shortcut way to get all the table models for each model class defined in the mapping list no need to iterate all the model classes and get table model for each one

protected collection < table model > get all table models ( ) { if ( m table models = = null ) { m table models = new array list < > ( ) ; } if ( ! can use cache ( ) ) { m table models clear ( ) ; for ( string class name : lite pal attr get instance ( ) get class names ( ) ) { m table models add ( get table model ( class name ) ) ; } } return m table models ; }


applies { @ link json path expectations helper # exists ( string ) }

public web test client body content spec exists ( ) { this path helper exists ( this content ) ; return this body spec ; }


returns whether the given class or its subclasses shadow any fields in the given target class

private boolean shadows any fields ( clazz clazz , clazz target class ) { member counter counter = new member counter ( ) ; / / visit all fields , counting the ones that are shadowing non - private / / fields in the class hierarchy of the target class clazz hierarchy accept ( true , false , false , true , new all field visitor ( new similar member visitor ( target class , true , true , true , false , new member access filter ( 0 , class constants acc private , counter ) ) ) ) ; return counter get count ( ) > 0 ; }


override the default { @ link time zone } to use for formatting default value used is utc ( not local timezone )

public jackson 2 object mapper builder time zone ( time zone time zone ) { this time zone = time zone ; return this ; }


this test makes sure no profile results are returned when profiling is disabled

public void test no profile ( ) throws exception { create index ( " test " ) ; ensure green ( ) ; int num docs = random int between ( 100 , 150 ) ; index request builder [ ] docs = new index request builder [ num docs ] ; for ( int i = 0 ; i < num docs ; i + + ) { docs [ i ] = client ( ) prepare index ( " test " ) set id ( string value of ( i ) ) set source ( " field 1 " , english int to english ( i ) , " field 2 " , i ) ; } index random ( true , docs ) ; refresh ( ) ; query builder q = query builders range query ( " field 2 " ) from ( 0 ) to ( 5 ) ; logger info ( " query : { } " , q ) ; search response resp = client ( ) prepare search ( ) set query ( q ) set profile ( false ) get ( ) ; assert that ( " profile response element should be an empty map " , resp get profile results ( ) size ( ) , equal to ( 0 ) ) ; }


compares the { @ link authentication } that was stored in the { @ link reader context } with the current authentication we cannot guarantee that all of the details of the authentication will be the same some things that could differ include the roles , the name of the authenticating ( or lookup ) realm to work around this we compare the username and the originating realm type

static void ensure authenticated user is same ( authentication original , authentication current , audit trail service audit trail service , shard search context id id , string action , transport request request , string request id , authorization info authorization info ) { / / this is really a best effort attempt since we cannot guarantee principal uniqueness / / and realm names can change between nodes final boolean same principal = original get user ( ) principal ( ) equals ( current get user ( ) principal ( ) ) ; final boolean same realm type ; if ( original get user ( ) is run as ( ) ) { if ( current get user ( ) is run as ( ) ) { same realm type = original get looked up by ( ) get type ( ) equals ( current get looked up by ( ) get type ( ) ) ; } else { same realm type = original get looked up by ( ) get type ( ) equals ( current get authenticated by ( ) get type ( ) ) ; } } else if ( current get user ( ) is run as ( ) ) { same realm type = original get authenticated by ( ) get type ( ) equals ( current get looked up by ( ) get type ( ) ) ; } else { same realm type = original get authenticated by ( ) get type ( ) equals ( current get authenticated by ( ) get type ( ) ) ; } final boolean same user = same principal & & same realm type ; if ( same user = = false ) { audit trail service get ( ) access denied ( request id , current , action , request , authorization info ) ; throw new search context missing exception ( id ) ; } }


get the attempt id that took this task to completion

public task attempt i d get successful task attempt ( ) { return task attempt i d downgrade ( super get successful task attempt id ( ) ) ; }


creates a new key unless present that is newer than the current active key and returns the corresponding metadata note : this method doesn ' t modify the metadata used in this token service see { @ link # refresh metadata ( token metadata ) }

synchronized token metadata generate spare key ( ) { key and cache max key = key cache cache values ( ) stream ( ) max ( comparator comparing long ( v - > v key and timestamp get timestamp ( ) ) ) get ( ) ; key and cache current key = key cache active key cache ; if ( current key = = max key ) { long timestamp = created time stamps increment and get ( ) ; while ( true ) { byte [ ] salt arr = new byte [ salt bytes ] ; secure random next bytes ( salt arr ) ; secure string token key = generate token key ( ) ; key and cache key and cache = new key and cache ( new key and timestamp ( token key , timestamp ) , new bytes key ( salt arr ) ) ; if ( key cache cache contains key ( key and cache get key hash ( ) ) ) { continue ; / / collision - - generate a new key } return new token metadata ( key cache current token key hash , iterables concat ( key cache cache values ( ) , collections singleton list ( key and cache ) ) ) ; } } return new token metadata ( key cache current token key hash , key cache cache values ( ) ) ; }


wraps an { @ link executor } into a new scheduler instance and delegates { @ code schedule ( ) } calls to it the tasks scheduled by the returned { @ link scheduler } and its { @ link io reactivex rxjava 3 core scheduler worker scheduler worker } can be optionally interrupted if the provided executor doesn ' t support any of the more specific standard java executor a p is , tasks scheduled with a time delay or periodically will use the { @ link # single ( ) } scheduler for the timed waiting before posting the actual task to the given executor if the provided executor supports the standard java { @ link executor service } api , canceling tasks scheduled by this scheduler can be cancelledinterrupted by calling { @ link io reactivex rxjava 3 disposables disposable # dispose ( ) } in addition , tasks scheduled with a time delay or periodically will use the { @ link # single ( ) } scheduler for the timed waiting before posting the actual task to the given executor if the provided executor supports the standard java { @ link scheduled executor service } api , canceling tasks scheduled by this scheduler can be cancelledinterrupted by calling { @ link io reactivex rxjava 3 disposables disposable # dispose ( ) } in addition , tasks scheduled with a time delay or periodically will use the provided executor note , however , if the provided { @ code scheduled executor service } instance is not single threaded , tasks scheduled with a time delay close to each other may end up executing in different order than the original schedule ( ) call was issued this limitation may be lifted in a future patch the implementation of the worker of this wrapper scheduler can operate in both eager ( non - fair ) and fair modes depending on the specified parameter in eager mode , it will execute as many non - delayed tasks as it can , which may result in a longer than expected occupation of a thread of the given backing executor in other terms , it does not allow per - runnable fairness in case the worker runs on a shared underlying thread of the executor in fair mode , non - delayed tasks will still be executed in a fifo and non - overlapping manner , but after each task , the execution for the next task is rescheduled with the same underlying executor , allowing interleaving from both the same scheduler or other external usages of the underlying executor starting , stopping and restarting this scheduler is not supported ( no - op ) and the provided executor ' s lifecycle must be managed externally : < code > executor service exec = executors new single threaded executor ( ) ; try { scheduler scheduler = schedulers from ( exec , true , true ) ; flowable just ( 1 ) subscribe on ( scheduler ) map ( v - & gt ; v + 1 ) observe on ( scheduler ) blocking subscribe ( system out : : println ) ; } finally { exec shutdown ( ) ; } < code > this type of scheduler is less sensitive to leaking { @ link io reactivex rxjava 3 core scheduler worker scheduler worker } instances , although not disposing a worker that has timeddelayed tasks not cancelled by other means may leak resources andor execute those tasks " unexpectedly " note that this method returns a new { @ link scheduler } instance , even for the same { @ link executor } instance

public static scheduler from ( @ non null executor executor , boolean interruptible worker , boolean fair ) { return new executor scheduler ( executor , interruptible worker , fair ) ; }


public double get double ( ) { return double ; }


attempts to seek the read position to the keyframe before or at the specified time

public final synchronized boolean seek to ( long time us , boolean allow time beyond buffer ) { rewind ( ) ; int relative read index = get relative index ( read position ) ; if ( ! has next sample ( ) | | time us < times us [ relative read index ] | | ( time us > largest queued timestamp us & & ! allow time beyond buffer ) ) { return false ; } int offset = find sample before ( relative read index , length - read position , time us , / * keyframe = * / true ) ; if ( offset = = - 1 ) { return false ; } start time us = time us ; read position + = offset ; return true ; }


creates a { @ code cycle detecting lock factory with explicit ordering < e > }

public static < e extends enum < e > > with explicit ordering < e > new instance with explicit ordering ( class < e > enum class , policy policy ) { / / create nodes maps each enum class to a map with the corresponding enum key / / type check not null ( enum class ) ; check not null ( policy ) ; @ suppress warnings ( " unchecked " ) map < e , lock graph node > lock graph nodes = ( map < e , lock graph node > ) get or create nodes ( enum class ) ; return new with explicit ordering < e > ( policy , lock graph nodes ) ; }


load extensions of the type from all extending plugins the concrete extensions must have either a no - arg constructor or a single - arg constructor accepting the specific plugin class

< t > list < t > load extensions ( class < t > extension point type ) ;


returns a markdown header string that should appear at the top of stardoc ' s output , providing a summary for the input starlark module

public string render markdown header ( module info module info ) throws i o exception { velocity context context = new velocity context ( ) ; context put ( " util " , new markdown util ( ) ) ; context put ( " module docstring " , module info get module docstring ( ) ) ; string writer string writer = new string writer ( ) ; reader reader = reader from path ( header template filename ) ; try { velocity engine evaluate ( context , string writer , header template filename , reader ) ; } catch ( resource not found exception | parse error exception | method invocation exception e ) { throw new i o exception ( e ) ; } return string writer to string ( ) ; }


creates and returns the manifest to use for the output this may modify { @ link # output resources } ( removing the pre - existing manifest )

private manifest make manifest ( ) throws i o exception { byte [ ] manifest bytes = output resources get ( manifest name ) ; manifest manifest ; attributes attribs ; if ( manifest bytes = = null ) { / / we need to construct an entirely new manifest manifest = new manifest ( ) ; attribs = manifest get main attributes ( ) ; attribs put ( attributes name manifest version , " 1 0 " ) ; } else { manifest = new manifest ( new byte array input stream ( manifest bytes ) ) ; attribs = manifest get main attributes ( ) ; output resources remove ( manifest name ) ; } string created by = attribs get value ( created by ) ; if ( created by = = null ) { created by = " " ; } else { created by + = " + " ; } created by + = " dx " + version version ; attribs put ( created by , created by ) ; attribs put value ( " dex - location " , dex format dex in jar name ) ; return manifest ; }


takes the serialized accumulator results and tries to deserialize them using the provided class loader

public static map < string , optional failure < object > > deserialize accumulators ( map < string , serialized value < optional failure < object > > > serialized accumulators , class loader loader ) throws i o exception , class not found exception { if ( serialized accumulators = = null | | serialized accumulators is empty ( ) ) { return collections empty map ( ) ; } map < string , optional failure < object > > accumulators = new hash map < > ( serialized accumulators size ( ) ) ; for ( map entry < string , serialized value < optional failure < object > > > entry : serialized accumulators entry set ( ) ) { optional failure < object > value = null ; if ( entry get value ( ) ! = null ) { value = entry get value ( ) deserialize value ( loader ) ; } accumulators put ( entry get key ( ) , value ) ; } return accumulators ; }


this method is deprecated use get entries ( ) instead

public list < t > get values ( ) { return m entries ; }


protected void mark wait ( final long time ) throws exception { final long time start = system current time millis ( ) ; while ( true ) { thread sleep ( mark step ( ) ) ; measure ( ) mark ( ) ; final long time finish = system current time millis ( ) ; if ( time finish - time start > = time ) { system out print ( " + \ n " ) ; return ; } else { system out print ( " - " ) ; } } }


test case for https : issues apache orgjirabrowse z o o k e e p e r - 3721

public void test parse boolean ( ) throws i o exception , config exception { quorum peer config quorum peer config = new quorum peer config ( ) ; properties zk prop = get default z k properties ( ) ; zk prop set property ( " local sessions enabled " , " true " ) ; quorum peer config parse properties ( zk prop ) ; assert equals ( true , quorum peer config are local sessions enabled ( ) ) ; zk prop set property ( " local sessions enabled " , " false " ) ; quorum peer config parse properties ( zk prop ) ; assert equals ( false , quorum peer config are local sessions enabled ( ) ) ; zk prop set property ( " local sessions enabled " , " true " ) ; quorum peer config parse properties ( zk prop ) ; assert equals ( true , quorum peer config are local sessions enabled ( ) ) ; zk prop set property ( " local sessions enabled " , " false " ) ; quorum peer config parse properties ( zk prop ) ; assert equals ( false , quorum peer config are local sessions enabled ( ) ) ; zk prop set property ( " local sessions enabled " , " yes " ) ; try { quorum peer config parse properties ( zk prop ) ; fail ( " must throw exception as ' yes ' is not accpetable for parse boolean ! " ) ; } catch ( config exception e ) { / / expected } }


supply the binding information this implementation returns a fixed ensemble bonded to the quorum supplied by { @ link # build connection string ( ) }

public binding information supply binding information ( ) { binding information binding = new binding information ( ) ; string connect string = build connection string ( ) ; binding ensemble provider = new fixed ensemble provider ( connect string ) ; binding description = " fixed zk quorum \ " " + connect string + " \ " " ; return binding ; }


get the angle in degrees of the rotation this quaternion represents use { @ link # get axis angle ( vector 3 ) } to get both the axis and the angle of this rotation use { @ link # get angle around ( vector 3 ) } to get the angle around a specific axis

public float get angle ( ) { return get angle rad ( ) * math utils radians to degrees ; }


override the thread context class loader with the environment ' s bean class loader if necessary , i e if the bean class loader is not equivalent to the thread context class loader already

public static class loader override thread context class loader ( @ nullable class loader class loader to use ) { thread current thread = thread current thread ( ) ; class loader thread context class loader = current thread get context class loader ( ) ; if ( class loader to use ! = null & & ! class loader to use equals ( thread context class loader ) ) { current thread set context class loader ( class loader to use ) ; return thread context class loader ; } else { return null ; } }


public void just symbol test ( ) { / / todo : test just symbol }


allocate a direct { @ link composite byte buf } with the given maximum number of components that can be stored in it

composite byte buf composite direct buffer ( int max num components ) ;


public long get pid ( ) { return pid ; }


returns true if this updater is performing any animations or running any jobs that can mutate the graph or view

public boolean is busy ( ) { if ( edge hover animator ! = null ) { if ( ! edge hover animator has finished ( ) ) { return true ; } } if ( vertex twinkle animator ! = null ) { if ( ! vertex twinkle animator has finished ( ) ) { return true ; } } boolean busy = job runner is busy ( ) ; return busy ; }


public static void remove acl feature ( acl feature acl feature ) { unique acl features remove ( acl feature ) ; }


converts { @ link string } to given type

public static < t > t from json ( final string json , @ non null final class < t > type ) { return from json ( get gson ( ) , json , type ) ; }


this test is the same as { @ link # test create structure ( ) } with the exception that this test passes an already created structure to the command object

public void test create structure from structure ( ) { long start offset = undefined area ; long offset = start offset ; data type float ptr = program get data type manager ( ) get pointer ( new float data type ( ) ) ; data type string ptr = program get data type manager ( ) get pointer ( new string data type ( ) ) ; int default ptr len = program get address factory ( ) get default address space ( ) get pointer size ( ) ; offset = create data ( offset , new byte data type ( ) ) ; offset = create data ( offset , float ptr ) ; offset = create data ( offset , 10 , new string data type ( ) ) ; offset = create array ( offset , 8 , 4 , string ptr ) ; int struct len = ( int ) ( offset - start offset ) ; address address = addr ( start offset ) ; structure structure = structure factory create structure data type ( program , address , struct len , " test struct a " , true ) ; create structure cmd cmd = new create structure cmd ( structure , address ) ; cmd apply to ( program ) ; data d = program get listing ( ) get data at ( address ) ; assert not null ( d ) ; assert true ( d is defined ( ) ) ; assert true ( d get data type ( ) instanceof structure ) ; assert equals ( struct len , d get length ( ) ) ; structure struct = ( structure ) d get data type ( ) ; assert equals ( struct len , struct get length ( ) ) ; assert equals ( 4 , struct get num components ( ) ) ; data type component comp = struct get component ( 0 ) ; assert equals ( 1 , comp get length ( ) ) ; assert true ( comp get data type ( ) instanceof byte data type ) ; comp = struct get component ( 1 ) ; assert equals ( default ptr len , comp get length ( ) ) ; assert true ( float ptr is equivalent ( comp get data type ( ) ) ) ; comp = struct get component ( 2 ) ; assert equals ( 10 , comp get length ( ) ) ; assert true ( comp get data type ( ) instanceof string data type ) ; comp = struct get component ( 3 ) ; assert equals ( 8 * default ptr len , comp get length ( ) ) ; assert true ( comp get data type ( ) instanceof array ) ; array a = ( array ) comp get data type ( ) ; assert equals ( default ptr len , a get element length ( ) ) ; assert equals ( 8 , a get num elements ( ) ) ; assert true ( a get data type ( ) is equivalent ( string ptr ) ) ; data type struct a = program get data type manager ( ) get data type ( category path root , " test struct a " ) ; assert equals ( struct , struct a ) ; }


public void to string test ( ) { branch register request branch register request = new branch register request ( ) ; branch register request set xid ( " 127 0 0 1 : 8091 : 1249853 " ) ; branch register request set branch type ( branch type at ) ; branch register request set resource id ( " resource 1 " ) ; branch register request set lock key ( " lock key 1 " ) ; assertions assert equals ( " xid = 127 0 0 1 : 8091 : 1249853 , branch type = at , resource id = resource 1 , lock key = lock key 1 " , branch register request to string ( ) ) ; }


evaluates the schema on a project , returning a list of item updates generated by the schema some warnings will be emitted in the warning store : those are only the ones that are generated at evaluation time ( such as invalid formats for dates ) issues detected on candidate statements ( such as constraint violations ) are not included at this stage

public list < item update > evaluate ( project project , engine engine , q a warning store warning store ) { list < item update > result = new array list < > ( ) ; filtered rows filtered rows = engine get all filtered rows ( ) ; filtered rows accept ( project , new evaluating row visitor ( result , warning store ) ) ; return result ; }


illustrates the somewhat bizarre behavior when a null is passed in

public void test concat containing null ( ) { @ suppress warnings ( " unchecked " ) iterator < iterator < integer > > input = as list ( iterate over ( 1 , 2 ) , null , iterate over ( 3 ) ) iterator ( ) ; iterator < integer > result = iterators concat ( input ) ; assert equals ( 1 , ( int ) result next ( ) ) ; assert equals ( 2 , ( int ) result next ( ) ) ; try { result has next ( ) ; fail ( " no exception thrown " ) ; } catch ( null pointer exception e ) { } try { result next ( ) ; fail ( " no exception thrown " ) ; } catch ( null pointer exception e ) { } / / there is no way to get " through " to the 3 buh - bye }


checks whether a string matches a given wildcard pattern

public static boolean match ( char sequence string , char sequence pattern ) { return match ( string , pattern , 0 , 0 ) ; }


public boolean replace ( k key , v old value , v new value ) { return false ; }


sets the field delimiter , " , " by default

public old csv field delimiter ( string delim ) { this field delim = optional of ( delim ) ; return this ; }


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

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


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 translog durability for this index

public translog durability get translog durability ( ) { return durability ; }


removes all nodes from this graph except those whose label is an element of { @ code keep labels } edges are added so as to preserve the transitive closure relation

private void subgraph ( final set < t > keep labels ) { / / this algorithm does the following : / / let keep = nodes that have labels in keep labels / / let to remove = nodes \ keep reachables = successors and predecessors of keep in nodes / / reachables is the subset of nodes of remove that are an immediate neighbor of some node in / / keep / / / / removes all nodes of reachables from keep labels / / until reachables is empty : / / takes n from reachables / / for all s in succ ( n ) / / for all p in pred ( n ) / / add the edge ( p , s ) / / add s to reachables / / for all p in pred ( n ) / / add p to reachables / / remove n and its edges / / / / a few adjustments are needed to do the whole computation final set < node < t > > to remove = new hash set < > ( ) ; final set < node < t > > keep neighbors = new hash set < > ( ) ; / / look for all nodes if they are to be kept or removed for ( node < t > node : nodes values ( ) ) { if ( keep labels contains ( node get label ( ) ) ) { / / node is to be kept keep neighbors add all ( node get predecessors ( ) ) ; keep neighbors add all ( node get successors ( ) ) ; } else { / / node is to be removed to remove add ( node ) ; } } if ( to remove is empty ( ) ) { / / this premature return is needed to avoid 0 - size priority queue creation return ; } / / we use a priority queue to look for low - order nodes first so we don ' t propagate the high / / number of paths of high - order nodes making the time consumption explode / / for perfect results we should reorder the set each time we add a new edge but this would / / be too expensive , so this is a good enough approximation final priority queue < node < t > > reachables = new priority queue < > ( to remove size ( ) , comparing long ( arg - > ( long ) arg num predecessors ( ) * ( long ) arg num successors ( ) ) ) ; / / construct the reachables queue with the list of successors and predecessors of keep in / / to remove keep neighbors retain all ( to remove ) ; reachables add all ( keep neighbors ) ; to remove remove all ( reachables ) ; / / remove nodes , least connected first , preserving reachability while ( ! reachables is empty ( ) ) { node < t > node = reachables poll ( ) ; collection < node < t > > neighbours = remove node ( node , / * preserve order * / true ) ; for ( node < t > neighbour : neighbours ) { if ( to remove remove ( neighbour ) ) { reachables add ( neighbour ) ; } } } / / final cleanup for non - reachable nodes for ( node < t > node : to remove ) { remove node ( node , false ) ; } }


this handles both load and store for dot accesses as necessary this uses build load store to stub out the appropriate load and store ir nodes

public void visit dot ( e dot user dot node , script scope script scope ) { expression node ir expression node ; if ( script scope has decoration ( user dot node , static type class ) ) { class < ? > static type = script scope get decoration ( user dot node , static type class ) get static type ( ) ; static node static node = new static node ( user dot node get location ( ) ) ; static node attach decoration ( new i r d expression type ( static type ) ) ; ir expression node = static node ; } else { boolean read = script scope get condition ( user dot node , read class ) ; boolean write = script scope get condition ( user dot node , write class ) ; boolean compound = script scope get condition ( user dot node , compound class ) ; location location = user dot node get location ( ) ; string index = user dot node get index ( ) ; class < ? > value type = script scope get decoration ( user dot node , value type class ) get value type ( ) ; value type prefix value type = script scope get decoration ( user dot node get prefix node ( ) , value type class ) ; expression node ir prefix node = ( expression node ) visit ( user dot node get prefix node ( ) , script scope ) ; expression node ir index node = null ; unary node ir store node = null ; expression node ir load node = null ; int access depth ; if ( prefix value type ! = null & & prefix value type get value type ( ) is array ( ) ) { load dot array length node ir load dot array length node = new load dot array length node ( location ) ; ir load dot array length node attach decoration ( new i r d expression type ( int class ) ) ; ir load node = ir load dot array length node ; access depth = 1 ; } else if ( prefix value type ! = null & & prefix value type get value type ( ) = = def class ) { if ( write | | compound ) { store dot def node ir store dot def node = new store dot def node ( location ) ; ir store dot def node attach decoration ( new i r d expression type ( read ? value type : void class ) ) ; ir store dot def node attach decoration ( new i r d store type ( value type ) ) ; ir store dot def node attach decoration ( new i r d value ( index ) ) ; ir store node = ir store dot def node ; } if ( write = = false | | compound ) { load dot def node ir load dot def node = new load dot def node ( location ) ; ir load dot def node attach decoration ( new i r d expression type ( value type ) ) ; ir load dot def node attach decoration ( new i r d value ( user dot node get index ( ) ) ) ; ir load node = ir load dot def node ; } access depth = 1 ; } else if ( script scope has decoration ( user dot node , standard painless field class ) ) { painless field painless field = script scope get decoration ( user dot node , standard painless field class ) get standard painless field ( ) ; if ( write | | compound ) { store dot node ir store dot node = new store dot node ( location ) ; ir store dot node attach decoration ( new i r d expression type ( read ? value type : void class ) ) ; ir store dot node attach decoration ( new i r d store type ( value type ) ) ; ir store dot node attach decoration ( new i r d field ( painless field ) ) ; ir store node = ir store dot node ; } if ( write = = false | | compound ) { load dot node ir load dot node = new load dot node ( location ) ; ir load dot node attach decoration ( new i r d expression type ( value type ) ) ; ir load dot node attach decoration ( new i r d field ( painless field ) ) ; ir load node = ir load dot node ; } access depth = 1 ; } else if ( script scope get condition ( user dot node , shortcut class ) ) { if ( write | | compound ) { store dot shortcut node ir store dot shortcut node = new store dot shortcut node ( location ) ; ir store dot shortcut node attach decoration ( new i r d expression type ( read ? value type : void class ) ) ; ir store dot shortcut node attach decoration ( new i r d store type ( value type ) ) ; ir store dot shortcut node attach decoration ( new i r d method ( script scope get decoration ( user dot node , setter painless method class ) get setter painless method ( ) ) ) ; ir store node = ir store dot shortcut node ; } if ( write = = false | | compound ) { load dot shortcut node ir load dot shortcut node = new load dot shortcut node ( location ) ; ir load dot shortcut node attach decoration ( new i r d expression type ( value type ) ) ; ir load dot shortcut node attach decoration ( new i r d method ( script scope get decoration ( user dot node , getter painless method class ) get getter painless method ( ) ) ) ; ir load node = ir load dot shortcut node ; } access depth = 1 ; } else if ( script scope get condition ( user dot node , map shortcut class ) ) { constant node ir constant node = new constant node ( location ) ; ir constant node attach decoration ( new i r d expression type ( string class ) ) ; ir constant node attach decoration ( new i r d constant ( index ) ) ; ir index node = ir constant node ; if ( write | | compound ) { store map shortcut node ir store map shortcut node = new store map shortcut node ( location ) ; ir store map shortcut node attach decoration ( new i r d expression type ( read ? value type : void class ) ) ; ir store map shortcut node attach decoration ( new i r d store type ( value type ) ) ; ir store map shortcut node attach decoration ( new i r d method ( script scope get decoration ( user dot node , setter painless method class ) get setter painless method ( ) ) ) ; ir store node = ir store map shortcut node ; } if ( write = = false | | compound ) { load map shortcut node ir load map shortcut node = new load map shortcut node ( location ) ; ir load map shortcut node attach decoration ( new i r d expression type ( value type ) ) ; ir load map shortcut node attach decoration ( new i r d method ( script scope get decoration ( user dot node , getter painless method class ) get getter painless method ( ) ) ) ; ir load node = ir load map shortcut node ; } access depth = 2 ; } else if ( script scope get condition ( user dot node , list shortcut class ) ) { constant node ir constant node = new constant node ( location ) ; ir constant node attach decoration ( new i r d expression type ( int class ) ) ; ir constant node attach decoration ( new i r d constant ( script scope get decoration ( user dot node , standard constant class ) get standard constant ( ) ) ) ; ir index node = ir constant node ; if ( write | | compound ) { store list shortcut node ir store list shortcut node = new store list shortcut node ( location ) ; ir store list shortcut node attach decoration ( new i r d expression type ( read ? value type : void class ) ) ; ir store list shortcut node attach decoration ( new i r d store type ( value type ) ) ; ir store list shortcut node attach decoration ( new i r d method ( script scope get decoration ( user dot node , setter painless method class ) get setter painless method ( ) ) ) ; ir store node = ir store list shortcut node ; } if ( write = = false | | compound ) { load list shortcut node ir load list shortcut node = new load list shortcut node ( location ) ; ir load list shortcut node attach decoration ( new i r d expression type ( value type ) ) ; ir load list shortcut node attach decoration ( new i r d method ( script scope get decoration ( user dot node , getter painless method class ) get getter painless method ( ) ) ) ; ir load node = ir load list shortcut node ; } access depth = 2 ; } else { throw user dot node create error ( new illegal state exception ( " illegal tree structure " ) ) ; } script scope put decoration ( user dot node , new access depth ( access depth ) ) ; ir expression node = build load store ( access depth , location , user dot node is null safe ( ) , ir prefix node , ir index node , ir load node , ir store node ) ; } script scope put decoration ( user dot node , new i r node decoration ( ir expression node ) ) ; }


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


check if dfs remains in proper condition after a restart

void test restart dfs ( boolean use flush ) throws exception { final configuration conf = new hdfs configuration ( ) ; / / turn off persistent ipc , so that the d f s client can survive nn restart conf set int ( common configuration keys public ipc client connection maxidletime key , 0 ) ; mini d f s cluster cluster = null ; long len = 0 ; f s data output stream stream ; try { cluster = new mini d f s cluster builder ( conf ) num data nodes ( 3 ) build ( ) ; file system fs = cluster get file system ( ) ; / / creating a file with 4096 block size to write multiple blocks stream = fs create ( file path , true , block size , ( short ) 1 , block size ) ; stream write ( data before restart ) ; if ( use flush ) stream flush ( ) ; else stream hflush ( ) ; / / wait for at least a few blocks to get through while ( len < = block size ) { file status status = fs get file status ( file path ) ; len = status get len ( ) ; thread sleep ( 100 ) ; } / / explicitly do not close the file cluster restart name node ( ) ; / / check that the file has no less bytes than before the restart / / this would mean that blocks were successfully persisted to the log file status status = fs get file status ( file path ) ; assert true ( " length too short : " + status get len ( ) , status get len ( ) > = len ) ; / / and keep writing ( ensures that leases are also persisted correctly ) stream write ( data after restart ) ; stream close ( ) ; / / verify that the data showed up , both from before and after the restart f s data input stream read stream = fs open ( file path ) ; try { byte [ ] verify buf = new byte [ data before restart length ] ; i o utils read fully ( read stream , verify buf , 0 , verify buf length ) ; assert array equals ( data before restart , verify buf ) ; i o utils read fully ( read stream , verify buf , 0 , verify buf length ) ; assert array equals ( data after restart , verify buf ) ; } finally { i o utils close stream ( read stream ) ; } } finally { if ( cluster ! = null ) { cluster shutdown ( ) ; } } }


get the progress mechanism for reporting progress

public progressable get progressible ( ) { return progress ; }


declare that this filesystem connector is always read only { @ inherit doc }

public boolean has path capability ( final path path , final string capability ) throws i o exception { switch ( validate path capability args ( path , capability ) ) { case common path capabilities fs read only connector : return true ; default : return super has path capability ( path , capability ) ; } }


set < long > get offsets ( ) { return symbols by offset key set ( ) ; }


returns the omf segment descriptions in this omf module

public o m f seg desc [ ] get o m f seg descs ( ) { return seg desc arr ; }


appends a { @ link path fragment } to the fingerprint message

public fingerprint add path ( path fragment input ) { return add string ( input get path string ( ) ) ; }


set a default locale that this resolver will return if no other locale found

public void set default locale ( @ nullable locale default locale ) { this default locale = default locale ; }


create a { @ link grouped } instance with the provided name , key serde , and value serde if the key serde andor the value serde is { @ code null } the default value for the respective serde from config will be used

public static < k , v > grouped < k , v > with ( final string name , final serde < k > key serde , final serde < v > value serde ) { return new grouped < > ( name , key serde , value serde ) ; }


returns { @ code true } if and only if the { @ link timer task } associated with this handle has been expired


public object get anytype 3 ( ) { return anytype 3 ; }


set the login for the shared " system " connection used to send messages to the stomp broker from within the application , i e messages not associated with a specific client session ( e g resthttp request handling method ) by default this is set to " guest "

public stomp broker relay registration set system login ( string login ) { assert has text ( login , " system login must not be empty " ) ; this system login = login ; return this ; }


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


return true if there is no in - flight request directed at the given node and false otherwise

public boolean is empty ( string node ) { deque < network client in flight request > queue = requests get ( node ) ; return queue = = null | | queue is empty ( ) ; }


output the getter name for boolean property , e g get active

public string to boolean getter ( string name ) { return " get " + getter and setter capitalize ( name ) ; }


get the text up but not including one of the specified delimiter characters or the end of line , whichever comes first

public string next to ( string delimiters ) throws j s o n exception { char c ; string builder sb = new string builder ( ) ; for ( ; ; ) { c = next ( ) ; if ( delimiters index of ( c ) > = 0 | | c = = 0 | | c = = ' \ n ' | | c = = ' \ r ' ) { if ( c ! = 0 ) { back ( ) ; } return sb to string ( ) trim ( ) ; } sb append ( c ) ; } }


private void cancel all active futures ( ) { log debug ( " cancelling futures " ) ; for ( listenable future < part e tag > future : part e tags futures ) { future cancel ( true ) ; } }


get a { @ link task attempt info } with a { @ link task attempt i d } associated with task type , task number , and task attempt number this function considers locality , and follows the following decision logic : 1 make up a { @ link task attempt info } if the task attempt is missing in trace , 2 make up a { @ link task attempt info } if the task attempt has a killed final status in trace , 3 if final state is failed , construct a { @ link task attempt info } from the trace , without considering locality 4 if final state is succeeded , construct a { @ link task attempt info } from the trace , with runtime scaled according to locality in simulation and locality in trace

public task attempt info get map task attempt info adjusted ( int task number , int task attempt number , int locality ) { task type task type = task type map ; logged task logged task = get logged task ( task type , task number ) ; if ( logged task = = null ) { / / todo insert parameters task info task info = new task info ( 0 , 0 , 0 , 0 , 0 , 0 ) ; return make up task attempt info ( task type , task info , task attempt number , task number , locality ) ; } logged task attempt logged attempt = get logged task attempt ( task type , task number , task attempt number ) ; if ( logged attempt = = null ) { / / task exists , but attempt is missing task info task info = get task info ( logged task ) ; return make up task attempt info ( task type , task info , task attempt number , task number , locality ) ; } else { / / task and task attempt both exist if ( logged attempt get result ( ) = = values killed ) { task info task info = get task info ( logged task ) ; return make up task attempt info ( task type , task info , task attempt number , task number , locality ) ; } else if ( logged attempt get result ( ) = = values failed ) {


allows subclasses to add extra fields to the { @ code descriptor } for an m bean the default implementation sets the { @ code currency time limit } field to the specified " default currency time limit " , if any ( by default none )

protected void populate m bean descriptor ( descriptor descriptor , object managed bean , string bean key ) { apply default currency time limit ( descriptor ) ; }


get an input stream attached to the configuration resource with the given < code > name < code >

public input stream get conf resource as input stream ( string name ) { try { url url = get resource ( name ) ; if ( url = = null ) { log info ( name + " not found " ) ; return null ; } else { log info ( " found resource " + name + " at " + url ) ; } return url open stream ( ) ; } catch ( exception e ) { return null ; } }


the payload is the part number repeated for the length of the part this makes checking the correctness of the upload straightforward

private byte [ ] generate payload ( int part number ) { return generate payload ( part number , part size in bytes ( ) ) ; }


we place a read request followed by committed update request of the same session in queued requests we verify that both requests are processed , according to the order of the session ( first read , then the write )

public void committed and uncommitted of the same session race test ( ) throws exception { final string path = " / test cvs u c race " ; request read req = new request ( new get data request ( path , false ) , op code get data , 0x 0 , 0 ) ; request write req = new request ( new set data request ( path , new byte [ 16 ] , - 1 ) , op code set data , 0x 0 , 1 ) ; processor committed requests add ( write req ) ; processor queued requests add ( read req ) ; processor queued requests add ( write req ) ; processor queued write requests add ( write req ) ; processor init threads ( 1 ) ; processor stopped main loop = true ; processor run ( ) ; assert true ( processed requests peek ( ) ! = null & & processed requests peek ( ) equals ( read req ) , " request was not processed " + read req + " instead " + processed requests peek ( ) ) ; processed requests poll ( ) ; assert true ( processed requests peek ( ) ! = null & & processed requests peek ( ) equals ( write req ) , " request was not processed " + write req + " instead " + processed requests peek ( ) ) ; }


called for each fixture found in the query you control how the ray cast proceeds by returning a float : return - 1 : ignore this fixture and continue return 0 : terminate the ray cast return fraction : clip the ray to this point return 1 : don ' t clip the ray and continue the { @ link vector 2 } instances passed to the callback will be reused for future calls so make a copy of them !

public float report ray fixture ( fixture fixture , vector 2 point , vector 2 normal , float fraction ) ;


return a query that will return docs like the passed terms

public query like ( terms like terms ) throws i o exception { map < string , int > term freq map = new hash map < > ( ) ; for ( terms vector : like terms ) { add term frequencies ( term freq map , vector ) ; } return create query ( create queue ( term freq map ) ) ; }


public long read long ( ) throws e o f exception { long short 0 = read ( ) ; long short 1 = read ( ) ; long short 2 = read ( ) ; long short 3 = read ( ) ; return short 0 | ( short 1 < < 16 ) | ( short 2 < < 32 ) | ( short 3 < < 48 ) ; }


sets the { @ code generate alias as model } and returns a reference to this builder so that the methods can be chained together an ' alias ' is a primitive type defined as a schema , and this option will attempt to construct a model for that primitive

public builder with generate alias as model ( boolean generate alias as model ) { this generate alias as model = generate alias as model ! = null ? generate alias as model : boolean value of ( default generate alias as model ) ; return this ; }


this method returns once the " started after string " has been seen

protected runner start with args ( string [ ] args , string started after string , run types type ) throws i o exception { log info ( " running with args { } " , arrays to string ( args ) ) ; out content = new byte array output stream ( ) ; err content = new byte array output stream ( ) ; piped output stream out = new piped output stream ( ) ; piped input stream in = new piped input stream ( out ) ; print stream stdin print stream = new print stream ( out ) ; system set out ( new print stream ( out content ) ) ; system set err ( new print stream ( err content ) ) ; system set in ( in ) ; final int start timeout seconds = 60 ; runner runner = new runner ( args , flink configuration , cli frontend get configuration directory from env ( ) , type , 0 , stdin print stream ) ; runner set name ( " frontend ( cli / yarn client ) runner thread ( start with args ( ) ) " ) ; runner start ( ) ; for ( int second = 0 ; second < start timeout seconds ; second + + ) { sleep ( 1000 ) ; / / check output for correct task manager startup if ( out content to string ( ) contains ( started after string ) | | err content to string ( ) contains ( started after string ) ) { log info ( " found expected output in redirected streams " ) ; return runner ; } / / check if thread died if ( ! runner is alive ( ) ) { reset streams and send output ( ) ; if ( runner get runner error ( ) ! = null ) { throw new runtime exception ( " runner failed with exception " , runner get runner error ( ) ) ; } assert fail ( " runner thread died before the test was finished " ) ; } } reset streams and send output ( ) ; assert fail ( " during the timeout period of " + start timeout seconds + " seconds the " + " expected string did not show up " ) ; return null ; }


protected void init application context ( ) throws beans exception { extend interceptors ( this interceptors ) ; detect mapped interceptors ( this adapted interceptors ) ; init interceptors ( ) ; }


public void test multidimenstional arrays serialization ( ) { string [ ] [ ] items = new string [ ] [ ] { { " 3m co " , " 71 72 " , " 0 02 " , " 0 03 " , " 4 / 2 12 : 0 0am " , " manufacturing " } , { " alcoa inc " , " 29 01 " , " 0 42 " , " 1 47 " , " 4 / 1 12 : 0 0am " , " manufacturing " } } ; string json = gson to json ( items ) ; assert true ( json contains ( " [ [ \ " 3m co " ) ) ; assert true ( json contains ( " manufacturing \ " ] ] " ) ) ; }


public resize response split ( resize request resize request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( resize request , indices request converters : : split , options , resize response : : from x content , empty set ( ) ) ; }


returns the ascii name of the section a section name is not guaranteed to be null - terminated if you specify a section name longer than eight characters , the linker truncates it to eight characters in the executable a mechanism exists for allowing longer section names in obj files section names often start with a period , but this is not a requirement section names with a $ in the name get special treatment from the linker sections with identical names prior to the $ character are merged the characters following the $ provide an alphabetic ordering for how the merged sections appear in the final section there ' s quite a bit more to the subject of sections with $ in the name and how they ' re combined , but the details are outside the scope of this article

public string get name ( ) { return name ; }


returns the nodes which are the endpoints of { @ code edge } in this network

endpoint pair < n > incident nodes ( e edge ) ;


get a unique fork id returns a default value for non - parallel tests

public static string get fork i d ( ) { return system get property ( azure test constants test unique fork id , " fork - 1 " ) ; }


e g { @ code path to parent key ( s 3a : bucketpatha ) - > bucketpatha }

public static string path to parent key ( path path ) { preconditions check not null ( path ) ; preconditions check argument ( path is uri path absolute ( ) , " path not absolute : ' % s ' " , path ) ; uri uri = path to uri ( ) ; string bucket = uri get host ( ) ; preconditions check argument ( ! string utils is empty ( bucket ) , " path missing bucket % s " , path ) ; string p key = " / " + bucket + uri get path ( ) ; / / strip trailing slash if ( p key ends with ( " / " ) ) { p key = p key substring ( 0 , p key length ( ) - 1 ) ; } return p key ; }


invoked when the contents of the file chooser model have changed


public list < sequence item > get prefix ( ) { return prefix sequence ; }


sets the additional amount to offset a line of text on the y axis this is typically set to a negative number when top or bottom padding is used so that lines of text are not spaced too far apart

public void set padding advance y ( int padding advance y ) { this padding advance y = padding advance y ; }


specify a particular instance of the target advice directly , avoiding lazy resolution in { @ link # get advice ( ) }

public void set advice ( advice advice ) { synchronized ( this advice monitor ) { this advice = advice ; } }


does the specified method support rest or not ?

protected abstract boolean supports ( processing environment processing env , type element service type , type element service interface type , executable element method ) ;


return the file extensions to use for suffix pattern matching if { @ code registered suffix pattern match = true } , the extensions are obtained from the configured { @ code content negotiation manager }

public list < string > get file extensions ( ) { if ( use registered suffix pattern match ( ) & & this content negotiation manager ! = null ) { return this content negotiation manager get all file extensions ( ) ; } return null ; }


returns a list of realms that are configured , but are not permitted under the current license

public list < realm > get unlicensed realms ( ) { final x pack license state license state snapshot = license state copy current license state ( ) ; / / if auth is not allowed , then everything is unlicensed if ( license state snapshot is security enabled ( ) = = false ) { return collections unmodifiable list ( realms ) ; } / / if all realms are allowed , then nothing is unlicensed if ( license state snapshot check feature ( feature security all realms ) ) { return collections empty list ( ) ; } final list < realm > allowed realms = this as list ( ) ; / / shortcut for the typical case , all the configured realms are allowed if ( allowed realms equals ( this realms ) ) { return collections empty list ( ) ; } / / otherwise , we return anything in " all realms " that is not in the allowed realm list list < realm > unlicensed = realms stream ( ) filter ( r - > allowed realms contains ( r ) = = false ) collect ( collectors to list ( ) ) ; return collections unmodifiable list ( unlicensed ) ; }


gets whether this type represents an uninitialized instance an uninitialized instance is what one gets back from the { @ code new } opcode , and remains uninitialized until a valid constructor is invoked on it

public boolean is uninitialized ( ) { return ( new at > = 0 ) ; }


public static < t extends throwable > void assert has root cause ( final class < ? extends throwable > expected class , final t actual ) { assert true ( expected class is instance ( get root cause ( actual ) ) ) ; }


increments all counters by the values in { @ code other }

public void increment by ( stats counter other ) { cache stats other stats = other snapshot ( ) ; hit count add ( other stats hit count ( ) ) ; miss count add ( other stats miss count ( ) ) ; load success count add ( other stats load success count ( ) ) ; load exception count add ( other stats load exception count ( ) ) ; total load time add ( other stats total load time ( ) ) ; eviction count add ( other stats eviction count ( ) ) ; }


a few options that should all parse successfully

public void test startup success ( ) { check expected ( true , startup option regular , conf ) ; check expected ( true , startup option regular , conf , " - regular " ) ; check expected ( true , startup option regular , conf , " - regular " ) ; check expected ( true , startup option rollback , conf , " - rollback " ) ; }


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


adds a new promise to be combined new promises may be added until an aggregate promise is added via the { @ link promise combiner # finish ( promise ) } method

public void add ( promise promise ) { add ( ( future ) promise ) ; }


return whether this a < b > prototype < b > , with an independent instance returned for each call

public boolean is prototype ( ) { return scope prototype equals ( this scope ) ; }


remove any values from a bucket and the base values too

public static void remove base and bucket overrides ( final string bucket , final configuration conf , final string options ) { for ( string option : options ) { conf unset ( option ) ; } remove bucket overrides ( bucket , conf , options ) ; }


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


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


set a pre - configured markup template engine to use for the groovy markup template web configuration note that this engine instance has to be manually configured , since all other bean properties of this configurer will be ignored

public void set template engine ( markup template engine template engine ) { this template engine = template engine ; }


returns a { @ link char source } view of this byte source that decodes bytes read from this source as characters using the given { @ link charset } if { @ link char source # as byte source } is called on the returned source with the same charset , the default implementation of this method will ensure that the original { @ code byte source } is returned , rather than round - trip encoding subclasses that override this method should behave the same way

public char source as char source ( charset charset ) { return new as char source ( charset ) ; }


overridden to string to pretty print object for debug

public string to string ( ) { return " fid d b : " + fid file get file ( ) get absolute path ( ) ; }


test to verify that servers are able to form quorum peer 0 - & gt ; quorum auth enable sasl = true , quorum auth learner require sasl = true , quorum auth server require sasl = true peer 1 - & gt ; quorum auth enable sasl = true , quorum auth learner require sasl = true , quorum auth server require sasl = true

public void test auth learner server ( ) throws exception { map < string , string > auth configs = new hash map < string , string > ( ) ; auth configs put ( quorum auth quorum sasl auth enabled , " true " ) ; auth configs put ( quorum auth quorum server sasl auth required , " true " ) ; auth configs put ( quorum auth quorum learner sasl auth required , " true " ) ; string connect str = start quorum ( 2 , auth configs , 2 ) ; countdown watcher watcher = new countdown watcher ( ) ; zoo keeper zk = new zoo keeper ( connect str , client base connection timeout , watcher ) ; watcher wait for connected ( client base connection timeout ) ; zk create ( " / foo " , new byte [ 0 ] , ids open acl unsafe , create mode persistent ) ; zk close ( ) ; }


public final string to human ( ) { string buffer sb = new string buffer ( 100 ) ; boolean first = true ; sb append ( " { " ) ; for ( offsetted item i : items ) { if ( first ) { first = false ; } else { sb append ( " , " ) ; } sb append ( i to human ( ) ) ; } sb append ( " } " ) ; return sb to string ( ) ; }


public controller listener < ? super info > get controller listener ( ) { return m controller listener ; }


sets the specified boolean at the specified absolute { @ code index } in this buffer this method does not modify { @ code reader index } or { @ code writer index } of this buffer

public abstract byte buf set boolean ( int index , boolean value ) ;


draws an entry label at the specified position

protected void draw entry label ( canvas c , string label , float x , float y ) { c draw text ( label , x , y , m entry labels paint ) ; }