adds the specified data element to the beginning of the skip list , if the element is not already present

public void add first ( directory diff diff ) { final int node level = directory diff list factory random level ( ) ; final skip list node [ ] node path = new skip list node [ node level + 1 ] ; arrays fill ( node path , head ) ; final skip list node new node = new skip list node ( diff , node level ) ; for ( int level = 0 ; level < = node level ; level + + ) { if ( level > 0 ) { / / case : s0 is added at the beginning and it has 3 levels / / suppose the list is like : / / level 1 : head - - - - - - - - - - - - - - - - - - - > s 5 - - - - - - - - - - - - - > null / / level 0 : head - > s 1 - > s 2 - > s 3 - > s 4 - > s 5 - > s 6 - > s 7 - > s 8 - > s 9 / / in this case : / / level 2 : head - > s 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > null / / level 1 : head - > s 0 ' - - - - - - - - - - - - - - - - > s 5 - - - - - - - - - - - - - > null / / level 0 : head - > s 0 - > s 1 - > s 2 - > s 3 - > s 4 - > s 5 - > s 6 - > s 7 - > s 8 - > s 9 / / at level 1 , we need to combine s 0 , s 1 , s 2 , s 3 , s 4 and s 5 and store / / as s 0 ' at level 2 , s 0 of next is pointing to null ; / / note : in this case , the diff of element being added is included / / while combining the diffs final skip list node next node = head get skip node ( level ) ; if ( next node ! = null ) { children diff combined = combine diff ( new node , next node , level ) ; if ( combined ! = null ) { new node set skip diff ( combined , level ) ; } } } / / insert to the linked list new node set skip to ( node path [ level ] get skip node ( level ) , level ) ; node path [ level ] set skip to ( new node , level ) ; } skip node list add ( 0 , new node ) ; }


creates a change of type insert range as a result of this change {

static change insert range ( int index , int count , list < render info > render infos , @ nullable list < ? > next data ) { return acquire ranged change ( insert range , index , count , render infos , null , next data ) ; }


tests that subscribed partitions are the same when there ' s no change on the intial topics ( filter restored partitions with discovered is disabled )

public void test disable filter restored paritions no change ( ) throws exception { check filter restored partitions with disovered ( arrays as list ( new string [ ] { " kafka topic 1 " , " kafka topic 2 " } ) , arrays as list ( new string [ ] { " kafka topic 1 " , " kafka topic 2 " } ) , arrays as list ( new string [ ] { " kafka topic 1 " , " kafka topic 2 " } ) , true ) ; }


create new { @ code ssl context } instance with configured settings if { @ link # ssl provider ( ssl provider ) } is set to { @ link ssl provider # openssl refcnt } then the caller is responsible for releasing this object , or else native memory may leak

public ssl context build ( ) throws s s l exception { if ( for server ) { return ssl context new server context internal ( provider , ssl context provider , trust cert collection , trust manager factory , key cert chain , key , key password , key manager factory , ciphers , cipher filter , apn , session cache size , session timeout , client auth , protocols , start tls , enable ocsp , key store type ) ; } else { return ssl context new client context internal ( provider , ssl context provider , trust cert collection , trust manager factory , key cert chain , key , key password , key manager factory , ciphers , cipher filter , apn , protocols , session cache size , session timeout , enable ocsp , key store type ) ; } }


force the app to behave as if it is in a country where signal is censored

public synchronized boolean forced censorship ( ) { return feature flags internal user ( ) & & get boolean ( force censorship , false ) ; }


fills ' dst ' with bytes from ' in ' , throwing e o f exception if insufficient bytes are available

public static void read fully ( input stream in , byte [ ] dst ) throws i o exception { read fully ( in , dst , 0 , dst length ) ; }


this supplier is used for all fields that expect to be aggregated as a numeric value this includes floating points , and formatted types that use numerics internally for storage ( date , boolean , etc )

private static terms aggregator supplier numeric supplier ( ) { return new terms aggregator supplier ( ) { @ override public aggregator build ( string name , aggregator factories factories , values source values source , bucket order order , doc value format format , terms aggregator bucket count thresholds bucket count thresholds , include exclude include exclude , string execution hint , aggregation context context , aggregator parent , sub agg collection mode sub agg collect mode , boolean show term doc count error , cardinality upper bound cardinality , map < string , object > metadata ) throws i o exception { if ( ( include exclude ! = null ) & & ( include exclude is regex based ( ) ) ) { throw new aggregation execution exception ( " aggregation [ " + name + " ] cannot support regular expression style " + " include / exclude settings as they can only be applied to string fields use an array of numeric values for " + " include / exclude clauses used to filter numeric fields " ) ; } if ( sub agg collect mode = = null ) { sub agg collect mode = pick sub agg colect mode ( factories , bucket count thresholds get shard size ( ) , - 1 ) ; } values source numeric numeric values source = ( values source numeric ) values source ; include exclude long filter long filter = null ; function < numeric terms aggregator , result strategy < ? , ? > > result strategy ; if ( numeric values source is floating point ( ) ) { if ( include exclude ! = null ) { long filter = include exclude convert to double filter ( ) ; } result strategy = agg - > agg new double terms results ( show term doc count error ) ; } else { if ( include exclude ! = null ) { long filter = include exclude convert to long filter ( format ) ; } result strategy = agg - > agg new long terms results ( show term doc count error ) ; } return new numeric terms aggregator ( name , factories , result strategy , numeric values source , format , order , bucket count thresholds , context , parent , sub agg collect mode , long filter , cardinality , metadata ) ; } } ; }


adds the container localizer arguments for a @ { link shell command executor } , as expected by container localizer main

public static void build main args ( list < string > command , string user , string app id , string loc id , inet socket address nm addr , string token file name , list < string > local dirs , configuration conf ) { string log level = conf get ( yarn configuration nm container localizer log level , yarn configuration nm container localizer log level default ) ; add log 4j system properties ( log level , command ) ; command add ( container localizer class get name ( ) ) ; command add ( user ) ; command add ( app id ) ; command add ( loc id ) ; command add ( nm addr get host name ( ) ) ; command add ( integer to string ( nm addr get port ( ) ) ) ; command add ( token file name ) ; for ( string dir : local dirs ) { command add ( dir ) ; } }


sets the space between the form and the actual labeltext , converts to dp internally

public void set form to text space ( float space ) { this m form to text space = space ; }


should only be set by { @ link org thoughtcrime securesms pin pin state }

public synchronized void set kbs master key ( @ non null kbs pin data pin data , @ non null string pin ) { master key master key = pin data get master key ( ) ; string token response ; try { token response = json utils to json ( pin data get token response ( ) ) ; } catch ( i o exception e ) { throw new assertion error ( e ) ; } get store ( ) begin write ( ) put string ( token response , token response ) put blob ( master key , master key serialize ( ) ) put string ( lock local pin hash , pin hashing local pin hash ( pin ) ) put string ( pin , pin ) put long ( last create failed timestamp , - 1 ) put boolean ( opted out , false ) commit ( ) ; }


verify get at most when sync generation policy = all

public void testget at most policy a l l ( ) throws exception { mock filler filler = new mock filler ( ) ; final value queue < string > vq = new value queue < string > ( 10 , 0 1f , 30000 , 1 , sync generation policy all , filler ) ; / / trigger a prefill ( 1 ) and an async refill ( 10 ) assert assert equals ( " test " , vq get next ( " k 1 " ) ) ; assert assert equals ( 1 , filler get top ( ) num ) ; / / wait for the async task to finish wait for refill ( vq , " k 1 " , 10 ) ; / / refill task should add 10 values to get to a full queue ( 1 produced by / / the prefill to the low watermark , 1 consumed by get next ( ) ) assert assert equals ( 10 , filler get top ( ) num ) ; / / drain completely , no further refills triggered vq drain ( " k 1 " ) ; / / wait a while to make sure that no async refills are triggered try { wait for refill ( vq , " k 1 " , 10 ) ; } catch ( timeout exception ignored ) { / / this is the correct outcome - no refill is expected } assert assert null ( filler get top ( ) ) ; / / synchronous call : / / 1 synchronously fill returned list / / 2 start another async task to fill the queue in the cache assert assert equals ( " failed in sync call " , 10 , vq get at most ( " k 1 " , 10 ) size ( ) ) ; assert assert equals ( " sync call filler got wrong number " , 10 , filler get top ( ) num ) ; / / wait for the async task to finish wait for refill ( vq , " k 1 " , 10 ) ; / / refill task should add 10 values to get to a full queue assert assert equals ( " failed in async call " , 10 , filler get top ( ) num ) ; / / drain completely after filled by the async thread vq drain ( " k 1 " ) ; assert assert equals ( " failed to drain completely after async " , 0 , vq get size ( " k 1 " ) ) ; / / synchronous call assert assert equals ( " failed to get all 19 " , 19 , vq get at most ( " k 1 " , 19 ) size ( ) ) ; assert assert equals ( " failed in sync call " , 19 , filler get top ( ) num ) ; vq shutdown ( ) ; }


initiate the flushing of data from the accumulator this makes all requests immediately ready

public void begin flush ( ) { this flushes in progress get and increment ( ) ; }


protected abstract t random instance ( ) ;


return the target connection factory that this connection factory delegates to

public connection factory get target connection factory ( ) { return this target connection factory ; }


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


public counter counter ( string name ) { return noop counter instance ; }


returns true if this data directory is contained inside of a section if true , that means that the section is loaded into memory at runtime

boolean is contained in section ( ) { return rva to pointer ( ) ! = get virtual address ( ) ; }


private synchronized node and client build node ( int node id , settings settings , boolean reuse existing , runnable on transport service started ) { assert thread holds lock ( this ) ; ensure open ( ) ; collection < class < ? extends plugin > > plugins = get plugins ( ) ; string name = settings get ( " node name " ) ; final node and client node and client = nodes get ( name ) ; if ( reuse existing & & node and client ! = null ) { on transport service started run ( ) ; / / reusing an existing node implies its transport service already started return node and client ; } assert reuse existing | | node and client = = null : " node name [ " + name + " ] already exists but not allowed to use it " ; secure settings secure settings = settings builder ( ) put ( settings ) get secure settings ( ) ; if ( secure settings instanceof mock secure settings ) { / / we clone this here since in the case of a node restart we might need it again secure settings = ( ( mock secure settings ) secure settings ) clone ( ) ; } mock node node = new mock node ( settings , plugins , node configuration source node config path ( node id ) , forbid private index settings ) ; node injector ( ) get instance ( transport service class ) add lifecycle listener ( new lifecycle listener ( ) { @ override public void after start ( ) { on transport service started run ( ) ; } } ) ; try { i o utils close ( secure settings ) ; } catch ( i o exception e ) { throw new unchecked i o exception ( e ) ; } return new node and client ( name , node , settings , node id ) ; }


this method serves to force sub classes to " hide " this static factory

public static managed channel builder < ? > for target ( string target ) { throw new unsupported operation exception ( " subclass failed to hide static factory " ) ; }


sets that this compile should validate inclusions against the dotd file

public builder should validate inclusions ( ) { this should validate inclusions = true ; return this ; }


public string get object type ( ) { return object type ; }


returns true if this contains an entry matching the given key an acl entry ' s key consists of scope , type and name ( but not permission )

public boolean contains key ( acl entry key ) { return collections binary search ( acl spec , key , acl entry comparator ) > = 0 ; }


public void set clob ( int parameter index , reader reader ) throws s q l exception { }


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


public void trace ( locator locator , string trace message , throwable throwable if available ) ;


an integer specifying the number of the section that this symbol can be found in , or no sect if symbol is not found in a section of this image

public byte get section ( ) { return n sect ; }


public void set heuristic cpu cost ( double cost ) { if ( cost < = 0 ) { throw new illegal argument exception ( " heuristic costs must be positive " ) ; } this heuristic cpu cost = cost ; }


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


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


if set , this node is a chunk of text < code > optional string text = 2 ; < code >

private void clear text ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 2 ) ; text = get default instance ( ) get text ( ) ; }


set the java mail { @ code session } , possibly pulled from jndi default is a new { @ code session } without defaults , that is completely configured via this instance ' s properties if using a pre - configured { @ code session } , non - default properties in this instance will override the settings in the { @ code session }

public synchronized void set session ( session session ) { assert not null ( session , " session must not be null " ) ; this session = session ; }


for shards and delta select id from ` shards ` table for both shard and delta shards - purpose : 1 check the count as pre - check to avoid conflict 2 get statistics 3 use id to perform delete insert into deleted shards delete from ` shards node ` table ( won ' t verify delete count : none - bucketed ) for both shards and delta shards delete from ` shards ` table verify delete count for both shards and delta shards delete from index table verify delete count only for shards

private shard stats delete shards and index simple ( long table id , set < uuid > shard uuids , handle handle , boolean is delta ) throws s q l exception { if ( shard uuids is empty ( ) ) { return new shard stats ( 0 , 0 , 0 ) ; } long row count = 0 ; long compressed size = 0 ; long uncompressed size = 0 ; / / for batch execution for ( list < uuid > uuids : partition ( shard uuids , 1000 ) ) { string args = joiner on ( " , " ) join ( n copies ( uuids size ( ) , " ? " ) ) ; immutable set builder < long > shard id set = immutable set builder ( ) ; string select shards = format ( " " + " select shard id , row count , compressed size , uncompressed size \ n " + " from shards \ n " + " where shard uuid in ( % s ) " , args ) ; try ( prepared statement statement = handle get connection ( ) prepare statement ( select shards ) ) { bind uuids ( statement , uuids ) ; try ( result set rs = statement execute query ( ) ) { while ( rs next ( ) ) { shard id set add ( rs get long ( " shard id " ) ) ; row count + = rs get long ( " row count " ) ; compressed size + = rs get long ( " compressed size " ) ; uncompressed size + = rs get long ( " uncompressed size " ) ; } } } set < long > shard ids = shard id set build ( ) ; if ( shard ids size ( ) ! = uuids size ( ) ) { throw transaction conflict ( ) ; } / / for background cleaner shard dao dao = shard dao supplier attach ( handle ) ; dao insert deleted shards ( uuids ) ; string where = " where shard id in ( " + args + " ) " ; string delete from shard nodes = " delete from shard nodes " + where ; string delete from shards = " delete from shards " + where ; string delete from shard index = " delete from " + shard index table ( table id ) + where ; try ( prepared statement statement = handle get connection ( ) prepare statement ( delete from shard nodes ) ) { bind longs ( statement , shard ids ) ; statement execute update ( ) ; } for ( string sql : is delta ? immutable list of ( delete from shards ) : as list ( delete from shards , delete from shard index ) ) { try ( prepared statement statement = handle get connection ( ) prepare statement ( sql ) ) { bind longs ( statement , shard ids ) ; if ( statement execute update ( ) ! = shard ids size ( ) ) { throw transaction conflict ( ) ; } } } } return new shard stats ( row count , compressed size , uncompressed size ) ; }


public void array of string test ( ) { / / todo : test array of string }


the optinal style from which this style inherits attributes < code > optional aapt pb reference parent = 1 ; < code >

public builder set parent ( com android aapt resources reference builder builder for value ) { copy on write ( ) ; instance set parent ( builder for value ) ; return this ; }


public static void put ( @ non null final string key , final j s o n object value , final int save time , @ non null final cache double utils cache double utils ) { cache double utils put ( key , value , save time ) ; }


returns a java util set containing the edges in this graph

public set < edge > get edges ( ) { return this edges ( ) to set ( ) ; }


return the headers as an { @ link http headers } instance


returns the list of mandatory inputs for the { @ link cpp compile action } as configured

nested set < artifact > build mandatory inputs ( ) { nested set builder < artifact > real mandatory inputs builder = nested set builder compile order ( ) ; real mandatory inputs builder add transitive ( mandatory inputs builder build ( ) ) ; real mandatory inputs builder add all ( get builtin include files ( ) ) ; if ( use header modules ( ) & & ! should scan includes ) { real mandatory inputs builder add transitive ( cc compilation context get transitive modules ( use pic ) ) ; } cc compilation context add additional inputs ( real mandatory inputs builder ) ; real mandatory inputs builder add ( preconditions check not null ( source file ) ) ; if ( grep includes ! = null ) { real mandatory inputs builder add ( grep includes ) ; } if ( ! should scan includes & & dotd file = = null ) { real mandatory inputs builder add transitive ( cc compilation context get declared include srcs ( ) ) ; real mandatory inputs builder add all ( additional prunable headers ) ; } return real mandatory inputs builder build ( ) ; }


public int get min session timeout ( ) { return min session timeout ; }


set this to true to enable zooming in by double - tap on the chart default : enabled

public void set double tap to zoom enabled ( boolean enabled ) { m double tap to zoom enabled = enabled ; }


report an error with the given message for the given source element

protected void error ( string message , node source ) { this reader context error ( message , source , this parse state snapshot ( ) ) ; }


refresh the list of scripts by listing files in each script directory note : this method must not be used off the swing event thread

private void do refresh ( ) { has been refreshed = true ; tree path pre refresh selection path = script category tree get selection path ( ) ; update available script files for all paths ( ) ; trim unused tree categories ( ) ; script root fire node structure changed ( script root ) ; if ( pre refresh selection path ! = null ) { script category tree set selection path ( pre refresh selection path ) ; } }


returns an augmented version of { @ code e get owners ( ) } ' s { @ link action input dep owners } , adding ownership information from { @ code input deps } this compensates for how the ownership information in { @ code e get owners ( ) } is potentially incomplete e g , it may lack knowledge of a runfiles middleman owning a fileset , even if it knows that fileset owns a lost input

private action input dep owners create augmented input dep owners ( lost inputs action execution exception e , action action , environment env , list < value or exception 3 < i o exception , action execution exception , artifact nested set eval exception > > input deps , nested set < artifact > all inputs , iterable < sky key > requested sky keys ) throws interrupted exception { set < action input > lost inputs and owners so far = new hash set < > ( ) ; action input dep owners owners = e get owners ( ) ; for ( action input lost input : e get lost inputs ( ) values ( ) ) { lost inputs and owners so far add ( lost input ) ; lost inputs and owners so far add all ( owners get dep owners ( lost input ) ) ; } action input dep owner map input dep owners ; try { input dep owners = get input dep owners ( env , action , input deps , all inputs , action discovers inputs ( ) ? action get mandatory inputs ( ) to set ( ) : null , requested sky keys , lost inputs and owners so far ) ; } catch ( action execution exception unexpected ) { / / get input dep owners should not be able to throw , because it does the same work as / / check inputs , so if get input dep owners throws then check inputs should have thrown , and if / / check inputs threw then we shouldn ' t have reached this point in action execution throw new illegal state exception ( unexpected ) ; } / / ownership information from input deps may be incomplete notably , it does not expand / / filesets fileset and other ownership relationships should have been captured in the / / exception ' s action input dep owners , and this copies that knowledge into the augmented version for ( action input lost input : e get lost inputs ( ) values ( ) ) { for ( artifact dep owner : owners get dep owners ( lost input ) ) { input dep owners add owner ( lost input , dep owner ) ; } } return input dep owners ; }


returns a request builder to load the given { @ link uri } note - this method caches data at uris using only the uri itself as the cache key the data represented by uris from some content providers may change without the uri changing , which means using this method can lead to displaying stale data consider using { @ link com bumptech glide request request options # signature ( com bumptech glide load key ) } to mixin a signature you create based on the data at the given uri that will invalidate the cache if that data changes alternatively , using { @ link com bumptech glide load engine disk cache strategy # none } andor { @ link com bumptech glide request request options # skip memory cache ( boolean ) } may be appropriate

public request builder < transcode type > load ( @ nullable uri uri ) { return load generic ( uri ) ; }


this test checks , that for an unregistered { @ link incremental remote keyed state handle } all state ( including shared ) is discarded

public void test unregistered discarding ( ) throws exception { incremental remote keyed state handle state handle = create ( new random ( 42 ) ) ; state handle discard state ( ) ; for ( stream state handle handle : state handle get private state ( ) values ( ) ) { verify ( handle ) discard state ( ) ; } for ( stream state handle handle : state handle get shared state ( ) values ( ) ) { verify ( handle ) discard state ( ) ; } verify ( state handle get meta state handle ( ) ) discard state ( ) ; }


retrieve the given message source resolvable in the current theme note that theme messages are never html - escaped , as they typically denote theme - specific resource paths and not client - visible messages

public string get theme message ( message source resolvable resolvable ) throws no such message exception { return get theme ( ) get message source ( ) get message ( resolvable , get locale ( ) ) ; }


assert that a given statistic has an expected value

private static < e > e verify statistic value ( final string type , final string key , final map < string , e > map , final e value ) { final e statistic = lookup statistic ( type , key , map ) ; assert that ( statistic ) described as ( " % s named % s with expected value % s " , type , key , value ) is equal to ( value ) ; return statistic ; }


configures the { @ code s s l connection socket factory } used by the aws sdk a custom socket factory can be set using the method { @ code set ssl socket factory ( ) } if { @ code s s l connection socket factory } cannot be found on the classpath , the value of { @ link org apache hadoop fs s 3a constants # ssl channel mode } is ignored

public static void bind s s l channel mode ( configuration conf , client configuration aws conf ) throws i o exception { / / validate that ssl channel mode is set to a valid value string channel mode string = conf get trimmed ( ssl channel mode , default ssl channel mode name ( ) ) ; delegating s s l socket factory s s l channel mode channel mode = null ; for ( delegating s s l socket factory s s l channel mode mode : delegating s s l socket factory s s l channel mode values ( ) ) { if ( mode name ( ) equals ignore case ( channel mode string ) ) { channel mode = mode ; } } if ( channel mode = = null ) { throw new illegal argument exception ( channel mode string + " is not a valid value for " + ssl channel mode ) ; } delegating s s l socket factory initialize default factory ( channel mode ) ; try { / / look for aws socket factory classname on the classpath and instantiate / / an instance using the delegating s s l socket factory as the / / s s l socket factory class < ? > ssl connection socket factory = class for name ( aws socket factory classname ) ; constructor < ? > factory constructor = ssl connection socket factory get declared constructor ( s s l socket factory class , hostname verifier class ) ; aws conf get apache http client config ( ) set ssl socket factory ( ( com amazonaws thirdparty apache http conn ssl s s l connection socket factory ) factory constructor new instance ( delegating s s l socket factory get default factory ( ) , ( hostname verifier ) null ) ) ; } catch ( class not found exception | no such method exception | illegal access exception | instantiation exception | invocation target exception | linkage error e ) { log debug ( " unable to create class { } , value of { } will be ignored " , aws socket factory classname , ssl channel mode , e ) ; } }


obtain state whether user decide to use selected media in original

public static boolean obtain original state ( intent data ) { return data get boolean extra ( matisse activity extra result original enable , false ) ; }


creates a { @ link pattern stream } from an input data stream and a pattern

public static < t > pattern stream < t > pattern ( data stream < t > input , pattern < t , ? > pattern , event comparator < t > comparator ) { final pattern stream < t > stream = new pattern stream < > ( input , pattern ) ; return stream with comparator ( comparator ) ; }


retrieve a user by its id , and create a new one if requested

private static @ nullable user get or create by id ( @ non null string id , @ non null string full name , boolean create ) { user u = all users get ( id ) ; if ( u = = null & & ( create | | user id mapper get instance ( ) is mapped ( id ) ) ) { u = new user ( id , full name ) ; all users put ( id , u ) ; if ( ! id equals ( full name ) & & ! user id mapper get instance ( ) is mapped ( id ) ) { try { u save ( ) ; } catch ( i o exception x ) { logger log ( level warning , " failed to save user configuration for " + id , x ) ; } } } return u ; }


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


public container state ( container state state ) { this state = state ; return this ; }


returns a new object with rotated image data by 45 degrees counterclockwise only callable if { @ link # is rotate supported ( ) } is true

public binary bitmap rotate counter clockwise 4 5 ( ) { luminance source new source = binarizer get luminance source ( ) rotate counter clockwise 4 5 ( ) ; return new binary bitmap ( binarizer create binarizer ( new source ) ) ; }


tests that multiple concurrent run as requests can be authenticated successfully there was a bug in the cache implementation used for our internal realms that caused some run as requests to fail even when the authentication was valid and the run as user existed the issue was that when iterating the realms there would be failed lookups and under heavy concurrency , requests will wait for an existing load attempt in the cache the original caller was thrown an execution exception with a nested null pointer exception since the loader returned a null value , while the other caller ( s ) would get a null value unexpectedly

public void test concurrent run as ( ) throws exception { prepare put user ( " joe " , " s 3krit - password " , hasher , security settings source test role ) get ( ) ; prepare put user ( " executor " , " s 3krit - password " , hasher , " superuser " ) get ( ) ; final string token = basic auth header value ( " executor " , new secure string ( " s 3krit - password " ) ) ; final client client = client ( ) filter with header ( map of ( " authorization " , token , " es - security - runas - user " , " joe " ) ) ; final count down latch latch = new count down latch ( 1 ) ; final int number of processors = runtime get runtime ( ) available processors ( ) ; final int number of threads = scaled random int between ( number of processors , number of processors * 3 ) ; final int number of iterations = scaled random int between ( 20 , 100 ) ; list < thread > threads = new array list < > ( ) ; for ( int i = 0 ; i < number of threads ; i + + ) { threads add ( new thread ( ( ) - > { try { latch await ( ) ; for ( int j = 0 ; j < number of iterations ; j + + ) { cluster health response response = client admin ( ) cluster ( ) prepare health ( ) get ( ) ; assert no timeout ( response ) ; } } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; } } ) ) ; } for ( thread thread : threads ) { thread start ( ) ; } latch count down ( ) ; for ( thread thread : threads ) { thread join ( ) ; } }


public long get start time ( ) { return start time ; }


public void test configuration block ( ) throws exception { app context ctx = mock ( app context class ) ; job job = mock ( job class ) ; path path = new path ( " conf " ) ; configuration configuration = new configuration ( ) ; configuration set ( " key for test " , " value for test " ) ; final string redacted prop = " key for redaction " ; configuration set ( m r job config mr job redacted properties , redacted prop ) ; when ( job get conf file ( ) ) then return ( path ) ; when ( job load conf file ( ) ) then return ( configuration ) ; when ( ctx get job ( any ( job id class ) ) ) then return ( job ) ; conf block for test configuration block = new conf block for test ( ctx ) ; print writer p writer = new print writer ( data ) ; block html = new block for test ( new html block for test ( ) , p writer , 0 , false ) ; configuration block render ( html ) ; p writer flush ( ) ; assert true ( data to string ( ) contains ( " sorry , can ' t do anything without a job i d " ) ) ; configuration block add parameter ( a m params job id , " job 01 01 " ) ; data reset ( ) ; configuration block render ( html ) ; p writer flush ( ) ; assert true ( data to string ( ) contains ( " key for test " ) ) ; assert true ( data to string ( ) contains ( " value for test " ) ) ; assert true ( data to string ( ) contains ( redacted prop ) ) ; assert true ( data to string ( ) contains ( m r job conf util redaction replacement val ) ) ; }


create the aggregated log suffix the log aggregation file controller should call this to get the suffix and append the suffix to the end of each log this would keep the aggregated log format consistent

protected string aggregated log suffix ( string file name ) { string builder sb = new string builder ( ) ; string end of file = " end of log type : " + file name ; sb append ( " \ n " + end of file + " \ n " ) append ( string utils repeat ( " * " , end of file length ( ) + 50 ) + " \ n \ n " ) ; return sb to string ( ) ; }


this implementation compares the underlying class path locations

public boolean equals ( @ nullable object other ) { if ( this = = other ) { return true ; } if ( ! ( other instanceof class path resource ) ) { return false ; } class path resource other res = ( class path resource ) other ; return ( this path equals ( other res path ) & & object utils null safe equals ( this class loader , other res class loader ) & & object utils null safe equals ( this clazz , other res clazz ) ) ; }


return the namenode address that will be used by clients to access this namenode or name service this needs to be called before the config is overriden this method behaves as follows : 1 fs default f s is undefined : - return null 2 fs default f s is defined but has no hostname ( logical or physical ) : - return null 3 single nn ( no ha , no federation ) : - return uri authority from fs default f s 4 current nn is in an ha nameservice ( with or without federation ) : - return nameservice for current nn 5 current nn is in non - ha namespace , federated cluster : - return value of dfs namenode rpc - address [ ns id ] [ nn id ] - if the above key is not defined , then return authority from fs default f s if the port number is > 0 6 if port number in the authority is missing or zero in step 6 : - return null

static string get client namenode address ( configuration conf , @ nullable string ns id ) { final collection < string > nameservices = d f s util client get name service ids ( conf ) ; final string nn addr = conf get trimmed ( fs default name key ) ; if ( nn addr = = null ) { / / default fs is not set return null ; } log info ( " { } is { } " , fs default name key , nn addr ) ; final uri nn uri = uri create ( nn addr ) ; string default nn host = nn uri get host ( ) ; if ( default nn host = = null ) { return null ; } / / current nameservice is ha if ( ns id ! = null & & nameservices contains ( ns id ) ) { final collection < string > namenodes = conf get trimmed string collection ( dfs ha namenodes key prefix + " " + ns id ) ; if ( namenodes size ( ) > 1 ) { return ns id ; } } / / federation without ha we must handle the case when the current nn / / is not in the default nameservice string current nn address = null ; if ( ns id ! = null ) { string host name key = dfs namenode rpc address key + " " + ns id ; current nn address = conf get ( host name key ) ; } / / fallback to the address in fs default f s if ( current nn address = = null ) { current nn address = nn uri get authority ( ) ; } int port = 0 ; if ( current nn address contains ( " : " ) ) { port = integer parse int ( current nn address split ( " : " ) [ 1 ] ) ; } if ( port > 0 ) { return current nn address ; } else { / / the port is missing or 0 figure out real bind address later return null ; } }


demote old evictable mmaps into the regular eviction map you must hold the cache lock while calling this function

private int demote old evictable mmaped ( long now ) { int num demoted = 0 ; boolean need more space = false ; long eviction time ns ; while ( ! evictable mmapped is empty ( ) ) { object eldest key = evictable mmapped first key ( ) ; eviction time ns = ( long ) eldest key ; long eviction time ms = time unit milliseconds convert ( eviction time ns , time unit nanoseconds ) ; if ( eviction time ms + max evictable mmaped lifespan ms > = now ) { if ( evictable mmapped size ( ) < max evictable mmaped size ) { break ; } need more space = true ; } short circuit replica replica = ( short circuit replica ) evictable mmapped get ( eldest key ) ; if ( log is trace enabled ( ) ) { string rationale = need more space ? " because we need more space " : " because it ' s too old " ; log trace ( " demote old evictable : demoting " + replica + " : " + rationale + " : " + string utils get stack trace ( thread current thread ( ) ) ) ; } remove evictable ( replica , evictable mmapped ) ; munmap ( replica ) ; insert evictable ( eviction time ns , replica , evictable ) ; num demoted + + ; } return num demoted ; }


converts the object from json representation to the specified j d b c type

static object convert ( object v , es type column type , string type string ) throws s q l exception { switch ( column type ) { case null : return null ; case boolean : case text : case keyword : return v ; / / these types are already represented correctly in json case byte : return ( ( number ) v ) byte value ( ) ; / / parser might return it as integer or long - need to update to the correct type case short : return ( ( number ) v ) short value ( ) ; / / parser might return it as integer or long - need to update to the correct type case integer : return ( ( number ) v ) int value ( ) ; case long : return ( ( number ) v ) long value ( ) ; case half float : case scaled float : case double : return double value ( v ) ; / / double might be represented as string for infinity and na n values case float : return float value ( v ) ; / / float might be represented as string for infinity and na n values case date : return as date time field ( v , jdbc date utils : : as date , date : : new ) ; case time : return time as time ( v to string ( ) ) ; case datetime : return as date time field ( v , jdbc date utils : : as timestamp , timestamp : : new ) ; case interval year : case interval month : case interval year to month : return period parse ( v to string ( ) ) ; case interval day : case interval hour : case interval minute : case interval second : case interval day to hour : case interval day to minute : case interval day to second : case interval hour to minute : case interval hour to second : case interval minute to second : return duration parse ( v to string ( ) ) ; case geo point : case geo shape : case shape : try { return wkt from w k t ( v to string ( ) ) ; } catch ( i o exception | parse exception ex ) { throw new s q l exception ( " cannot parse geo shape " , ex ) ; } case ip : return v to string ( ) ; default : throw new s q l exception ( " unexpected column type [ " + type string + " ] " ) ; } }


performs this operation on the given arguments


returns true iff the file represented by the path is executable

protected abstract boolean is executable ( path path ) throws i o exception ;


protected b validate headers ( boolean validate headers ) { enforce non codec constraints ( " validate headers " ) ; this validate headers = validate headers ; return self ( ) ; }


mirror the bit matrix in order to attempt a second reading

void mirror ( ) { for ( int x = 0 ; x < bit matrix get width ( ) ; x + + ) { for ( int y = x + 1 ; y < bit matrix get height ( ) ; y + + ) { if ( bit matrix get ( x , y ) ! = bit matrix get ( y , x ) ) { bit matrix flip ( y , x ) ; bit matrix flip ( x , y ) ; } } } }


construct a new u r l connection factory based on the configuration it will hornor connec timeout and read timeout when they are specified

public static u r l connection factory new default u r l connection factory ( int connect timeout , int read timeout , configuration conf ) { connection configurator conn = get s s l connection configuration ( connect timeout , read timeout , conf ) ; return new u r l connection factory ( conn ) ; }


adds an entry to the data set at the specified index entries are added to the end of the list

public void add entry ( entry e , int data set index ) { if ( m data sets size ( ) > data set index & & data set index > = 0 ) { i data set set = m data sets get ( data set index ) ; / / add the entry to the dataset if ( ! set add entry ( e ) ) return ; calc min max ( e , set get axis dependency ( ) ) ; } else { log e ( " add entry " , " cannot add entry because data set index too high or too low " ) ; } }


returns whether the shared slot has no assigned logical slot requests

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


return whether the file for this property file exists

public boolean exists ( ) { return property file exists ( ) ; }


set the persistence unit manager to use for obtaining the jpa persistence unit that this factory bean is supposed to build an entity manager factory for the default is to rely on the local settings specified on this factory bean , such as " persistence xml location " , " data source " and " load time weaver " for reuse of existing persistence unit configuration or more advanced forms of custom persistence unit handling , consider defining a separate persistence unit manager bean ( typically a default persistence unit manager instance ) and linking it in here { @ code persistence xml } location , data source configuration and load time weaver will be defined on that separate default persistence unit manager bean in such a scenario

public void set persistence unit manager ( persistence unit manager persistence unit manager ) { this persistence unit manager = persistence unit manager ; }


< code > optional string foo = 1 ; < code >

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


returns true if the passed class name is an ancestor of the visited class

private boolean is an ancestor ( @ non null string class name ) { for ( class node parent node : parent nodes ) { if ( parent node name equals ( class name ) ) { return true ; } } return false ; }


the creation timestamp of the resource < code > google protobuf timestamp create time = 2 ; < code >

public builder set create time ( com google protobuf timestamp builder builder for value ) { if ( create time builder = = null ) { create time = builder for value build ( ) ; on changed ( ) ; } else { create time builder set message ( builder for value build ( ) ) ; } return this ; }


notifies the process engine that a message event with name ' message name ' has been received and has been correlated to an execution with id ' execution id ' the waiting execution is notified synchronously

void message event received ( string message name , string execution id ) ;


the requests allowed per second in the underlying delete by query requests executed ` - 1 0f ` indicates that the standard nightly cleanup behavior should be ran throttling scales according to the number of data nodes ` null ` is default and means no throttling will occur

public float get requests per second ( ) { return requests per second ; }


public void shutdown ( ) { this keep running = false ; this interrupt ( ) ; }


called when the audio track runs out of data to play

void on underrun ( int buffer size , long buffer size ms ) ;


executes the given task in a cpu thread pool at fix rate

public static < t > void execute by cpu at fix rate ( final task < t > task , final long period , final time unit unit , @ int range ( from = 1 , to = 10 ) final int priority ) { execute at fixed rate ( get pool by type and priority ( type cpu , priority ) , task , 0 , period , unit ) ; }


public void invalidate ( ) { if ( program = = null ) { throw new unsupported operation exception ( " pseduo code unit has null program - refresh not supported " ) ; } is valid = false ; }


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

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


returns an estimate of the amount of live data in bytes

public void enable estimate live data size ( ) { this properties add ( rocks d b property estimate live data size get rocks d b property ( ) ) ; }


invalidates the instance buffer object so a new open g l buffer handle is created use this in case of a context loss

public void invalidate ( ) { buffer handle = create buffer object ( ) ; is dirty = true ; }


creates an empty { @ code copy on write array list } instance < b > note : < b > if you need an immutable empty { @ link list } , use { @ link collections # empty list } instead

public static < e > copy on write array list < e > new copy on write array list ( ) { return new copy on write array list < > ( ) ; }


creates a { @ link private key } from the contents of { @ code b reader } that contains an dsa private key encoded in open s s l traditional format

private static private key parse open ssl dsa ( buffered reader b reader , supplier < char [ ] > password supplier ) throws i o exception , general security exception { string builder sb = new string builder ( ) ; string line = b reader read line ( ) ; map < string , string > pem headers = new hash map < > ( ) ; while ( line ! = null ) { if ( openssl dsa footer equals ( line trim ( ) ) ) { / / unencrypted break ; } / / parse pem headers according to https : / / www ietf org / rfc / rfc 1 4 2 1 txt if ( line contains ( " : " ) ) { string [ ] header = line split ( " : " ) ; pem headers put ( header [ 0 ] trim ( ) , header [ 1 ] trim ( ) ) ; } else { sb append ( line trim ( ) ) ; } line = b reader read line ( ) ; } if ( null = = line | | openssl dsa footer equals ( line trim ( ) ) = = false ) { throw new i o exception ( " malformed pem file , pem footer is invalid or missing " ) ; } byte [ ] key bytes = possibly decrypt p k c s 1 key ( pem headers , sb to string ( ) , password supplier ) ; d s a private key spec spec = parse dsa der ( key bytes ) ; key factory key factory = key factory get instance ( " dsa " ) ; return key factory generate private ( spec ) ; }


initiates a full outer join transformation an outer join transformation joins two elements of two { @ link data set data sets } on key equality and provides multiple ways to combine joining elements into one data set elements of < b > both < b > data sets that do not have a matching element on the opposing side are joined with { @ code null } and emitted to the resulting data set


adds a stored field to load and return as part of the search request if none are specified , the source of the document will be return

public search source builder stored field ( string name ) { return stored fields ( collections singleton list ( name ) ) ; }


determine if a set equate operation is permitted for the specified action context the current context must satisfy the following constraints : current location must correspond to an operand scalar within the default representation if an equate reference on the operand exists it must correspond to the same value for data , it must be a simple defined data unit not contained within an array or composite ( create equate cmd does not currently support such data cases ) currently markup of equates is not supported within composite or array data

protected boolean is equate permitted ( listing action context context ) { / / is the data a scalar object scalar scalar = get scalar ( context ) ; if ( scalar = = null ) { return false ; } / / is the data defined code unit cu = get code unit ( context ) ; if ( cu instanceof data ) { data data = ( data ) cu ; if ( ! data is defined ( ) ) { return false ; } data type data type = data get base data type ( ) ; if ( ! ( data type instanceof abstract integer data type ) ) { return false ; } } equate equate = get equate ( context ) ; if ( equate = = null ) { return true ; } return ! is equate equal scalar ( equate , scalar ) ; }


set the target object on which to call the target method only necessary when the target method is not static ; else , a target class is sufficient

public void set target object ( @ nullable object target object ) { this target object = target object ; if ( target object ! = null ) { this target class = target object get class ( ) ; } }


a reference to the xml attribute < code > optional aapt pb reference key = 3 ; < code >

private void set key ( com android aapt resources reference builder builder for value ) { key = builder for value build ( ) ; bit field 0 | = 0x 0 0 0 0 0 0 0 4 ; }


classes that have a { @ code run with } annotation for { @ link classpath suite } or { @ link custom suite } are automatically excluded to avoid picking up the suite class itself

private static boolean is suite ( class < ? > container ) { run with run with = container get annotation ( run with class ) ; return ( run with ! = null ) & & ( ( run with value ( ) = = classpath suite class ) | | ( run with value ( ) = = custom suite class ) ) ; }


should the node indices info be returned

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


public static void compress ( final string root dir , final string source dir , final string output file , final checksum checksum ) throws i o exception { try ( final file output stream fos = new file output stream ( output file ) ; final checked output stream cos = new checked output stream ( fos , checksum ) ; final zip output stream zos = new zip output stream ( new buffered output stream ( cos ) ) ) { compress directory to zip file ( root dir , source dir , zos ) ; zos flush ( ) ; fos get f d ( ) sync ( ) ; } }


gets the approximated final length of the file

public long get length ( ) { long calculated ; if ( ps state = = 1 | | ps state = = 3 ) { return length ; } calculated = offsets [ current < offsets length ? current : ( offsets length - 1 ) ] + length ; calculated - = offsets [ 0 ] ; / / don ' t count reserved space return math max ( calculated , near length ) ; }


private void calculate l c s ( task monitor monitor ) throws cancelled exception { if ( c ! = null ) { return ; } if ( too big ( ) ) { c = new int [ 0 ] [ 0 ] ; return ; } int [ ] [ ] temp c = new int [ length of x ( ) + 1 ] [ ] ; monitor set message ( " calculating lcs " ) ; monitor initialize ( temp c length ) ; / / create the zero - initialized matrix for ( int i = 0 ; i < temp c length ; i + + ) { temp c [ i ] = new int [ length of y ( ) + 1 ] ; } for ( int i = 1 ; i < temp c length ; i + + ) { monitor check canceled ( ) ; for ( int j = 1 ; j < temp c [ i ] length ; j + + ) { if ( matches ( value of x ( i ) , value of y ( j ) ) ) { temp c [ i ] [ j ] = temp c [ i - 1 ] [ j - 1 ] + 1 ; } else { temp c [ i ] [ j ] = math max ( temp c [ i ] [ j - 1 ] , temp c [ i - 1 ] [ j ] ) ; } } monitor increment progress ( 1 ) ; } c = temp c ; }


sets polygon with repeating texture region , the size of repeating grid is equal to region size

public void set polygon ( texture region region , float [ ] vertices ) { set polygon ( region , vertices , - 1 ) ; }


set the maximum percentage in which words may still appear words that appear in more than this many percent of all docs will be ignored

public void set max doc freq pct ( int max percentage ) { this max doc freq = max percentage * ir num docs ( ) / 100 ; }


format a date into ' yyyy - mm - dd thh : mm : ss z ' ( default timezone , no milliseconds precision )

public static string format ( date date ) { return format ( date , false , timezone utc ) ; }


public resource name [ ] get resource names ( ) { return names ; }


configures this builder to produce tests appropriate for the given features this method may be called more than once to add features in multiple groups

public b with features ( feature < ? > features ) { return with features ( arrays as list ( features ) ) ; }


synchronously calls the delete alias api

public org elasticsearch client core acknowledged response delete alias ( delete alias request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , indices request converters : : delete alias , options , org elasticsearch client core acknowledged response : : from x content , empty set ( ) ) ; }


public void set host name ( final string host name ) { this host name = host name ; }


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

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


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


create the attributes of an object for subsequent use

private s 3 object attributes create object attributes ( final path f , final string e tag , final string version id , final long len ) { return new s 3 object attributes ( bucket , f , path to key ( f ) , get server side encryption algorithm ( ) , encryption secrets get encryption key ( ) , e tag , version id , len ) ; }


runs the benchmark for the given file size and flush frequency

private static void test for size and flush interval ( native azure file system fs , final long size , final long flush interval ) throws i o exception { for ( int i = 0 ; i < 5 ; i + + ) { test result page blob results = write page blob test file ( fs , size , flush interval ) ; system out printf ( " page blob upload took % d ms total number of requests : % d \ n " , page blob results time taken in ms , page blob results total number of requests ) ; test result block blob results = write block blob test file ( fs , size , flush interval ) ; system out printf ( " block blob upload took % d ms total number of requests : % d \ n " , block blob results time taken in ms , block blob results total number of requests ) ; } }


hook system menu to show context menu instead

public boolean on create options menu ( menu menu ) { m terminal view show context menu ( ) ; return false ; }


this method is a convenience for testing code should call { @ link segment # copy entry } directly

reference entry < k , v > copy entry ( reference entry < k , v > original , reference entry < k , v > new next ) { int hash = original get hash ( ) ; return segment for ( hash ) copy entry ( original , new next ) ; }


returns a { @ link query task future } representing the given computation { @ code callable } being performed after the successful completion of all the computations encapsulated by the given { @ code futures } the returned { @ link query task future } is considered " successful " for purposes of { @ link # when succeeds call } , { @ link # when all succeed } , and { @ link query task future # get if successful } iff all of the given computations are " successful " and { @ code callable # call } does not throw an exception

< r > query task future < r > when all succeed call ( iterable < ? extends query task future < ? > > futures , query task callable < r > callable ) ;


return the cached value if available otherwise , we need to synchronize access to the underlying { @ link histogram }

public int get value at percentile ( double percentile ) { int permyriad = ( int ) ( percentile * 100 ) ; switch ( permyriad ) { case 0 : return p 0 ; case 500 : return p 5 ; case 1000 : return p 1 0 ; case 1500 : return p 1 5 ; case 2000 : return p 2 0 ; case 2500 : return p 2 5 ; case 3000 : return p 3 0 ; case 3500 : return p 3 5 ; case 4000 : return p 4 0 ; case 4500 : return p 4 5 ; case 5000 : return p 5 0 ; case 5500 : return p 5 5 ; case 6000 : return p 6 0 ; case 6500 : return p 6 5 ; case 7000 : return p 7 0 ; case 7500 : return p 7 5 ; case 8000 : return p 8 0 ; case 8500 : return p 8 5 ; case 9000 : return p 9 0 ; case 9500 : return p 9 5 ; case 9900 : return p 9 9 ; case 9950 : return p 9 9 5 ; case 9990 : return p 9 9 9 ; case 9995 : return p 9 9 95 ; case 9999 : return p 9 9 99 ; case 10000 : return p 1 0 0 ; default : throw new illegal argument exception ( " percentile ( " + percentile + " ) is not currently cached " ) ; } }


check to make sure this config setting contains and sets least one of { values , define values , flag value or constraint values }

private boolean values are set ( immutable multimap < string , string > native flag settings , map < label , string > user defined flag settings , iterable < label > constraint values , rule error consumer errors ) { if ( native flag settings is empty ( ) & & user defined flag settings is empty ( ) & & iterables is empty ( constraint values ) ) { errors rule error ( string format ( " either % s , % s or % s must be specified and non - empty " , config setting rule settings attribute , config setting rule flag settings attribute , config setting rule constraint values attribute ) ) ; return false ; } return true ; }


handle the case when a declared path variable does not match any extracted uri variable the default implementation sends an http 500 error , and returns an empty { @ code model and view } alternatively , a fallback view could be chosen , or the missing path variable exception could be rethrown as - is

protected model and view handle missing path variable ( missing path variable exception ex , http servlet request request , http servlet response response , @ nullable object handler ) throws i o exception { response send error ( http servlet response sc internal server error , ex get message ( ) ) ; return new model and view ( ) ; }


public static list < file > list files in dir ( final file dir , final boolean is recursive , final comparator < file > comparator ) { return list files in dir with filter ( dir , new file filter ( ) { @ override public boolean accept ( file pathname ) { return true ; } } , is recursive , comparator ) ; }


creates a byte datatype at the given address

public final data create byte ( address address ) throws exception { return create data ( address , new byte data type ( ) ) ; }


sets the number of bytes that should be loaded between each invocation of { @ link media period callback # on continue loading requested ( sequenceable loader ) } the default value is { @ link # default loading check interval bytes }

public factory set continue loading check interval bytes ( int continue loading check interval bytes ) { this continue loading check interval bytes = continue loading check interval bytes ; return this ; }


completes the join operation with the user function that is executed for each combination of elements with the same key in a window < b > note : < b > this is a temporary workaround while the { @ link # apply ( flat join function , type information ) } method has the wrong return type and hence does not allow one to set an operator - specific parallelism

public < t > single output stream operator < t > with ( join function < t1 , t2 , t > function , type information < t > result type ) { return ( single output stream operator < t > ) apply ( function , result type ) ; }


loads the regex for a property and compiles it to a pattern ( this is cached upstream , plus we are doing it only once per property and batch )

protected set < pattern > get pattern ( property id value pid ) { if ( patterns contains key ( pid ) ) { return patterns get ( pid ) ; } else { list < statement > statement list = fetcher get constraints by type ( pid , format constraint qid ) ; set < pattern > patterns = new hash set < > ( ) ; for ( statement statement : statement list ) { format constraint constraint = new format constraint ( statement ) ; string regex = constraint regular expression format ; pattern pattern = null ; if ( regex ! = null ) { pattern = pattern compile ( regex ) ; } patterns add ( pattern ) ; } patterns put ( pid , patterns ) ; return patterns ; } }


public void delete child node ( xml tree node node ) { iterator < xml tree node > it = children iterator ( ) ; while ( it has next ( ) ) { if ( it next ( ) = = node ) { it remove ( ) ; return ; } } }


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


checks that the current state is equal to the expected state

private void check current state ( state expected ) { state actual = state ( ) ; if ( actual ! = expected ) { if ( actual = = failed ) { / / handle this specially so that we can include the failure cause , if there is one throw new illegal state exception ( " expected the service " + this + " to be " + expected + " , but the service has failed " , failure cause ( ) ) ; } throw new illegal state exception ( " expected the service " + this + " to be " + expected + " , but was " + actual ) ; } }


{ @ inherit doc } the default implementation does nothing

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


get the number of currently running reduce tasks in the cluster

public int get reduce tasks ( ) { return reduce tasks ; }


general - purpose http put command to the httpfs server

private void put cmd ( string filename , string message , string command , string params , boolean expect o k ) throws exception { string user = hadoop users conf test helper get hadoop users ( ) [ 0 ] ; string out msg = message + " ( " + command + " ) " ; / / remove leading / from filename if ( filename char at ( 0 ) = = ' / ' ) { filename = filename substring ( 1 ) ; } string path ops = message format format ( " / webhdfs / v 1 / { 0 } ? user name = { 1 } { 2 } { 3 } & op = { 4 } " , filename , user , ( params = = null ) ? " " : " & " , ( params = = null ) ? " " : params , command ) ; url url = new url ( test jetty helper get jetty u r l ( ) , path ops ) ; http u r l connection conn = ( http u r l connection ) url open connection ( ) ; conn set request method ( " put " ) ; conn connect ( ) ; int resp = conn get response code ( ) ; if ( expect o k ) { assert assert equals ( out msg , http u r l connection http ok , resp ) ; } else { assert assert equals ( out msg , http u r l connection http forbidden , resp ) ; } }


adds a data { @ link source } to the environment to get a { @ link data stream } the result will be either a bounded data stream ( that can be processed in a batch way ) or an unbounded data stream ( that must be processed in a streaming way ) , based on the boundedness property of the source , as defined by { @ link source # get boundedness ( ) } this method takes an explicit type information for the produced data stream , so that callers can define directly what typeserializer will be used for the produced stream for sources that describe their produced type , the method { @ link # from source ( source , watermark strategy , string ) } can be used to avoid specifying the produced type redundantly

public < out > data stream source < out > from source ( source < out , ? , ? > source , watermark strategy < out > timestamps and watermarks , string source name , type information < out > type info ) { final type information < out > resolved type info = get type info ( source , source name , source class , type info ) ; return new data stream source < > ( this , check not null ( source , " source " ) , check not null ( timestamps and watermarks , " timestamps and watermarks " ) , check not null ( resolved type info ) , check not null ( source name ) ) ; }


determines the number of cores available on the device

public static int calculate best thread count ( ) { if ( best thread count = = 0 ) { best thread count = math min ( maximum automatic thread count , runtime compat available processors ( ) ) ; } return best thread count ; }


releases the resources associated with the input


sets the < code > prefix ns number < code > property

public void set prefix ns number ( big decimal prefix ns number ) { this prefix ns number = prefix ns number ; }


returns all the nodes in the topologically sorted order that is , if there ' s an edge a → b , b always come earlier than a

public list < n > get sorted ( ) { return topological order ; }


remove all successors edges and return collection of its self edge removed but did not returned in result collection

collection < node < t > > remove all successors ( ) { this remove edge ( this ) ; / / remove self edge collection < node < t > > successors = this succs clear ( ) ; for ( node < t > s : successors ) { if ( ! s remove predecessor ( this ) ) { throw new illegal state exception ( " inconsistent graph state " ) ; } } return successors ; }


start the watcher service , load watches in the background

public void start ( cluster state state , runnable post watches loaded callback ) { execution service un pause ( ) ; processed cluster state version set ( state get version ( ) ) ; executor execute ( wrap watcher service ( ( ) - > { if ( reload inner ( state , " starting " , true ) ) { post watches loaded callback run ( ) ; } } , e - > logger error ( " error starting watcher " , e ) ) ) ; }


indicates if there are attributes returns false if not " applied " yet

boolean has attributes ( ) { if ( nested type definition applier = = null ) { return false ; } if ( nested type definition applier get ms type ( ) instanceof abstract nested type ms type ) { return false ; } return true ; }


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

@ override public t visit comp ( painless parser comp context ctx ) { return visit children ( ctx ) ; }


set the interval for the periodic service

protected void set interval ms ( long interval ) { if ( get service state ( ) = = state started ) { throw new service state exception ( " periodic service already started " ) ; } else { this interval ms = interval ; } }


add a rack - local request to the final answer

private void add rack r r ( sub cluster id target id , resource request rr ) { preconditions check argument ( ! resource request is any location ( rr get resource name ( ) ) ) ; internal add to answer ( target id , rr , true ) ; }


get the preferred load address for a program segment

public address get preferred segment address ( elf load helper elf load helper , elf program header elf program header ) { program program = elf load helper get program ( ) ; address space space = get preferred segment address space ( elf load helper , elf program header ) ; long addr word offset = elf program header get virtual address ( ) ; if ( space = = program get address factory ( ) get default address space ( ) ) { addr word offset + = elf load helper get image base word adjustment offset ( ) ; } return space get truncated address ( addr word offset , true ) ; }


calculates this buffer ' s hash code from the remaining chars the position , limit , capacity and mark don ' t affect the hash code

public int hash code ( ) { int my position = position ; int hash = 0 ; while ( my position < limit ) { hash = hash + get ( my position + + ) ; } return hash ; }


finds the first available ml node in the cluster and redirects the request to this node

private void redirect to ml node ( put data frame analytics action request request , action listener < explain data frame analytics action response > listener ) { optional < discovery node > node = find ml node ( cluster service state ( ) ) ; if ( node is present ( ) ) { transport service send request ( node get ( ) , action name , request , new action listener response handler < > ( listener , explain data frame analytics action response : : new ) ) ; } else { listener on failure ( exceptions helper bad request exception ( " no ml node to run on " ) ) ; } }


void set allow nested snapshots ( boolean allow nested snapshots ) { this allow nested snapshots = allow nested snapshots ; }


adds a route to the given handler function that handles http { @ code head } requests

builder head ( handler function < server response > handler function ) ;


private void add any r r ( sub cluster id target id , resource request rr ) { preconditions check argument ( resource request is any location ( rr get resource name ( ) ) ) ; internal add to answer ( target id , rr , false ) ; }


can only be called inside of a transaction

void add thread ( @ non null context context , long old id , long new id ) { ensure in transaction ( context ) ; ensure thread map is populated ( context ) ; thread map put ( old id , new id ) ; database factory get remapped records database ( context ) add thread mapping ( old id , new id ) ; }


instantiates the given task invokable class , passing the given environment ( and possibly the initial task state ) to the task ' s constructor the method will first try to instantiate the task via a constructor accepting both the environment and the task state snapshot if no such constructor exists , and there is no initial state , the method will fall back to the stateless convenience constructor that accepts only the environment

private static abstract invokable load and instantiate invokable ( class loader class loader , string class name , environment environment ) throws throwable { final class < ? extends abstract invokable > invokable class ; try { invokable class = class for name ( class name , true , class loader ) as subclass ( abstract invokable class ) ; } catch ( throwable t ) { throw new exception ( " could not load the task ' s invokable class " , t ) ; } constructor < ? extends abstract invokable > stateless ctor ; try { stateless ctor = invokable class get constructor ( environment class ) ; } catch ( no such method exception ee ) { throw new flink exception ( " task misses proper constructor " , ee ) ; } / / instantiate the class try { / / noinspection constant conditions - - > cannot happen return stateless ctor new instance ( environment ) ; } catch ( invocation target exception e ) { / / directly forward exceptions from the eager initialization throw e get target exception ( ) ; } catch ( exception e ) { throw new flink exception ( " could not instantiate the task ' s invokable class " , e ) ; } }


called when an m bean is registered under the given { @ link object name } allows subclasses to perform additional processing when an m bean is registered the default implementation is empty can be overridden in subclasses

protected void on register ( object name object name ) { }


registers a { @ link user defined function } instance as a temporary catalog function compared to { @ link # create temporary function ( string , class ) } , this method takes a function instance that might have been parameterized before ( e g through its constructor ) this might be useful for more interactive sessions make sure that the instance is { @ link serializable } compared to { @ link # create temporary system function ( string , user defined function ) } with a globally defined name , catalog functions are always ( implicitly or explicitly ) identified by a catalog and database temporary functions can shadow permanent ones if a permanent function under a given name exists , it will be inaccessible in the current session to make the permanent function available again one can drop the corresponding temporary function

void create temporary function ( string path , user defined function function instance ) ;


helper method to retrieve the user group information from the http servlet request

public static user group information get caller user group information ( http servlet request hsr , boolean use principal ) { string remote user = hsr get remote user ( ) ; if ( use principal ) { principal princ = hsr get user principal ( ) ; remote user = princ = = null ? null : princ get name ( ) ; } user group information caller u g i = null ; if ( remote user ! = null ) { caller u g i = user group information create remote user ( remote user ) ; } return caller u g i ; }


< code > optional int 6 4 num = 4 ; < code >

public builder set num ( long value ) { bit field 0 | = 0x 0 0 0 0 0 0 0 8 ; num = value ; on changed ( ) ; return this ; }


callback when ping ack was not received in keepalive timeout should shutdown the transport


updates a global binding in the module environment

public void set global ( string name , object value ) { preconditions check not null ( value , " module set global ( % s , null ) " , name ) ; set global by index ( get index of global ( name ) , value ) ; }


tests that we can register task manager and their slots at the slot manager

public void test task manager registration ( ) throws exception { final task executor gateway task executor gateway = new testing task executor gateway builder ( ) create testing task executor gateway ( ) ; final resource i d resource id = resource i d generate ( ) ; final task executor connection task manager connection = new task executor connection ( resource id , task executor gateway ) ; final slot i d slot id 1 = new slot i d ( resource id , 0 ) ; final slot i d slot id 2 = new slot i d ( resource id , 1 ) ; final slot report slot report = new slot report ( arrays as list ( create free slot status ( slot id 1 ) , create free slot status ( slot id 2 ) ) ) ; final default slot tracker slot tracker = new default slot tracker ( ) ; try ( declarative slot manager slot manager = create declarative slot manager builder ( ) set slot tracker ( slot tracker ) build and start with direct exec ( ) ) { slot manager register task manager ( task manager connection , slot report , resource profile any , resource profile any ) ; assert that ( " the number registered slots does not equal the expected number " , slot manager get number registered slots ( ) , is ( 2 ) ) ; assert not null ( slot tracker get slot ( slot id 1 ) ) ; assert not null ( slot tracker get slot ( slot id 2 ) ) ; } }


returns an unmodifiable { @ code iterable } over the nodes reachable from any of the { @ code start nodes } , in the order of a depth - first pre - order traversal this is equivalent to a depth - first pre - order traversal of a graph with an additional root node whose successors are the listed { @ code start nodes }

public final iterable < n > depth first pre order ( iterable < ? extends n > start nodes ) { final immutable set < n > validated = validate ( start nodes ) ; return new iterable < n > ( ) { @ override public iterator < n > iterator ( ) { return new traversal ( ) pre order ( validated iterator ( ) ) ; } } ; }


produce a metadata marshaller for a protobuf type

public static < t extends message > metadata binary marshaller < t > metadata marshaller ( t instance ) { return proto lite utils metadata marshaller ( instance ) ; }


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


create r m delegated node labels updater based on configuration

protected r m delegated node labels updater create r m delegated node labels updater ( ) { if ( conf get boolean ( yarn configuration node labels enabled , yarn configuration default node labels enabled ) & & yarn configuration is delegated centralized node label configuration ( conf ) ) { return new r m delegated node labels updater ( rm context ) ; } else { return null ; } }


add the given header to all requests that haven ' t added it

builder default header ( string header name , string header values ) ;


if both string arguments are non - null , this method concatenates them with ' and ' if only one of the arguments is non - null , this method returns the non - null argument if both arguments are null , this method returns null

public static string concatenate with and ( @ nullable string s 1 , @ nullable string s 2 ) { if ( s 1 ! = null ) { return s 2 = = null ? s 1 : s 1 + " and " + s 2 ; } else { return s 2 ; } }


public void print ( string message ) { logger info ( " hp printer : { } " , message ) ; }


instantiates the { @ code master trigger restore hook }

< v > master trigger restore hook < v > create ( ) ;


{ @ link # remove listener ( string , string , configuration listener ) }

default void remove listener ( string key , configuration listener listener ) { remove listener ( key , get default group ( ) , listener ) ; }


generate a sql for add new column into the existing table

protected string generate add column s q l ( string table name , column model column model ) { string builder add column s q l = new string builder ( ) ; add column s q l append ( " alter table " ) append ( table name ) ; add column s q l append ( " add column " ) append ( column model get column name ( ) ) ; add column s q l append ( " " ) append ( column model get column type ( ) ) ; if ( ! column model is nullable ( ) ) { add column s q l append ( " not null " ) ; } if ( column model is unique ( ) ) { add column s q l append ( " unique " ) ; } string default value = column model get default value ( ) ; if ( ! text utils is empty ( default value ) ) { add column s q l append ( " default " ) append ( default value ) ; } else { if ( ! column model is nullable ( ) ) { if ( " integer " equals ignore case ( column model get column type ( ) ) ) { default value = " 0 " ; } else if ( " text " equals ignore case ( column model get column type ( ) ) ) { default value = " ' ' " ; } else if ( " real " equals ignore case ( column model get column type ( ) ) ) { default value = " 0 0 " ; } add column s q l append ( " default " ) append ( default value ) ; } } lite pal log d ( tag , " add column sql is > > " + add column s q l ) ; return add column s q l to string ( ) ; }


disposes all resources associated with this shader must be called when the shader is no longer used

public void dispose ( ) { gl20 gl = gdx gl 2 0 ; gl gl use program ( 0 ) ; gl gl delete shader ( vertex shader handle ) ; gl gl delete shader ( fragment shader handle ) ; gl gl delete program ( program ) ; if ( shaders get ( gdx app ) ! = null ) shaders get ( gdx app ) remove value ( this , true ) ; }


performs the filesystem operations to plant the symlink forest

public immutable list < path > plant symlink forest ( ) throws i o exception , abrupt exit exception { delete trees below not prefixed ( execroot , prefix ) ; if ( sibling repository layout ) { / / delete execroot / / < symlinks > to directories representing external repositories for ( path p : execroot get parent directory ( ) get directory entries ( ) ) { if ( p is symbolic link ( ) ) { p delete tree ( ) ; } } } boolean should link all top level items = false ; map < path , path > main repo links = maps new linked hash map ( ) ; set < root > main repo roots = sets new linked hash set ( ) ; set < path > external repo links = sets new linked hash set ( ) ; map < package identifier , root > package roots for main repo = maps new linked hash map ( ) ; immutable list builder < path > planted symlinks = immutable list builder ( ) ; for ( map entry < package identifier , root > entry : package roots entry set ( ) ) { package identifier pkg id = entry get key ( ) ; if ( pkg id equals ( label constants external package identifier ) ) { / / / / external is a virtual package regardless , don ' t add it to the symlink tree / / subpackages of / / external , like / / external / foo , are fine though continue ; } repository name repository = pkg id get repository ( ) ; if ( repository is main ( ) | | repository is default ( ) ) { / / record main repo packages package roots for main repo put ( entry get key ( ) , entry get value ( ) ) ; / / record the root of the packages main repo roots add ( entry get value ( ) ) ; / / for single root ( single package path ) case : / / if root package of the main repo is required , we record the main repo root so that / / we can later link everything under the main repo ' s top - level directory / / if root package of the main repo is not required , we only record links for / / directories under the top - level directory that are used in required packages if ( pkg id get package fragment ( ) equals ( path fragment empty fragment ) ) { should link all top level items = true ; } else { string base name = pkg id get package fragment ( ) get segment ( 0 ) ; if ( ! sibling repository layout & & base name equals ( label constants external path prefix get base name ( ) ) ) { / / ignore external / directory if user has it in the source tree / / because it conflicts with external repository location continue ; } path execroot link = execroot get relative ( base name ) ; path source path = entry get value ( ) get relative ( pkg id get source root ( ) get segment ( 0 ) ) ; main repo links put if absent ( execroot link , source path ) ; } } else { plant symlink for external repo ( planted symlinks , repository , entry get value ( ) as path ( ) , external repo links ) ; } } / / todo ( bazel - team ) : bazel can find packages in multiple paths by specifying - - package paths , / / we need a more complex algorithm to build execroot in that case as - - package path will be / / removed in the future , we should remove the plant symlink forest multi package path / / implementation when - - package path is gone if ( main repo roots size ( ) > 1 ) { if ( ! this not symlinked in execroot directories is empty ( ) ) { throw new abrupt exit exception ( detailed symlink forest exit code ( " toplevel output directories is not supported together with - - package path option " , code toplevel outdir package path conflict ) ) ; } plant symlink forest multi package path ( planted symlinks , package roots for main repo ) ; } else if ( should link all top level items ) { path main repo root = iterables get only element ( main repo roots ) as path ( ) ; plant symlink forest with full main repository ( planted symlinks , main repo root ) ; } else { plant symlink forest with partial main repository ( planted symlinks , main repo links ) ; } logger at info ( ) log ( " planted symlink forest in % s " , execroot ) ; return planted symlinks build ( ) ; }


final boolean cas base ( long cmp , long val ) { return unsafe compare and swap long ( this , base offset , cmp , val ) ; }


returns an array containing all of the elements in this queue , in proper sequence the returned array will be " safe " in that no references to it are maintained by this queue ( in other words , this method must allocate a new array ) the caller is thus free to modify the returned array this method acts as bridge between array - based and collection - based a p is

public object [ ] to array ( ) { final e [ ] items = this items ; final monitor monitor = this monitor ; monitor enter ( ) ; try { object [ ] a = new object [ count ] ; int k = 0 ; int i = take index ; while ( k < count ) { a [ k + + ] = items [ i ] ; i = inc ( i ) ; } return a ; } finally { monitor leave ( ) ; } }


any symbols this file auto - generatesexports ( eg & # 64 ; + idfoo in an xml file ) < code > repeated aapt pb internal compiled file symbol exported symbol = 4 ; < code >

public builder add exported symbol ( int index , symbol value ) { copy on write ( ) ; instance add exported symbol ( index , value ) ; return this ; }


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


returns a { @ code top k selector } that collects the greatest { @ code k } elements added to it , relative to the natural ordering of the elements , and returns them via { @ link # top k } in descending order

public static < t extends comparable < ? super t > > top k selector < t > greatest ( int k ) { return greatest ( k , ordering natural ( ) ) ; }


replaces all the occurrences of the given uninitialized type in this frame with its initialized equivalent

public void make initialized ( type type ) { locals make initialized ( type ) ; stack make initialized ( type ) ; }


public static < e > linked blocking deque < e > new blocking unlimit deque ( ) { return new linked blocking deque < e > ( ) ; }


the inner hit options to expand the collapsed results

public list < inner hit builder > get inner hit ( ) { return inner hits ; }


check if solver ' s input parameters are valid

public final void validate ( final map < recurrence id , list < resource skyline > > job history , final int time interval ) throws invalid input exception { if ( ( job history = = null ) | | ( job history size ( ) = = 0 ) ) { logger error ( " job resource skyline history is invalid , please try again with " + " valid resource skyline history " ) ; throw new invalid input exception ( " job resource skyline history " , " invalid " ) ; } if ( time interval < = 0 ) { logger error ( " solver time interval { } is invalid , please specify a positive value " , time interval ) ; throw new invalid input exception ( " solver time interval " , " non - positive " ) ; } }


increment a specific gauge no - op if not defined

public void increment gauge ( statistic op , long count ) { mutable gauge long gauge = lookup gauge ( op get symbol ( ) ) ; if ( gauge ! = null ) { gauge incr ( count ) ; } else { log debug ( " no gauge : " + op ) ; } }


returns the declared provider requested , or null , if the information is not found use { @ link # get ( builtin provider ) } for built - in providers

info get ( provider key provider key ) ;


for the quick checks outside of skip x x x and try x x x methods of this class , assume that the step takes just one symbol

public void ensure end ( ) { if ( end < 0 ) { end = position + 1 ; } }


public okhttp 3 call test body with query params async ( string query , user body , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = test body with query params validate before call ( query , body , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


returns true if the format factory can be found using the given factory base class and identifier

private boolean format factory exists ( context context , class < ? > factory class ) { configuration options = configuration from map ( context get catalog table ( ) get options ( ) ) ; string identifier = options get ( factory util format ) ; if ( identifier = = null ) { throw new validation exception ( string format ( " table options do not contain an option key ' % s ' for discovering a format " , factory util format key ( ) ) ) ; } final list < factory > factories = new linked list < > ( ) ; service loader load ( factory class , context get class loader ( ) ) iterator ( ) for each remaining ( factories : : add ) ; final list < factory > found factories = factories stream ( ) filter ( f - > factory class is assignable from ( f get class ( ) ) ) collect ( collectors to list ( ) ) ; final list < factory > matching factories = found factories stream ( ) filter ( f - > f factory identifier ( ) equals ( identifier ) ) collect ( collectors to list ( ) ) ; return ! matching factories is empty ( ) ; }


simulates a factory method that wraps the supplied object in a proxy of the same type

public static < t > t create proxy ( t object ) { return null ; }


type - specific modifiers see type mod constants


configure the maximum size of an inbound sub - protocol message , such as a stomp frame which may be aggregated from multiple web socket messages the default value is 64k ( i e 64 1024 ) note : this is not the same as the size of an individual web socket message which needs to be configured at the web socket server level instead see the reference documentation for details

public web socket transport registration set message size limit ( int message size limit ) { this message size limit = message size limit ; return this ; }


set owner of a path ( i e a file or a directory ) the parameters username and groupname cannot both be null

public void set owner ( path p , string username , string groupname ) throws i o exception { map < string , string > params = new hash map < string , string > ( ) ; params put ( op param , operation setowner to string ( ) ) ; params put ( owner param , username ) ; params put ( group param , groupname ) ; http u r l connection conn = get connection ( operation setowner get method ( ) , params , p , true ) ; http exception utils validate response ( conn , http u r l connection http ok ) ; }


verifies that a multiset is immutable a multiset is considered immutable if : all its mutation methods result in unsupported operation exception , and do not change the underlying contents all methods that return objects that can indirectly mutate the multiset throw unsupported operation exception when those mutators are called

public static < e > void assert multiset is unmodifiable ( multiset < e > multiset , final e sample element ) { multiset < e > copy = linked hash multiset create ( multiset ) ; assert collections are equivalent ( multiset , copy ) ; / / multiset is a collection , so we can use all those tests assert collection is unmodifiable ( multiset , sample element ) ; assert collections are equivalent ( multiset , copy ) ; try { multiset add ( sample element , 2 ) ; fail ( " add ( object , int ) succeeded on unmodifiable collection " ) ; } catch ( unsupported operation exception expected ) { } assert collections are equivalent ( multiset , copy ) ; try { multiset remove ( sample element , 2 ) ; fail ( " remove ( object , int ) succeeded on unmodifiable collection " ) ; } catch ( unsupported operation exception expected ) { } assert collections are equivalent ( multiset , copy ) ; assert collections are equivalent ( multiset , copy ) ; assert set is unmodifiable ( multiset element set ( ) , sample element ) ; assert collections are equivalent ( multiset , copy ) ; assert set is unmodifiable ( multiset entry set ( ) , new multiset entry < e > ( ) { @ override public int get count ( ) { return 1 ; } @ override public e get element ( ) { return sample element ; } } ) ; assert collections are equivalent ( multiset , copy ) ; }


adds the given directories to the include directories ( they are passed with { @ code " - i " } to the compiler ) ; these are also passed to dependent rules

public cc compilation helper add include dirs ( iterable < path fragment > include dirs ) { iterables add all ( this include dirs , include dirs ) ; return this ; }


test a case where there is a cycle in renaming dirs

public void test sync 6 ( ) throws exception { init data 6 ( source ) ; init data 6 ( target ) ; enable and create first snapshot ( ) ; int num created modified = change data 6 ( source ) ; dfs create snapshot ( source , " s 2 " ) ; test and verify ( num created modified ) ; }


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


in some scenario , we may nee to add and remove service config or reference config dynamically

public void remove config ( abstract config config ) { if ( config = = null ) { return ; } map < string , abstract config > configs = configs cache get ( get tag name ( config get class ( ) ) ) ; if ( collection utils is not empty map ( configs ) ) { configs remove ( get id ( config ) ) ; } }


returns the files necessary for compilation excluding headers , assuming that included files will be discovered by input discovery if the toolchain does not provide this fileset , falls back to { @ link # get compiler files ( ) }

public nested set < artifact > get compiler files without includes ( ) { if ( compiler files without includes is empty ( ) ) { return get compiler files ( ) ; } return compiler files without includes ; }


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

public text prop model view model on bind ( on model bound listener < text prop model view model , text prop model view > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


tests that { @ link event sample stream # update event stream ( event stream , boolean ) } will update the underlying event stream , but keep the timestamp the stream has seek to , so the next { @ link event sample stream # read data ( format holder , decoder input buffer , boolean ) } call will return sample data from the seek position

public void seek to then update stream continue to read from seek position even seek more than available ( ) { long presentation time us 1 = 1000000 ; long presentation time us 2 = 2000000 ; long presentation time us 3 = 3000000 ; event message event message 1 = new event message with id ( 1 ) ; event message event message 2 = new event message with id ( 2 ) ; event message event message 3 = new event message with id ( 3 ) ; event stream event stream 1 = new event stream ( scheme id , value , time scale , new long [ ] { presentation time us 1 } , new event message [ ] { event message 1 } ) ; event stream event stream 2 = new event stream ( scheme id , value , time scale , new long [ ] { presentation time us 1 , presentation time us 2 , presentation time us 3 } , new event message [ ] { event message 1 , event message 2 , event message 3 } ) ; event sample stream sample stream = new event sample stream ( event stream 1 , format , true ) ; / / first read - read format read data ( sample stream ) ; sample stream seek to us ( presentation time us 2 + 1 ) ; sample stream update event stream ( event stream 2 , true ) ; int result = read data ( sample stream ) ; assert that ( result ) is equal to ( c result buffer read ) ; assert that ( input buffer data array ( ) ) is equal to ( get encoded message ( event message 3 ) ) ; }


public string get name ( ) { return name ; }


causes the current thread to wait until the latch has counted down to zero , unless the thread is { @ linkplain thread # interrupt interrupted } , or the specified waiting time elapses if the current count is zero then this method returns immediately with the value { @ code true } if the current count is greater than zero then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of three things happen : the count reaches zero due to invocations of the { @ link # count down } method ; or some other thread { @ linkplain thread # interrupt interrupts } the current thread ; or the specified waiting time elapses if the count reaches zero then the method returns with the value { @ code true } if the current thread : has its interrupted status set on entry to this method ; or is { @ linkplain thread # interrupt interrupted } while waiting , then { @ link interrupted exception } is thrown and the current thread ' s interrupted status is cleared if the specified waiting time elapses then the value { @ code false } is returned if the time is less than or equal to zero , the method will not wait at all

public boolean await ( long timeout , time unit unit ) throws interrupted exception { return sync try acquire shared nanos ( 1 , unit to nanos ( timeout ) ) ; }


when retrieved this will iterate over the contained { @ link hystrix property } instances until a non - null value is found and return that

public static < t > hystrix property < t > as property ( final hystrix property < t > values ) { return new hystrix property < t > ( ) { @ override public t get ( ) { for ( hystrix property < t > v : values ) { / / return the first one that doesn ' t return null if ( v get ( ) ! = null ) { return v get ( ) ; } } return null ; } } ; }


check whether a topic matches a subscribed pattern

synchronized boolean matches subscribed pattern ( string topic ) { pattern pattern = this subscribed pattern ; if ( has pattern subscription ( ) & & pattern ! = null ) return pattern matcher ( topic ) matches ( ) ; return false ; }


tells if the function is declspec ( strict gs check )

public boolean is declspec strict gs check ( ) { return is declspec strict gs check ; }


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


gets a collection of account names a surrogate can authenticate as

collection < string > get eligible accounts for surrogate to proxy ( string username ) ;


returns a { @ link cache loader } that throws the given error for every request

static < k , v > cache loader < k , v > error loader ( final error e ) { check not null ( e ) ; return new cache loader < k , v > ( ) { @ override public v load ( k key ) { throw e ; } } ; }


set get the spring frequency in hertz setting the frequency to zero disables the spring

public void set spring frequency hz ( float hz ) { joint set spring frequency hz ( hz ) ; }


set the < code > value < code > of the < code > name < code > property if < code > name < code > is deprecated , it also sets the < code > value < code > to the keys that replace the deprecated key name will be trimmed before put into configuration

public void set ( string name , string value , string source ) { preconditions check argument ( name ! = null , " property name must not be null " ) ; preconditions check argument ( value ! = null , " the value of property % s must not be null " , name ) ; name = name trim ( ) ; deprecation context deprecations = deprecation context get ( ) ; if ( deprecations get deprecated key map ( ) is empty ( ) ) { get props ( ) ; } get overlay ( ) set property ( name , value ) ; get props ( ) set property ( name , value ) ; string new source = ( source = = null ? " programmatically " : source ) ; if ( ! is deprecated ( name ) ) { put into updating resource ( name , new string [ ] { new source } ) ; string [ ] alt names = get alternative names ( name ) ; if ( alt names ! = null ) { for ( string n : alt names ) { if ( ! n equals ( name ) ) { get overlay ( ) set property ( n , value ) ; get props ( ) set property ( n , value ) ; put into updating resource ( n , new string [ ] { new source } ) ; } } } } else { string [ ] names = handle deprecation ( deprecation context get ( ) , name ) ; string alt source = " because " + name + " is deprecated " ; for ( string n : names ) { get overlay ( ) set property ( n , value ) ; get props ( ) set property ( n , value ) ; put into updating resource ( n , new string [ ] { alt source } ) ; } } }


for the given index metadata , register ( index a document ) that the index has been deleted by ilm using the { @ link i l m history store }

void register delete operation ( index metadata metadata before deletion ) { if ( metadata before deletion = = null ) { throw new illegal state exception ( " cannot register deletion of an index that did not previously exist " ) ; } long origination = calculate origination millis ( metadata before deletion ) ; ilm history store put async ( i l m history item success ( metadata before deletion get index ( ) get name ( ) , lifecycle settings lifecycle name setting get ( metadata before deletion get settings ( ) ) , now supplier get as long ( ) , origination = = null ? null : ( now supplier get as long ( ) - origination ) , lifecycle execution state builder ( lifecycle execution state from index metadata ( metadata before deletion ) ) / / register that the delete phase is now " complete " set step ( phase complete step name ) build ( ) ) ) ; }