aggregate the values of records in these streams by the grouped key and defined sessions note that sessions are generated on a per - key basis and records with different keys create independent sessions records with { @ code null } key or value are ignored the result is written into a local { @ link session store } ( which is basically an ever - updating materialized view ) furthermore , updates to the store are sent downstream into a { @ link k table } changelog stream the specified { @ link initializer } is applied directly before the first input record per session is processed to provide an initial intermediate aggregation result that is used to process the first record per session the specified { @ link aggregator } ( as specified in { @ link k grouped stream # cogroup ( aggregator ) } or { @ link cogrouped k stream # cogroup ( k grouped stream , aggregator ) } ) is applied for each input record and computes a new aggregate using the current aggregate ( or for the very first record using the intermediate aggregation result provided via the { @ link initializer } ) and the record ' s value the specified { @ link merger } is used to merge two existing sessions into one , i e , when the windows overlap , they are merged into a single session and the old sessions are discarded thus , { @ code aggregate ( ) } can be used to compute aggregate functions like count or sum etc the default key and value serde from the config will be used for serializing the result if a different serde is required then you should use { @ link # aggregate ( initializer , merger , named , materialized ) } not all updates might get sent downstream , as an internal cache is used to deduplicate consecutive updates to the same window and key the rate of propagated updates depends on your input data rate , the number of distinct keys , the number of parallel running kafka streams instances , and the { @ link streams config configuration } parameters for { @ link streams config # cache max bytes buffering config cache size } , and { @ link streams config # commit interval ms config commit interval } for failure and recovery the store will be backed by an internal changelog topic that will be created in kafka the changelog topic will be named " $ { application id } - $ { internal store name } - changelog " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " internal store name " is an internal name and " - changelog " is a fixed suffix note that the internal store name may not be queryable through interactive queries you can retrieve all generated internal topic names via { @ link topology # describe ( ) }

k table < windowed < k > , v > aggregate ( final initializer < v > initializer , final merger < ? super k , v > session merger , final named named ) ;


test that we can do basic execution without a request variable being initialized

public void test basic execution works without request variable ( ) throws exception { / * force the request variable to not be initialized * / hystrix request context set context on current thread ( null ) ; test hystrix command < boolean > command = new successful test command ( ) ; assert equals ( true , command execute ( ) ) ; test hystrix command < boolean > command 2 = new successful test command ( ) ; assert equals ( true , command 2 queue ( ) get ( ) ) ; }


return the path within the servlet mapping for the given request , i e the part of the request ' s url beyond the part that called the servlet , or " " if the whole url has been used to identify the servlet

public string get path within servlet mapping ( http servlet request request ) { return get path within servlet mapping ( request , get path within application ( request ) ) ; }


update all the known event handlers for a dispatcher with the given key with the new dispacher instance

public synchronized void bind event handlers ( component context c , has event dispatcher dispatcher , string global key ) { if ( global key = = null ) { return ; } final event handlers wrapper event handlers = m event handlers get ( global key ) ; if ( event handlers = = null ) { return ; } / / mark that the list of event handlers for this component is still needed event handlers m used in current tree = true ; event handlers bind to dispatcher ( c , dispatcher ) ; }


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


adds the provided { @ link handler interceptor }

public interceptor registration add interceptor ( handler interceptor interceptor ) { interceptor registration registration = new interceptor registration ( interceptor ) ; this registrations add ( registration ) ; return registration ; }


public static clock default clock ( ) { return user time clock holder default ; }


converts byte to f s edit log op codes enum value

public static f s edit log op codes from byte ( byte op code ) { if ( op code > = 0 & & op code < values length ) { return values [ op code ] ; } return op code = = - 1 ? op invalid : null ; }


public int get word count ( ) { / / it is the same as size because all elements are classes return size ; }


add { @ code n } characters to the buffer returns the number of characters actually added to the buffer if the return value is less than { @ code n } , then eof was reached before { @ code n } characters could be added

protected int fill ( int n ) { for ( int i = 0 ; i < n ; i + + ) { if ( this n > 0 & & data [ this n - 1 ] = = int stream eof ) { return i ; } try { int c = next char ( ) ; if ( c > character max value | | c = = int stream eof ) { add ( c ) ; } else { char ch = ( char ) c ; if ( character is low surrogate ( ch ) ) { throw new runtime exception ( " invalid utf - 16 ( low surrogate with no preceding high surrogate ) " ) ; } else if ( character is high surrogate ( ch ) ) { int low surrogate = next char ( ) ; if ( low surrogate > character max value ) { throw new runtime exception ( " invalid utf - 16 ( high surrogate followed by code point > u + ffff " ) ; } else if ( low surrogate = = int stream eof ) { throw new runtime exception ( " invalid utf - 16 ( dangling high surrogate at end of file ) " ) ; } else { char low surrogate char = ( char ) low surrogate ; if ( character is low surrogate ( low surrogate char ) ) { add ( character to code point ( ch , low surrogate char ) ) ; } else { throw new runtime exception ( " invalid utf - 16 ( dangling high surrogate " ) ; } } } else { add ( c ) ; } } } catch ( i o exception ioe ) { throw new runtime exception ( ioe ) ; } } return n ; }


set whether to resolve the multipart request lazily at the time of file or parameter access default is " false " , resolving the multipart elements immediately , throwing corresponding exceptions at the time of the { @ link # resolve multipart } call switch this to " true " for lazy multipart parsing , throwing parse exceptions once the application attempts to obtain multipart files or parameters

public void set resolve lazily ( boolean resolve lazily ) { this resolve lazily = resolve lazily ; }


this function will do following logic based on the configured sps mode : if the configured mode is { @ link storage policy satisfier mode # external } , then it won ' t do anything administrator requires to start external sps service explicitly if the configured mode is { @ link storage policy satisfier mode # none } , then the service is disabled and won ' t do any action

public void start ( ) { if ( ! storage policy enabled ) { log info ( " disabling storage policy satisfier service as { } set to { } " , d f s config keys dfs storage policy enabled key , storage policy enabled ) ; return ; } switch ( mode ) { case external : log info ( " storage policy satisfier is configured as external , " + " please start external sps service explicitly to satisfy policy " ) ; break ; case none : log info ( " storage policy satisfier is disabled " ) ; break ; default : log info ( " given mode : { } is invalid " , mode ) ; break ; } }


returns the message from the gui resources that corresponds to the given key

private static string msg ( string message key ) { return g u i resources get message ( message key ) ; }


returns the single smallest { @ link resource } allocation that can be reserved in this plan

public resource get minimum allocation ( ) ;


callback from reference manager when a new fall - through reference is set

public void fall through changed ( address from addr , reference new fall through ref ) { lock acquire ( ) ; try { instruction d b instr = get instruction at ( addr map get key ( from addr , false ) ) ; / / todo : should prevent this if instruction is null or is in delay slot if ( instr ! = null ) { instr fall through changed ( new fall through ref ) ; } } finally { lock release ( ) ; } }


public body type get type ( ) { org jbox 2d dynamics body type type = body get type ( ) ; if ( type = = org jbox 2d dynamics body type dynamic ) return body type dynamic body ; if ( type = = org jbox 2d dynamics body type kinematic ) return body type kinematic body ; if ( type = = org jbox 2d dynamics body type static ) return body type static body ; return body type dynamic body ; }


is the filesystem using the inconsistentthrottlingunreliable client ?

public static boolean is fault injecting ( s 3 a file system fs ) { return fs get amazon s 3 client ( ) instanceof inconsistent amazon s 3 client ; }


synthesize an array of annotations from the supplied array of { @ code annotations } by creating a new array of the same size and type and populating it with { @ linkplain # synthesize annotation ( annotation , annotated element ) synthesized } versions of the annotations from the input array

static annotation [ ] synthesize annotation array ( annotation [ ] annotations , annotated element annotated element ) { if ( annotations scanner has plain java annotations only ( annotated element ) ) { return annotations ; } annotation [ ] synthesized = ( annotation [ ] ) array new instance ( annotations get class ( ) get component type ( ) , annotations length ) ; for ( int i = 0 ; i < annotations length ; i + + ) { synthesized [ i ] = synthesize annotation ( annotations [ i ] , annotated element ) ; } return synthesized ; }


sets the { @ link rule context } for the calling target

public builder set rule context ( rule context rule context ) { this rule context = rule context ; return this ; }


encode ' p ' in context of " - psalm - " , where it has become silent

boolean encode psalm ( ) { / / ' - psalm - ' if ( string at ( ( m current + 1 ) , 4 , " salm " , " " ) ) { / / go ahead and encode entire word if ( m encode vowels ) { metaph add ( " sam " ) ; } else { metaph add ( " sm " ) ; } m current + = 5 ; return true ; } return false ; }


public vh get ad view holder ( view view ) { return null ; }


public void remove interface ( int interface constant index ) { int interfaces count = target class u 2interfaces count ; int [ ] interfaces = target class u 2interfaces ; int interface index = find interface index ( interface constant index ) ; / / shift the interface entries system arraycopy ( interfaces , interface index + 1 , interfaces , interface index , interfaces count - interface index - 1 ) ; / / clear the last entry interfaces [ - - target class u 2interfaces count ] = 0 ; }


< b > note : < b > setting service context clears all services embedded with it

public void set service context ( r m service context context ) { this service context = context ; }


for each top - level class in the compilation matching the given predicate , determine the path prefix of classes corresponding to that compilation unit

static immutable set < string > get prefixes ( manifest manifest , predicate < compilation unit > p ) { return manifest get compilation unit list ( ) stream ( ) filter ( p ) flat map ( unit - > get unit prefixes ( unit ) ) collect ( to immutable set ( ) ) ; }


if you override this method , and the default behavior of checking 0 - 256 and mask values is desired , call super evaluate constant ( ) in your overriden method

public address evaluate constant ( varnode context context , instruction instr , int pcodeop , address constant , int size , ref type ref type ) { / / constant references below min speculative or near the end of the address space are suspect , / / even if memory exists for those locations address space space = constant get address space ( ) ; long max addr offset = space get max address ( ) get offset ( ) ; long word offset = constant get offset ( ) ; if ( ( ( word offset > = 0 & & word offset < min speculative offset ) | | ( math abs ( max addr offset - word offset ) < max speculative offset ) ) & & ! space is external space ( ) ) { return null ; } / / could just be integer - 1 extended into address if ( word offset = = 0xffffffff l | | word offset = = 0xffff l | | word offset = = - 1l ) { return null ; } return constant ; }


public static void set block token lifetime ( block token secret manager handler , long token lifetime ) { handler set token lifetime ( token lifetime ) ; }


returns true if the reference is indirect

public boolean is indirect ( ) { if ( this = = indirection ) { return true ; } return false ; }


returns a string representation of this system property

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


returns a new { @ code future } whose result is derived from the result of this { @ code future } if this input { @ code future } fails , the returned { @ code future } fails with the same exception ( and the function is not invoked ) example usage : { @ code listenable future < list < row > > rows future = query future transform ( query result : : get rows , executor ) ; } when selecting an executor , note that { @ code direct executor } is dangerous in some cases see the discussion in the { @ link # add listener } documentation all its warnings about heavyweight listeners are also applicable to heavyweight functions passed to this method the returned { @ code future } attempts to keep its cancellation state in sync with that of the input future that is , if the returned { @ code future } is cancelled , it will attempt to cancel the input , and if the input is cancelled , the returned { @ code future } will receive a callback in which it will attempt to cancel itself an example use of this method is to convert a serializable object returned from an rpc into a pojo this method is similar to { @ link java util concurrent completable future # then apply } and { @ link java util concurrent completable future # then apply async } it can also serve some of the use cases of { @ link java util concurrent completable future # handle } and { @ link java util concurrent completable future # handle async } when used along with { @ link # catching }

public final < t > fluent future < t > transform ( function < ? super v , t > function , executor executor ) { return ( fluent future < t > ) futures transform ( this , function , executor ) ; }


returns the distance between the given line and point note the specified line is not a line segment

public static float distance line point ( float start x , float start y , float end x , float end y , float point x , float point y ) { float normal length = ( float ) math sqrt ( ( end x - start x ) * ( end x - start x ) + ( end y - start y ) * ( end y - start y ) ) ; return math abs ( ( point x - start x ) * ( end y - start y ) - ( point y - start y ) * ( end x - start x ) ) / normal length ; }


make sure that an aggregation not using a script does get cached

public void test cache aggregation ( ) throws i o exception { directory directory = new directory ( ) ; random index writer index writer = new random index writer ( random ( ) , directory ) ; final int num docs = 10 ; for ( int i = 0 ; i < num docs ; i + + ) { index writer add document ( singleton ( new numeric doc values field ( " value " , i + 1 ) ) ) ; } index writer close ( ) ; directory unmapped directory = new directory ( ) ; random index writer unmapped index writer = new random index writer ( random ( ) , unmapped directory ) ; unmapped index writer close ( ) ; index reader index reader = directory reader open ( directory ) ; index reader unamapped index reader = directory reader open ( unmapped directory ) ; multi reader multi reader = new multi reader ( index reader , unamapped index reader ) ; index searcher index searcher = new searcher ( multi reader , true , true ) ; mapped field type field type = new number field mapper number field type ( " value " , number field mapper number type integer ) ; avg aggregation builder aggregation builder = new avg aggregation builder ( " avg " ) field ( " value " ) ; aggregation context context = create aggregation context ( index searcher , null , field type ) ; avg aggregator aggregator = create aggregator ( aggregation builder , context ) ; aggregator pre collection ( ) ; index searcher search ( new match all docs query ( ) , aggregator ) ; internal avg avg = ( internal avg ) aggregator build aggregation ( 0l ) ; assert equals ( 5 5 , avg get value ( ) , 0 ) ; assert equals ( " avg " , avg get name ( ) ) ; assert true ( aggregation inspection helper has value ( avg ) ) ; / / test that an aggregation not using a script does get cached assert true ( context is cacheable ( ) ) ; multi reader close ( ) ; directory close ( ) ; unmapped directory close ( ) ; }


test proper handling where an object incorrectly tests for an incompatible class

public void test invalid equals incompatible class ( ) { object obj = new invalid equals incompatible class object ( ) ; equals tester add equality group ( obj ) ; try { equals tester test equals ( ) ; } catch ( assertion failed error e ) { assert error message ( e , obj + " must not be object # equals to an arbitrary object of another class " ) ; return ; } fail ( " should get equal to incompatible class error " ) ; }


public void set baz ( string baz ) { this baz = baz ; }


option to control tagging data types and functions with their source code location ( ie filename : line number ) if the information is present in the dwarf record

public void set output source location info ( boolean output dwarf location info ) { this output d w a r f location info = output dwarf location info ; }


ensure get default port ( ) delegates to the custom implementation

public void get default port custom ( ) { int custom port = 43 ; channel builder default port provider mock channel builder default port provider = mock ( channel builder default port provider class ) ; when ( mock channel builder default port provider get default port ( ) ) then return ( custom port ) ; builder = new managed channel impl builder ( dummy target , new unsupported client transport factory builder ( ) , mock channel builder default port provider ) ; assert equals ( custom port , builder get default port ( ) ) ; verify ( mock channel builder default port provider ) get default port ( ) ; }


calculate the maximum distance of the currently added nodes from the nodes without inputs the smallest distance is 0 ( which are exactly the nodes without inputs ) and the distances of other nodes are the largest distances in their inputs plus 1 distance of a node is defined as the number of edges one needs to go through from the nodes without inputs to this node

map < exec node < ? > , integer > calculate maximum distance ( ) { map < exec node < ? > , integer > result = new hash map < > ( ) ; map < topology node , integer > inputs visited map = new hash map < > ( ) ; queue < topology node > queue = new linked list < > ( ) ; for ( topology node node : nodes values ( ) ) { if ( node inputs size ( ) = = 0 ) { queue offer ( node ) ; } } while ( ! queue is empty ( ) ) { topology node node = queue poll ( ) ; int dist = - 1 ; for ( topology node input : node inputs ) { dist = math max ( dist , preconditions check not null ( result get ( input exec node ) , " the distance of an input node is not calculated this is a bug " ) ) ; } dist + + ; result put ( node exec node , dist ) ; for ( topology node output : node outputs ) { int inputs visited = inputs visited map compute ( output , ( k , v ) - > v = = null ? 1 : v + 1 ) ; if ( inputs visited = = output inputs size ( ) ) { queue offer ( output ) ; } } } return result ; }


returns private immutable program this represents the local program to be checked - in program returned will be released by the merge test facilitator when disposed or re - initialized

public program d b get private program ( ) { if ( model = = null ) { return null ; / / initialize was never called } return model get private program ( ) ; }


double argument that has an absolute difference to the given value that is less than the given delta details see examples in javadoc for { @ link additional matchers } class

public static double eq ( double value , double delta ) { report matcher ( new equals with delta ( value , delta ) ) ; return 0 ; }


a duration > 1h is forbidden client - side in aws sdk 1 11 271 ; with the ability to extend durations deployed in march 2018 , duration checks will need to go server - side , and , presumably , later s d ks will remove the client side checks this code exists to see when this happens

public void test assume role three hour session duration ( ) throws exception { describe ( " try to authenticate with a long session duration " ) ; configuration conf = create assumed role config ( ) ; / / add a duration of three hours conf set int ( assumed role session duration , 3 * 60 * 60 ) ; try { new path ( get file system ( ) get uri ( ) ) get file system ( conf ) close ( ) ; log info ( " successfully created token of a duration > 3h " ) ; } catch ( i o exception ioe ) { assert exception contains ( validation error , ioe ) ; } }


heuristic used to determine the size of shard - side priority queues when selecting the top n terms from a distributed index

public static int suggest shard side queue size ( int final size ) { if ( final size < 1 ) { throw new illegal argument exception ( " size must be positive , got " + final size ) ; } / / request 50 % more buckets on the shards in order to improve accuracy / / as well as a small constant that should help with small values of ' size ' final long shard sample size = ( long ) ( final size * 1 5 + 10 ) ; return ( int ) math min ( integer max value , shard sample size ) ; }


outputs the final result to the wrapped collector

public void output result ( t result ) { this collector collect ( result ) ; }


public void test get all ( ) throws exception { / / setup final testing long state handle helper state handle provider = new testing long state handle helper ( ) ; zoo keeper state handle store < long > store = new zoo keeper state handle store < > ( zookeeper get client ( ) , state handle provider ) ; / / config final string path in zoo keeper = " / test get all " ; final set < long > expected = new hash set < > ( ) ; expected add ( 311222268470898l ) ; expected add ( 132812888l ) ; expected add ( 27255442l ) ; expected add ( 11122233124l ) ; / / test for ( long val : expected ) { store add and lock ( path in zoo keeper + val , val ) ; } for ( tuple 2 < retrievable state handle < long > , string > val : store get all and lock ( ) ) { assert true ( expected remove ( val f 0 retrieve state ( ) ) ) ; } assert equals ( 0 , expected size ( ) ) ; }


public boolean is call ( ) { return false ; }


the name of the tag , and its attributes , encoded as follows : tag name ; attr 1 = value 1 ; attr 2 = value 2 ; [ ] < code > optional string tag = 1 ; < code >

public builder set tag bytes ( com google protobuf byte string value ) { copy on write ( ) ; instance set tag bytes ( value ) ; return this ; }


public delete snapshot request builder set snapshots ( string snapshots ) { request snapshots ( snapshots ) ; return this ; }


public int [ ] execute batch ( ) throws s q l exception { return null ; }


rpc sync request obtain the return result through message future blocking

protected object send sync ( channel channel , rpc message rpc message , long timeout millis ) throws timeout exception { if ( timeout millis < = 0 ) { throw new framework exception ( " timeout should more than 0ms " ) ; } if ( channel = = null ) { logger warn ( " send sync nothing , caused by null channel " ) ; return null ; } message future message future = new message future ( ) ; message future set request message ( rpc message ) ; message future set timeout ( timeout millis ) ; futures put ( rpc message get id ( ) , message future ) ; channel writable check ( channel , rpc message get body ( ) ) ; string remote addr = channel util get address from channel ( channel ) ; do before rpc hooks ( remote addr , rpc message ) ; channel write and flush ( rpc message ) add listener ( ( channel future listener ) future - > { if ( ! future is success ( ) ) { message future message future 1 = futures remove ( rpc message get id ( ) ) ; if ( message future 1 ! = null ) { message future 1 set result message ( future cause ( ) ) ; } destroy channel ( future channel ( ) ) ; } } ) ; try { object result = message future get ( timeout millis , time unit milliseconds ) ; do after rpc hooks ( remote addr , rpc message , result ) ; return result ; } catch ( exception exx ) { logger error ( " wait response error : { } , ip : { } , request : { } " , exx get message ( ) , channel remote address ( ) , rpc message get body ( ) ) ; if ( exx instanceof timeout exception ) { throw ( timeout exception ) exx ; } else { throw new runtime exception ( exx ) ; } } }


public final api get api ( ) { return new api ( this ) ; }


returns all of the concrete indices that are open

public string [ ] get concrete all open indices ( ) { return all open indices ; }


helper utility function to reduce repeat of running a specific { @ link set } of checks

public static < t > list < deprecation issue > filter checks ( list < t > checks , function < t , deprecation issue > mapper ) { return checks stream ( ) map ( mapper ) filter ( objects : : non null ) collect ( collectors to list ( ) ) ; }


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


private void create actions ( string owner ) { list < docking action > list = new array list < > ( ) ; go to view action = new program tree action ( " go to start of folder / fragment in view " , owner , new string [ ] { " go to in view " } , key stroke get key stroke ( key event vk g , input event ctrl mask ) ) { @ override public void action performed ( action context context ) { add to view ( ) ; } } ; go to view action set enabled ( false ) ; go to view action set popup menu data ( new menu data ( new string [ ] { " go to in view " } , null , " aview " ) ) ; list add ( go to view action ) ; remove view action = new program tree action ( " remove folder / fragment from view " , owner , new string [ ] { " remove from view " } , key stroke get key stroke ( key event vk x , input event ctrl mask ) ) { @ override public void action performed ( action context context ) { remove from view ( ) ; } } ; remove view action set enabled ( false ) ; remove view action set popup menu data ( new menu data ( new string [ ] { " remove from view " } , null , " aview " ) ) ; list add ( remove view action ) ; replace view action = new program tree action ( " replace view " , owner , new string [ ] { " replace view " } , key stroke get key stroke ( key event vk r , input event ctrl mask ) ) { @ override public void action performed ( action context context ) { replace view ( ) ; } } ; replace view action set enabled ( false ) ; replace view action set popup menu data ( new menu data ( new string [ ] { " replace view " } , null , " aview " ) ) ; list add ( replace view action ) ; cut action = new program tree action ( " cut folder / fragment " , owner , new string [ ] { " cut " } , null ) { @ override public void action performed ( action context context ) { cut ( ) ; } } ; cut action set enabled ( false ) ; / / actions - auto generated cut action set popup menu data ( new menu data ( new string [ ] { " cut " } , null , " edit " ) ) ; list add ( cut action ) ; copy action = new program tree action ( " copy folder / fragment " , owner , new string [ ] { " copy " } , null ) { @ override public void action performed ( action context context ) { copy ( ) ; } } ; copy action set enabled ( false ) ; / / actions - auto generated copy action set popup menu data ( new menu data ( new string [ ] { " copy " } , null , " edit " ) ) ; list add ( copy action ) ; paste action = new program tree action ( " paste folder / fragment " , owner , new string [ ] { " paste " } , null , program tree action single selection ) { @ override public void action performed ( action context context ) { tree path path = tree get selection path ( ) ; program node node = ( program node ) path get last path component ( ) ; paste mgr paste ( node ) ; } } ; paste action set enabled ( false ) ; / / actions - auto generated paste action set popup menu data ( new menu data ( new string [ ] { " paste " } , null , " edit " ) ) ; list add ( paste action ) ; create folder action = new program tree action ( " create folder " , owner , new string [ ] { " create folder " } , null , program tree action single selection ) { @ override public void action performed ( action context context ) { create folder ( ) ; } } ; create folder action set enabled ( false ) ; / / actions - auto generated create folder action set popup menu data ( new menu data ( new string [ ] { " create folder " } , null , " create group " ) ) ; list add ( create folder action ) ; create fragment action = new program tree action ( " create fragment " , owner , new string [ ] { " create fragment " } , null , program tree action single selection ) { @ override public void action performed ( action context context ) { create fragment ( ( program node ) tree get last selected path component ( ) ) ; } } ; create fragment action set enabled ( false ) ; / / actions - auto generated create fragment action set popup menu data ( new menu data ( new string [ ] { " create fragment " } , null , " create group " ) ) ; list add ( create fragment action ) ; merge action = new program tree action ( " merge folder / fragment with parent " , owner , new string [ ] { " merge with parent " } , null , program tree action single selection ) { @ override public void action performed ( action context context ) { merge ( ) ; } } ; merge action set enabled ( false ) ; / / actions - auto generated merge action set popup menu data ( new menu data ( new string [ ] { " merge with parent " } , null , " merge " ) ) ; list add ( merge action ) ; delete action = new program tree action ( " delete folder / fragment " , owner , new string [ ] { " delete " } , null ) { @ override public void action performed ( action context context ) { delete ( ) ; } } ; delete action set enabled ( false ) ; / / actions - auto generated delete action set popup menu data ( new menu data ( new string [ ] { " delete " } , null , " delete " ) ) ; delete action set key binding data ( new key binding data ( key event vk delete , 0 ) ) ; list add ( delete action ) ; rename action = new program tree action ( " rename folder / fragment " , owner , new string [ ] { " rename " } , null , program tree action single selection ) { @ override public void action performed ( action context context ) { tree rename ( ) ; } } ; rename action set enabled ( false ) ; / / actions - auto generated rename action set popup menu data ( new menu data ( new string [ ] { " rename " } , null , " delete " ) ) ; list add ( rename action ) ; expand action = new program tree action ( " expand all folders / fragments " , owner , new string [ ] { " expand all " } , null , program tree action single selection ) { @ override public void action performed ( action context context ) { expand ( ) ; } } ; expand action set enabled ( false ) ; / / actions - auto generated expand action set popup menu data ( new menu data ( new string [ ] { " expand all " } , null , " expand " ) ) ; list add ( expand action ) ; collapse action = new program tree action ( " collapse all folders / fragments " , owner , new string [ ] { " collapse all " } , null , program tree action single selection ) { @ override public void action performed ( action context context ) { collapse ( ) ; } } ; collapse action set enabled ( false ) ; / / actions - auto generated collapse action set popup menu data ( new menu data ( new string [ ] { " collapse all " } , null , " expand " ) ) ; list add ( collapse action ) ; actions = new docking action [ list size ( ) ] ; actions = list to array ( actions ) ; }


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

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


creates the record readers for the extra broadcast inputs as configured by { @ link task config # get num broadcast inputs ( ) } this method requires that the task configuration , the driver , and the user - code class loader are set

protected void init broadcast input readers ( ) throws exception { final int num broadcast inputs = this config get num broadcast inputs ( ) ; final mutable reader < ? > [ ] broadcast input readers = new mutable reader < ? > [ num broadcast inputs ] ; int current reader offset = config get num inputs ( ) ; for ( int i = 0 ; i < this config get num broadcast inputs ( ) ; i + + ) { / / - - - - - - - - - - - - - - - - create the input readers - - - - - - - - - - - - - - - - - - - - - / / in case where a logical input unions multiple physical inputs , create a union reader final int group size = this config get broadcast group size ( i ) ; if ( group size = = 1 ) { / / non - union case broadcast input readers [ i ] = new mutable record reader < > ( get environment ( ) get input gate ( current reader offset ) , get environment ( ) get task manager info ( ) get tmp directories ( ) ) ; } else if ( group size > 1 ) { / / union case indexed input gate [ ] readers = new indexed input gate [ group size ] ; for ( int j = 0 ; j < group size ; + + j ) { readers [ j ] = get environment ( ) get input gate ( current reader offset + j ) ; } broadcast input readers [ i ] = new mutable record reader < > ( new union input gate ( readers ) , get environment ( ) get task manager info ( ) get tmp directories ( ) ) ; } else { throw new exception ( " illegal input group size in task configuration : " + group size ) ; } current reader offset + = group size ; } this broadcast input readers = broadcast input readers ; }


set the artifact location for the output protobuf

public android resource parsing action builder set output ( artifact output ) { this output = output ; return this ; }


wait for a packet with given { @ code seqno } to be enqueued to ack queue

packet wait for ack head ( long seqno ) throws interrupted exception { synchronized ( ack queue ) { while ( is running ( ) & & ack queue is empty ( ) ) { log debug ( " { } : seqno = { } waiting for local datanode to finish write " , my string , seqno ) ; ack queue wait ( ) ; } return is running ( ) ? ack queue element ( ) : null ; } }


returns an integer value with value - 1 , 0 , or 1 , if this long value is less than , equal to , or greater than the given specific long value , respectively

public integer value compare ( specific long value other ) { return new comparison value ( this , other ) ; }


state updates can be triggered from inside the change set calculation which causes an infinite loop because state updates calculates the change set again to prevent this we keep a track of how many times consequently state updates was invoked from within change set if this crosses the threshold a runtime exception is thrown

private void log state update when change set in progress ( ) { if ( + + m state updates from change set count = = state updates in loop threshold ) { components reporter emit message ( components reporter log level fatal , state updates in loop exceed threshold , " large number of state updates detected which indicates an infinite loop leading to unresponsive apps " ) ; } }


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


fully delete the given directory if it exists

private static void delete if exists ( file file ) { if ( file exists ( ) & & ! file util fully delete ( file ) ) { fail ( " could not delete ' " + file + " ' " ) ; } }


compare and set in one thread enables another waiting for value to succeed

public void test compare and set in multiple threads ( ) throws interrupted exception { final atomic double array a = new atomic double array ( 1 ) ; a set ( 0 , 1 0 ) ; thread t = new started thread ( new checked runnable ( ) { public void real run ( ) { while ( ! a compare and set ( 0 , 2 0 , 3 0 ) ) { thread yield ( ) ; } } } ) ; assert true ( a compare and set ( 0 , 1 0 , 2 0 ) ) ; await termination ( t ) ; assert bit equals ( 3 0 , a get ( 0 ) ) ; }


returns the arguments to pass to clang for specifying module map artifact location and module name

protected list < string > module map artifact arguments ( string package path , string target name ) { artifact module map artifact = get genfiles artifact ( target name + " modulemaps / module modulemap " , package path + " : " + target name ) ; string module name = ( package path + " " + target name ) replace ( " / / " , " " ) replace ( " @ " , " " ) replace ( " - " , " " ) replace ( " / " , " " ) replace ( " : " , " " ) ; return immutable list of ( " - iquote " , module map artifact get exec path ( ) get parent directory ( ) to string ( ) , " - fmodule - name = " + module name ) ; }


this implementation supports file paths beneath the root of the servlet context

protected resource get resource by path ( string path ) { assert state ( this servlet context ! = null , " no servlet context available " ) ; return new servlet context resource ( this servlet context , path ) ; }


return the ( potentially null ) scope to be reported with the failure

public string failure scope ( ) { return failure scope ; }


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


returns true if the specified byte provider starts with a mach header magic signature

public static boolean is mach header ( byte provider provider ) { try { return provider length ( ) > integer bytes & & mach constants is magic ( read magic ( provider , 0 ) ) ; } catch ( i o exception e ) { / / dont care } return false ; }


determines whether this fluent iterable is empty < b > { @ code stream } equivalent : < b > { @ code ! stream find any ( ) is present ( ) }

public final boolean is empty ( ) { return ! get delegate ( ) iterator ( ) has next ( ) ; }


create a factory then a committer , validating its type

private < t extends path output committer factory > t create committer factory ( class < t > factory class , path path , configuration conf ) { path output committer factory factory = get committer factory ( path , conf ) ; assert equals ( " wrong factory for path " + path , factory class , factory get class ( ) ) ; return ( t ) factory ; }


encode special case where " - ga - " = > j

boolean encode ga to j ( ) { / / ' margary ' , ' margarine ' if ( ( string at ( ( m current - 3 ) , 7 , " margary " , " margari " , " " ) / / but not in spanish forms such as " margatita " & & ! string at ( ( m current - 3 ) , 8 , " margarit " , " " ) ) | | string at ( 0 , 4 , " gaol " , " " ) | | string at ( ( m current - 2 ) , 5 , " algae " , " " ) ) { metaph add exact approx ( " j " , " g " , " j " , " k " ) ; advance counter ( 2 , 1 ) ; return true ; } return false ; }


download < code > fsimage < code > and < code > edits < code > files from the name - node

static boolean download checkpoint files ( final url nn host port , final f s image dst image , final checkpoint signature sig , final remote edit log manifest manifest ) throws i o exception { / / sanity check manifest - these could happen if , eg , someone on the / / nn side accidentally rmed the storage directories if ( manifest get logs ( ) is empty ( ) ) { throw new i o exception ( " found no edit logs to download on nn since txid " + sig most recent checkpoint tx id ) ; } long expected tx id = sig most recent checkpoint tx id + 1 ; if ( manifest get logs ( ) get ( 0 ) get start tx id ( ) ! = expected tx id ) { throw new i o exception ( " bad edit log manifest ( expected txid = " + expected tx id + " : " + manifest ) ; } try { boolean b = user group information get current user ( ) do as ( new privileged exception action < boolean > ( ) { @ override public boolean run ( ) throws exception { dst image get storage ( ) c time = sig c time ; / / get fsimage if ( sig most recent checkpoint tx id = = dst image get storage ( ) get most recent checkpoint tx id ( ) ) { log info ( " image has not changed will not download image " ) ; } else { log info ( " image has changed downloading updated image from nn " ) ; m d 5 hash downloaded hash = transfer fs image download image to storage ( nn host port , sig most recent checkpoint tx id , dst image get storage ( ) , true , false ) ; dst image save digest and rename checkpoint image ( name node file image , sig most recent checkpoint tx id , downloaded hash ) ; } / / get edits file for ( remote edit log log : manifest get logs ( ) ) { transfer fs image download edits to storage ( nn host port , log , dst image get storage ( ) ) ; } / / true if we haven ' t loaded all the transactions represented by the / / downloaded fsimage return dst image get last applied tx id ( ) < sig most recent checkpoint tx id ; } } ) ; return b boolean value ( ) ; } catch ( interrupted exception e ) { throw new runtime exception ( e ) ; } }


required : a list of server specifications < code > repeated istio networking v 1alpha 3 server servers = 1 ; < code >

public java util list < ? extends com alibaba nacos istio model server or builder > get servers or builder list ( ) { if ( servers builder ! = null ) { return servers builder get message or builder list ( ) ; } else { return java util collections unmodifiable list ( servers ) ; } }


public void nio t c p client ( socket channel ch ) throws i o exception { try { / / query sizes are small , so the following two lines should work / / in all instances byte buffer buf = byte buffer allocate ( 1024 ) ; ch read ( buf ) ; buf flip ( ) ; int message length = get messge length ( buf ) ; byte [ ] in = new byte [ message length ] ; buf get ( in , 0 , message length ) ; message query ; byte [ ] response ; try { query = new message ( in ) ; log info ( " received tcp query { } " , query get question ( ) ) ; response = generate reply ( query , ch socket ( ) ) ; if ( response = = null ) { return ; } } catch ( i o exception e ) { response = form error message ( in ) ; } byte buffer out = byte buffer allocate ( response length + 2 ) ; out clear ( ) ; byte [ ] data = new byte [ 2 ] ; data [ 1 ] = ( byte ) ( response length & 0x f f ) ; data [ 0 ] = ( byte ) ( ( response length > > 8 ) & 0x f f ) ; out put ( data ) ; out put ( response ) ; out flip ( ) ; while ( out has remaining ( ) ) { ch write ( out ) ; } } catch ( i o exception e ) { throw net utils wrap exception ( ch socket ( ) get inet address ( ) get host name ( ) , ch socket ( ) get port ( ) , ch socket ( ) get local address ( ) get host name ( ) , ch socket ( ) get local port ( ) , e ) ; } catch ( buffer underflow exception e ) { / / ignore system monitor ping packets } finally { i o utils close stream ( ch ) ; } }


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


public client build ( string name ) { if ( ( environment = = null ) & & ( ( executor service = = null ) | | ( object mapper = = null ) ) ) { throw new illegal state exception ( " must have either an environment or both " + " an executor service and an object mapper " ) ; } if ( executor service = = null ) { / / create an executor service based on the provided / / configuration the disposable executor service decorator / / is used to ensure that the service is shut down if the / / jersey client disposes of it executor service = require non null ( environment ) lifecycle ( ) executor service ( " jersey - client - " + name + " - % d " ) min threads ( configuration get min threads ( ) ) max threads ( configuration get max threads ( ) ) work queue ( new array blocking queue < > ( configuration get work queue size ( ) ) ) build ( ) ; } if ( object mapper = = null ) { object mapper = require non null ( environment ) get object mapper ( ) ; } if ( environment ! = null ) { validator = environment get validator ( ) ; } return build ( name , executor service , object mapper , validator ) ; }


public static void bind service ( @ non null final class < ? > cls , @ non null final service connection conn , final int flags ) { bind service ( new intent ( utils get app ( ) , cls ) , conn , flags ) ; }


public bulk request add ( bytes reference data , @ nullable string default index , x content type x content type ) throws i o exception { return add ( data , default index , null , null , null , null , true , x content type ) ; }


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

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


set the instance that matches the one of child schema , check the instance parameter is valid against the one of child schemas : equilateral triangle , isosceles triangle , scalene triangle it could be an instance of the ' one of ' schemas the one of child schemas may themselves be a composed schema ( all of , any of , one of )

public void set actual instance ( object instance ) { if ( json is instance of ( equilateral triangle class , instance , new hash set < class < ? > > ( ) ) ) { super set actual instance ( instance ) ; return ; } if ( json is instance of ( isosceles triangle class , instance , new hash set < class < ? > > ( ) ) ) { super set actual instance ( instance ) ; return ; } if ( json is instance of ( scalene triangle class , instance , new hash set < class < ? > > ( ) ) ) { super set actual instance ( instance ) ; return ; } throw new runtime exception ( " invalid instance type must be equilateral triangle , isosceles triangle , scalene triangle " ) ; }


removes from this array all of elements contained in the specified array

public boolean remove all ( float array array ) { int size = this size ; int start size = size ; float [ ] items = this items ; for ( int i = 0 , n = array size ; i < n ; i + + ) { float item = array get ( i ) ; for ( int ii = 0 ; ii < size ; ii + + ) { if ( item = = items [ ii ] ) { remove index ( ii ) ; size - - ; break ; } } } return size ! = start size ; }


the file is a real performance report got from a 8 g p us aws instance it contains every combination g p us ' training performance of tensorflow benchmark the columns are the model name , batch size , gpu ids and images per second

public void read from file ( ) { string csv report file path = get class ( ) get class loader ( ) get resource ( " tensorflow - bench - result - for - gpu csv " ) get file ( ) ; buffered reader br = null ; string line = " " ; try { br = new buffered reader ( new file reader ( csv report file path ) ) ; string model ; int batch size ; string gpu combination ; float image per second ; int gpu count ; while ( ( line = br read line ( ) ) ! = null ) { / / skip the licence content if ( line starts with ( " # " ) ) { continue ; } string [ ] tokens = line replace all ( " \ " " , " " ) split ( " , " ) ; if ( tokens length ! = 4 ) { log error ( " unexpected performance data format ! " ) ; break ; } model = tokens [ 0 ] ; batch size = integer parse int ( tokens [ 1 ] trim ( ) ) ; gpu combination = tokens [ 2 ] ; image per second = float parse float ( tokens [ 3 ] ) ; gpu count = get gpu count ( gpu combination ) ; this data set add ( new data record ( model , batch size , gpu combination , image per second , gpu count ) ) ; } } catch ( exception e ) { e print stack trace ( ) ; } finally { if ( br ! = null ) { try { br close ( ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } } } / / end finally }


save snapshots and snapshot quota for a snapshottable directory

public static void save snapshots ( i node directory current , data output out ) throws i o exception { directory snapshottable feature sf = current get directory snapshottable feature ( ) ; preconditions check argument ( sf ! = null ) ; / / list of snapshots in snapshots by names read only list < snapshot > snapshots = sf get snapshot list ( ) ; out write int ( snapshots size ( ) ) ; for ( snapshot s : snapshots ) { / / write the snapshot id out write int ( s get id ( ) ) ; } / / snapshot quota out write int ( sf get snapshot quota ( ) ) ; }


where the enumflag item was defined < code > optional aapt pb source source = 1 ; < code >


public boolean is valid ( final string expected audience , final string expected issuer , final long time drift ) { if ( ! this audience equals ignore case ( expected audience ) ) { logger warn ( " audience [ { } ] is invalid where the expected audience should be [ { } ] " , this audience , expected audience ) ; return false ; } if ( ! this issuer equals ignore case ( expected issuer ) ) { logger warn ( " issuer [ { } ] is invalid since the expected issuer should be [ { } ] " , this issuer , expected issuer ) ; return false ; } val retrieved on time drift = get retrieved on ( ) minus ( time drift , chrono unit millis ) ; if ( get issued on ( ) is before ( retrieved on time drift ) ) { logger warn ( " ticket is issued before the allowed drift issued on [ { } ] while allowed drift is [ { } ] " , this issued on , retrieved on time drift ) ; return false ; } val retrieved on time after drift = get retrieved on ( ) plus ( time drift , chrono unit millis ) ; if ( get issued on ( ) is after ( retrieved on time after drift ) ) { logger warn ( " ticket is issued after the allowed drift issued on [ { } ] while allowed drift is [ { } ] " , get issued on ( ) , retrieved on time after drift ) ; return false ; } if ( get retrieved on ( ) is after ( this not on or after ) ) { logger warn ( " ticket is too late because it ' s retrieved on [ { } ] which is after [ { } ] " , get retrieved on ( ) , this not on or after ) ; return false ; } logger debug ( " ws fed credential is validated for [ { } ] and [ { } ] " , expected audience , expected issuer ) ; return true ; }


sets the java package will be ignored except when parsing resources with data binding

public android resource parsing action builder set java package ( @ nullable string java package ) { this java package = java package ; return this ; }


{ @ code predicate } that applies to any handlers

public static handler type predicate for any handler type ( ) { return new handler type predicate ( collections empty set ( ) , collections empty list ( ) , collections empty list ( ) ) ; }


public static < k , v > builder < k , v > builder ( ) { return new builder < > ( ) ; }


returns the index of the given value , or - 1 if the value does not appear in the list this will do a binary search if the list is sorted or a linear search if not

public int index of ( int value ) { int ret = binarysearch ( value ) ; return ret > = 0 ? ret : - 1 ; }


fake endpoint for testing various parameters 가짜 엔드 포인트 ( asynchronously ) fake endpoint for testing various parameters 가짜 엔드 포인트

public okhttp 3 call test endpoint parameters async ( big decimal number , double double , string pattern without delimiter , byte [ ] byte , integer integer , integer int 3 2 , long int 6 4 , float float , string string , file binary , local date date , offset date time date time , string password , string param callback , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = test endpoint parameters validate before call ( number , double , pattern without delimiter , byte , integer , int 3 2 , int 6 4 , float , string , binary , date , date time , password , param callback , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


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

public void delete user test ( ) { string username = null ; / / api delete user ( username ) ; / / todo : test validations }


a convenience method for setting a value directly on a register rather than breaking out the components

public final void set value ( register reg , long cval ) { address addr = reg get address ( ) ; set value ( addr get address space ( ) , addr get offset ( ) , reg get minimum byte size ( ) , cval ) ; }


we have an empty default implementation here because most source readers do not have to implement the method

default void notify checkpoint complete ( long checkpoint id ) throws exception { }


returns the table connector name used for log and web ui

public static string generate runtime name ( class < ? > clazz , string [ ] fields ) { return table connector utils generate runtime name ( clazz , fields ) ; }


public void test enum arrays ( ) { / / todo : test enum arrays }


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


returns true if the comparison panel opposite the one with focus , is read - only eg : if the right - side panel has focus , and the left - side panel is read - only , this will return true

protected boolean has read only non focused side ( code comparison panel < ? extends field panel coordinator > code comparison panel ) { function left function = code comparison panel get left function ( ) ; function right function = code comparison panel get right function ( ) ; if ( left function = = null | | right function = = null ) { return false ; / / doesn ' t have a function on both sides } boolean left has focus = code comparison panel left panel has focus ( ) ; program left program = left function get program ( ) ; program right program = right function get program ( ) ; return ( ! left has focus & & left program get domain file ( ) is read only ( ) ) | | ( left has focus & & right program get domain file ( ) is read only ( ) ) ; }


remove all vertices and edges from the { @ link graph }

public void clear ( ) { this graph remove all edges ( new hash set < > ( graph edge set ( ) ) ) ; this graph remove all vertices ( new hash set < > ( graph vertex set ( ) ) ) ; }


returns the upstream tls context in this ssl context provider if this is client side

public upstream tls context get upstream tls context ( ) { check state ( tls context instanceof upstream tls context , " expected upstream tls context " ) ; return ( ( upstream tls context ) tls context ) ; }


completes this operation successfully the stopwatch given during construction is used to measure the elapsed time registered callbacks are invoked and provided the measured elapsed time

public boolean complete ( ) { map < client transport ping callback , executor > callbacks ; long round trip time nanos ; synchronized ( this ) { if ( completed ) { return false ; } completed = true ; round trip time nanos = this round trip time nanos = stopwatch elapsed ( time unit nanoseconds ) ; callbacks = this callbacks ; this callbacks = null ; } for ( map entry < client transport ping callback , executor > entry : callbacks entry set ( ) ) { do execute ( entry get value ( ) , as runnable ( entry get key ( ) , round trip time nanos ) ) ; } return true ; }


return { @ link existing shards allocator } implementations added by this plugin ; the index setting { @ link existing shards allocator # existing shards allocator setting } sets the key of the allocator to use to allocate its shards the default allocator is { @ link org elasticsearch gateway gateway allocator }

default map < string , existing shards allocator > get existing shards allocators ( ) { return collections empty map ( ) ; }


public t random ( ) { list < t > items = ref items ; if ( items size ( ) = = 0 ) { return null ; } if ( items size ( ) = = 1 ) { return items get ( 0 ) ; } return items get ( thread local random current ( ) next int ( items size ( ) ) ) ; }


disable mouse navigation from within this dual decompiler panel

public void set mouse navigation enabled ( boolean enabled ) { c panels [ left ] set mouse navigation enabled ( enabled ) ; c panels [ right ] set mouse navigation enabled ( enabled ) ; }


adds a translational component to the matrix in the 3rd column the other columns are untouched

public matrix 3 trn ( vector 3 vector ) { val [ m02 ] + = vector x ; val [ m12 ] + = vector y ; return this ; }


returns the output base directory associated with this blaze server process this is the base directory for shared blaze state as well as tool and strategy specific subdirectories

public path get output base ( ) { return get directories ( ) get output base ( ) ; }


public long get succeeded max elapsed ( ) { return succeeded max elapsed get ( ) ; }


expand the square represented by the corner points by pushing out equally in all directions

private static result point [ ] expand square ( result point [ ] corner points , int old side , int new side ) { float ratio = new side / ( 2 0f * old side ) ; float dx = corner points [ 0 ] get x ( ) - corner points [ 2 ] get x ( ) ; float dy = corner points [ 0 ] get y ( ) - corner points [ 2 ] get y ( ) ; float centerx = ( corner points [ 0 ] get x ( ) + corner points [ 2 ] get x ( ) ) / 2 0f ; float centery = ( corner points [ 0 ] get y ( ) + corner points [ 2 ] get y ( ) ) / 2 0f ; result point result 0 = new result point ( centerx + ratio * dx , centery + ratio * dy ) ; result point result 2 = new result point ( centerx - ratio * dx , centery - ratio * dy ) ; dx = corner points [ 1 ] get x ( ) - corner points [ 3 ] get x ( ) ; dy = corner points [ 1 ] get y ( ) - corner points [ 3 ] get y ( ) ; centerx = ( corner points [ 1 ] get x ( ) + corner points [ 3 ] get x ( ) ) / 2 0f ; centery = ( corner points [ 1 ] get y ( ) + corner points [ 3 ] get y ( ) ) / 2 0f ; result point result 1 = new result point ( centerx + ratio * dx , centery + ratio * dy ) ; result point result 3 = new result point ( centerx - ratio * dx , centery - ratio * dy ) ; return new result point [ ] { result 0 , result 1 , result 2 , result 3 } ; }


gets a referenced repeatable comment as a ref repeat comment object

public string [ ] get referenced repeatable comments ( address ref address ) { object [ ] ref repeat array = display comment arrays [ ref repeatables ] ; for ( object element : ref repeat array ) { ref repeat comment ref repeat comment = ( ref repeat comment ) element ; if ( ref repeat comment get address ( ) equals ( ref address ) ) { return ref repeat comment get comment lines ( ) ; } } return null ; }


tests that track selector will prefer tracks that are within renderer ' s capabilities over track that have both language matching preferred audio given by { @ link parameters } and { @ link c # selection flag default } , but exceed renderer ' s capabilities

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


this implementation creates a class path resource , applying the given path relative to the path of the underlying resource of this descriptor

public resource create relative ( string relative path ) { string path to use = string utils apply relative path ( this path , relative path ) ; return ( this clazz ! = null ? new class path resource ( path to use , this clazz ) : new class path resource ( path to use , this class loader ) ) ; }


updates the ' add ' button state based on the selections in the known users panel

private void update add button state ( ) { boolean enabled = false ; list < string > selected user names = known users panel get selected users ( ) ; for ( string user : selected user names ) { if ( ! user access panel is in project access list ( user ) ) { enabled = true ; break ; } } add button set enabled ( enabled ) ; }


if { @ link # execute ( ) } or { @ link # queue ( ) } fails in any way then this method will be invoked to provide an opportunity to return a fallback response this should do work that does not require network transport to produce in other words , this should be a static or cached result that can immediately be returned upon failure if network traffic is wanted for fallback ( such as going to mem cache ) then the fallback implementation should invoke another { @ link hystrix command } instance that protects against that network access and possibly has another level of fallback that does not involve network access default behavior : it throws unsupported operation exception

protected r get fallback ( ) { throw new unsupported operation exception ( " no fallback available " ) ; }


public okhttp 3 call update user call ( string username , user body , final api callback callback ) throws api exception { object local var post body = body ; / / create path and map variables api operation api operation = local var api client get operation lookup map ( ) get ( " update user " ) ; if ( api operation = = null ) { throw new api exception ( " operation not found in oas " ) ; } operation operation = api operation get operation ( ) ; string local var path = api operation get path ( ) ; map < string , object > param map = new hash map < > ( ) ; param map put ( " username " , username ) ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; local var path = local var api client fill parameters from operation ( operation , param map , local var path , local var query params , local var collection query params , local var header params , local var cookie params ) ; final string [ ] local var accepts = { } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , api operation get method ( ) , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


public string get index ( ) { return get result get index ( ) ; }


helper method to set api key value for the first api key authentication

public void set api key ( string api key ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof api key auth ) { ( ( api key auth ) auth ) set api key ( api key ) ; return ; } } throw new runtime exception ( " no api key authentication configured ! " ) ; }


startrestart the timer the runs the check can safely be called multiple times

public void start ( ) { if ( task get ( ) = = null ) { timer task timer task = new timer task ( ) { @ override public void run ( ) { try { check containers ( ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; log info ( " interrupted " ) ; cancel ( ) ; } catch ( throwable e ) { log error ( " error checking containers " , e ) ; } } } ; if ( task compare and set ( null , timer task ) ) { timer schedule at fixed rate ( timer task , check interval ms , check interval ms ) ; } } }


returns task description that will be available via task manager

protected string get description ( persistent task < params > task in progress ) { return " id = " + task in progress get id ( ) ; }


get the filters this will be an unmodifiable list

public list < keyed filter > filters ( ) { return collections unmodifiable list ( this filters ) ; }


validates the entry throws an illegal argement exception if the data record is missing required information

public void validate ( ) { super validate ( ) ; if ( get nameservice id ( ) = = null | | get nameservice id ( ) length ( ) = = 0 ) { throw new illegal argument exception ( error msg no ns specified + this ) ; } if ( get web address ( ) = = null | | get web address ( ) length ( ) = = 0 ) { throw new illegal argument exception ( error msg no web addr specified + this ) ; } if ( get rpc address ( ) = = null | | get rpc address ( ) length ( ) = = 0 ) { throw new illegal argument exception ( error msg no rpc addr specified + this ) ; } if ( ! is bad state ( ) & & ( get block pool id ( ) is empty ( ) | | get block pool id ( ) length ( ) = = 0 ) ) { throw new illegal argument exception ( error msg no bp specified + this ) ; } }


connect to the given web socket url and notify the given { @ link org springframework messaging simp stomp stomp session handler } when connected on the stomp level after the connected frame is received

public listenable future < stomp session > connect ( string url , stomp session handler handler , object uri vars ) { return connect ( url , null , handler , uri vars ) ; }


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

public static generic array type array of ( type component type ) { return new generic array type impl ( component type ) ; }


returns the unsigned { @ code long } value represented by the given decimal string < b > java 8 users : < b > use { @ link long # parse unsigned long ( string ) } instead

public static long parse unsigned long ( string string ) { return parse unsigned long ( string , 10 ) ; }


an aspect has a late - bound attribute with no value ( that is , a late bound default whose get default ( ) returns ` null ` ) test that this attribute is available in the rule context which is provided to the aspect ' s ` create ( ) ` method

public void empty aspect attributes are available in rule context ( ) throws exception { set rules and aspects available in tests ( immutable list of ( test aspects simple aspect , empty aspect attributes are available in rule context aspect with empty late bound attribute instance ) , immutable list of ( test aspects base rule , empty aspect attributes are available in rule context test rule ) ) ; pkg ( " a " , " testrule ( name = ' a ' , foo = [ ' : b ' ] ) " , " testrule ( name = ' b ' ) " ) ; configured target a = get configured target ( " / / a : a " ) ; assert that ( a get provider ( rule info class ) get data ( ) to list ( ) ) contains ( " empty " ) ; }


generates a new reservation id which is then sent to the client this method is reachable by using { @ link r m w s consts # reservation new }

response create new reservation ( http servlet request hsr ) throws authorization exception , i o exception , interrupted exception ;


create a new { @ link geo distance } aggregation with the given name

public static geo distance aggregation builder geo distance ( string name , geo point origin ) { return new geo distance aggregation builder ( name , origin ) ; }


convenience method that forwards to { @ link # index random ( boolean , list ) }

public void index random ( boolean force refresh , index request builder builders ) throws interrupted exception { index random ( force refresh , arrays as list ( builders ) ) ; }


writes this { @ code bloom filter } to an output stream , with a custom format ( not java serialization ) this has been measured to save at least 400 bytes compared to regular serialization use { @ linkplain # read from ( input stream , funnel ) } to reconstruct the written bloom filter

public void write to ( output stream out ) throws i o exception { / / serial form : / / 1 signed byte for the strategy / / 1 unsigned byte for the number of hash functions / / 1 big endian int , the number of longs in our bitset / / n big endian longs of our bitset data output stream dout = new data output stream ( out ) ; dout write byte ( signed bytes checked cast ( strategy ordinal ( ) ) ) ; dout write byte ( unsigned bytes checked cast ( num hash functions ) ) ; / / note : checked at the c ' tor dout write int ( bits data length ( ) ) ; for ( int i = 0 ; i < bits data length ( ) ; i + + ) { dout write long ( bits data get ( i ) ) ; } }


test cleanup for a job that fails ( first a task fails , then the job recovers , then the whole job fails due to a limited restart policy )

public void test blob server cleanup failed job ( ) throws exception { test blob server cleanup ( test case job fails ) ; }


check whether required attributes are found in the given map

protected boolean required attributes found in map ( final map < string , object > principal attributes , final map < string , set < string > > required attributes ) { val difference = required attributes key set ( ) stream ( ) filter ( a - > principal attributes key set ( ) contains ( a ) ) collect ( collectors to set ( ) ) ; logger debug ( " difference of checking required attributes : [ { } ] " , difference ) ; if ( this require all attributes & & difference size ( ) < required attributes size ( ) ) { return false ; } if ( this require all attributes ) { return difference stream ( ) all match ( key - > required attribute found ( key , principal attributes , required attributes ) ) ; } return difference stream ( ) any match ( key - > required attribute found ( key , principal attributes , required attributes ) ) ; }


make sure that " \ r \ n " isn ' t made into a newline in audit log

public void test audit character escape ( ) throws exception { final path file = new path ( " foo " + " \ r \ n " + " bar " ) ; setup audit logs ( ) ; fs create ( file ) ; verify audit logs repeat ( true , 1 ) ; }


perform a given action and continue parsing , exhausting all results after the action

protected void do action ( action a , assembly parse token tok , set < assembly parse machine > results , deque < assembly parse machine > visited ) { try ( dbg ctx dc = dbg start ( " action : " + a ) ) { if ( a instanceof shift action ) { assembly parse machine m = copy ( ) ; m stack push ( ( ( shift action ) a ) new state num ) ; m tree stack push ( tok ) ; m last tok = tok ; m pos + = tok get string ( ) length ( ) ; m exhaust ( results , visited ) ; } else if ( a instanceof reduce action ) { assembly production prod = ( ( reduce action ) a ) prod ; assembly parse branch branch = new assembly parse branch ( parser grammar , prod ) ; assembly parse machine m = copy ( ) ; m output add ( prod get index ( ) ) ; dbg println ( " prod : " + prod ) ; for ( @ suppress warnings ( " unused " ) assembly symbol sym : prod ) { m stack pop ( ) ; branch add child ( m tree stack pop ( ) ) ; } for ( action aa : m parser actions get ( m stack peek ( ) , prod get l h s ( ) ) ) { goto action ga = ( goto action ) aa ; dbg println ( " goto : " + ga ) ; assembly parse machine n = m copy ( ) ; n stack push ( ga new state num ) ; n tree stack push ( branch ) ; n exhaust ( results , visited ) ; } } else if ( a instanceof accept action ) { assembly parse machine m = copy ( ) ; m accepted = true ; results add ( m ) ; } } }


specifies the types for the csv fields this method parses the csv data to a 25 - tuple which has fields of the specified types this method is overloaded for each possible length of the tuples to support type safe creation of data sets through csv parsing


sets the { @ link progress update listener }

public void set progress update listener ( @ nullable progress update listener listener ) { this progress update listener = listener ; }


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


returns the original element list , unchanged

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


creates a new named mock authentication handler that either successfully validates all credentials or fails to validate all credentials

private static authentication handler new mock handler ( final string name , final boolean success , final boolean error ) { val mock = mock ( authentication handler class ) ; when ( mock get name ( ) ) then return ( name ) ; when ( mock supports ( any ( credential class ) ) ) then return ( true ) ; if ( success ) { val p = principal factory utils new principal factory ( ) create principal ( " nobody " ) ; val result = new default authentication handler execution result ( mock , mock ( credential meta data class ) , p ) ; when ( mock authenticate ( any ( credential class ) ) ) then return ( result ) ; } else if ( ! error ) { when ( mock authenticate ( any ( credential class ) ) ) then throw ( new failed login exception ( ) ) ; } else { when ( mock authenticate ( any ( credential class ) ) ) then throw ( new prevented exception ( " failure " ) ) ; } return mock ; }


public static string task result 2string ( string name , task result result ) { return name + " " + name + " > " + result ; }


finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

public list < pet > find pets by tags ( list < string > tags ) throws api exception { api response < list < pet > > local var response = find pets by tags with http info ( tags ) ; return local var response get data ( ) ; }


propagate a counter from the instance - level statistics to the s3a instrumentation , subtracting the previous merged value

void promote i o counter ( string name ) { increment mutable counter ( name , lookup counter value ( name ) - merged stats counters ( ) get ( name ) ) ; }


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

public static < t > t touch ( t msg ) { if ( msg instanceof reference counted ) { return ( t ) ( ( reference counted ) msg ) touch ( ) ; } return msg ; }


public static rpc context get context from identified ( channel channel ) { return identified channels get ( channel ) ; }


this method checks if the flyweight task can be run on any of the available executors

private runnable make fly weight task buildable ( final buildable item p ) { / / we double check if this is a flyweight task if ( p task instanceof flyweight task ) { jenkins h = jenkins get ( ) ; label lbl = p get assigned label ( ) ; computer master computer = h to computer ( ) ; if ( lbl ! = null & & lbl equals ( h get self label ( ) ) ) { / / the flyweight task is bound to the master if ( h can take ( p ) = = null ) { return create fly weight task runnable ( p , master computer ) ; } else { return null ; } } if ( lbl = = null & & h can take ( p ) = = null & & master computer is online ( ) & & master computer is accepting tasks ( ) ) { / / the flyweight task is not tied to a specific label , so execute on master if possible / / this will ensure that actual agent disconnects do not impact flyweight tasks randomly assigned to them return create fly weight task runnable ( p , master computer ) ; } map < node , integer > hash source = new hash map < > ( h get nodes ( ) size ( ) ) ; for ( node n : h get nodes ( ) ) { hash source put ( n , n get num executors ( ) * 100 ) ; } consistent hash < node > hash = new consistent hash < > ( node hash ) ; hash add all ( hash source ) ; string full display name = p task get full display name ( ) ; for ( node n : hash list ( full display name ) ) { final computer c = n to computer ( ) ; if ( c = = null | | c is offline ( ) ) { continue ; } if ( lbl ! = null & & ! lbl contains ( n ) ) { continue ; } if ( n can take ( p ) ! = null ) { continue ; } return create fly weight task runnable ( p , c ) ; } } return null ; }


gets the rocks d b { @ link column family options } to be used for all rocks d b instances

public column family options get column options ( ) { / / initial options from pre - defined profile column family options opt = predefined options create column options ( handles to close ) ; handles to close add ( opt ) ; / / add user - defined options , if specified if ( options factory ! = null ) { opt = options factory create column options ( opt , handles to close ) ; } / / if shared resources is non - null , use the block cache from it and / / set necessary options for performance consideration with memory control if ( shared resources ! = null ) { final rocks d b shared resources rocks resources = shared resources get resource handle ( ) ; final cache block cache = rocks resources get cache ( ) ; table format config table format config = opt table format config ( ) ; block based table config block based table config ; if ( table format config = = null ) { block based table config = new block based table config ( ) ; } else { preconditions check argument ( table format config instanceof block based table config , " we currently only support block based table config when bounding total memory " ) ; block based table config = ( block based table config ) table format config ; } block based table config set block cache ( block cache ) ; block based table config set cache index and filter blocks ( true ) ; block based table config set cache index and filter blocks with high priority ( true ) ; block based table config set pin l 0 filter and index blocks in cache ( true ) ; opt set table format config ( block based table config ) ; } return opt ; }


empty configured values are ignored and the fallback is used instead

private static formatter get configured formatter property ( formatter builder value , string configured name , formatter fallback value ) { return get configured property ( builder value , configured name , val - > { val = val trim ( ) ; if ( val length ( ) > 0 ) { try { return ( formatter ) class loader get system class loader ( ) load class ( val ) get declared constructor ( ) new instance ( ) ; } catch ( reflective operation exception e ) { throw new illegal argument exception ( e ) ; } } else { return fallback value ; } } , fallback value ) ; }


default boolean send ( final string from , final string to , final string message ) { return false ; }


public class < ? > get target type ( ) { object target type value = this target type ; if ( ! ( target type value instanceof class ) ) { throw new illegal state exception ( " typed string value does not carry a resolved target type " ) ; } return ( class < ? > ) target type value ; }


return true if the given node is on the temporary " cut " clipboard

boolean clipboard contains ( program node node ) { try { list < program node > list = get program node list from clipboard ( ) ; if ( list = = null ) { / / scr 7990 - - something bad has happened to the copy buffer return false ; } return list contains ( node ) ; } catch ( unsupported flavor exception e ) { / / data flavor is not supported throw new assert exception ( " data flavor in clipboard is not supported " ) ; } catch ( i o exception e ) { / / data is no longer available msg show error ( this , null , " clipboard check failed " , " data is no longer available for paste operation " , e ) ; } catch ( exception e ) { } return false ; }


generates a number in [ 0 , 2 ^ num bits ) with an exponential distribution the floor of the log 2 of the result is chosen uniformly at random in [ 0 , num bits ) , and then the result is chosen in that range uniformly at random zero is treated as having log 2 = = 0

static big integer random non negative big integer ( int num bits ) { int digits = random source next int ( num bits ) ; if ( digits = = 0 ) { return new big integer ( 1 , random source ) ; } else { return new big integer ( digits , random source ) set bit ( digits ) ; } }


one last chance to handle a possible null value specifically for booleans method parameters , use { @ link boolean # false } also raise an ise for primitive types

private object handle null value ( string name , @ nullable object value , class < ? > param type ) { if ( value = = null ) { if ( boolean type equals ( param type ) ) { return boolean false ; } else if ( param type is primitive ( ) ) { throw new illegal state exception ( " optional " + param type + " parameter ' " + name + " ' is present but cannot be translated into a null value due to being " + " declared as a primitive type consider declaring it as object wrapper " + " for the corresponding primitive type " ) ; } } return value ; }


return whether the file is newmodifieddeleted


jta { @ code before completion } callback : just invoked before commit in case of an exception , the jta transaction will be marked as rollback - only

public void before completion ( ) { try { boolean read only = transaction synchronization manager is current transaction read only ( ) ; this spring synchronization before commit ( read only ) ; } catch ( runtime exception | error ex ) { set rollback only if possible ( ) ; throw ex ; } finally { / / process spring ' s before completion early , in order to avoid issues / / with strict jta implementations that issue warnings when doing jdbc / / operations after transaction completion ( e g connection get warnings ) this before completion called = true ; this spring synchronization before completion ( ) ; } }


create a loop this automatically adjusts connectivity

public void create loop ( float [ ] vertices , int offset , int length ) { jni create loop ( addr , vertices , offset , length / 2 ) ; is looped = true ; }


convenience method , so that we don ' t open a new connection when using this method from within another method otherwise every api invocation incurs the overhead of openingclosing a tcp connection

private boolean exists ( f t p client client , path file ) throws i o exception { try { get file status ( client , file ) ; return true ; } catch ( file not found exception fnfe ) { return false ; } }


publishes the event to the registered { @ link event listener } instances

boolean publish ( result partition i d partition id , task event event ) ;


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


returns a range that contains all values less than or equal to { @ code endpoint }

public static < c extends comparable < ? > > range < c > at most ( c endpoint ) { return create ( cut < c > below all ( ) , cut above value ( endpoint ) ) ; }


returns a { @ link bitmap transition options } object that enables a cross fade animation

public static bitmap transition options with cross fade ( ) { return new bitmap transition options ( ) cross fade ( ) ; }


reset the internal fields before executing operations on a new record

private void reset ( ) { attempt = 0 ; position = null ; klass = null ; error = null ; }


called to initialize new emitted particles

public void activate particles ( int start index , int count ) { }


public animated image result builder set preview bitmap ( closeable reference < bitmap > preview bitmap ) { m preview bitmap = closeable reference clone or null ( preview bitmap ) ; return this ; }


returns the set of options filtered if a specific type is specified

private static < t > set < t > filter types ( optional < t > type , t [ ] options ) { if ( type is present ( ) ) { return type filter ( arrays as list ( options ) : : contains ) is present ( ) ? immutable set of ( type get ( ) ) : immutable set of ( ) ; } return immutable set copy of ( options ) ; }


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


test forwarding of standard hadoop - style credential keys

public void test config keys forwarding hadoop style ( ) { configuration conf = new configuration ( ) ; conf set string ( " fs s 3a access key " , " test access key " ) ; conf set string ( " fs s 3a secret key " , " test secret key " ) ; check hadoop access keys ( conf , " test access key " , " test secret key " ) ; }


the list of array elements < code > repeated aapt pb array element element = 1 ; < code >

public java util list < com android aapt resources array element > get element list ( ) { return element ; }


this method starts the sender and receiver threads

public void start ( ) { this messenger start ( ) ; }


if the stream writes in blocks , then counters during the write may be zero until a whole block is written - or the write has finished

public boolean stream writes in blocks ( ) { return false ; }


turn the given utf8 byte array into a string

public static string utf 8 ( byte [ ] bytes ) { return new string ( bytes , standard charsets utf 8 ) ; }


test the handling of sessionless responses pre - kip - 227 brokers always supply this kind of response

public void test sessionless ( ) { fetch session handler handler = new fetch session handler ( log context , 1 ) ; fetch session handler builder builder = handler new builder ( ) ; builder add ( new topic partition ( " foo " , 0 ) , new fetch request partition data ( 0 , 100 , 200 , optional empty ( ) ) ) ; builder add ( new topic partition ( " foo " , 1 ) , new fetch request partition data ( 10 , 110 , 210 , optional empty ( ) ) ) ; fetch session handler fetch request data data = builder build ( ) ; assert maps equal ( req map ( new req entry ( " foo " , 0 , 0 , 100 , 200 ) , new req entry ( " foo " , 1 , 10 , 110 , 210 ) ) , data to send ( ) , data session partitions ( ) ) ; assert equals ( invalid session id , data metadata ( ) session id ( ) ) ; assert equals ( initial epoch , data metadata ( ) epoch ( ) ) ; fetch response < memory records > resp = new fetch response < > ( errors none , resp map ( new resp entry ( " foo " , 0 , 0 , 0 ) , new resp entry ( " foo " , 1 , 0 , 0 ) ) , 0 , invalid session id ) ; handler handle response ( resp ) ; fetch session handler builder builder 2 = handler new builder ( ) ; builder 2 add ( new topic partition ( " foo " , 0 ) , new fetch request partition data ( 0 , 100 , 200 , optional empty ( ) ) ) ; fetch session handler fetch request data data 2 = builder 2 build ( ) ; assert equals ( invalid session id , data 2 metadata ( ) session id ( ) ) ; assert equals ( initial epoch , data 2 metadata ( ) epoch ( ) ) ; assert maps equal ( req map ( new req entry ( " foo " , 0 , 0 , 100 , 200 ) ) , data to send ( ) , data session partitions ( ) ) ; }


called when a single loop of the animation is completed

void on animation completed ( int loop number ) ;


create the committer factory for a task attempt and destination , then create the committer from it

public static path output committer create committer ( path output path , task attempt context context ) throws i o exception { return get committer factory ( output path , context get configuration ( ) ) create output committer ( output path , context ) ; }


returned information is a json representation of map with host name as the key and value is a map of decommissioning node attribute keys to its values

public string get decom nodes ( ) { final map < string , map < string , object > > info = new hash map < string , map < string , object > > ( ) ; final list < datanode descriptor > decom node list = block manager get datanode manager ( ) get decommissioning nodes ( ) ; for ( datanode descriptor node : decom node list ) { map < string , object > innerinfo = immutable map < string , object > builder ( ) put ( " xferaddr " , node get xfer addr ( ) ) put ( " under replicated blocks " , node get leaving service status ( ) get under replicated blocks ( ) ) put ( " decommission only replicas " , node get leaving service status ( ) get out of service only replicas ( ) ) put ( " under replicate in open files " , node get leaving service status ( ) get under replicated in open files ( ) ) build ( ) ; info put ( node get host name ( ) + " : " + node get xfer port ( ) , innerinfo ) ; } return json to string ( info ) ; }


register the processors for the spring annotation - driven features

private void register annotation config processors ( bean definition registry registry ) { annotation config utils register annotation config processors ( registry ) ; }


protected void set gesture detector ( @ nullable gesture detector gesture detector ) { m gesture detector = gesture detector ; if ( m gesture detector ! = null ) { m gesture detector set click listener ( this ) ; } }


test for an invalid hash code method , i e , one that returns different value for objects that are equal according to the equals method

public void test invalid hash code ( ) { object a = new invalid hash code object ( 1 , 2 ) ; object b = new invalid hash code object ( 1 , 2 ) ; equals tester add equality group ( a , b ) ; try { equals tester test equals ( ) ; } catch ( assertion failed error e ) { assert error message ( e , " the object # hash code ( " + a hash code ( ) + " ) of " + a + " [ group 1 , item 1 ] must be equal to the object # hash code ( " + b hash code ( ) + " ) of " + b ) ; return ; } fail ( " should get invalid hash code error " ) ; }


emits { @ link string } output of this class into the provided { @ link string builder }

public void emit ( string builder builder , bind bind ) { builder append ( " incomplete impl ( " + this get class ( ) get simple name ( ) + " ) " ) ; }


resources names of resources that have be deleted and to be removed from the mcp client removed resources for missing resources can be ignored < code > repeated string removed resources = 3 ; < code >

public int get removed resources count ( ) { return removed resources size ( ) ; }


method to see if the connection is usable

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


the given local variable must be at index in the local variable array of the current frame if the local variable at index is of type double or long , it occupies both index and index + 1

public int get index ( ) { return index & 0xffff ; }


symlink target is null if the create event i node type is not symlink

public string get symlink target ( ) { return symlink target ; }


public static string read assets 2 string ( final string assets file path , final string charset name ) { try { input stream is = utils get app ( ) get assets ( ) open ( assets file path ) ; byte [ ] bytes = utils bridge input stream 2 bytes ( is ) ; if ( bytes = = null ) return " " ; if ( utils bridge is space ( charset name ) ) { return new string ( bytes ) ; } else { try { return new string ( bytes , charset name ) ; } catch ( unsupported encoding exception e ) { e print stack trace ( ) ; return " " ; } } } catch ( i o exception e ) { e print stack trace ( ) ; return " " ; } }


adds the specified range to this { @ code range set } ( optional operation ) that is , for equal range sets a and b , the result of { @ code a add ( range ) } is that { @ code a } will be the minimal range set for which both { @ code a encloses all ( b ) } and { @ code a encloses ( range ) } note that { @ code range } will be { @ linkplain range # span ( range ) coalesced } with any ranges in the range set that are { @ linkplain range # is connected ( range ) connected } with it moreover , if { @ code range } is empty , this is a no - op


get the next source value this calls { @ link # source has next ( ) } first to verify that there is data

protected s source next ( ) throws i o exception { try { if ( ! source has next ( ) ) { throw new no such element exception ( ) ; } return get source ( ) next ( ) ; } catch ( no such element exception | i o exception e ) { i o utils cleanup with logger ( log , this ) ; throw e ; } }


records cache hits this should be called when a cache request returns a cached value


returns the total size , in bytes , of this file

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


computes a strong hash value for small files note that this method should only be used for files & lt ; 1mb

public static void hash file ( bytes ref builder file hash , input stream in , long size ) throws i o exception { final int len = ( int ) math min ( 1024 * 1024 , size ) ; / / for safety we limit this to 1mb file hash grow ( len ) ; file hash set length ( len ) ; final int read bytes = streams read fully ( in , file hash bytes ( ) , 0 , len ) ; assert read bytes = = len : integer to string ( read bytes ) + " ! = " + integer to string ( len ) ; assert file hash length ( ) = = len : integer to string ( file hash length ( ) ) + " ! = " + integer to string ( len ) ; }


asynchronous version of { @ link abstract dao session # run in tx ( runnable ) }

public async operation run in tx ( runnable runnable , int flags ) { return enqueue database operation ( operation type transaction runnable , runnable , flags ) ; }


get the last node associated with a specific { @ code label } for example , for pattern { @ code < id : id > } , { @ code get ( " id " ) } returns the node matched for that { @ code id } if more than one node matched the specified label , only the last is returned if there is no node associated with the label , this returns { @ code null } pattern tags like { @ code < id > } and { @ code < expr > } without labels are considered to be labeled with { @ code id } and { @ code expr } , respectively

public parse tree get ( string label ) { list < parse tree > parse trees = labels get ( label ) ; if ( parse trees = = null | | parse trees size ( ) = = 0 ) { return null ; } return parse trees get ( parse trees size ( ) - 1 ) ; / / return last if multiple }


test normal record storage within a leaf node chained - buffers will not be utilized

public void test insert small fixed key record ( ) throws i o exception { insert one fixed key record ( false , false , 1 ) ; }


activate x stream ' s autodetection mode < b > note < b > : autodetection implies that the x stream instance is being configured while it is processing the xml streams , and thus introduces a potential concurrency problem

public void set autodetect annotations ( boolean autodetect annotations ) { this autodetect annotations = autodetect annotations ; }


test correct parsing of ` dist ` parameter , this should create builder with prepost set to same value

public void test parse dist ( ) throws i o exception { x content builder builder = x content factory json builder ( ) ; builder start object ( ) ; builder start object ( span not query builder name ) ; builder field ( " exclude " ) ; span term query ( " description " , " jumped " ) to x content ( builder , null ) ; builder field ( " include " ) ; span near query ( query builders span term query ( " description " , " quick " ) , 1 ) add clause ( query builders span term query ( " description " , " fox " ) ) to x content ( builder , null ) ; builder field ( " dist " , 3 ) ; builder end object ( ) ; builder end object ( ) ; span not query builder query = ( span not query builder ) parse query ( strings to string ( builder ) ) ; assert that ( query pre ( ) , equal to ( 3 ) ) ; assert that ( query post ( ) , equal to ( 3 ) ) ; assert not null ( query include query ( ) ) ; assert not null ( query exclude query ( ) ) ; }


handle an inbound message from a web socket client

public void handle message ( web socket session session , web socket message < ? > message ) throws exception { web socket session holder holder = this sessions get ( session get id ( ) ) ; if ( holder ! = null ) { session = holder get session ( ) ; } sub protocol handler protocol handler = find protocol handler ( session ) ; protocol handler handle message from client ( session , message , this client inbound channel ) ; if ( holder ! = null ) { holder set has handled messages ( ) ; } check sessions ( ) ; }


returns the default name for the indicated stack offset

public string get default name ( data type component element ) { int offset = element get offset ( ) ; int param base offset = get parameter offset ( ) ; boolean is local = grows negative ? ( offset < param base offset ) : ( offset > = param base offset ) ; if ( is local ) { return symbol utilities get default local name ( function get program ( ) , offset , 0 ) ; } int index = get parameter index ( element ) ; if ( index > = 0 ) { return symbol utilities get default param name ( index ) ; } return unknown prefix + integer to hex string ( math abs ( offset ) ) ; }


returns true if this type does not correspond to a non - existent path

public boolean exists ( ) { return this ! = nonexistent ; }


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

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