returns { @ code x } , rounded to a { @ code double } with the specified rounding mode if { @ code x } is precisely representable as a { @ code double } , its { @ code double } value will be returned ; otherwise , the rounding will choose between the two nearest representable values with { @ code mode } for the case of { @ link rounding mode # half even } , this implementation uses the ieee 754 default rounding mode : if the two nearest representable values are equally near , the one with the least significant bit zero is chosen ( in such cases , both of the nearest representable values are even integers ; this method returns the one that is a multiple of a greater power of two )

public static double round to double ( long x , rounding mode mode ) { / / logic adapted from to double rounder double round arbitrarily = ( double ) x ; long round arbitrarily as long = ( long ) round arbitrarily ; int cmp x to round arbitrarily ; if ( round arbitrarily as long = = long max value ) { / * * for most values , the conversion from round arbitrarily to round arbitrarily as long is * lossless in that case we can compare x to round arbitrarily using longs compare ( x , * round arbitrarily as long ) the exception is for values where the conversion to double rounds * up to give round arbitrarily equal to 2 ^ 63 , so the conversion back to long overflows and * round arbitrarily as long is long max value ( this is the only way this condition can occur as * otherwise the conversion back to long pads with zero bits ) in this case we know that * round arbitrarily > x ( this is important when x = = long max value = = * round arbitrarily as long ) * / cmp x to round arbitrarily = - 1 ; } else { cmp x to round arbitrarily = longs compare ( x , round arbitrarily as long ) ; } switch ( mode ) { case unnecessary : check rounding unnecessary ( cmp x to round arbitrarily = = 0 ) ; return round arbitrarily ; case floor : return ( cmp x to round arbitrarily > = 0 ) ? round arbitrarily : double utils next down ( round arbitrarily ) ; case ceiling : return ( cmp x to round arbitrarily < = 0 ) ? round arbitrarily : math next up ( round arbitrarily ) ; case down : if ( x > = 0 ) { return ( cmp x to round arbitrarily > = 0 ) ? round arbitrarily : double utils next down ( round arbitrarily ) ; } else { return ( cmp x to round arbitrarily < = 0 ) ? round arbitrarily : math next up ( round arbitrarily ) ; } case up : if ( x > = 0 ) { return ( cmp x to round arbitrarily < = 0 ) ? round arbitrarily : math next up ( round arbitrarily ) ; } else { return ( cmp x to round arbitrarily > = 0 ) ? round arbitrarily : double utils next down ( round arbitrarily ) ; } case half down : case half up : case half even : { long round floor ; double round floor as double ; long round ceiling ; double round ceiling as double ; if ( cmp x to round arbitrarily > = 0 ) { round floor as double = round arbitrarily ; round floor = round arbitrarily as long ; round ceiling as double = math next up ( round arbitrarily ) ; round ceiling = ( long ) math ceil ( round ceiling as double ) ; } else { round ceiling as double = round arbitrarily ; round ceiling = round arbitrarily as long ; round floor as double = double utils next down ( round arbitrarily ) ; round floor = ( long ) math floor ( round floor as double ) ; } long delta to floor = x - round floor ; long delta to ceiling = round ceiling - x ; if ( round ceiling = = long max value ) { / / correct for long max value as discussed above : round ceiling as double must be 2 ^ 63 , but / / round ceiling is 2 ^ 63 - 1 delta to ceiling + + ; } int diff = longs compare ( delta to floor , delta to ceiling ) ; if ( diff < 0 ) { / / closer to floor return round floor as double ; } else if ( diff > 0 ) { / / closer to ceiling return round ceiling as double ; } / / halfway between the representable values ; do the half - whatever logic switch ( mode ) { case half even : return ( ( double utils get significand ( round floor as double ) & 1l ) = = 0 ) ? round floor as double : round ceiling as double ; case half down : return ( x > = 0 ) ? round floor as double : round ceiling as double ; case half up : return ( x > = 0 ) ? round ceiling as double : round floor as double ; default : throw new assertion error ( " impossible " ) ; } } } throw new assertion error ( " impossible " ) ; }


public final numeric type numeric type ( ) { return numeric type ; }


returns the offset of the long array which this buffer is based on , if there is one the offset is the index of the array and corresponds to the zero position of the buffer

public final int array offset ( ) { return protected array offset ( ) ; }


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


ensure our metadata is fresh ( if an update is expected , this will block until it has completed )

boolean ensure fresh metadata ( timer timer ) { if ( this metadata update requested ( ) | | this metadata time to next update ( timer current time ms ( ) ) = = 0 ) { return await metadata update ( timer ) ; } else { / / the metadata is already fresh return true ; } }


set the list of acceptable { @ linkplain media type media types } , as specified by the { @ code accept } header

b accept ( media type acceptable media types ) ;


public static builder new builder ( ) { return new builder ( ) ; }


public @ nullable scaling utils scale type get progress bar image scale type ( ) { return m progress bar image scale type ; }


called after the { @ code model m bean info } instance has been constructed but before it is passed to the { @ code m bean exporter } subclasses can implement this method to add additional descriptors to the m bean metadata default implementation is empty

protected void populate m bean descriptor ( descriptor descriptor , object managed bean , string bean key ) throws j m exception { }


tells whether a particular key needs to be looked up in the stash based on its name returns true if the string representation of the key starts with " $ " , false otherwise the stash contains fields eventually extracted from previous responses that can be reused as arguments for following requests ( e g scroll id )

public boolean contains stashed value ( object key ) { if ( key = = null | | false = = key instanceof char sequence ) { return false ; } string stash key = key to string ( ) ; if ( false = = strings has length ( stash key ) ) { return false ; } if ( stash key starts with ( " $ " ) ) { return true ; } return extended key matcher ( stash key ) find ( ) ; }


utility to validate a create mode and a ttl

public static void validate t t l ( create mode mode , long ttl ) { if ( mode is t t l ( ) ) { ttl to ephemeral owner ( ttl ) ; } else if ( ttl > = 0 ) { throw new illegal argument exception ( " ttl not valid for mode : " + mode ) ; } }


creates a new listenable future - style stub that supports unary calls on the service

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


reloads cache manager state from the passed data input used during namenode startup to restore cache manager state from an f s image

public void load state compat ( data input in ) throws i o exception { serializer compat load ( in ) ; }


writes a { @ link tuple } data set as csv file ( s ) to the specified location with the specified field and line delimiters < b > note : only a tuple data set can written as a csv file < b > for each tuple field the result of { @ link object # to string ( ) } is written

public data sink < t > write as csv ( string file path , string row delimiter , string field delimiter ) { return internal write as csv ( new path ( file path ) , row delimiter , field delimiter , null ) ; }


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


called when the primary action is done ( on the next call to { @ link # get result or depend on future }


returns candidate build for calculating the estimated duration of the current run returns the 3 last successful ( stable or unstable ) builds , if there are any failing to find 3 of those , it will return up to 3 last unsuccessful builds in any case it will not go more than 6 builds into the past to avoid costly build loading

protected list < run t > get estimated duration candidates ( ) { list < run t > candidates = new array list < > ( 3 ) ; run t last successful = get last successful build ( ) ; int last successful number = - 1 ; if ( last successful ! = null ) { candidates add ( last successful ) ; last successful number = last successful get number ( ) ; } int i = 0 ; run t r = get last build ( ) ; list < run t > fallback candidates = new array list < > ( 3 ) ; while ( r ! = null & & candidates size ( ) < 3 & & i < 6 ) { if ( ! r is building ( ) & & r get result ( ) ! = null & & r get number ( ) ! = last successful number ) { result result = r get result ( ) ; if ( result is better or equal to ( result unstable ) ) { candidates add ( r ) ; } else if ( result is complete build ( ) ) { fallback candidates add ( r ) ; } } i + + ; r = r get previous build ( ) ; } while ( candidates size ( ) < 3 ) { if ( fallback candidates is empty ( ) ) break ; run t run = fallback candidates remove ( 0 ) ; candidates add ( run ) ; } return candidates ; }


public static void main ( string [ ] args ) { string ip values = null ; if ( args length ! = 3 | | ( ! args [ 0 ] equals ( " ip " ) & & ! args [ 0 ] equals ( " range " ) ) ) { system out println ( " invalid invocation the right syntax is ip / range < numberof ips / cidr > < test range > " ) ; } else { if ( args [ 0 ] equals ( " ip " ) ) { int number of ips = integer parse int ( args [ 1 ] ) ; string builder sb = new string builder ( ) ; for ( int i = 0 ; i < number of ips ; i + + ) { sb append ( " 1 2 3 " + i + " , " ) ; } ip values = sb to string ( ) ; } else if ( args [ 0 ] equals ( " range " ) ) { ip values = args [ 1 ] ; } int test range = integer parse int ( args [ 2 ] ) ; load test ( ip values , test range ) ; } }


assigns a timestamp to an element , in milliseconds since the epoch the method is passed the previously assigned timestamp of the element that previous timestamp may have been assigned from a previous assigner , by ingestion time if the element did not carry a timestamp before , this value is { @ code long min value }

long extract timestamp ( t element , long record timestamp ) ;


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


removes all associations from this range map in the specified range ( optional operation ) if { @ code ! range contains ( k ) } , { @ link # get ( comparable ) get ( k ) } will return the same result before and after a call to { @ code remove ( range ) } if { @ code range contains ( k ) } , then after a call to { @ code remove ( range ) } , { @ code get ( k ) } will return { @ code null }


public int get subroutine address ( ) { return subroutine address ; }


computes a simple agg metric ( min , sum , etc ) from the provided values

public static double calculate metric ( double [ ] values , values source aggregation builder < ? > metric ) { if ( metric instanceof min aggregation builder ) { double accumulator = double positive infinity ; for ( double value : values ) { accumulator = math min ( accumulator , value ) ; } return accumulator ; } else if ( metric instanceof max aggregation builder ) { double accumulator = double negative infinity ; for ( double value : values ) { accumulator = math max ( accumulator , value ) ; } return accumulator ; } else if ( metric instanceof sum aggregation builder ) { double accumulator = 0 ; for ( double value : values ) { accumulator + = value ; } return accumulator ; } else if ( metric instanceof avg aggregation builder ) { double accumulator = 0 ; for ( double value : values ) { accumulator + = value ; } return accumulator / values length ; } return 0 0 ; }


sets the maximum parallelism of this operator the maximum parallelism specifies the upper bound for dynamic scaling it also defines the number of key groups used for partitioned state

public one input operator transformation < t > set max parallelism ( int max parallelism ) { this operator max parallelism = optional int of ( max parallelism ) ; return this ; }


returns the { @ link http 2 connection }

protected http 2 connection connection ( ) { return connection ; }


blob cache is configured in ha mode and the cache can download files from the file system directly and does not need to download b l o bs from the blob server which remains active after the blob upload using job - related b l o bs

public void test blob for job cache ha ( ) throws i o exception { configuration config = new configuration ( ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; config set string ( high availability options ha mode , " zookeeper " ) ; config set string ( high availability options ha storage path , temporary folder new folder ( ) get path ( ) ) ; upload file get test ( config , new job i d ( ) , true , true , permanent blob ) ; }


writes string value of enum to data output

public static void write enum ( data output out , enum < ? > enum val ) throws i o exception { text write string ( out , enum val name ( ) ) ; }


set the value of dfs namenode redundancy considerload key in the config file

public builder set n n redundancy consider load ( final boolean val ) { conf set boolean ( dfs namenode redundancy considerload key , val ) ; return this ; }


exit a parse tree produced by { @ link sql base parser # builtin date time function }

void exit builtin date time function ( sql base parser builtin date time function context ctx ) ;


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

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


returns an instance of { @ code interface type } that delegates all method calls to the { @ code target } object , enforcing the specified time limit on each call this time - limited delegation is also performed for calls to { @ link object # equals } , { @ link object # hash code } , and { @ link object # to string } if the target method call finishes before the limit is reached , the return value or exception is propagated to the caller exactly as - is if , on the other hand , the time limit is reached , the proxy will attempt to abort the call to the target , and will throw an { @ link unchecked timeout exception } to the caller it is important to note that the primary purpose of the proxy object is to return control to the caller when the timeout elapses ; aborting the target method call is of secondary concern the particular nature and strength of the guarantees made by the proxy is implementation - dependent however , it is important that each of the methods on the target object behaves appropriately when its thread is interrupted for example , to return the value of { @ code target some method ( ) } , but substitute { @ code default value } if this method call takes over 50 ms , you can use this code : time limiter limiter = ; target type proxy = limiter new proxy ( target , target type class , duration of millis ( 50 ) ) ; try { return proxy some method ( ) ; } catch ( unchecked timeout exception e ) { return default value ; }

default < t > t new proxy ( t target , class < t > interface type , duration timeout ) { return new proxy ( target , interface type , to nanos saturated ( timeout ) , time unit nanoseconds ) ; }


public void logout user ( ) throws api exception { logout user with http info ( ) ; }


public void limit to ( int to ) { if ( to < 0 ) to = 0 ; m to = to ; }


the id of the type this may be 0 , which indicates no id is set < code > optional uint 3 2 id = 1 ; < code >

public int get id ( ) { return instance get id ( ) ; }


get the instance of the held job manager

public job manager get job manager ( ) { if ( instance = = null ) { throw new elasticsearch exception ( " tried to get job manager although machine learning is disabled " ) ; } return instance ; }


returns true if this is the event dispatch thread note that this method returns true in headless mode because any thread in headless mode can dispatch its own events in swing environments , the swing thread is usually used to dispatch events

public static boolean is swing thread ( ) { if ( is in headless mode ( ) ) { return true ; } / / note : just calling this method may trigger the awt thread to get created return swing utilities is event dispatch thread ( ) ; }


called when bazel starts up after { @ link # get startup options } , { @ link # global init } , and { @ link # get file system }

public void blaze startup ( options parsing result startup options , blaze version info version info , uuid instance id , file system file system , server directories directories , clock clock ) throws abrupt exit exception { }


for starlark rule classes , returns this rule class ' s rule definition environment ' s label , which is never null is null for native rules ' rule class objects

public label get rule definition environment label ( ) { return rule definition environment label ; }


returns the next chunk index or { @ link c # index unset } if it is not known

public long get next chunk index ( ) { return chunk index ! = c index unset ? chunk index + 1 : c index unset ; }


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


clears the internal state of the view after this call , all read attempts will fail , until the { @ link # advance ( ) } or { @ link # seek input ( memory segment , int , int ) } method have been invoked

protected void clear ( ) { this current segment = null ; this position in segment = this header length ; this limit in segment = header length ; }


void on change ( final state new state , final state old state ) ;


returns zero - based index of currently played animation loop if animation is infinite or drawable is recycled 0 is returned

public int get current loop ( ) { final int current loop = m native info handle get current loop ( ) ; if ( current loop = = 0 | | current loop < m native info handle get loop count ( ) ) { return current loop ; } else { return current loop - 1 ; } }


ensures that the argument expression is true

static void require argument ( boolean expression ) { if ( ! expression ) { throw new illegal argument exception ( ) ; } }


public void set max interval ( long max interval ) { this max interval = max interval ; }


caches frequently used file names to reuse file name objects and reduce heap size

void cache name ( i node inode ) { / / name is cached only for files if ( ! inode is file ( ) ) { return ; } byte array name = new byte array ( inode get local name bytes ( ) ) ; name = name cache put ( name ) ; if ( name ! = null ) { inode set local name ( name get bytes ( ) ) ; } }


encodes the value which may be a string , number , boolean , null , map , or list

public final json writer json value ( @ nullable object value ) throws i o exception { if ( value instanceof map < ? , ? > ) { begin object ( ) ; for ( map entry < ? , ? > entry : ( ( map < ? , ? > ) value ) entry set ( ) ) { object key = entry get key ( ) ; if ( ! ( key instanceof string ) ) { throw new illegal argument exception ( key = = null ? " map keys must be non - null " : " map keys must be of type string : " + key get class ( ) get name ( ) ) ; } name ( ( ( string ) key ) ) ; json value ( entry get value ( ) ) ; } end object ( ) ; } else if ( value instanceof list < ? > ) { begin array ( ) ; for ( object element : ( ( list < ? > ) value ) ) { json value ( element ) ; } end array ( ) ; } else if ( value instanceof string ) { value ( ( ( string ) value ) ) ; } else if ( value instanceof boolean ) { value ( ( ( boolean ) value ) boolean value ( ) ) ; } else if ( value instanceof double ) { value ( ( ( double ) value ) double value ( ) ) ; } else if ( value instanceof long ) { value ( ( ( long ) value ) long value ( ) ) ; } else if ( value instanceof number ) { value ( ( ( number ) value ) ) ; } else if ( value = = null ) { null value ( ) ; } else { throw new illegal argument exception ( " unsupported type : " + value get class ( ) get name ( ) ) ; } return this ; }


private static void process command ( repository manager repository mgr , string cmd ) throws i o exception { user manager user mgr = repository mgr get user manager ( ) ; string [ ] args = split command ( cmd ) ; if ( add user command equals ( args [ 0 ] ) ) { / / add user string sid = args [ 1 ] ; char [ ] pwd hash = null ; if ( args length = = 4 & & args [ 2 ] content equals ( password option ) ) { pwd hash = args [ 3 ] to char array ( ) ; } try { user mgr add user ( sid , pwd hash ) ; log info ( " user ' " + sid + " ' added " ) ; } catch ( duplicate name exception e ) { log error ( " add user failed : user ' " + sid + " ' already exists " ) ; } } else if ( remove user command equals ( args [ 0 ] ) ) { / / remove user string sid = args [ 1 ] ; user mgr remove user ( sid ) ; log info ( " user ' " + sid + " ' removed " ) ; } else if ( reset user command equals ( args [ 0 ] ) ) { / / reset user string sid = args [ 1 ] ; char [ ] pwd hash = null ; if ( args length = = 4 & & args [ 2 ] content equals ( password option ) ) { pwd hash = args [ 3 ] to char array ( ) ; } if ( ! user mgr reset password ( sid , pwd hash ) ) { log info ( " failed to reset password for user ' " + sid + " ' " ) ; } else if ( pwd hash ! = null ) { log info ( " user ' " + sid + " ' password reset to specified password " ) ; } else { log info ( " user ' " + sid + " ' password reset to default password " ) ; } } else if ( set user dn command equals ( args [ 0 ] ) ) { / / set / add user with dn for pki string sid = args [ 1 ] ; x 5 0 0 principal x 5 0 0 user = new x 5 0 0 principal ( args [ 2 ] ) ; if ( user mgr is valid user ( sid ) ) { user mgr set distinguished name ( sid , x 5 0 0 user ) ; log info ( " user ' " + sid + " ' dn set ( " + x 5 0 0 user get name ( ) + " ) " ) ; } else { try { user mgr add user ( sid , x 5 0 0 user ) ; log info ( " user ' " + sid + " ' added with dn ( " + x 5 0 0 user get name ( ) + " ) and default password " ) ; } catch ( duplicate name exception e ) { / / should never occur } } } else if ( set admin command equals ( args [ 0 ] ) ) { / / set / add repository admin string sid = args [ 1 ] ; string rep name = args [ 2 ] ; if ( ! user mgr is valid user ( sid ) ) { try { user mgr add user ( sid ) ; log info ( " user ' " + sid + " ' added " ) ; } catch ( duplicate name exception e ) { return ; / / should never occur } } repository rep = repository mgr get repository ( rep name ) ; if ( rep = = null ) { log error ( " failed to add ' " + sid + " ' as admin , repository ' " + rep name + " ' not found " ) ; } else { rep add admin ( sid ) ; } } }


creates the initial snapshot clone entry

public static entry start clone ( snapshot snapshot , snapshot id source , list < index id > indices , long start time , long repository state id , version version ) { return new snapshots in progress entry ( snapshot , true , false , state started , indices , collections empty list ( ) , start time , repository state id , immutable open map of ( ) , null , collections empty map ( ) , version , source , immutable open map of ( ) ) ; }


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


only select process instances which have a local string variable which is not the given value , case insensitive this method only works if your database has encodingcollation that supports case - sensitive queries for example , use " collate utf - 8 " on my s q l and for mssql , select one of the case - sensitive collations available ( < a href = " http : msdn microsoft comen - uslibraryms 1 4 4 2 5 0 ( v = sql 105 ) aspx " > msdn server collation reference )

process instance query variable value not equals ignore case ( string name , string value ) ;


decode the bit stream created by encode nulls as bits

public static optional < boolean [ ] > decode null bits ( slice input slice input , int position count ) { if ( ! slice input read boolean ( ) ) { return optional empty ( ) ; } / / read null bits 8 at a time boolean [ ] value is null = new boolean [ position count ] ; for ( int position = 0 ; position < ( position count & ~ 0b 1 1 1 ) ; position + = 8 ) { byte value = slice input read byte ( ) ; value is null [ position ] = ( ( value & 0b 1 0 0 0 0000 ) ! = 0 ) ; value is null [ position + 1 ] = ( ( value & 0b 0 1 0 0 0000 ) ! = 0 ) ; value is null [ position + 2 ] = ( ( value & 0b 0 0 1 0 0000 ) ! = 0 ) ; value is null [ position + 3 ] = ( ( value & 0b 0 0 0 1 0000 ) ! = 0 ) ; value is null [ position + 4 ] = ( ( value & 0b 0 0 0 0 1000 ) ! = 0 ) ; value is null [ position + 5 ] = ( ( value & 0b 0 0 0 0 0100 ) ! = 0 ) ; value is null [ position + 6 ] = ( ( value & 0b 0 0 0 0 0010 ) ! = 0 ) ; value is null [ position + 7 ] = ( ( value & 0b 0 0 0 0 0001 ) ! = 0 ) ; } / / read last null bits if ( ( position count & 0b 1 1 1 ) > 0 ) { byte value = slice input read byte ( ) ; int mask = 0b 1 0 0 0 0000 ; for ( int position = position count & ~ 0b 1 1 1 ; position < position count ; position + + ) { value is null [ position ] = ( ( value & mask ) ! = 0 ) ; mask > > > = 1 ; } } return optional of ( value is null ) ; }


ensures that the string has a leading and trailing quote

private string ensure quotes ( string in ) { pattern pattern = pattern compile ( " \ r \ n | \ r | \ n " ) ; matcher matcher = pattern matcher ( in ) ; if ( matcher find ( ) ) { / / if a string has a new line in it add triple quotes to make it a python multiline string return " ' ' ' " + in + " ' ' ' " ; } string str pattern = " ^ [ ' \ " ] * ? [ ' \ " ] $ " ; if ( in matches ( str pattern ) ) { return in ; } return " \ " " + in + " \ " " ; }


appends the contents of the specified string , then create a new line if the string is { @ code null } , then the string { @ code " null " } is appended

public string builder append line ( string str ) { append 0 ( str ) ; append 0 ( ' \ n ' ) ; return this ; }


model tests for additional properties object

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


finds the button with the indicated text that is a sub - component of the indicated container , and then programmatically presses the button < br > the following is a sample j unit test use : < pre > env show tool ( ) ; option dialog dialog = ( option dialog ) env wait for dialog ( option dialog class , 1000 ) ; assert not null ( dialog ) ; press button by text ( dialog , " ok " ) ; < pre >

public static void press button by text ( dialog component provider provider , string button text ) { press button by text ( provider get component ( ) , button text , true ) ; }


ensures the truth of an expression involving the state of the calling instance , but not involving any parameters to the calling method see { @ link # check state ( boolean , string , object ) } for details

public static void check state ( boolean b , @ nullable decl string error message template , long p 1 , char p 2 ) { if ( ! b ) { throw new illegal state exception ( lenient format ( error message template , p 1 , p 2 ) ) ; } }


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


public mock response add header ( string name , string value ) { headers add ( name , value ) ; return this ; }


obtain the transactional entity manager for this accessor ' s entity manager factory , if any

protected entity manager get transactional entity manager ( ) throws illegal state exception { entity manager factory emf = obtain entity manager factory ( ) ; return entity manager factory utils get transactional entity manager ( emf , get jpa property map ( ) ) ; }


returns the subset of shards in the routing table that are unassigned or initializing and not ready yet to receive operations ( i e engine not opened yet ) includes relocation targets

public list < shard routing > get skipped shards ( ) { return skipped shards ; }


tests that track selector will prefer tracks that are within renderer ' s capabilities over track that exceed renderer ' s capabilities

public void select tracks prefer track within capabilities ( ) throws exception { format builder format builder = audio format build upon ( ) ; format supported format = format builder set id ( " supported format " ) build ( ) ; format exceeded format = format builder set id ( " exceeded format " ) build ( ) ; track group array track groups = wrap formats ( exceeded format , supported format ) ; map < string , integer > mapped capabilities = new hash map < > ( ) ; mapped capabilities put ( supported format id , format handled ) ; mapped capabilities put ( exceeded format id , format exceeds capabilities ) ; renderer capabilities mapped audio renderer capabilities = new fake mapped renderer capabilities ( c track type audio , mapped capabilities ) ; track selector result result = track selector select tracks ( new renderer capabilities [ ] { mapped audio renderer capabilities } , track groups , period id , timeline ) ; assert fixed selection ( result selections get ( 0 ) , track groups , supported format ) ; }


clear all the files in cache ( in memory and disk )

public static void clear state files ( ) { if ( main activity debug ) { log d ( tag , " clear state files ( ) called " ) ; } state objects holder clear ( ) ; file cache dir = new file ( cache dir path ) ; if ( ! cache dir exists ( ) ) { return ; } cache dir = new file ( cache dir , cache dir name ) ; if ( cache dir exists ( ) ) { for ( final file file : cache dir list files ( ) ) { file delete ( ) ; } } }


check equality of the advisors behind the given advised support objects

public static boolean equals advisors ( advised support a , advised support b ) { return a get advisor count ( ) = = b get advisor count ( ) & & arrays equals ( a get advisors ( ) , b get advisors ( ) ) ; }


test sending to a destination using the method send ( string d , message creator message creator )

void test send destination name ( ) throws exception { do test send destination ( false , false , true , false ) ; }


assert that an optional value matches an expected one ; checks include null and empty on the actual value

public static < t > void assert optional unset ( string message , optional < t > actual ) { assert assert not null ( message , actual ) ; actual if present ( t - > assert fail ( " expected empty option , got " + t to string ( ) ) ) ; }


returns the empty immutable sorted multiset

public static < e > immutable sorted multiset < e > of ( ) { return ( immutable sorted multiset ) regular immutable sorted multiset natural empty multiset ; }


returns the debugging information string to be shown by the target { @ link text view }

protected string get debug string ( ) { return get player state string ( ) + get video string ( ) + get audio string ( ) ; }


public void test model 2 0 0 response ( ) { / / todo : test model 2 0 0 response }


private void test kill job ( configuration conf ) throws exception { job job = run job in back ground ( conf ) ; string job id = job get job i d ( ) to string ( ) ; cli jc = create job client ( ) ; byte array output stream out = new byte array output stream ( ) ; / / without job id int exit code = run tool ( conf , jc , new string [ ] { " - kill " } , out ) ; assert equals ( " exit code " , - 1 , exit code ) ; / / good parameters exit code = run tool ( conf , jc , new string [ ] { " - kill " , job id } , out ) ; assert equals ( " exit code " , 0 , exit code ) ; string answer = new string ( out to byte array ( ) , " utf - 8 " ) ; assert true ( answer contains ( " killed job " + job id ) ) ; }


a hook for subclasses to post - process the { @ link proxy factory } before creating the proxy instance with it

protected void post process proxy factory ( proxy factory proxy factory ) { }


verify that locked bytes are correctly updated when a block is finalized at less than its max length

public void test short block finalized ( ) throws i o exception , timeout exception , interrupted exception { get cluster builder ( ) set num datanodes ( 1 ) build ( ) ; final string method name = generic test utils get method name ( ) ; final fs dataset spi < ? > fsd = cluster get data nodes ( ) get ( 0 ) get f s dataset ( ) ; path path = new path ( " / " + method name + " dat " ) ; make test file ( path , 1 , true ) ; assert that ( fsd get cache used ( ) , is ( os page size ) ) ; / / delete the file and ensure locked ram usage goes to zero fs delete ( path , false ) ; wait for locked bytes used ( fsd , 0 ) ; }


public string sequence builder add value ( string value ) { values add ( value ) ; return this ; }


returns true if the text is clipped ( truncated )

public boolean is clipped ( ) { return is clipped ; }


returns the greatest value present in { @ code array }

public static int max ( int array ) { preconditions check argument ( array length > 0 ) ; int max = array [ 0 ] ; for ( int i = 1 ; i < array length ; i + + ) { if ( array [ i ] > max ) { max = array [ i ] ; } } return max ; }


test reading a unsigned leb128 that is just 1 bit too large for a java 64 bit long int

public void test toolarge unsigned ( ) throws i o exception { byte [ ] bytes = new byte [ ] { ( byte ) 0xff , ( byte ) 0xff , ( byte ) 0xff , ( byte ) 0xff , ( byte ) 0xff , ( byte ) 0xff , ( byte ) 0xff , ( byte ) 0xff , ( byte ) 0xff , ( byte ) 0x 0 2 } ; try { long value = leb128 decode ( bytes , false ) ; assert fail ( " should not be able to read a leb128 that is larger than what can fit in java 6 4bit long int : " + value ) ; } catch ( i o exception ioe ) { / / good } }


this member gives the virtual address at which the first byte of the segment resides in memory

public long get virtual address ( ) { return header adjust address for prelink ( p vaddr ) ; }


a sensible definition of { @ link # poll last } in terms of the { @ code descending iterator } method if you override { @ link # descending iterator } you may wish to override { @ link # poll last } to forward to this implementation

protected e standard poll last ( ) { return iterators poll next ( descending iterator ( ) ) ; }


not supported { @ code contiguous set } instances are constructed with { @ link # create } this method exists only to hide { @ link immutable set # builder } from consumers of { @ code contiguous set }

public static < e > immutable sorted set builder < e > builder ( ) { throw new unsupported operation exception ( ) ; }


outputs a value from the index this is useful for " value " window functions such as { @ code lag } that operate on arbitrary types without caring about the specific contents

void append to ( int channel , int position , block builder output ) ;


use the given thread pool for processing the work items if you do not care to configure the thread pool used and you do not wish to make use of shared thread pools , then you can call { @ link # set thread pool name ( string ) } instead of this method

public concurrent q builder < i , r > set thread pool ( g thread pool thread pool ) { this thread pool = thread pool ; return this ; }


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


if this returns true , don ' t enqueue new actions

protected boolean block new actions ( ) { return is interrupted ( ) | | ( unhandled ! = null & & fail fast on exception ) ; }


gets the iteration aggregator registered under the given name the iteration aggregator combines all aggregates globally once per superstep and makes them available in the next superstep

public final < t extends aggregator < ? > > t get iteration aggregator ( string name ) { return this runtime context get iteration aggregator ( name ) ; }


we need to override this as a { @ link legacy serializer snapshot transformer } because in flink 1 6 x and below , this serializer was incorrectly returning directly the snapshot of the nested list serializer as its own snapshot this method transforms the incorrect list serializer snapshot to be a proper { @ link list view serializer snapshot }

public < u > type serializer snapshot < list view < t > > transform legacy serializer snapshot ( type serializer snapshot < u > legacy snapshot ) { if ( legacy snapshot instanceof list view serializer snapshot ) { return ( type serializer snapshot < list view < t > > ) legacy snapshot ; } else if ( legacy snapshot instanceof collection serializer config snapshot ) { / / first , transform the incorrect list serializer ' s snapshot / / into a proper list serializer snapshot list serializer snapshot < t > transformed nested list serializer snapshot = new list serializer snapshot < > ( ) ; collection serializer config snapshot < list < t > , t > snapshot = ( collection serializer config snapshot < list < t > , t > ) legacy snapshot ; composite type serializer util set nested serializers snapshots ( transformed nested list serializer snapshot , ( type serializer snapshot < ? > ) ( snapshot get single nested serializer and config ( ) f 1 ) ) ; / / then , wrap the transformed list serializer snapshot / / as a nested snapshot in the final resulting list view serializer snapshot list view serializer snapshot < t > transformed list view serializer snapshot = new list view serializer snapshot < > ( ) ; composite type serializer util set nested serializers snapshots ( transformed list view serializer snapshot , transformed nested list serializer snapshot ) ; return transformed list view serializer snapshot ; } else { throw new unsupported operation exception ( legacy snapshot get class ( ) get canonical name ( ) + " is not supported " ) ; } }


creates a new builder with the given host and port

public static ok http channel builder for address ( string host , int port , channel credentials creds ) { return for target ( grpc util authority from host and port ( host , port ) , creds ) ; }


gets the decoded frames only used if the { @ code image decode options } were configured to decode all frames at decode time

public list < closeable reference < bitmap > > get decoded frames ( ) { return closeable reference clone or null ( m decoded frames ) ; }


removes and returns the object with the highest priority number in the queue if more than one object has the same priority , then the object that was added to the queue last is considered to have the higher priority value null is returned if the queue is empty

public t remove last ( ) { if ( tree is empty ( ) ) { return null ; } size - - ; integer key = tree last key ( ) ; linked list < t > list = tree get ( key ) ; if ( list size ( ) = = 1 ) { tree remove ( key ) ; } return list remove last ( ) ; }


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


this test expects read ahead manager to throw exception if the read ahead thread had failed within the last threshold age milliseconds also checks that the read buffers are evicted as per the read buffer manager threshold criteria

public void test read ahead manager for failed read ahead ( ) throws exception { abfs client client = get mock abfs client ( ) ; abfs rest operation success op = get mock rest op ( ) ; / / stub : / / read request leads to 3 readahead calls : fail all 3 readahead - client read ( ) / / actual read request fails with the failure in readahead thread do throw ( new timeout exception ( " internal server error for rah - thread - x " ) ) do throw ( new timeout exception ( " internal server error for rah - thread - y " ) ) do throw ( new timeout exception ( " internal server error rah - thread - z " ) ) do return ( success op ) / / any extra calls to read , pass it when ( client ) read ( any ( string class ) , any ( long class ) , any ( byte [ ] class ) , any ( integer class ) , any ( integer class ) , any ( string class ) , any ( string class ) ) ; abfs input stream input stream = get abfs input stream ( client , " test read ahead manager for failed read ahead txt " ) ; queue read aheads ( input stream ) ; / / abfs input stream read would have waited for the read - ahead for the requested offset / / as we are testing from read ahead manager directly , sleep for a sec to / / get the read ahead threads to complete thread sleep ( 1000 ) ; / / if read ahead failed for specific offset , get block should / / throw exception from the read buffer that failed within last threshold age milliseconds sec intercept ( i o exception class , ( ) - > read buffer manager get buffer manager ( ) get block ( input stream , 0 , one kb , new byte [ one kb ] ) ) ; / / only the 3 read ahead threads should have triggered client read verify read call count ( client , 3 ) ; / / stub returns success for the 4th read request , if read buffers still / / persisted , read ahead manager get block would have returned exception check evicted status ( input stream , 0 , false ) ; }


returns the available xcode versions from { @ code available xcodes }

public iterable < xcode version rule data > get available versions ( ) { return available xcodes ; }


define the datetime format with a { @ link simple date format } note : setting this property makes the exposed { @ link object mapper } non - thread - safe , according to jackson ' s thread safety rules

public void set simple date format ( string format ) { this builder simple date format ( format ) ; }


public boolean is empty ( ) { return size = = 0 ; }


set the formatter that will be used for objects representing time values this formatter will be used for the { @ link local time } and { @ link offset time } types when specified , the { @ link # set time style time style } and { @ link # set use iso format use iso format } properties will be ignored

public void set time formatter ( date time formatter formatter ) { this formatters put ( type time , formatter ) ; }


private list < string > pick table names from table models ( ) { list < string > table names = new array list < > ( ) ; for ( table model table model : m table models ) { table names add ( table model get table name ( ) ) ; } return table names ; }


dumps this class this package - protected method is for debugging only


set the queue connection factory to use for obtaining jms queue connections

public void set connection factory ( @ nullable connection factory connection factory ) { this connection factory = connection factory ; }


sets an id for this operator the specified id is used to assign the same operator id across job submissions ( for example when starting a job from a savepoint ) important : this id needs to be unique per transformation and job otherwise , job submission will fail

public cassandra sink < in > uid ( string uid ) { if ( use data stream sink ) { get sink transformation ( ) set uid ( uid ) ; } else { get transformation ( ) set uid ( uid ) ; } return this ; }


return the underlying source of the resolvable type will return a { @ link field } , { @ link method parameter } or { @ link type } depending on how the { @ link resolvable type } was constructed with the exception of the { @ link # none } constant , this method will never return { @ code null } this method is primarily to provide access to additional type information or meta - data that alternative jvm languages may provide

public object get source ( ) { object source = ( this type provider ! = null ? this type provider get source ( ) : null ) ; return ( source ! = null ? source : this type ) ; }


reset the various state - keeping maps of artifact nested set function

void reset artifact nested set function maps ( ) { artifact sky key to sky value = maps new concurrent map ( ) ; }


returns the command line specification for this link , included any required linkstamp compilation steps the command line may refer to a params file

public final list < string > get command line ( @ nullable artifact expander expander ) throws command line expansion exception { return link command line get command line ( expander ) ; }


public static void init request from entity ( http request base request base , map < string , string > body , string charset ) throws exception { if ( body = = null | | body is empty ( ) ) { return ; } list < name value pair > params = new array list < name value pair > ( body size ( ) ) ; for ( map entry < string , string > entry : body entry set ( ) ) { params add ( new basic name value pair ( entry get key ( ) , entry get value ( ) ) ) ; } if ( request base instanceof http entity enclosing request ) { http entity enclosing request request = ( http entity enclosing request ) request base ; http entity entity = new url encoded form entity ( params , charset ) ; request set entity ( entity ) ; } }


returns pet inventories by status returns a map of status codes to quantities

public map < string , integer > get inventory ( ) throws api exception { return get inventory with http info ( ) get data ( ) ; }


reads all stories in the folders provided , asserts if no story found

protected static list < object > create stories ( string [ ] interop tests ) throws exception { if ( interop tests length = = 0 ) { return collections singleton list ( missing ) ; } list < object > result = new array list < > ( ) ; for ( string interop test name : interop tests ) { list < story > stories = hpack json util read stories ( interop test name ) ; for ( story story : stories ) { result add ( story ) ; } } return result ; }


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


recursively list all entries , with a depth first traversal of the directory tree

public static tree scan results tree walk ( file system fs , path path ) throws i o exception { tree scan results dirs and files = new tree scan results ( ) ; file status [ ] statuses = fs list status ( path ) ; for ( file status status : statuses ) { log info ( " { } { } " , status get path ( ) , status is directory ( ) ? " * " : " " ) ; } for ( file status status : statuses ) { dirs and files add ( status ) ; if ( status is directory ( ) ) { dirs and files add ( tree walk ( fs , status get path ( ) ) ) ; } } return dirs and files ; }


method to see if the connection is usable

public boolean is valid ( ) { return valid & & real connection ! = null & & data source ping connection ( this ) ; }


get a string representation of this pair

public string to string ( ) { return name + " = " + value ; }


unmounts an existing sandboxfs instance unless the user asked not to by providing the { @ code - - sandbox debug } flag

private void unmount sandboxfs ( ) { if ( sandboxfs process ! = null ) { if ( should cleanup sandbox base ) { sandboxfs process destroy ( ) ; sandboxfs process = null ; } else { check not null ( env , " env not initialized ; was before command called ? " ) ; env get reporter ( ) handle ( event info ( " leaving sandboxfs mounted because of - - sandbox debug " ) ) ; } } }


post fake { pet id } upload image with required file : uploads an image ( required )

default response entity < model api response > upload file with required file ( @ api param ( value = " id of pet to update " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " file to upload " ) @ valid @ request part ( value = " required file " , required = true ) multipart file required file , @ api param ( value = " additional data to pass to server " ) @ valid @ request part ( value = " additional metadata " , required = false ) string additional metadata ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " code \ " : 0 , \ " type \ " : \ " type \ " , \ " message \ " : \ " message \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


private void disconnect ( channel sftp channel ) throws i o exception { connection pool disconnect ( channel ) ; }


check that throttling was detected ; warn if not

public boolean probe throttling detected ( ) { if ( ! is throttling detected ( ) ) { log warn ( " no throttling detected in { } against { } " , this , ddbms ) ; return false ; } return true ; }


returns a { @ link message digest } instance for sha - 1 digests ; note that the instance returned is thread local and must not be shared amongst threads

public static message digest sha 1 ( ) { return get ( sha 1 digest ) ; }


get the value of the ' { @ code onmousedown } ' attribute may be a runtime expression

protected string get onmousedown ( ) { return this onmousedown ; }


deserialize the json string to java object

public static < t > t from json ( final string json str , final type reference type ) throws i o exception { return object mapper read value ( json str , type ) ; }


set a key that is local to the parent of this component

void set key ( string key ) { m has manual key = true ; m key = key ; }


decset 7 , decawm , controls wraparound mode

public void test wrap around mode ( ) { / / default with wraparound : with terminal sized ( 3 , 3 ) enter string ( " abcd " ) assert lines are ( " abc " , " d " , " " ) ; / / with wraparound disabled : with terminal sized ( 3 , 3 ) enter string ( " \ 033 [ ? 7labcd " ) assert lines are ( " abd " , " " , " " ) ; enter string ( " efg " ) assert lines are ( " abg " , " " , " " ) ; / / re - enabling wraparound : enter string ( " \ 033 [ ? 7hhij " ) assert lines are ( " abh " , " ij " , " " ) ; }


transfers the information provided by the specified content message to the specified aggregated message note that the content of the specified content message has been appended to the content of the specified aggregated message already , so that you don ' t need to use this method to transfer the additional information that the content message provides to { @ code aggregated }

protected void aggregate ( o aggregated , c content ) throws exception { }


returns the label of the xcode config rule to use for resolving the host system xcode version

public label get xcode config label ( ) { return null ; }


get the name with any namespace stripped

string strip namespace ( string name ) { int index = name last index of ( namespace delimiter ) ; if ( index < = 0 ) { return name ; } return name substring ( index + namespace delimiter length ( ) ) ; }


gets the status code of the previous request

public int get status code ( ) { return status code ; }


given an output filename , write a bunch of random records to it

public void map ( text key , text value , context context ) throws i o exception , interrupted exception { int item count = 0 ; while ( num bytes to write > 0 ) { / / generate the key / value int no words key = min words in key + ( words in key range ! = 0 ? random next int ( words in key range ) : 0 ) ; int no words value = min words in value + ( words in value range ! = 0 ? random next int ( words in value range ) : 0 ) ; text key words = generate sentence ( no words key ) ; text value words = generate sentence ( no words value ) ; / / write the sentence context write ( key words , value words ) ; num bytes to write - = ( key words get length ( ) + value words get length ( ) ) ; / / update counters , progress etc context get counter ( counters bytes written ) increment ( key words get length ( ) + value words get length ( ) ) ; context get counter ( counters records written ) increment ( 1 ) ; if ( + + item count % 200 = = 0 ) { context set status ( " wrote record " + item count + " " + num bytes to write + " bytes left " ) ; } } context set status ( " done with " + item count + " records " ) ; }


raise an overflow exception for the given number and target class

private static void raise overflow exception ( number number , class < ? > target class ) { throw new illegal argument exception ( " could not convert number [ " + number + " ] of type [ " + number get class ( ) get name ( ) + " ] to target class [ " + target class get name ( ) + " ] : overflow " ) ; }


public static @ non null recipient id from ( @ nullable uuid uuid , @ nullable string e 1 6 4 ) { return from ( uuid , e 1 6 4 , false ) ; }


this method should close the stream , if has not been closed before if this method actually closes the stream , it should deleterelease the resource behind the stream , such as the file that the stream writes to the above implies that this method is intended to be the " unsuccessful close " , such as when cancelling the stream writing , or when an exception occurs closing the stream for the successful case must go through { @ link # close and get handle ( ) }

public abstract void close ( ) throws i o exception ;


clears out the instruction list in this model , and fires off a notification to subscribers

public void clear and reload ( ) { / / no need to do anything if the instructions are already empty if ( instructions is empty ( ) ) { return ; } instructions clear ( ) ; model changed ( update type reload ) ; }


public static boolean is flag ( int operand type ) { return ( operand type & flag ) ! = 0 ; }


returns the original element list , unchanged

public list < double > order ( list < double > insertion order ) { return insertion order ; }


public create users with list input oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


get the builder this must be used after the constructor has been invoked to create the actual builder : it allows for subclasses to do things after construction

public future data input stream builder builder ( ) { return get this builder ( ) ; }


public static void load rules ( list < authority rule > rules ) { current property update value ( rules ) ; }


< code > optional aapt pb config description config = 1 ; < code >

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


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


find the { @ link field } by the name in the specified class and its inherited types

static field find field ( object object , string field name ) { return find field ( object get class ( ) , field name ) ; }


for a lexer , a string is a sequence of char to match that is , " fog " is treated as ' f ' ' o ' ' g ' not as a single transition in the dfa machine = = o - ' f ' - & gt ; o - ' o ' - & gt ; o - ' g ' - & gt ; o and has n + 1 states for n characters

public handle string literal ( terminal a s t string literal a s t ) { string chars = string literal a s t get text ( ) ; a t n state left = new state ( string literal a s t ) ; a t n state right ; string s = char support get string from grammar string literal ( chars ) ; if ( s = = null ) { / / the lexer will already have given an error return new handle ( left , left ) ; } int n = s length ( ) ; a t n state prev = left ; right = null ; for ( int i = 0 ; i < n ; ) { right = new state ( string literal a s t ) ; int code point = s code point at ( i ) ; prev add transition ( code point transitions create with code point ( right , code point ) ) ; prev = right ; i + = character char count ( code point ) ; } string literal a s t atn state = left ; return new handle ( left , right ) ; }


public static void create table ( database db , boolean if not exists ) { string constraint = if not exists ? " if not exists " : " " ; db exec s q l ( " create table " + constraint + " \ " test entity \ " ( " + / / " \ " id \ " integer primary key , " + / / 0 : id " \ " simple int \ " integer not null , " + / / 1 : simple int " \ " simple integer \ " integer , " + / / 2 : simple integer " \ " simple string not null \ " text not null , " + / / 3 : simple string not null " \ " simple string \ " text , " + / / 4 : simple string " \ " indexed string \ " text , " + / / 5 : indexed string " \ " indexed string asc unique \ " text , " + / / 6 : indexed string asc unique " \ " simple date \ " integer , " + / / 7 : simple date " \ " simple boolean \ " integer , " + / / 8 : simple boolean " \ " simple byte array \ " blob ) ; " ) ; / / 9 : simple byte array / / add indexes db exec s q l ( " create index " + constraint + " idx test entity indexed string on test entity " + " ( \ " indexed string \ " ) ; " ) ; db exec s q l ( " create unique index " + constraint + " idx test entity indexed string asc unique on test entity " + " ( \ " indexed string asc unique \ " asc ) ; " ) ; }


create a path to a service under a user and service class

public static string service path ( string user , string service class , string service name ) { return join ( serviceclass path ( user , service class ) , service name ) ; }


the indirect symbols need to be applied across the import segment the individual section do not really matter except the number of bytes between each symbol varies based on section

private void process indirect symbols ( ) throws exception { monitor set message ( " processing indirect symbols " ) ; symbol table command symbol table command = macho header get first load command ( symbol table command class ) ; dynamic symbol table command dynamic command = macho header get first load command ( dynamic symbol table command class ) ; if ( dynamic command = = null ) { return ; } int [ ] indirect symbols = dynamic command get indirect symbols ( ) ; if ( indirect symbols length = = 0 ) { return ; } int [ ] section types = new int [ ] { section types s non lazy symbol pointers , section types s lazy symbol pointers , section types s symbol stubs } ; list < section > sections = get sections with types ( section types ) ; for ( section section : sections ) { if ( monitor is cancelled ( ) ) { return ; } if ( section get size ( ) = = 0 ) { continue ; } namespace namespace = create namespace for section ( section ) ; int indirect symbol table index = section get reserved 1 ( ) ; int symbol size = macho header get address size ( ) ; if ( section get type ( ) = = section types s symbol stubs ) { symbol size = section get reserved 2 ( ) ; } int n symbols = ( int ) section get size ( ) / symbol size ; address start addr = space get address ( section get address ( ) ) ; for ( int i = indirect symbol table index ; i < indirect symbol table index + n symbols ; + + i ) { if ( monitor is cancelled ( ) ) { break ; } int symbol index = indirect symbols [ i ] ; n list symbol = symbol table command get symbol at ( symbol index ) ; if ( symbol ! = null ) { string name = generate valid name ( symbol get string ( ) ) ; if ( name ! = null & & name length ( ) > 0 ) { try { program get symbol table ( ) create label ( start addr , name , namespace , source type imported ) ; } catch ( exception e ) { log append msg ( " unable to create indirect symbol " + name ) ; log append exception ( e ) ; } } } start addr = start addr add ( symbol size ) ; } } }


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


get pet { pet id } : find pet by id returns a single pet

public response entity < pet > get pet by id ( @ api param ( value = " id of pet to return " , required = true ) @ path variable ( " pet id " ) long pet id ) { return delegate get pet by id ( pet id ) ; }


filter events by multifactor authentication providers

protected pair < collection < event > , collection < multifactor authentication provider > > filter events by multifactor authentication provider ( final collection < event > resolve events , final authentication authentication , final registered service registered service , final http servlet request request ) { logger debug ( " locating multifactor providers to determine support for this authentication sequence " ) ; val providers = multifactor authentication utils get available multifactor authentication providers ( get webflow event resolution configuration context ( ) get application context ( ) ) ; if ( providers is empty ( ) ) { logger debug ( " no providers are available to honor this request moving on " ) ; return pair of ( resolve events , new hash set < > ( 0 ) ) ; } val provider values = providers values ( ) ; provider values remove if ( p - > resolve events stream ( ) none match ( e - > p matches ( e get id ( ) ) ) ) ; resolve events remove if ( e - > provider values stream ( ) none match ( p - > p matches ( e get id ( ) ) ) ) ; logger debug ( " finalized set of resolved events are [ { } ] " , resolve events ) ; val final events = new tree set < > ( comparator comparing ( event : : get id ) ) ; final events add all ( resolve events ) ; return pair of ( final events , provider values ) ; }


returns true if the connection was cancelled by the user

public boolean is cancelled ( ) { return connect cancelled ; }


return a { @ link resolvable type } for the specified { @ link class } , using the full generic type information for assignability checks for example : { @ code resolvable type for class ( my array list class ) }

public static resolvable type for class ( @ nullable class < ? > clazz ) { return new resolvable type ( clazz ) ; }


compares the two specified { @ code int } values , treating them as unsigned values between { @ code 0 } and { @ code 2 ^ 32 - 1 } inclusive < b > java 8 users : < b > use { @ link integer # compare unsigned ( int , int ) } instead

public static int compare ( int a , int b ) { return ints compare ( flip ( a ) , flip ( b ) ) ; }


commit a single pending commit ; exceptions are caught and converted to an outcome see { @ link commit operations # commit ( single pending commit , string , bulk operation state ) }

public maybe i o e commit ( single pending commit commit , string origin ) { return commit operations this commit ( commit , origin , operation state ) ; }


private void records written ( final int count ) { instrumentation records written ( count ) ; }


sets the confidence level for this suggester the confidence level defines a factor applied to the input phrases score which is used as a threshold for other suggest candidates only candidates that score higher than the threshold will be included in the result for instance a confidence level of { @ code 1 0 } will only return suggestions that score higher than the input phrase if set to { @ code 0 0 } the top n candidates are returned the default is { @ code 1 0 }

public phrase suggestion builder confidence ( float confidence ) { if ( confidence < 0 0 ) { throw new illegal argument exception ( " confidence must be > = 0 0 " ) ; } this confidence = confidence ; return this ; }


this implementation compares the underlying servlet context resource locations

public boolean equals ( @ nullable object other ) { if ( this = = other ) { return true ; } if ( ! ( other instanceof servlet context resource ) ) { return false ; } servlet context resource other res = ( servlet context resource ) other ; return ( this servlet context equals ( other res servlet context ) & & this path equals ( other res path ) ) ; }


install the app silently without root permission must hold { @ code android : shared user id = " android uid shell " } and { @ code < uses - permission android : name = " android permission install packages " > }

public static boolean install app silent ( final string file path , final string params ) { return install app silent ( get file by path ( file path ) , params ) ; }


attempts to determine the set of references which refer to the specified variable in utilizing the first use offset scoping model , negative offsets ( relative to the functions entry ) are shifted beyond the maximum positive offset within the function while this does not account for the actual instruction flow , it is hopefully accurate enough for most situations

public reference [ ] get references to ( variable var ) { lock acquire ( ) ; try { function function = var get function ( ) ; if ( ! ( function instanceof function d b ) | | function get program ( ) ! = program | | ! ( ( function d b ) function ) check is valid ( ) ) { return no refs ; } symbol d b var symbol = ( symbol d b ) var get symbol ( ) ; if ( var symbol ! = null & & ! var symbol check is valid ( ) ) { return no refs ; } function cacher set function ( function ) ; variable storage storage = var get variable storage ( ) ; scope scope = find variable scope ( function , var symbol , var ) ; list < reference > matching references = get scoped variable references ( storage , function , scope ) ; if ( matching references is empty ( ) ) { return no refs ; } reference [ ] refs = new reference [ matching references size ( ) ] ; matching references to array ( refs ) ; return refs ; } finally { lock release ( ) ; } }


returns the given function object if it is not { @ code null } otherwise , a { @ link # function ( ) } is returned this is useful to avoid using { @ code null }

public static < t , r > function < t , r > if null ( function < t , r > f ) { return f = = null ? function ( ) : f ; }


public void test resilience to filesystem inconsistencies directory existence ( ) throws exception { / / our custom filesystem says " pkg path / build " exists but " pkg path " does not exist fs stub stat ( pkg path , null ) ; rooted path pkg rooted path = rooted path to rooted path ( root from path ( root ) , pkg path ) ; file state value pkg dir file state value = file state value create ( pkg rooted path , null ) ; file value pkg dir value = file value value ( immutable list of ( pkg rooted path ) , null , null , pkg rooted path , pkg dir file state value , pkg rooted path , pkg dir file state value ) ; differencer inject ( immutable map of ( file value key ( pkg rooted path ) , pkg dir value ) ) ; string expected message = " / root / workspace / pkg is no longer an existing directory " ; sky key sky key = glob value key ( pkg id , root from path ( root ) , " * / foo " , false , path fragment empty fragment ) ; evaluation result < glob value > result = driver evaluate ( immutable list of ( sky key ) , evaluation options ) ; assert that ( result has error ( ) ) is true ( ) ; error info error info = result get error ( sky key ) ; assert that ( error info get exception ( ) ) is instance of ( inconsistent filesystem exception class ) ; assert that ( error info get exception ( ) ) has message that ( ) contains ( expected message ) ; }


return all locally registered tasks that have been scheduled by this registrar

public set < scheduled task > get scheduled tasks ( ) { return collections unmodifiable set ( this scheduled tasks ) ; }


called in doc id order for each hit in a leaf reader

void process ( hit context hit context ) throws i o exception ;


public static void show message ( string message ) { j option pane show message dialog ( viewer , message ) ; }


remove all { @ link # flushed entry stored ( object ) flushed entries } , { @ link # flushed entry removed ( object ) flushed removals } ,

public void clear ( ) { restorable entries clear ( ) ; flushed entries clear ( ) ; flushed removals clear ( ) ; }


void set attribute value ( int attr index , object value , boolean explicit ) { if ( attr index < 0 | | attr index > = values length ) { throw new illegal argument exception ( " attribute with index " + attr index + " is not valid for rule " ) ; } if ( ! explicit & & explicit attrs get ( attr index ) ) { throw new illegal argument exception ( " attribute with index " + attr index + " already explicitly set " ) ; } values [ attr index ] = value ; if ( explicit ) { explicit attrs set ( attr index ) ; } }


sets this dialog to remember its location from one invocation to the next the default is to remember location

public void set remember location ( boolean remember location ) { this remember location = remember location ; }


{ @ inherit doc } the default implementation does nothing

@ override public void enter date escaped literal ( sql base parser date escaped literal context ctx ) { }


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


tells this provider to refresh , which means to rebuild the graph and relayout the vertices

private void refresh ( boolean keep perspective ) { f g data function graph data = controller get function graph data ( ) ; if ( function graph data has results ( ) ) { / / / / we use the graph ' s data over the ' current x x x ' data , as there is a chance that the / / latter values have been set to new values , while the graph has differing data in / / that case we have made the decision to prefer the graph ' s data / / function function = function graph data get function ( ) ; address address = function get entry point ( ) ; address current address = current location get address ( ) ; if ( function get body ( ) contains ( current address ) ) { / / prefer the current address if it is within the current function ( i e , the / / location hasn ' t changed out from under the graph due to threading issues ) address = current address ; } program program = function get program ( ) ; program location program location = new program location ( program , address ) ; controller rebuild display ( program , program location , keep perspective ) ; return ; } controller rebuild display ( current program , current location , keep perspective ) ; }


adds all the given entries to the built map duplicate keys , according to the comparator ( which might be the keys ' natural order ) , are not allowed , and will cause { @ link # build } to fail

public builder < k , v > put all ( iterable < ? extends entry < ? extends k , ? extends v > > entries ) { super put all ( entries ) ; return this ; }


returns the ack timestamp of the latest acknowledged subtask or < code > - 1 < code > if none was acknowledged yet

public long get latest ack timestamp ( ) { subtask state stats subtask = get latest acknowledged subtask stats ( ) ; if ( subtask ! = null ) { return subtask get ack timestamp ( ) ; } else { return - 1 ; } }


constructs a key for loading a regular ( non - prelude ) bzl

public static key key ( root root , label label ) { return key create ( root , label , kind normal ) ; }


merges all the fields of { @ code other } with the current { @ link source file coverage } into a new { @ link source file coverage } assumes both the current and the given { @ link source file coverage } have the same { @ code source file name }

static source file coverage merge ( source file coverage source 1 , source file coverage source 2 ) { assert source 1 source file name equals ( source 2 source file name ) ; source file coverage merged = new source file coverage ( source 2 source file name ) ; merged add all line numbers ( merge line numbers ( source 1 , source 2 ) ) ; merged add all functions execution ( merge functions execution ( source 1 , source 2 ) ) ; merged add all branches ( merge branches ( source 1 , source 2 ) ) ; merged add all lines ( merge lines ( source 1 , source 2 ) ) ; return merged ; }


encodes the byte array into a newly created hex char array , without allocating any other temporary variables

static char [ ] to hex char array ( byte [ ] bytes ) { objects require non null ( bytes ) ; final char [ ] result = new char [ 2 * bytes length ] ; for ( int i = 0 ; i < bytes length ; i + + ) { byte b = bytes [ i ] ; result [ 2 * i ] = hex digits [ b > > 4 & 0xf ] ; result [ 2 * i + 1 ] = hex digits [ b & 0xf ] ; } return result ; }


public void test read only first ( ) { / / todo : test read only first }


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


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


returns the remote fs root absolute path or { @ code null } if the agent is off - line the absolute path may change between connections if the connection method does not provide a consistent working directory and the node ' s remote fs is specified as a relative path

public string get absolute remote fs ( ) { return channel = = null ? null : absolute remote fs ; }


return default value for the jmx field " currency time limit " , if any

protected integer get default currency time limit ( ) { return this default currency time limit ; }


returns an authenticated { @ link http u r l connection } if the delegation token is present , it will be used taking precedence over the configured < code > authenticator < code > if the < code > do as < code > parameter is not null , the request will be done on behalf of the specified < code > do as < code > user

public http u r l connection open connection ( url url , token token , string do as ) throws i o exception , authentication exception { preconditions check not null ( url , " url " ) ; preconditions check not null ( token , " token " ) ; map < string , string > extra params = new hash map < string , string > ( ) ; org apache hadoop security token token < ? extends token identifier > d token = null ; log debug ( " connecting to url { } with token { } as { } " , url , token , do as ) ; / / if we have valid auth token , it takes precedence over a delegation token / / and we don ' t even look for one if ( ! token is set ( ) ) { / / delegation token credentials creds = user group information get current user ( ) get credentials ( ) ; if ( log is debug enabled ( ) ) { log debug ( " token not set , looking for delegation token creds : { } , " + " size : { } " , creds get all tokens ( ) , creds number of tokens ( ) ) ; } if ( ! creds get all tokens ( ) is empty ( ) ) { d token = select delegation token ( url , creds ) ; if ( d token ! = null ) { if ( use query string for delegation token ( ) ) { / / delegation token will go in the query string , injecting it extra params put ( kerberos delegation token authenticator delegation param , d token encode to url string ( ) ) ; } else { / / delegation token will go as request header , setting it in the / / auth - token to ensure no authentication handshake is triggered / / ( if we have a delegation token , we are authenticated ) / / the delegation token header is injected in the connection request / / at the end of this method token delegation token = ( org apache hadoop security token token < abstract delegation token identifier > ) d token ; } } } } / / proxyuser if ( do as ! = null ) { extra params put ( do as , u r l encoder encode ( do as , " utf - 8 " ) ) ; } url = augment u r l ( url , extra params ) ; http u r l connection conn = super open connection ( url , token ) ; if ( ! token is set ( ) & & ! use query string for delegation token ( ) & & d token ! = null ) { / / injecting the delegation token header in the connection request conn set request property ( delegation token authenticator delegation token header , d token encode to url string ( ) ) ; } return conn ; }


default void execute ( t t ) throws runtime exception { try { accept ( t ) ; } catch ( throwable e ) { throw new runtime exception ( e get message ( ) , e get cause ( ) ) ; } }


helper for asserting tls info in s s l session { @ link io grpc server call # get attributes ( ) }

protected void assert x 5 0 0 subject dn ( string tls info ) { test service grpc test service blocking stub stub = blocking stub with deadline after ( 5 , time unit seconds ) ; stub unary call ( simple request get default instance ( ) ) ; list < certificate > certificates ; s s l session ssl session = server call capture get ( ) get attributes ( ) get ( grpc transport attr ssl session ) ; try { certificates = arrays as list ( ssl session get peer certificates ( ) ) ; } catch ( s s l peer unverified exception e ) { / / should never happen throw new assertion error ( e ) ; } x 5 0 9 certificate x 5 0 9cert = ( x 5 0 9 certificate ) certificates get ( 0 ) ; assert equals ( 1 , certificates size ( ) ) ; assert equals ( tls info , x 5 0 9cert get subject d n ( ) to string ( ) ) ; }


method used to determine if or not node descriptors fetching script is configured and whether it is fit to run returns true if following conditions are met : path to the script is not empty the script file exists

protected void verify configured script ( string script path ) throws i o exception { boolean invalid configuration ; if ( script path = = null | | script path trim ( ) is empty ( ) ) { invalid configuration = true ; } else { file f = new file ( script path ) ; invalid configuration = ! f exists ( ) | | ! file util can execute ( f ) ; } if ( invalid configuration ) { throw new i o exception ( " node descriptors provider script \ " " + script path + " \ " is not configured properly please check whether " + " the script path exists , owner and the access rights " + " are suitable for nm process to execute it " ) ; } }


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


sets the starting position and the direction of this ray

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


gets default encryption settings for the bucket or returns null if default encryption is disabled

private get bucket encryption result get default encryption ( ) throws i o exception { s 3 a file system fs = get file system ( ) ; amazon s 3 s 3 = fs get amazon s 3 client for testing ( " check default encryption " ) ; try { return invoker once ( " get bucket encryption ( ) " , fs get bucket ( ) , ( ) - > s 3 get bucket encryption ( fs get bucket ( ) ) ) ; } catch ( file not found exception e ) { return null ; } }


returns a map from rule variable to fully - expanded value , for all rule variables defined in this target

public immutable sorted map < ninja rule variable , string > compute rule variables ( ) { immutable sorted map < string , string > late expansion variables = compute input output variables ( ) ; immutable sorted map builder < string , string > full expansion variables builder = immutable sorted map < string , string > natural order ( ) put all ( late expansion variables ) ; immutable sorted map builder < ninja rule variable , string > builder = immutable sorted map natural order ( ) ; for ( map entry < ninja rule variable , ninja variable value > entry : rule variables entry set ( ) ) { ninja rule variable type = entry get key ( ) ; / / skip command for now it may need to expand other rule variables if ( ninja rule variable command equals ( type ) ) { continue ; } string expanded value = entry get value ( ) expand value ( late expansion variables ) ; builder put ( type , expanded value ) ; full expansion variables builder put ( ascii to lower case ( type name ( ) ) , expanded value ) ; } / / todo ( cparsons ) : ensure parsing exception is thrown early if the rule has no command defined / / otherwise , this throws npe string expanded command = rule variables get ( ninja rule variable command ) expand value ( full expansion variables builder build ( ) ) ; builder put ( ninja rule variable command , expanded command ) ; return builder build ( ) ; }


returns an immutable multiset containing the given elements , in order

public static < e > immutable multiset < e > of ( e e 1 , e e 2 ) { return copy from elements ( e 1 , e 2 ) ; }


verifies that the file is a valid snapshot snapshot may be invalid if it ' s incomplete as in a situation when the server dies while in the process of storing a snapshot any files that are improperly formated or corrupted are invalid any file that is not a snapshot is also an invalid snapshot

public static boolean is valid snapshot ( file file ) throws i o exception { if ( file = = null | | util get zxid from name ( file get name ( ) , file snap snapshot file prefix ) = = - 1 ) { return false ; } boolean is valid = false ; switch ( get stream mode ( file get name ( ) ) ) { case gzip : is valid = is valid g zip stream ( file ) ; break ; case snappy : is valid = is valid snappy stream ( file ) ; break ; case checked : default : is valid = is valid checked stream ( file ) ; } return is valid ; }


through { @ link browser error log # get unique id ( ) } hash code

public boolean should sample ( int hash code ) { return hash code % 10000 < sample rate ; }


check if a byte array contains valid utf - 8

public static void validate u t f 8 ( byte [ ] utf 8 ) throws malformed input exception { validate u t f 8 ( utf 8 , 0 , utf 8 length ) ; }


returns an immutable array containing the given values , in order

public static immutable double array of ( double e 0 , double e 1 , double e 2 , double e 3 ) { return new immutable double array ( new double [ ] { e 0 , e 1 , e 2 , e 3 } ) ; }


manually run this to write binary snapshot data

public void write and or subtyp conditions pattern after migration snapshot ( ) throws exception { key selector < event , integer > key selector = new key selector < event , integer > ( ) { private static final long serial version u i d = - 4873366487571254798l ; @ override public integer get key ( event value ) throws exception { return value get id ( ) ; } } ; final event start event 1 = new sub event ( 42 , " start " , 1 0 , 6 0 ) ; one input stream operator test harness < event , map < string , list < event > > > harness = new keyed one input stream operator test harness < > ( get keyed cep opearator ( false , new n f a complex conditions factory ( ) ) , key selector , basic type info int type info ) ; try { harness setup ( ) ; harness open ( ) ; harness process element ( new stream record < > ( start event 1 , 5 ) ) ; harness process watermark ( new watermark ( 6 ) ) ; / / do snapshot and save to file operator subtask state snapshot = harness snapshot ( 0l , 0l ) ; operator snapshot util write state handle ( snapshot , " src / test / resources / cep - migration - conditions - flink " + flink generate savepoint version + " - snapshot " ) ; } finally { harness close ( ) ; } }


sets the amount of delay between each backoff attempt when flushing bulk requests , in milliseconds

public void set bulk flush backoff delay ( long delay millis ) { preconditions check argument ( delay millis > = 0 , " delay ( in milliseconds ) between each backoff attempt must be larger than or equal to 0 " ) ; this bulk requests config put ( config key bulk flush backoff delay , string value of ( delay millis ) ) ; }


only select tasks which are part of a process that has a local string variable which is not the given value , case insensitive this method only works if your database has encodingcollation that supports case - sensitive queries for example , use " collate utf - 8 " on my s q l and for mssql , select one of the case - sensitive collations available ( < a href = " http : msdn microsoft comen - uslibraryms 1 4 4 2 5 0 ( v = sql 105 ) aspx " > msdn server collation reference )

t process variable value equals ignore case ( string name , string value ) ;


public void test increment def ( ) { assert equals ( ( byte ) 0 , exec ( " def x = ( byte ) 0 ; return x + + ; " ) ) ; assert equals ( ( byte ) 0 , exec ( " def x = ( byte ) 0 ; return x - - ; " ) ) ; assert equals ( ( byte ) 1 , exec ( " def x = ( byte ) 0 ; return + + x ; " ) ) ; assert equals ( ( byte ) - 1 , exec ( " def x = ( byte ) 0 ; return - - x ; " ) ) ; assert equals ( ( char ) 0 , exec ( " def x = ( char ) 0 ; return x + + ; " ) ) ; assert equals ( ( char ) 1 , exec ( " def x = ( char ) 1 ; return x - - ; " ) ) ; assert equals ( ( char ) 1 , exec ( " def x = ( char ) 0 ; return + + x ; " ) ) ; assert equals ( ( short ) 0 , exec ( " def x = ( short ) 0 ; return x + + ; " ) ) ; assert equals ( ( short ) 0 , exec ( " def x = ( short ) 0 ; return x - - ; " ) ) ; assert equals ( ( short ) 1 , exec ( " def x = ( short ) 0 ; return + + x ; " ) ) ; assert equals ( ( short ) - 1 , exec ( " def x = ( short ) 0 ; return - - x ; " ) ) ; assert equals ( 0 , exec ( " def x = 0 ; return x + + ; " ) ) ; assert equals ( 0 , exec ( " def x = 0 ; return x - - ; " ) ) ; assert equals ( 1 , exec ( " def x = 0 ; return + + x ; " ) ) ; assert equals ( - 1 , exec ( " def x = 0 ; return - - x ; " ) ) ; assert equals ( 0l , exec ( " def x = 0l ; return x + + ; " ) ) ; assert equals ( 0l , exec ( " def x = 0l ; return x - - ; " ) ) ; assert equals ( 1l , exec ( " def x = 0l ; return + + x ; " ) ) ; assert equals ( - 1l , exec ( " def x = 0l ; return - - x ; " ) ) ; assert equals ( 0f , exec ( " def x = 0f ; return x + + ; " ) ) ; assert equals ( 0f , exec ( " def x = 0f ; return x - - ; " ) ) ; assert equals ( 1f , exec ( " def x = 0f ; return + + x ; " ) ) ; assert equals ( - 1f , exec ( " def x = 0f ; return - - x ; " ) ) ; assert equals ( 0d , exec ( " def x = 0 0 ; return x + + ; " ) ) ; assert equals ( 0d , exec ( " def x = 0 0 ; return x - - ; " ) ) ; assert equals ( 1d , exec ( " def x = 0 0 ; return + + x ; " ) ) ; assert equals ( - 1d , exec ( " def x = 0 0 ; return - - x ; " ) ) ; }


private void move into fragment ( string name , address start , address end , string file name ) { if ( file name ! = null ) { program module module = null ; int index = root module get index ( file name ) ; if ( index = = - 1 ) { try { module = root module create module ( file name ) ; } catch ( duplicate name exception e ) { msg error ( this , " error while moving fragment " + name + " from " + start + " to " + end , e ) ; return ; } } else { group [ ] children = root module get children ( ) ; / / todo add a get child at ( index ) method module = ( program module ) children [ index ] ; } if ( module ! = null ) { try { program fragment frag = null ; index = module get index ( name ) ; if ( index = = - 1 ) { frag = module create fragment ( name ) ; } else { group [ ] children = module get children ( ) ; / / todo add a get child at ( index ) method frag = ( program fragment ) children [ index ] ; } frag move ( start , end ) ; } catch ( not found exception e ) { msg error ( this , " error moving fragment from " + start + " to " + end , e ) ; return ; } catch ( duplicate name exception e ) { / / todo : thrown by create fragment if fragment name exists in any other module } } } }


helper method to implement the tests of consistent list files ( ) the file structure has dir num subdirectories , and each directory ( including the test base directory itself ) has normal file num normal files and delayed file num delayed files

private void do test list files ( s 3 a file system fs , int dir num , int normal file num , int delayed file num , boolean recursive ) throws exception { describe ( " testing dir num = % d , normal file = % d , delayed file = % d , " + " recursive = % s " , dir num , normal file num , delayed file num , recursive ) ; final path base test dir = path ( " do test list files - " + dir num + " - " + normal file num + " - " + delayed file num + " - " + recursive ) ; / / delete the old test path ( if any ) so that when we call mkdirs ( ) later , / / the to delay sub directories will be tracked via put object ( ) request fs delete ( base test dir , true ) ; / / make subdirectories ( if any ) final list < path > test dirs = new array list < > ( dir num + 1 ) ; assert true ( fs mkdirs ( base test dir ) ) ; test dirs add ( base test dir ) ; for ( int i = 0 ; i < dir num ; i + + ) { final path subdir = path ( base test dir + " / dir - " + i ) ; assert true ( fs mkdirs ( subdir ) ) ; test dirs add ( subdir ) ; } final collection < string > file names = new array list < > ( normal file num + delayed file num ) ; int index = 0 ; for ( ; index < normal file num ; index + + ) { file names add ( " file - " + index ) ; } for ( ; index < normal file num + delayed file num ; index + + ) { / / any s3 keys that contain delay key substring will be delayed / / in list objects ( ) results via inconsistent s 3 client file names add ( " file - " + index + " - " + default delay key substring ) ; } int files and empty directories = 0 ; / / create files under each test directory for ( path dir : test dirs ) { for ( string file name : file names ) { write text file ( fs , new path ( dir , file name ) , " i , " + file name , false ) ; files and empty directories + + ; } } / / this should return the union data from s3 and metadata store final remote iterator < located file status > status iterator = fs list files ( base test dir , recursive ) ; final collection < path > listed files = new hash set < > ( ) ; for ( ; status iterator has next ( ) ; ) { final file status status = status iterator next ( ) ; assert true ( " file status " + status + " is not a file ! " , status is file ( ) ) ; listed files add ( status get path ( ) ) ; } log info ( " s 3 a file system : : list files ( ' { } ' , { } ) - > { } " , base test dir , recursive , listed files ) ; / / this should fail without s 3 guard , and succeed with it because part of the / / files to list are delaying visibility if ( ! recursive ) { / / in this case only the top level files are listed verify file is listed ( listed files , base test dir , file names ) ; assert equals ( " unexpected number of files returned by list files ( ) call " , normal file num + delayed file num , listed files size ( ) ) ; } else { for ( path dir : test dirs ) { verify file is listed ( listed files , dir , file names ) ; } assert equals ( " unexpected number of files returned by list files ( ) call " , files and empty directories , listed files size ( ) ) ; } }


initialization method ; override to add initialization for this plugin this is where a plugin should acquire its services when this method is called , all plugins have been instantiated in the tool

protected void init ( ) { / / do nothing by default ; subclasses should override as needed }


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 void test category ( ) { / / todo : test category }


private void cut ( ) { / / revert the " cut " if something is in the temporary clipboard check clipboard ( false ) ; if ( tree get selection count ( ) = = 1 ) { / / cut to clipboard tree path [ ] paths = new tree path [ ] { tree get selection path ( ) } ; set clipboard contents ( g clipboard get system clipboard ( ) , paths ) ; / / put on the temporary clipboard set clipboard contents ( temp clipboard , paths ) ; set nodes deleted ( paths ) ; } else { cut range ( ) ; } }


the floating buffer is recycled to local buffer pool directly , and the exclusive buffer will be gathered to return to global buffer pool later

void release all ( list < memory segment > exclusive segments ) { buffer buffer ; while ( ( buffer = floating buffers poll ( ) ) ! = null ) { buffer recycle buffer ( ) ; } while ( ( buffer = exclusive buffers poll ( ) ) ! = null ) { exclusive segments add ( buffer get memory segment ( ) ) ; } }


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

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


check that at least one shard is on the set of nodes if they are all unallocated , we do not want to make any prediction to not hit the wrong policy

private boolean data stream allocated to nodes ( list < index metadata > indices ) { for ( int i = 0 ; i < indices size ( ) ; + + i ) { index metadata index metadata = indices get ( indices size ( ) - i - 1 ) ; set < boolean > in nodes = state get routing table ( ) all shards ( index metadata get index ( ) get name ( ) ) stream ( ) map ( shard routing : : current node id ) filter ( objects : : non null ) map ( node ids : : contains ) collect ( collectors to set ( ) ) ; if ( in nodes contains ( false ) ) { return false ; } if ( in nodes contains ( true ) ) { return true ; } } return false ; }


returns the number of exceptions that has been visited so far

public int get count ( ) { return count ; }


returns the next value as a stream of utf - 8 bytes and consumes it the following program demonstrates how json bytes are returned from an enclosing stream as their original bytes , including their original whitespace : { @ code string json = " { \ " a \ " : [ 4 , 5 , 6 0 , { \ " x \ " : 7 } , 8 ] , \ " b \ " : 9 } " ; json reader reader = json reader of ( new buffer ( ) write utf 8 ( json ) ) ; reader begin object ( ) ; assert that ( reader next name ( ) ) is equal to ( " a " ) ; try ( buffered source buffered source = reader value source ( ) ) { assert that ( buffered source read utf 8 ( ) ) is equal to ( " [ 4 , 5 , 6 0 , { \ " x \ " : 7 } , 8 ] " ) ; } assert that ( reader next name ( ) ) is equal to ( " b " ) ; assert that ( reader next int ( ) ) is equal to ( 9 ) ; reader end object ( ) ; } this reads an entire value : composite objects like arrays and objects are returned in their entirety the stream starts with the first character of the value ( typically { @ code [ } , < code > { < code > , or { @ code " } ) and ends with the last character of the object ( typically { @ code ] } , < code > } < code > , or { @ code " } ) the returned source may not be used after any other method on this { @ code json reader } is called for example , the following code crashes with an exception : { @ code json reader reader = reader begin array ( ) ; buffered source source = reader value source ( ) ; reader end array ( ) ; source read utf 8 ( ) ; crash ! } the returned bytes are not validated this method assumes the stream is well - formed json and only attempts to find the value ' s boundary in the byte stream it is the caller ' s responsibility to check that the returned byte stream is a valid json value closing the returned source does not close this reader

public abstract buffered source next source ( ) throws i o exception ;


protected void place 0 ( section added to , int offset ) { / / encode the data and note the size try { encoded = encode ( added to get file ( ) , null , null , null , false ) ; set write size ( encoded length ) ; } catch ( runtime exception ex ) { throw exception with context with context ( ex , " while placing debug info for " + ref to human ( ) ) ; } }


hash code for the subclass of { @ link suggestion builder } to implement

protected abstract int do hash code ( ) ;


validate properly formatted distinguished name example : ' cn = doe john , ou = x , ou = y , ou = do d , o = u s government , c = us '

private void validate d n ( string [ ] args , int i ) { if ( args length < ( i + 1 ) ) { display usage ( " invalid usage ! " ) ; system exit ( - 1 ) ; } string dn = args [ i ] ; try { x 5 0 0 principal x 5 0 0 user = new x 5 0 0 principal ( dn ) ; args [ i ] = " \ " " + x 5 0 0 user get name ( ) + " \ " " ; } catch ( exception e ) { msg error ( user admin class , " invalid dn : " + dn ) ; system exit ( - 1 ) ; } }


adds additional columns similar to a sql select statement the field expressions can contain complex expressions , but can not contain aggregations it will throw an exception if the added fields already exist example : { @ code tab add columns ( " a + 1 as a 1 , concat ( b , ' sunny ' ) as b 1 " ) }


public static list < uri > extract uris ( string json , path path ) throws swift operation failed exception { final matcher matcher = uri pattern matcher ( json ) ; final list < uri > result = new array list < uri > ( ) ; while ( matcher find ( ) ) { final string s = matcher group ( ) ; final string uri = s substring ( 1 , s length ( ) - 1 ) ; try { uri created uri = uri create ( uri ) ; result add ( created uri ) ; } catch ( illegal argument exception e ) { / / failure to create the uri , which means this is bad json convert / / to an exception with useful text throw new swift operation failed exception ( string format ( " could not convert \ " % s \ " into a uri " + " source : % s " + " first json : % s " , uri , path , json substring ( 0 , 256 ) ) ) ; } } return result ; }


sets the four columns of the matrix which correspond to the x - , y - and z - axis of the vector space this matrix creates as well as the 4th column representing the translation of any point that is multiplied by this matrix

public matrix 4 set ( vector 3 x axis , vector 3 y axis , vector 3 z axis , vector 3 pos ) { val [ m00 ] = x axis x ; val [ m01 ] = x axis y ; val [ m02 ] = x axis z ; val [ m10 ] = y axis x ; val [ m11 ] = y axis y ; val [ m12 ] = y axis z ; val [ m20 ] = z axis x ; val [ m21 ] = z axis y ; val [ m22 ] = z axis z ; val [ m03 ] = pos x ; val [ m13 ] = pos y ; val [ m23 ] = pos z ; val [ m30 ] = 0f ; val [ m31 ] = 0f ; val [ m32 ] = 0f ; val [ m33 ] = 1f ; return this ; }


public static string sha 5 1 2 ( final string data ) { return digest ( message digest algorithms sha 512 , data get bytes ( standard charsets utf 8 ) ) ; }


reallocates the underlying array if necessary calls to this method should be guarded by a test of { @ link # stretchy }

private void ensure capacity ( int desired size ) { if ( data length < desired size ) { byte [ ] new data = new byte [ desired size * 2 + 1000 ] ; system arraycopy ( data , 0 , new data , 0 , cursor ) ; data = new data ; } }


add a source jar in the transitive closure , that can be reached by a chain of java source jars provider instances

public builder add transitive source jar ( artifact transitive source jar ) { transitive source jars add ( preconditions check not null ( transitive source jar ) ) ; return this ; }


creates a domain entity key with column name suffix , of the form token master key entry prefix + sequence number

private static byte [ ] create token master key entry key ( int key id ) throws i o exception { return key builder new instance ( ) add ( token master key entry prefix ) add ( integer to string ( key id ) ) get bytes ( ) ; }


required if mode is ` mutual ` the path to a file containing certificate authority certificates to use in verifying a presented client side certificate < code > string ca certificates = 5 ; < code >

public java lang string get ca certificates ( ) { java lang object ref = ca certificates ; if ( ! ( ref instanceof java lang string ) ) { com google protobuf byte string bs = ( com google protobuf byte string ) ref ; java lang string s = bs to string utf 8 ( ) ; ca certificates = s ; return s ; } else { return ( java lang string ) ref ; } }


exit a parse tree produced by the { @ code show tables } labeled alternative in { @ link sql base parser # statement }

void exit show tables ( sql base parser show tables context ctx ) ;


this method is executed once per superstep after the scatter function has been invoked for each vertex

public void post superstep ( ) throws exception { }