configure the codecs for the { @ code web client } in the { @ link # exchange strategies ( exchange strategies ) underlying } { @ code exchange strategies }

builder codecs ( consumer < client codec configurer > configurer ) ;


public to with timestamp ( final long timestamp ) { this timestamp = timestamp ; return this ; }


search for sequences of ascii strings in program memory see { @ link ascii char set recognizer } to see exactly what chars are considered ascii for purposes of this search

public list < found string > find strings ( address set view address set , int minimum string length , int alignment , boolean require null termination , boolean include all char widths ) { final list < found string > list = new array list < > ( ) ; found string callback found string callback = found string - > list add ( found string ) ; string searcher searcher = new string searcher ( current program , minimum string length , alignment , include all char widths , require null termination ) ; searcher search ( address set , found string callback , true , monitor ) ; return list ; }


flink - 5985 this tests checks the inverse of { @ link # test null subtask state leads to stateless task ( ) } we want to test that for subtasks that acknowledge some state are given an entry in the task states of the checkpoint

public void test non null subtask state leads to stateful task ( ) throws exception { pending checkpoint pending = create pending checkpoint ( checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) ) ; pending acknowledge task ( attempt id , mock ( task state snapshot class ) , mock ( checkpoint metrics class ) ) ; assert assert false ( pending get operator states ( ) is empty ( ) ) ; }


public void set client info ( properties properties ) throws s q l client info exception { }


{ @ link painless explain error } doesn ' t serialize but the headers still make it

public void test painless explain error serialization ( ) throws i o exception { map < string , object > params = singleton map ( " a " , " jumped over the moon " ) ; script exception e = expect throws ( script exception class , ( ) - > exec ( " debug explain ( params a ) " , params , true ) ) ; assert equals ( singleton list ( " jumped over the moon " ) , e get metadata ( " es to string " ) ) ; assert equals ( singleton list ( " java lang string " ) , e get metadata ( " es java class " ) ) ; assert equals ( singleton list ( " java lang string " ) , e get metadata ( " es painless class " ) ) ; try ( bytes stream output out = new bytes stream output ( ) ) { out write exception ( e ) ; try ( stream input in = out bytes ( ) stream input ( ) ) { elasticsearch exception read = ( script exception ) in read exception ( ) ; assert equals ( singleton list ( " jumped over the moon " ) , read get metadata ( " es to string " ) ) ; assert equals ( singleton list ( " java lang string " ) , read get metadata ( " es java class " ) ) ; assert equals ( singleton list ( " java lang string " ) , read get metadata ( " es painless class " ) ) ; } } }


applies action to all disrupted links between two sets of nodes

private void apply to nodes ( string [ ] nodes 1 , string [ ] nodes 2 , bi consumer < mock transport service , mock transport service > consumer ) { for ( string node 1 : nodes 1 ) { if ( disrupted links nodes ( ) contains ( node 1 ) ) { for ( string node 2 : nodes 2 ) { if ( disrupted links nodes ( ) contains ( node 2 ) ) { if ( node 1 equals ( node 2 ) = = false ) { if ( disrupted links disrupt ( node 1 , node 2 ) ) { consumer accept ( transport ( node 1 ) , transport ( node 2 ) ) ; } } } } } } }


get the number of task trackers in the cluster

public int get task trackers ( ) { return num active trackers ; }


specifies the expected number of nodes in the network

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


returns the time at which the checkout was completed

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


get the subscription topics for which metadata is required for the leader , this will include the union of the subscriptions of all group members for followers , it is just that member ' s subscription this is used when querying topic metadata to detect the metadata changes which would require rebalancing the leader fetches metadata for all topics in the group so that it can do the partition assignment ( which requires at least partition counts for all topics to be assigned )

synchronized set < string > metadata topics ( ) { if ( group subscription is empty ( ) ) return subscription ; else if ( group subscription contains all ( subscription ) ) return group subscription ; else { / / when subscription changes ` group subscription ` may be outdated , ensure that / / new subscription topics are returned set < string > topics = new hash set < > ( group subscription ) ; topics add all ( subscription ) ; return topics ; } }


this method actually executes the client - side sasl handshake

private i o stream pair do sasl handshake ( inet address addr , output stream underlying out , input stream underlying in , string user name , map < string , string > sasl props , callback handler callback handler , token < block token identifier > access token ) throws i o exception { data output stream out = new data output stream ( underlying out ) ; data input stream in = new data input stream ( underlying in ) ; sasl participant sasl = sasl participant create client sasl participant ( user name , sasl props , callback handler ) ; out write int ( sasl transfer magic number ) ; out flush ( ) ; try { / / start of handshake - " initial response " in sasl terminology / / the handshake secret can be null , this happens when client is running / / a new version but the cluster does not have this feature / / in which case there will be no encrypted secret sent from nn block token identifier block token identifier = access token decode identifier ( ) ; if ( block token identifier ! = null ) { byte [ ] handshake secret = access token decode identifier ( ) get handshake msg ( ) ; if ( handshake secret = = null | | handshake secret length = = 0 ) { log debug ( " handshake secret is null , " + " sending without handshake secret " ) ; send sasl message ( out , new byte [ 0 ] ) ; } else { log debug ( " sending handshake secret " ) ; block token identifier identifier = new block token identifier ( ) ; identifier read fields ( new data input stream ( new byte array input stream ( access token get identifier ( ) ) ) ) ; string bpid = identifier get block pool id ( ) ; send sasl message handshake secret ( out , new byte [ 0 ] , handshake secret , bpid ) ; } } else { log debug ( " block token id is null , sending without handshake secret " ) ; send sasl message ( out , new byte [ 0 ] ) ; } / / step 1 byte [ ] remote response = read sasl message ( in ) ; byte [ ] local response = sasl evaluate challenge or response ( remote response ) ; list < cipher option > cipher options = null ; string cipher suites = conf get ( dfs encrypt data transfer cipher suites key ) ; if ( requested qop contains privacy ( sasl props ) ) { / / negotiate cipher suites if configured currently , the only supported / / cipher suite is aes / ctr / no padding or sm4 / ctr / nopadding , / / but the protocol allows multiple values for future expansion if ( cipher suites ! = null & & ! cipher suites is empty ( ) ) { cipher option option = null ; if ( cipher suites equals ( cipher suite aes ctr nopadding get name ( ) ) ) { option = new cipher option ( cipher suite aes ctr nopadding ) ; } else if ( cipher suites equals ( cipher suite sm4 ctr nopadding get name ( ) ) ) { option = new cipher option ( cipher suite sm4 ctr nopadding ) ; } else { throw new i o exception ( string format ( " invalid cipher suite , % s = % s " , dfs encrypt data transfer cipher suites key , cipher suites ) ) ; } cipher options = lists new array list with capacity ( 1 ) ; cipher options add ( option ) ; } } send sasl message and negotiation cipher options ( out , local response , cipher options ) ; / / step 2 ( client - side only ) sasl response with negotiated cipher option response = read sasl message and negotiated cipher option ( in ) ; local response = sasl evaluate challenge or response ( response payload ) ; assert local response = = null ; / / sasl handshake is complete check sasl complete ( sasl , sasl props ) ; cipher option cipher option = null ; if ( sasl is negotiated qop privacy ( ) ) { / / unwrap the negotiated cipher option cipher option = unwrap ( response cipher option , sasl ) ; if ( log is debug enabled ( ) ) { if ( cipher option = = null ) { / / no cipher suite is negotiated if ( cipher suites ! = null & & ! cipher suites is empty ( ) ) { / / the client accepts some cipher suites , but the server does not log debug ( " client accepts cipher suites { } , " + " but server { } does not accept any of them " , cipher suites , addr to string ( ) ) ; } } else { log debug ( " client using cipher suite { } with server { } " , cipher option get cipher suite ( ) get name ( ) , addr to string ( ) ) ; } } } / / if negotiated cipher option is not null , we will use it to create / / stream pair return cipher option ! = null ? create stream pair ( conf , cipher option , underlying out , underlying in , false ) : sasl create stream pair ( out , in ) ; } catch ( i o exception ioe ) { send generic sasl error message ( out , ioe get message ( ) ) ; throw ioe ; } }


creates an instance of { @ link to string helper } in the same manner as { @ link # to string helper ( object ) } , but using { @ code class name } instead of using an instance ' s { @ link object # get class ( ) }

public static to string helper to string helper ( string class name ) { return new to string helper ( class name ) ; }


resets this reader ' s position to the last { @ code mark ( ) } location invocations of { @ code read ( ) } and { @ code skip ( ) } will occur from this new location if this reader has not been marked , the behavior of { @ code reset ( ) } is implementation specific this default implementation throws an { @ code i o exception }

public void reset ( ) throws i o exception { throw new i o exception ( ) ; }


lazily initializes the internal data structure for tracking the specified phase and step returns either the newly initialized data structure or the existing one initialization is atomic , so there is no risk of lost updates even if multiple threads attempt to initialize the same step simultaneously

private step tracking lazy init step ( phase phase , step step ) { concurrent map < step , step tracking > steps = phases get ( phase ) steps ; if ( ! steps contains key ( step ) ) { steps put if absent ( step , new step tracking ( ) ) ; } return steps get ( step ) ; }


returns whether stack traces of { @ link throwable } s will be logged to logcat

public boolean get log stack traces ( ) { return log stack traces ; }


complete the last request that was sent to a particular node

public network client in flight request complete last sent ( string node ) { network client in flight request in flight request = request queue ( node ) poll first ( ) ; in flight request count decrement and get ( ) ; return in flight request ; }


convert the given text value using the given property editor

private object do convert text value ( @ nullable object old value , string new text value , property editor editor ) { try { editor set value ( old value ) ; } catch ( exception ex ) { if ( logger is debug enabled ( ) ) { logger debug ( " property editor [ " + editor get class ( ) get name ( ) + " ] does not support set value call " , ex ) ; } / / swallow and proceed } editor set as text ( new text value ) ; return editor get value ( ) ; }


returns the shuffle mode for the given exo player ' s shuffle mode

public static int get shuffle mode ( boolean exo player shuffle mode ) { return exo player shuffle mode ? session player shuffle mode all : session player shuffle mode none ; }


get a report of all ( containers ) of application attempt in the cluster

public abstract list < container report > get containers ( application attempt id application attempt id ) throws yarn exception , i o exception ;


notifies listeners that the given model has changed

public void model changed ( field format model model ) { if ( ! initialized ) { return ; } for ( format model listener l : format listeners ) { l format model changed ( model ) ; } set row i ds ( ) ; }


attach a { @ link terminal session } to this view

public boolean attach session ( terminal session session ) { if ( session = = m term session ) return false ; m top row = 0 ; m term session = session ; m emulator = null ; m combining accent = 0 ; update size ( ) ; / / wait with enabling the scrollbar until we have a terminal to get scroll position from set vertical scroll bar enabled ( true ) ; return true ; }


void configure credential factory ( chaining rest http request credential factory factory ) ;


always return { @ code true } since any method argument and return value type will be processed in some way a method argument not recognized by any handler method argument resolver is interpreted as a request parameter if it is a simple type , or as a model attribute otherwise a return value not recognized by any handler method return value handler will be interpreted as a model attribute

protected boolean supports internal ( handler method handler method ) { return true ; }


the new rename which has the posix semantic

static rename result rename to int ( f s directory fsd , f s permission checker pc , final string src arg , final string dst arg , boolean log retry cache , options rename options ) throws i o exception { string src = src arg ; string dst = dst arg ; if ( name node state change log is debug enabled ( ) ) { name node state change log debug ( " dir * name system rename to : with options - " + " " + src + " to " + dst ) ; } blocks map update info collected blocks = new blocks map update info ( ) ; / / returns resolved path return rename to ( fsd , pc , src , dst , collected blocks , log retry cache , options ) ; }


figures out how many slice statuses to expect in the response

protected int expected slice statuses ( int request slices , collection < string > indices ) { int slices configured = expected slices ( request slices , indices ) ; if ( slices configured > 1 ) { return slices configured ; } else { return 0 ; } }


creates a custom analyzer from a collection of { @ link name or definition } specifications for each component callers are responsible for closing the returned analyzer

public named analyzer build custom analyzer ( index settings index settings , boolean normalizer , name or definition tokenizer , list < name or definition > char filters , list < name or definition > token filters ) throws i o exception { tokenizer factory tokenizer factory = get component factory ( index settings , tokenizer , " tokenizer " , this : : get tokenizer provider , prebuilt analysis : : get tokenizer factory , this : : get tokenizer provider ) ; list < char filter factory > char filter factories = new array list < > ( ) ; for ( name or definition nod : char filters ) { char filter factories add ( get component factory ( index settings , nod , " char filter " , this : : get char filter provider , prebuilt analysis : : get char filter factory , this : : get char filter provider ) ) ; } list < token filter factory > token filter factories = new array list < > ( ) ; for ( name or definition nod : token filters ) { token filter factory tff = get component factory ( index settings , nod , " filter " , this : : get token filter provider , prebuilt analysis : : get token filter factory , this : : get token filter provider ) ; if ( normalizer & & tff instanceof normalizing token filter factory = = false ) { throw new illegal argument exception ( " custom normalizer may not use filter [ " + tff name ( ) + " ] " ) ; } tff = tff get chain aware token filter factory ( tokenizer factory , char filter factories , token filter factories , name - > { try { return get component factory ( index settings , new name or definition ( name ) , " filter " , this : : get token filter provider , prebuilt analysis : : get token filter factory , this : : get token filter provider ) ; } catch ( i o exception e ) { throw new unchecked i o exception ( e ) ; } } ) ; token filter factories add ( tff ) ; } analyzer analyzer = new custom analyzer ( tokenizer factory , char filter factories to array ( new char filter factory [ ] { } ) , token filter factories to array ( new token filter factory [ ] { } ) ) ; return produce analyzer ( " custom " , new analyzer provider < > ( ) { @ override public string name ( ) { return " custom " ; } @ override public analyzer scope scope ( ) { return analyzer scope global ; } @ override public analyzer get ( ) { return analyzer ; } } , null , null , null ) ; }


public static boolean get boolean ( @ non null final string key , @ non null final s p utils sp utils ) { return sp utils get boolean ( key ) ; }


checks if this node info is equal to the {

public boolean is equivalent to ( @ nullable node info other ) { return node info utils is equivalent to ( this , other ) ; }


enter a parse tree produced by the { @ code integer literal } labeled alternative in { @ link sql base parser # number }

void enter integer literal ( sql base parser integer literal context ctx ) ;


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


only select process instances that do not have a tenant id

execution query execution without tenant id ( ) ;


visit a parse tree produced by the { @ code refcast } labeled alternative in { @ link painless parser # castexpression }

t visit refcast ( painless parser refcast context ctx ) ;


decrements the given number down to the closest power of two if the argument is a power of two , it remains unchanged

public static int round down to power of 2 ( int value ) { return integer highest one bit ( value ) ; }


a callback invoked when the data for a section has rendered to the underlying recycler view

void on data rendered ( boolean is mounted , long uptime millis ) ;


return the value of the { @ code if - none - match } header

public list < string > get if none match ( ) { return get e tag values as list ( if none match ) ; }


asserts that a configured target has the given python version

protected void assert python version is ( string target name , python version version ) throws exception { assert that ( get python version ( get ok py target ( target name ) ) ) is equal to ( version ) ; }


called by recycler view when it stops observing this adapter

public void on detached from recycler view ( recycler view recycler view ) { super on detached from recycler view ( recycler view ) ; timer remove callbacks ( cbloadmore ) ; }


probe for a path being a parent of another

private boolean is parent of ( path parent , path child ) { uri parent u r i = parent to uri ( ) ; string parent path = parent u r i get path ( ) ; if ( ! parent path ends with ( " / " ) ) { parent path + = " / " ; } uri child u r i = child to uri ( ) ; string child path = child u r i get path ( ) ; return child path starts with ( parent path ) ; }


set string description ( returned by to string )

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


saves all the assets required by all the controllers inside this effect

public void save ( asset manager asset manager , resource data data ) { for ( particle controller controller : controllers ) { controller save ( asset manager , data ) ; } }


creates a { @ link leaf bucket collector } that extracts all values from a document and invokes { @ link leaf bucket collector # collect } on the provided < code > next < code > collector for each of them the current value of this source is set on each call and can be accessed by < code > next < code > via the { @ link # copy current ( int ) } and { @ link # compare current ( int ) } methods note that these methods are only valid when invoked from the { @ link leaf bucket collector } created in this source

abstract leaf bucket collector get leaf collector ( leaf reader context context , leaf bucket collector next ) throws i o exception ;


child class implements this method to realize { @ code array offset ( ) }

abstract int protected array offset ( ) ;


public void test unary operator ( ) { assert equals ( ( byte ) 5 , exec ( " long x = 5l ; return ( byte ) ( + x ) ; " ) ) ; assert equals ( ( short ) 5 , exec ( " long x = 5l ; return ( short ) ( + x ) ; " ) ) ; assert equals ( ( char ) 5 , exec ( " long x = 5l ; return ( char ) ( + x ) ; " ) ) ; assert equals ( 5 , exec ( " long x = 5l ; return ( int ) ( + x ) ; " ) ) ; assert equals ( 5f , exec ( " long x = 5l ; return ( float ) ( + x ) ; " ) ) ; assert equals ( 5l , exec ( " long x = 5l ; return ( long ) ( + x ) ; " ) ) ; assert equals ( 5d , exec ( " long x = 5l ; return ( double ) ( + x ) ; " ) ) ; }


if set to a value { @ code > 1 } , requests the decoder to subsample the original frames , returning a smaller frame buffer to save memory the sample size is the number of pixels in either dimension that correspond to a single pixel in the decoded bitmap for example , in sample size = = 4 returns an image that is 14 the widthheight of the original , and 116 the number of pixels values outside range { @ code < 1 , 65635 > } are treated as 1 unlike { @ link android graphics bitmap factory options # in sample size } values which are not powers of 2 are also supported default value is 1

public void set in sample size ( @ int range ( from = 1 , to = character max value ) int in sample size ) { if ( in sample size < 1 | | in sample size > character max value ) { this in sample size = 1 ; } else { this in sample size = ( char ) in sample size ; } }


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

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


public static http response execute ( final string url , final string method , final string basic auth username , final string basic auth password , final map < string , object > headers ) { return execute ( url , method , basic auth username , basic auth password , new hash map < > ( 0 ) , headers ) ; }


handler for out of memory events - no attempt is made here to cleanly shutdown or support halt blocking ; a robust printing of the event to stderr is all that can be done

public static void halt on out of memory ( out of memory error oome ) { / / after catching an oom java says it is undefined behavior , so don ' t / / even try to clean up or we can get stuck on shutdown try { system err println ( " halting due to out of memory error " ) ; } catch ( throwable err ) { / / again we done want to exit because of logging issues } runtime get runtime ( ) halt ( - 1 ) ; }


public container id get container id ( ) { return container id from string ( datum get container id ( ) to string ( ) ) ; }


return a { @ link resolvable type } for the specified { @ link type } note : the resulting { @ link resolvable type } instance may not be { @ link serializable }

public static resolvable type for type ( @ nullable type type ) { return for type ( type , null , null ) ; }


private static linked hash map < aspect descriptor , aspect > deduplicate aspects ( iterable < aspect > aspect path ) throws aspect cycle on path exception { linked hash map < aspect descriptor , aspect > aspect map = new linked hash map < > ( ) ; array list < aspect > seen aspects = new array list < > ( ) ; for ( aspect aspect : aspect path ) { if ( ! aspect map contains key ( aspect get descriptor ( ) ) ) { aspect map put ( aspect get descriptor ( ) , aspect ) ; seen aspects add ( aspect ) ; } else { validate duplicate aspect ( aspect , seen aspects ) ; } } return aspect map ; }


return a merged properties instance containing both the loaded properties and properties set on this factory bean

protected properties merge properties ( ) throws i o exception { properties result = new properties ( ) ; if ( this local override ) { / / load properties from file upfront , to let local properties override load properties ( result ) ; } if ( this local properties ! = null ) { for ( properties local prop : this local properties ) { collection utils merge properties into map ( local prop , result ) ; } } if ( ! this local override ) { / / load properties from file afterwards , to let those properties override load properties ( result ) ; } return result ; }


return value offset relative to parent structure start

public long get value relative offset ( ) { if ( child value = = null ) { return 0 ; } return ( ( child name length ( ) + 1 ) * 2 ) + value alignment + 6 ; }


ensures that the external array tmp has at least the specified number of elements , increasing its size if necessary the size increases exponentially to ensure amortized linear time complexity

private t [ ] ensure capacity ( int min capacity ) { tmp count = math max ( tmp count , min capacity ) ; if ( tmp length < min capacity ) { / / compute smallest power of 2 > min capacity int new size = min capacity ; new size | = new size > > 1 ; new size | = new size > > 2 ; new size | = new size > > 4 ; new size | = new size > > 8 ; new size | = new size > > 16 ; new size + + ; if ( new size < 0 ) / / not bloody likely ! new size = min capacity ; else new size = math min ( new size , a length > > > 1 ) ; t [ ] new array = ( t [ ] ) new object [ new size ] ; tmp = new array ; } return tmp ; }


util for get a { @ link partition writer factory }

static < t > partition writer factory < t > get ( boolean dynamic partition , boolean grouped , linked hash map < string , string > static partitions ) { if ( dynamic partition ) { return grouped ? grouped partition writer : : new : dynamic partition writer : : new ; } else { return ( partition writer factory < t > ) ( context , manager , computer ) - > new single directory writer < > ( context , manager , computer , static partitions ) ; } }


brings the window to front and sets input focus the window should already be visible and not iconified

public void focus window ( ) { glfw glfw focus window ( window handle ) ; }


return the instance of { @ link validator } for a given url


the weight of a vertex is an accumulation of all of the { @ link connection } s that are linked to this { @ link vertex } as part of a graph exploration it is used internally to identify the most interesting vertices to be returned

public double get weight ( ) { return weight ; }


test case for https : issues apache orgjirabrowse z o o k e e p e r - 2247 test to verify that even after non recoverable error ( error while writing transaction log ) , zoo keeper is still available

public void test non recoverable error ( ) throws exception { client base setup test env ( ) ; final int client port = port assignment unique ( ) ; main thread main = new main thread ( client port , true , null ) ; main start ( ) ; assert true ( client base wait for server up ( " 127 0 0 1 : " + client port , connection timeout ) , " waiting for server being up " ) ; zoo keeper zk = new zoo keeper ( " 127 0 0 1 : " + client port , client base connection timeout , this ) ; zk create ( " / foo 1 " , " foobar " get bytes ( ) , ids open acl unsafe , create mode persistent ) ; assert equals ( new string ( zk get data ( " / foo 1 " , null , null ) ) , " foobar " ) ; / / inject problem in server zoo keeper server zoo keeper server = main get cnxn factory ( ) get zoo keeper server ( ) ; file txn snap log snap log = zoo keeper server get txn log factory ( ) ; file txn snap log file txn snap log with error = new file txn snap log ( snap log get data dir ( ) , snap log get snap dir ( ) ) { @ override public void commit ( ) throws i o exception { throw new i o exception ( " input / output error " ) ; } } ; z k database new d b = new z k database ( file txn snap log with error ) ; zoo keeper server set z k database ( new d b ) ; try { / / do create operation , so that injected i o exception is thrown zk create ( " / foo 2 " , " foobar " get bytes ( ) , ids open acl unsafe , create mode persistent ) ; fail ( " i o exception is expected as error is injected in transaction log commit funtionality " ) ; } catch ( exception e ) { / / do nothing } zk close ( ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port , client base connection timeout ) , " waiting for server down " ) ; file txn snap log with error close ( ) ; main shutdown ( ) ; main delete dirs ( ) ; }


post storeorder : place an order for a pet

public response entity < order > place order ( @ api param ( value = " order placed for purchasing the pet " , required = true ) @ valid @ request body order body ) { return delegate place order ( body ) ; }


removes all instances of the same type , then add the new one

public void replace ( t item ) throws i o exception { remove all ( ( class ) item get class ( ) ) ; data add ( item ) ; on modified ( ) ; }


short - circuit integer : no threadsemaphore : thread thread pool full integer : no thread pool queue full integer : no timeout : no execution result : e m i tx 4 , failure , fallback e m i tx 4 , fallback success

public void test execution hook thread multiple emits then error then multiple fallback emits and then fallback success ( ) { assert hooks on success ( new func 0 < test hystrix observable command < integer > > ( ) { @ override public test hystrix observable command < integer > call ( ) { return get command ( execution isolation strategy thread , abstract test hystrix command execution result multiple emits then failure , 0 , abstract test hystrix command fallback result multiple emits then success ) ; } } , new action 1 < test hystrix observable command < integer > > ( ) { @ override public void call ( test hystrix observable command < integer > command ) { testable execution hook hook = command get builder ( ) execution hook ; assert true ( hook command emissions match ( 8 , 0 , 1 ) ) ; assert true ( hook execution events match ( 4 , 1 , 0 ) ) ; assert true ( hook fallback events match ( 4 , 0 , 1 ) ) ; assert equals ( runtime exception class , hook get execution exception ( ) get class ( ) ) ; assert equals ( " on start - on thread start - ! on run start - on execution start - " + " on execution emit - ! on run success - ! on complete - on emit - " + " on execution emit - ! on run success - ! on complete - on emit - " + " on execution emit - ! on run success - ! on complete - on emit - " + " on execution emit - ! on run success - ! on complete - on emit - " + " on execution error - ! on run error - on thread complete - on fallback start - " + " on fallback emit - ! on fallback success - ! on complete - on emit - " + " on fallback emit - ! on fallback success - ! on complete - on emit - " + " on fallback emit - ! on fallback success - ! on complete - on emit - " + " on fallback emit - ! on fallback success - ! on complete - on emit - " + " on fallback success - on success - " , command get builder ( ) execution hook execution sequence to string ( ) ) ; } } ) ; }


locate file that is linked to the service

default optional < file > locate ( final registered service service ) { return file extensions stream ( ) map ( ext - > determine ( service , ext ) ) filter ( file : : exists ) find first ( ) ; }


returns the absolute angles of the different chart slices ( where the slices end )

public float [ ] get absolute angles ( ) { return m absolute angles ; }


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


calculate the full endpoint path for the given endpoint

protected string calculate endpoint path ( endpoint endpoint , string service name ) { return this base path + service name ; }


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


static block factory create factory ( s 3 a file system owner , string name ) { switch ( name ) { case constants fast upload buffer array : return new array block factory ( owner ) ; case constants fast upload buffer disk : return new disk block factory ( owner ) ; case constants fast upload bytebuffer : return new byte buffer block factory ( owner ) ; default : throw new illegal argument exception ( " unsupported block buffer " + " \ " " + name + ' " ' ) ; } }


writes { @ code value } as an unsigned integer to { @ code out } , starting at { @ code offset } returns the number of bytes written

public static void write unsigned leb 1 2 8 ( byte array output stream out , int value ) { int remaining = value > > > 7 ; while ( remaining ! = 0 ) { out write ( ( byte ) ( ( value & 0x 7f ) | 0x 8 0 ) ) ; value = remaining ; remaining > > > = 7 ; } out write ( ( byte ) ( value & 0x 7f ) ) ; }


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


we may want to use the new patch just now ! !

public void on patch result ( patch result result ) { if ( result = = null ) { share tinker log e ( tag , " default tinker result service received null result ! ! ! ! " ) ; return ; } share tinker log i ( tag , " default tinker result service received a result : % s " , result to string ( ) ) ; / / first , we want to kill the recover process tinker service internals kill tinker patch service process ( get application context ( ) ) ; / / if success and new patch , it is nice to delete the raw file , and restart at once / / only main process can load an upgrade patch ! if ( result is success ) { delete raw patch file ( new file ( result raw patch file path ) ) ; if ( check if need kill ( result ) ) { android os process kill process ( android os process my pid ( ) ) ; } else { share tinker log i ( tag , " i have already install the newly patch version ! " ) ; } } }


continues a read from the provided { @ code source } into a given { @ code target } it ' s assumed that the data should be written into { @ code target } starting from an offset of zero

private boolean continue read ( parsable byte array source , byte [ ] target , int target length ) { int bytes to read = min ( source bytes left ( ) , target length - bytes read ) ; source read bytes ( target , bytes read , bytes to read ) ; bytes read + = bytes to read ; return bytes read = = target length ; }


return the { @ code charset } to use for reading from the { @ linkplain # get resource ( ) resource } , or { @ code null } if none specified

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


tests the { @ link d w a r f data type conflict handler # instance } conflict handler to ensure that adding a empty conflicting structure resolves to a previous populated structure

public void test add empty struct resolve to populated struct 1 ( ) { assert struct ( create populated ( data mgr ) , create stub ( data mgr , 0 ) , conflict result use existing ) ; }


public static bitmap to round ( final bitmap src , @ int range ( from = 0 ) int border size , @ color int int border color ) { return to round ( src , border size , border color , false ) ; }


add to the answer a localized node request , and keeps track of statistics on a per - allocation - id and per - subcluster bases

private void add localized node r r ( sub cluster id target id , resource request rr ) { preconditions check argument ( ! resource request is any location ( rr get resource name ( ) ) ) ; if ( rr get num containers ( ) > 0 ) { if ( ! count containers per r m contains key ( rr get allocation request id ( ) ) ) { count containers per r m put ( rr get allocation request id ( ) , new hash map < > ( ) ) ; } if ( ! count containers per r m get ( rr get allocation request id ( ) ) contains key ( target id ) ) { count containers per r m get ( rr get allocation request id ( ) ) put ( target id , new atomic long ( 0 ) ) ; } count containers per r m get ( rr get allocation request id ( ) ) get ( target id ) add and get ( rr get num containers ( ) ) ; if ( ! tot num localized containers contains key ( rr get allocation request id ( ) ) ) { tot num localized containers put ( rr get allocation request id ( ) , new atomic long ( 0 ) ) ; } tot num localized containers get ( rr get allocation request id ( ) ) add and get ( rr get num containers ( ) ) ; } internal add to answer ( target id , rr , false ) ; }


if maximum number of checkpoints is exceeded , pack oldest checkpoint into baseline

private void pack checkpoints ( ) { if ( checkpoint heads size ( ) < = max checkpoints ) { return ; } buffer node cp head = checkpoint heads get ( 1 ) ; / / oldest checkpoint ( excluding baseline ) buffer node cp node = cp head next in checkpoint ; while ( cp node id ! = tail ) { buffer node baseline = cp node next version ; buffer node cp next = cp node next in checkpoint ; if ( baseline id ! = tail ) { / / discard old baseline buffer node - free disk cache index dispose node ( baseline , true ) ; } / / node becomes new baseline buffer version cp node checkpoint = 0 ; cp node add to checkpoint ( baseline checkpoint head ) ; cp node = cp next ; } / / discard checkpoint list checkpoint heads remove ( 1 ) ; has non undoable changes = true ; }


creates a table environment that is the entry point and central context for creating table and sql api programs it is unified both on a language level for all jvm - based languages ( i e there is no distinction between scala and java api ) and for bounded and unbounded data processing a table environment is responsible for : connecting to external systems registering and retrieving { @ link table } s and other meta objects from a catalog executing sql statements offering further configuration options note : this environment is meant for pure table programs if you would like to convert from or to other flink a p is , it might be necessary to use one of the available language - specific table environments in the corresponding bridging modules

static table environment create ( environment settings settings ) { return table environment impl create ( settings ) ; }


return the set of used analyzers in the cluster

public set < index feature stats > get used analyzer types ( ) { return used analyzers ; }


set the timeout for the node to stop overcommitting the resources after this time the scheduler will start killing containers until the resources are not overcommitted anymore this may reset a previous timeout

public synchronized void set overcommit time out ( long time out ) { if ( time out > = 0 ) { if ( this overcommit timeout ! = - 1 ) { log debug ( " the overcommit timeout for { } was already set to { } " , get node i d ( ) , this overcommit timeout ) ; } this overcommit timeout = time now ( ) + time out ; } }


exported alias for { @ link jenkins location configuration # get url }

public string get configured root url ( ) { jenkins location configuration config = jenkins location configuration get ( ) ; return config ! = null ? config get url ( ) : null ; }


returns the low - level memory address that point to the first byte of ths backing data

public abstract long memory address ( ) ;


tests that allow values works in the normal case where the value the user specified is allowed by the policy

public void test allow values allows value ( ) throws exception { invocation policy builder invocation policy builder = invocation policy new builder ( ) ; invocation policy builder add flag policies builder ( ) set flag name ( " test string " ) get allow values builder ( ) add allowed values ( test options test string default ) add allowed values ( allowed value 1 ) add allowed values ( allowed value 2 ) ; invocation policy enforcer enforcer = create options policy enforcer ( invocation policy builder ) ; parser parse ( " - - test string = " + allowed value 1 ) ; / / option should be " foo " as specified by the user test options test options = get test options ( ) ; assert that ( test options test string ) is equal to ( allowed value 1 ) ; enforcer enforce ( parser , build command ) ; / / still " foo " since " foo " is allowed by the policy test options = get test options ( ) ; assert that ( test options test string ) is equal to ( allowed value 1 ) ; }


public string get task id ( ) { return task i d downgrade ( super get task i d ( ) ) to string ( ) ; }


public static void add activity lifecycle callbacks ( final utils activity lifecycle callbacks callbacks ) { utils bridge add activity lifecycle callbacks ( callbacks ) ; }


adds a series of direct input artifacts if the list containing them is not null or empty for efficiency , when adding a nested set of artifacts , use one of the transitive methods , such as { @ link # add transitive flag ( string , nested set , android data converter ) } and { @ link # add transitive input values ( nested set ) } , instead

public busy box action builder maybe add input ( @ compile time constant string arg , @ nullable collection < artifact > values ) { if ( values ! = null & & ! values is empty ( ) ) { command line add exec paths ( arg , values ) ; inputs add all ( values ) ; } return this ; }


premultiplies this matrix with the given matrix , storing the result in this matrix for example : a mul left ( b ) results in a : = ba

public matrix 4 mul left ( matrix 4 matrix ) { tmp mat set ( matrix ) ; mul ( tmp mat val , val ) ; return set ( tmp mat ) ; }


sets the { @ link skip callback } to handle skip backward and skip forward

public session callback builder set skip callback ( @ nullable skip callback skip callback ) { this skip callback = skip callback ; return this ; }


returns the component that allows the user to edit

public j component get editor component ( ) { return editor panel ; }


public proc starter copy ( ) { proc starter rhs = new proc starter ( ) cmds ( commands ) pwd ( pwd ) masks ( masks ) stdin ( stdin ) stdout ( stdout ) stderr ( stderr ) envs ( envs ) quiet ( quiet ) build step ( env vars filterable builder ) ; rhs stdout listener = stdout listener ; rhs reverse stdin = this reverse stdin ; rhs reverse stderr = this reverse stderr ; rhs reverse stdout = this reverse stdout ; return rhs ; }


return the fragment can be { @ code null }

public final string get fragment ( ) { return this fragment ; }


gracefully wakes up the thread with the given { @ code thread index } if it is blocked in adding an element to the queue if the thread is blocked in { @ link # put ( int , object ) } it will immediately return from the method with a return value of false if this method is called , the next time the thread with the given index is about to be blocked in adding an element , it may immediately wake up and return

public void wake up putting thread ( int thread index ) { lock lock ( ) ; try { maybe create condition ( thread index ) ; condition and flag caf = put condition and flags [ thread index ] ; if ( caf ! = null ) { caf set wake up ( true ) ; caf condition ( ) signal ( ) ; } } finally { lock unlock ( ) ; } }


public static int get day of week ( @ not null final date date ) { int result = get with monday first ( date , calendar day of week ) ; return result = = 1 ? 7 : result - 1 ; }


extract data from the given { @ code client http response } and return it

t extract data ( client http response response ) throws i o exception ;


get both has idempotent records flag and has transactional records flag from produce request noted that we find all flags at once to avoid duplicate loop and record batch construction

public static abstract map simple entry < boolean , boolean > flags ( produce request request ) { boolean has idempotent records = false ; boolean has transactional records = false ; for ( produce request data topic produce data tpd : request data ( ) topic data ( ) ) { for ( produce request data partition produce data ppd : tpd partition data ( ) ) { base records records = ppd records ( ) ; if ( records instanceof records ) { iterator < ? extends record batch > iterator = ( ( records ) records ) batches ( ) iterator ( ) ; if ( iterator has next ( ) ) { record batch batch = iterator next ( ) ; has idempotent records = has idempotent records | | batch has producer id ( ) ; has transactional records = has transactional records | | batch is transactional ( ) ; } } / / return early if ( has idempotent records & & has transactional records ) return new abstract map simple entry < > ( true , true ) ; } } return new abstract map simple entry < > ( has idempotent records , has transactional records ) ; }


public void clear warnings ( ) throws s q l exception { }


creates a ( network ) buffer with unspecified data of the given size

public static buffer create buffer ( int buffer size , int data size ) { return new network buffer ( memory segment factory allocate unpooled segment ( buffer size ) , recycler , buffer data type data buffer , data size ) ; }


increases the reference counter for the given entry so that it is not accidentally removed

public void lock node ( final node id node ) { lockable < shared buffer node > shared buffer node = shared buffer get entry ( node ) ; if ( shared buffer node ! = null ) { shared buffer node lock ( ) ; shared buffer upsert entry ( node , shared buffer node ) ; } }


process any public symbol records and produce corresponding ghidra symbols

private void process public symbols ( omf file header header , program program , task monitor monitor , message log log ) { symbol table symbol table = program get symbol table ( ) ; array list < omf symbol record > symbols = header get public symbols ( ) ; array list < omf segment header > segments = header get segments ( ) ; array list < omf group record > groups = header get groups ( ) ; language language = program get language ( ) ; monitor set message ( " creating public symbols " ) ; for ( omf symbol record symbolrec : symbols ) { if ( monitor is cancelled ( ) ) { break ; } address addr base = null ; if ( symbolrec get segment index ( ) ! = 0 ) { / / todo : what does it mean if both the segment and group index are non - zero ? / / is the segment index group relative ? / / for now we assume if a segment index is present , we don ' t need the group index omf segment header base segment = segments get ( symbolrec get segment index ( ) - 1 ) ; addr base = base segment get address ( language ) ; } else if ( symbolrec get group index ( ) ! = 0 ) { omf group record base group = groups get ( symbolrec get group index ( ) - 1 ) ; addr base = base group get address ( language ) ; } else { / / absolute address / / the base frame is ignored by most linkers addr base = language get default space ( ) get address ( 0 ) ; } int num symbols = symbolrec num symbols ( ) ; for ( int i = 0 ; i < num symbols ; + + i ) { omf symbol symbol = symbolrec get symbol ( i ) ; address address = addr base add ( symbol get offset ( ) ) ; symbol set address ( address ) ; create symbol ( symbol , address , symbol table , log ) ; } } }


this implementation returns a description that includes the class path location

public string get description ( ) { string builder builder = new string builder ( " class path resource [ " ) ; string path to use = path ; if ( this clazz ! = null & & ! path to use starts with ( " / " ) ) { builder append ( class utils class package as resource path ( this clazz ) ) ; builder append ( ' / ' ) ; } if ( path to use starts with ( " / " ) ) { path to use = path to use substring ( 1 ) ; } builder append ( path to use ) ; builder append ( ' ] ' ) ; return builder to string ( ) ; }


check if the given array contains the given value ( with case - insensitive comparison )

public static boolean contains ignore case ( string [ ] array , string value ) { for ( string str : array ) { if ( value = = null & & str = = null ) { return true ; } if ( value ! = null & & value equals ignore case ( str ) ) { return true ; } } return false ; }


gets a list of all the settings definitions used by this datatype

protected settings definition [ ] get built in settings definitions ( ) { return null ; }


protected void set task run time ( int task completion time ) { this task run time = task completion time ; }


read the given amount of bytes into a new { @ link byte buf } that is allocated from the { @ link byte buf allocator }

public static byte buf read bytes ( byte buf allocator alloc , byte buf buffer , int length ) { boolean release = true ; byte buf dst = alloc buffer ( length ) ; try { buffer read bytes ( dst ) ; release = false ; return dst ; } finally { if ( release ) { dst release ( ) ; } } }


expert users can override this method for more complete control over the execution of the mapper

public void run ( context context ) throws i o exception , interrupted exception { setup ( context ) ; try { while ( context next key value ( ) ) { map ( context get current key ( ) , context get current value ( ) , context ) ; } } finally { cleanup ( context ) ; } }


drops frames from the current output buffer to the next keyframe at or before the playback position if no such keyframe exists , as the playback position is inside the same group of pictures as the buffer being processed , returns { @ code false } returns { @ code true } otherwise

protected boolean maybe drop buffers to keyframe ( media codec codec , int index , long presentation time us , long position us , boolean treat dropped buffers as skipped ) throws exo playback exception { int dropped source buffer count = skip source ( position us ) ; if ( dropped source buffer count = = 0 ) { return false ; } decoder counters dropped to keyframe count + + ; / / we dropped some buffers to catch up , so update the decoder counters and flush the codec , / / which releases all pending buffers buffers including the current output buffer int total dropped buffer count = buffers in codec count + dropped source buffer count ; if ( treat dropped buffers as skipped ) { decoder counters skipped output buffer count + = total dropped buffer count ; } else { update dropped buffer counters ( total dropped buffer count ) ; } flush or reinitialize codec ( ) ; return true ; }


uploads the given user jars using the given { @ link blob client } , and sets the appropriate blobkeys on the given { @ link job graph }

private static void upload and set user jars ( job graph job graph , collection < path > user jars , blob client blob client ) throws i o exception { collection < permanent blob key > blob keys = upload user jars ( job graph get job i d ( ) , user jars , blob client ) ; set user jar blob keys ( blob keys , job graph ) ; }


returns a new multimap containing all attributes that match a given predicate and corresponding labels , not including outputs

public multimap < attribute , label > get transitions ( final binary predicate < ? super rule , attribute > predicate ) { final multimap < attribute , label > transitions = hash multimap create ( ) ; / / todo ( bazel - team ) : move this to attribute map , too just like visit labels , which labels should / / be visited may depend on the calling context we shouldn ' t implicitly decide this for / / the caller aggregating attribute mapper of ( this ) visit labels ( ) stream ( ) filter ( dep edge - > predicate apply ( rule this , dep edge get attribute ( ) ) ) for each ( dep edge - > transitions put ( dep edge get attribute ( ) , dep edge get label ( ) ) ) ; return transitions ; }


public long get value ( ) { return value ; }


return whether a property source with the given name is contained


public object get target ( ) { return null ; }


apply the batch of edits to the local namespace

private synchronized void apply edits ( long first tx id , int num txns , byte [ ] data ) throws i o exception { preconditions check argument ( first tx id = = last applied tx id + 1 , " received txn batch starting at % s but expected % s " , first tx id , last applied tx id + 1 ) ; assert backup input stream length ( ) = = 0 : " backup input stream is not empty " ; try { if ( log is trace enabled ( ) ) { log trace ( " data : " + string utils byte to hex string ( data ) ) ; } f s edit log loader log loader = new f s edit log loader ( get namesystem ( ) , last applied tx id ) ; int log version = storage get layout version ( ) ; backup input stream set bytes ( data , log version ) ; long num txns advanced = log loader load edit records ( backup input stream , true , last applied tx id + 1 , null , null ) ; if ( num txns advanced ! = num txns ) { throw new i o exception ( " batch of txns starting at txnid " + first tx id + " was supposed to contain " + num txns + " transactions , but we were only able to advance by " + num txns advanced ) ; } last applied tx id = log loader get last applied tx id ( ) ; get namesystem ( ) write lock ( ) ; try { get namesystem ( ) dir update count for quota ( ) ; } finally { get namesystem ( ) write unlock ( ) ; } } finally { backup input stream clear ( ) ; } }


returns the string value of the requested attribute , or - default value - if the attribute is missing or not the correct type

public string get string ( int attribute , string default value ) { d w a r f string attribute attr = get attribute ( attribute , d w a r f string attribute class ) ; return ( attr ! = null ) ? attr get value ( get program ( ) get debug strings ( ) ) : default value ; }


gives a marginal performance improvement versus using reflection to invoke the target when invoking public methods

protected object invoke joinpoint ( ) throws throwable { if ( this method proxy ! = null ) { return this method proxy invoke ( this target , this arguments ) ; } else { return super invoke joinpoint ( ) ; } }


public query builder post filter ( ) { return post query builder ; }


returns a string containing only whitespace , used for each level of indentation if empty , the encoded document will be compact

public final string get indent ( ) { return indent ! = null ? indent : " " ; }


verifies that , when no exporters are enabled , the { @ code exporters } will still return as expected

public void test no exporters ( ) throws exception { settings builder settings = settings builder ( ) put ( " xpack monitoring exporters explicitly disabled type " , " local " ) put ( " xpack monitoring exporters explicitly disabled enabled " , false ) ; exporters exporters = new exporters ( settings build ( ) , factories , cluster service , license state , thread context , ssl service ) ; exporters start ( ) ; assert that ( exporters get enabled exporters ( ) , empty ( ) ) ; assert exporters ( exporters ) ; exporters close ( ) ; }


return an instance of this utility that represents what the state of the internal data structures should be when topic creation is disabled

public static topic creation empty ( ) { return empty ; }


dispatch the move to the proxy source & wait for the response

private void dispatch ( ) { socket sock = new socket ( ) ; data output stream out = null ; data input stream in = null ; try { if ( source is iteration over ( ) ) { log info ( " cancel moving " + this + " as iteration is already cancelled due to " + " dfs balancer max - iteration - time is passed " ) ; throw new i o exception ( " block move cancelled " ) ; } log info ( " start moving " + this ) ; assert ! ( reported block instanceof d block striped ) ; sock connect ( net utils create socket addr ( target get datanode info ( ) get xfer addr ( dispatcher this connect to dn via hostname ) ) , hdfs constants read timeout ) ; / / set read timeout so that it doesn ' t hang forever against / / unresponsive nodes datanode normally sends in progress response / / twice within the client read timeout period ( every 30 seconds by / / default ) here , we make it give up after 5 minutes of no response sock set so timeout ( hdfs constants read timeout * 5 ) ; sock set keep alive ( true ) ; output stream unbuf out = sock get output stream ( ) ; input stream unbuf in = sock get input stream ( ) ; extended block eb = new extended block ( nnc get blockpool i d ( ) , reported block get block ( ) ) ; final key manager km = nnc get key manager ( ) ; token < block token identifier > access token = km get access token ( eb , new storage type [ ] { target storage type } , new string [ 0 ] ) ; i o stream pair sasl streams = sasl client socket send ( sock , unbuf out , unbuf in , km , access token , target get datanode info ( ) ) ; unbuf out = sasl streams out ; unbuf in = sasl streams in ; out = new data output stream ( new buffered output stream ( unbuf out , io file buffer size ) ) ; in = new data input stream ( new buffered input stream ( unbuf in , io file buffer size ) ) ; send request ( out , eb , access token ) ; receive response ( in ) ; nnc add bytes moved ( reported block get num bytes ( ) ) ; target get d datanode ( ) set has success ( ) ; log info ( " successfully moved " + this ) ; } catch ( i o exception e ) { log warn ( " failed to move " + this , e ) ; target get d datanode ( ) set has failure ( ) ; / / check that the failure is due to block pinning errors if ( e instanceof block pinning exception ) { / / pinned block can ' t be moved add this block into failure list / / later in the next iteration mover will exclude these blocks from / / pending moves target get d datanode ( ) add block pinning failures ( this ) ; return ; } / / proxy or target may have some issues , delay before using these nodes / / further in order to avoid a potential storm of " threads quota / / exceeded " warnings when the dispatcher gets out of sync with work / / going on in datanodes proxy source activate delay ( delay after errors ) ; target get d datanode ( ) activate delay ( delay after errors ) ; } finally { i o utils close stream ( out ) ; i o utils close stream ( in ) ; i o utils close socket ( sock ) ; proxy source remove pending block ( this ) ; target get d datanode ( ) remove pending block ( this ) ; synchronized ( this ) { reset ( ) ; } synchronized ( dispatcher this ) { dispatcher this notify all ( ) ; } } }


returns a map from { @ link dependency } inputs to the { @ link configured target and data } s corresponding to those dependencies for use for legacy support and tests calling through { @ code build view } only if a requested configured target is in error , the corresponding value is omitted from the returned list

public immutable multimap < dependency key , configured target and data > get configured target map for testing ( extended event handler event handler , build configuration value key original config , iterable < dependency key > keys ) throws invalid configuration exception , interrupted exception { return get configured target map for testing ( event handler , get configuration ( event handler , original config ) , keys ) ; }


reads a typed bytes sequence the first byte is interpreted as a type code , and then the right number of subsequent bytes are read depending on the obtained type

public byte [ ] read raw ( ) throws i o exception { int code = - 1 ; try { code = in read unsigned byte ( ) ; } catch ( e o f exception eof ) { return null ; } if ( code = = type bytes code ) { return read raw bytes ( ) ; } else if ( code = = type byte code ) { return read raw byte ( ) ; } else if ( code = = type bool code ) { return read raw bool ( ) ; } else if ( code = = type int code ) { return read raw int ( ) ; } else if ( code = = type long code ) { return read raw long ( ) ; } else if ( code = = type float code ) { return read raw float ( ) ; } else if ( code = = type double code ) { return read raw double ( ) ; } else if ( code = = type string code ) { return read raw string ( ) ; } else if ( code = = type vector code ) { return read raw vector ( ) ; } else if ( code = = type list code ) { return read raw list ( ) ; } else if ( code = = type map code ) { return read raw map ( ) ; } else if ( code = = type marker code ) { return null ; } else if ( 50 < = code & & code < = 200 ) { / / application - specific typecodes return read raw bytes ( code ) ; } else { throw new runtime exception ( " unknown type " ) ; } }


use the shutdown pattern from : https : docs oracle comjavase 8docsapijavautilconcurrent executor service html

public static void graceful shutdown ( executor executor , int timeout ) { if ( ! ( executor instanceof executor service ) | | is terminated ( executor ) ) { return ; } final executor service es = ( executor service ) executor ; try { / / disable new tasks from being submitted es shutdown ( ) ; } catch ( security exception ex 2 ) { return ; } catch ( null pointer exception ex 2 ) { return ; } try { / / wait a while for existing tasks to terminate if ( ! es await termination ( timeout , time unit milliseconds ) ) { es shutdown now ( ) ; } } catch ( interrupted exception ex ) { es shutdown now ( ) ; thread current thread ( ) interrupt ( ) ; } if ( ! is terminated ( es ) ) { new thread to close executor ( es ) ; } }


public void set times ( final path f , final long mtime , final long atime ) throws access control exception , file not found exception , unsupported file system exception , i o exception { final path abs f = fix relative part ( f ) ; new f s link resolver < void > ( ) { @ override public void next ( final abstract file system fs , final path p ) throws i o exception , unresolved link exception { fs set times ( p , mtime , atime ) ; return null ; } } resolve ( this , abs f ) ; }


invokes sequential proxy calls to different locations continues to invoke calls until the success condition is met , or until all locations have been attempted the success condition may be specified by : an expected result class an expected result value if no expected result classvalues are specified , the success condition is a call that does not throw a remote exception

public < t > t invoke sequential ( final list < ? extends remote location context > locations , final remote method remote method , class < t > expected result class , object expected result value ) throws i o exception { return ( t ) invoke sequential ( remote method , locations , expected result class , expected result value ) get result ( ) ; }


public boolean contains quorum ( set < long > set ) { hash map < long , long > expansion = new hash map < long , long > ( ) ; / * * adds up weights per group * / log debug ( " set size : { } " , set size ( ) ) ; if ( set size ( ) = = 0 ) { return false ; } for ( long sid : set ) { long gid = server group get ( sid ) ; if ( gid = = null ) { continue ; } if ( ! expansion contains key ( gid ) ) { expansion put ( gid , server weight get ( sid ) ) ; } else { long total weight = server weight get ( sid ) + expansion get ( gid ) ; expansion put ( gid , total weight ) ; } } / * * check if all groups have majority * / int maj group counter = 0 ; for ( entry < long , long > entry : expansion entry set ( ) ) { long gid = entry get key ( ) ; log debug ( " group info : { } , { } , { } " , entry get value ( ) , gid , group weight get ( gid ) ) ; if ( entry get value ( ) > ( group weight get ( gid ) / 2 ) ) { maj group counter + + ; } } log debug ( " majority group counter : { } , { } " , maj group counter , num groups ) ; if ( ( maj group counter > ( num groups / 2 ) ) ) { log debug ( " positive set size : { } " , set size ( ) ) ; return true ; } else { log debug ( " negative set size : { } " , set size ( ) ) ; return false ; } }


indicates whether this provider represents a store that is intended for transient use - such as the user provider is these providers are generally used to provide job access to passwords rather than for long term storage

public boolean is transient ( ) { return false ; }


fail engine due to some error the engine will also be closed the underlying store is marked corrupted iff failure is caused by index corruption

public void fail engine ( string reason , @ nullable exception failure ) { if ( failure ! = null ) { maybe die ( reason , failure ) ; } if ( fail engine lock try lock ( ) ) { try { if ( failed engine get ( ) ! = null ) { logger warn ( ( ) - > new parameterized message ( " tried to fail engine but engine is already failed ignoring [ { } ] " , reason ) , failure ) ; return ; } / / this must happen before we close iw or translog such that we can check this state to opt out of failing the engine / / again on any caught already closed exception failed engine set ( ( failure ! = null ) ? failure : new illegal state exception ( reason ) ) ; try { / / we just go and close this engine - no way to recover close no lock ( " engine failed on : [ " + reason + " ] " , closed latch ) ; } finally { logger warn ( ( ) - > new parameterized message ( " failed engine [ { } ] " , reason ) , failure ) ; / / we must set a failure exception , generate one if not supplied / / we first mark the store as corrupted before we notify any listeners / / this must happen first otherwise we might try to reallocate so quickly / / on the same node that we don ' t see the corrupted marker file when / / the shard is initializing if ( lucene is corruption exception ( failure ) ) { if ( store try inc ref ( ) ) { try { store mark store corrupted ( new i o exception ( " failed engine ( reason : [ " + reason + " ] ) " , exceptions helper unwrap corruption ( failure ) ) ) ; } catch ( i o exception e ) { logger warn ( " couldn ' t mark store corrupted " , e ) ; } finally { store dec ref ( ) ; } } else { logger warn ( ( ) - > new parameterized message ( " tried to mark store as corrupted but store is already closed [ { } ] " , reason ) , failure ) ; } } event listener on failed engine ( reason , failure ) ; } } catch ( exception inner ) { if ( failure ! = null ) inner add suppressed ( failure ) ; / / don ' t bubble up these exceptions up logger warn ( " fail engine threw exception " , inner ) ; } } else { logger debug ( ( ) - > new parameterized message ( " tried to fail engine but could not acquire lock - engine should " + " be failed by now [ { } ] " , reason ) , failure ) ; } }


send an { @ link android util log # error } log message send wtf soft error report ( sampled ) note : this is not equivalent of { @ link android util log # wtf }


skips bytes corresponding to serialized states in flink 1 6 + the states are no longer kept in state

static void skip serialized states ( data input view in ) throws i o exception { type serializer < string > name serializer = string serializer instance ; type serializer < state state type > state type serializer = new enum serializer < > ( state state type class ) ; type serializer < state transition action > action serializer = new enum serializer < > ( state transition action class ) ; final int no of states = in read int ( ) ; for ( int i = 0 ; i < no of states ; i + + ) { name serializer deserialize ( in ) ; state type serializer deserialize ( in ) ; } for ( int i = 0 ; i < no of states ; i + + ) { string src name = name serializer deserialize ( in ) ; int no of transitions = in read int ( ) ; for ( int j = 0 ; j < no of transitions ; j + + ) { string src = name serializer deserialize ( in ) ; preconditions check state ( src equals ( src name ) , " source edge names do not match ( " + src name + " - " + src + " ) " ) ; name serializer deserialize ( in ) ; action serializer deserialize ( in ) ; try { skip condition ( in ) ; } catch ( class not found exception e ) { e print stack trace ( ) ; } } } }


get a sorted array of repository names contained within the specified server root directory

static string [ ] get repository names ( file root dir file ) { file [ ] dir list = root dir file list files ( ) ; if ( dir list = = null ) { / / throw new file not found exception ( " folder " + root dir file + " not found " ) ; return new string [ 0 ] ; } array list < string > list = new array list < > ( dir list length ) ; for ( file element : dir list ) { if ( ! element is directory ( ) | | local file system is hidden dir name ( element get name ( ) ) ) { continue ; } if ( ! naming utilities is valid mangled name ( element get name ( ) ) ) { log warn ( " ignoring repository directory with bad name : " + element ) ; continue ; } list add ( naming utilities demangle ( element get name ( ) ) ) ; } collections sort ( list ) ; string [ ] names = new string [ list size ( ) ] ; return list to array ( names ) ; }


returns whether the playback controls can be shown

public boolean get use controller ( ) { return use controller ; }


emits the given { @ link watermark } a watermark of value { @ code t } declares that no elements with a timestamp { @ code t ' < = t } will occur any more if further such elements will be emitted , those elements are considered late this method is only relevant when running on { @ link time characteristic # event time } on { @ link time characteristic # processing time } , watermarks will be ignored on { @ link time characteristic # ingestion time } , the watermarks will be replaced by the automatic ingestion time watermarks

void emit watermark ( watermark mark ) ;


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

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


test : 1 hash arrays are the same size 2 elements are null expected result : equal

public void test equality 2 ( ) { hash entry [ ] hash entries 1 = new hash entry [ 5 ] ; hash entry [ ] hash entries 2 = new hash entry [ 5 ] ; vec 1 set hash entries ( hash entries 1 ) ; vec 2 set hash entries ( hash entries 2 ) ; assert assert true ( " failed to equate two vectors with identical hash entry instances " , vec 1 equals ( vec 2 ) ) ; }


splits given options into two lists - arguments matching options defined in this class and everything else , while preserving order in each list note that this method relies on the startup options always being in the < code > - - flag = arg < code > form ( instead of < code > - - flag arg < code > ) this is enforced by < code > get argument array ( ) < code > in < code > blaze cc < code > by reconstructing the startup options from their parsed versions instead of using < code > argv < code > verbatim

static command line options split startup options ( iterable < blaze module > modules , string args ) { list < string > prefixes = new array list < > ( ) ; list < option definition > startup options = lists new array list ( ) ; for ( class < ? extends options base > default options : blaze command utils get startup options ( modules ) ) { startup options add all ( options parser get option definitions ( default options ) ) ; } for ( option definition option definition : startup options ) { type option type = option definition get field ( ) get type ( ) ; prefixes add ( " - - " + option definition get option name ( ) ) ; if ( option type = = boolean class | | option type = = tri state class ) { prefixes add ( " - - no " + option definition get option name ( ) ) ; } } list < string > startup args = new array list < > ( ) ; list < string > other args = lists new array list ( args ) ; for ( iterator < string > argi = other args iterator ( ) ; argi has next ( ) ; ) { string arg = argi next ( ) ; if ( ! arg starts with ( " - - " ) ) { break ; / / stop at command - all startup options would be specified before it } for ( string prefix : prefixes ) { if ( arg starts with ( prefix ) ) { startup args add ( arg ) ; argi remove ( ) ; break ; } } } return new command line options ( immutable list copy of ( startup args ) , immutable list copy of ( other args ) ) ; }


checks if we need to shrink , and shrinks if necessary

protected void shrink if necessary ( ) { if ( size < this shrink threshold & & capacity > initial capacity ) { resize ( capacity / expand multiplier ) ; } }


public void update short ( int column index , short x ) throws s q l exception { }


get userlogin : logs user into the system

response entity < string > login user ( @ not null @ api param ( value = " the user name for login " , required = true ) @ valid @ request param ( value = " username " , required = true ) string username , @ not null @ api param ( value = " the password for login in clear text " , required = true ) @ valid @ request param ( value = " password " , required = true ) string password ) ;


returns true if the given key event should be blocked ( i e , not processed by us or java )

private boolean block key input ( key event event ) { component component = event get component ( ) ; if ( component = = null ) { / / we are for managing gui keyboard input - - don ' t care about the event if this happens return false ; } j root pane root pane = swing utilities get root pane ( component ) ; if ( root pane = = null ) { / / this can happen when the source component of the key event has been hidden as a / / result of processing the key event earlier , like on a key pressed event ; for / / example , when the user presses the esc key to close a dialog return true ; / / don ' t let java process the remaining event chain } component glass pane = root pane get glass pane ( ) ; if ( glass pane instanceof g glass pane ) { if ( ( ( g glass pane ) glass pane ) is busy ( ) ) { return true ; / / out parent ' s glass pane is blocking don ' t let events through } } / / else { / / msg debug ( key binding override key event dispatcher this , / / " found a window with a non - standard glass pane - - this should be fixed to " + / / " use the docking windowing system " ) ; / / } return false ; }


assert the response status code is { @ code http status no content } ( 204 )

public result matcher is no content ( ) { return matcher ( http status no content ) ; }


set whether or not the shared cache manager has accepted the request shared cache manager will reject the request if there is an ongoing task

public abstract void set accepted ( boolean b ) ;


public float max errors ( ) { return this max errors ; }


tests maximum opportunistic container allocation per am heartbeat when limit is set to higher value

public void test max allocations per a m heartbeat with high limit ( ) throws exception { allocator set max allocations per a m heartbeat ( 100 ) ; final int num containers = 20 ; list < resource request > reqs = new array list < > ( ) ; for ( int i = 0 ; i < num containers ; i + + ) { reqs add ( create resource request ( i + 1 , " h 1 " , 1 ) ) ; } application attempt id app att id = application attempt id new instance ( application id new instance ( 0l , 1 ) , 1 ) ; allocator set node queue load monitor ( create node queue load monitor ( 3 , 2 , 500 ) ) ; list < container > containers = allocator allocate containers ( empty blacklist request , reqs , app att id , opp cntxt , 1l , " user " ) ; / / all containers should be allocated in single heartbeat assert equals ( num containers , containers size ( ) ) ; }


compatible with old design , it will be perfected in the future

static config service create config service ( nacos config properties nacos config properties ) { if ( objects is null ( service ) ) { synchronized ( nacos config manager class ) { try { if ( objects is null ( service ) ) { service = nacos factory create config service ( nacos config properties assemble config service properties ( ) ) ; } } catch ( nacos exception e ) { log error ( e get message ( ) ) ; throw new nacos connection failure exception ( nacos config properties get server addr ( ) , e get message ( ) , e ) ; } } } return service ; }


quote a string the string is quoted only if quoting is required due to embedded delimiters , quote characters or the empty string

public static string quote ( string s , string delim ) { if ( s = = null ) return null ; if ( s length ( ) = = 0 ) return " \ " \ " " ; for ( int i = 0 ; i < s length ( ) ; i + + ) { char c = s char at ( i ) ; if ( c = = ' \ \ ' | | c = = ' " ' | | c = = ' \ ' ' | | character is whitespace ( c ) | | delim index of ( c ) > = 0 ) { string buffer b = new string buffer ( s length ( ) + 8 ) ; quote ( b , s ) ; return b to string ( ) ; } } return s ; }


returns whether a field reference or method invocation from the referencing class to the referenced class might have any side effects

private boolean may have side effects ( clazz referencing class , clazz referenced class ) { return ! referenced class equals ( referencing class ) & & ! initialized super classes ( referencing class ) contains all ( initialized super classes ( referenced class ) ) ; }


this implementation delegates to a savepoint manager for the underlying transaction , if possible

public void release savepoint ( object savepoint ) throws transaction exception { get savepoint manager ( ) release savepoint ( savepoint ) ; }


test serialization of object with outer number type

public void fake outer composite serialize test ( test context context ) { async async = context async ( ) ; outer composite body = null ; api fake outer composite serialize ( body , result - > { / / todo : test validations async complete ( ) ; } ) ; }


fetch cache with the specified key the key is decided by key generator passed - in if the default key generator is used , then the key is in the format of < code > groupinterface class : version < code >

public < t > t get ( string key , class < t > type ) { map < string , object > proxies of type = proxies get ( type ) ; if ( collection utils is empty map ( proxies of type ) ) { return null ; } return ( t ) proxies of type get ( key ) ; }


public aux service record version ( string v ) { this version = v ; return this ; }


public enum number enum get enum number ( ) { return enum number ; }


retrieved a part of a cos object , which is specified the start position

public input stream retrieve ( string key , long byte range start ) throws i o exception { try { log debug ( " retrieve cos key : [ { } ] range start : [ { } ] " , key , byte range start ) ; long file size = get file length ( key ) ; long byte range end = file size - 1 ; get object request get object request = new get object request ( this bucket name , key ) ; if ( byte range end > = byte range start ) { get object request set range ( byte range start , file size - 1 ) ; } c o s object cos object = ( c o s object ) call c o s client with retry ( get object request ) ; return cos object get object content ( ) ; } catch ( exception e ) { string err msg = string format ( " retrieving cos key : [ % s ] occurs an exception " + " byte range start : [ % s ] , exception : [ % s ] " , key , byte range start , e to string ( ) ) ; log error ( err msg ) ; handle exception ( new exception ( err msg ) , key ) ; } / / never will get here return null ; }


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


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


sets the value of an identified integer field

public sub set ( int field id < ? extends sub > id , int value ) { buffer put int ( id address ( ) , value ) ; return ( sub ) this ; }


adds a task to the queue and makes sure a worker thread is running if this method throws , e g a { @ code rejected execution exception } from the delegate executor , execution of tasks will stop until a call to this method is made

public void execute ( final runnable task ) { check not null ( task ) ; final runnable submitted task ; final long old run count ; synchronized ( queue ) { / / if the worker is already running ( or execute ( ) on the delegate returned successfully , and / / the worker has yet to start ) then we don ' t need to start the worker if ( worker running state = = running | | worker running state = = queued ) { queue add ( task ) ; return ; } old run count = worker run count ; / / if the worker is not yet running , the delegate executor might reject our attempt to start / / it to preserve fifo order and failure atomicity of rejected execution when the same / / runnable is executed more than once , allocate a wrapper that we know is safe to remove by / / object identity / / a data structure that returned a removal handle from add ( ) would allow eliminating this / / allocation submitted task = new runnable ( ) { @ override public void run ( ) { task run ( ) ; } @ override public string to string ( ) { return task to string ( ) ; } } ; queue add ( submitted task ) ; worker running state = queuing ; } try { executor execute ( worker ) ; } catch ( runtime exception | error t ) { synchronized ( queue ) { boolean removed = ( worker running state = = idle | | worker running state = = queuing ) & & queue remove last occurrence ( submitted task ) ; / / if the delegate is direct executor ( ) , the submitted runnable could have thrown a ree but / / that ' s handled by the log check that catches runtime exceptions in the queue worker if ( ! ( t instanceof rejected execution exception ) | | removed ) { throw t ; } } return ; } / * * this is an unsynchronized read ! after the read , the function returns immediately or acquires * the lock to check again since an idle state was observed inside the preceding synchronized * block , and reference field assignment is atomic , this may save reacquiring the lock when * another thread or the worker task has cleared the count and set the state * * < p > when { @ link # executor } is a direct executor ( ) , the value written to * { @ code worker running state } will be available synchronously , and behaviour will be * deterministic * / @ suppress warnings ( " guarded by " ) boolean already marked queued = worker running state ! = queuing ; if ( already marked queued ) { return ; } synchronized ( queue ) { if ( worker run count = = old run count & & worker running state = = queuing ) { worker running state = queued ; } } }


gets whether the query builder will ignore unmapped types ( and run a { @ link match no docs query } in place of this query ) or throw an exception if the type is unmapped

public boolean ignore unmapped ( ) { return ignore unmapped ; }


sets the persistent settings to be updated they will get applied cross restarts

public cluster update settings request builder set persistent settings ( map < string , ? > settings ) { request persistent settings ( settings ) ; return this ; }


derives a rocks d b memory configuration from another object and a configuration the values set on the other object take precedence , and the values from the configuration are used if no values are set on the other config object

public static rocks d b memory configuration from other and configuration ( rocks d b memory configuration other , readable config config ) { final rocks d b memory configuration new config = new rocks d b memory configuration ( ) ; new config use managed memory = other use managed memory ! = null ? other use managed memory : config get ( rocks d b options use managed memory ) ; new config fixed memory per slot = other fixed memory per slot ! = null ? other fixed memory per slot : config get ( rocks d b options fix per slot memory size ) ; new config write buffer ratio = other write buffer ratio ! = null ? other write buffer ratio : config get ( rocks d b options write buffer ratio ) ; new config high priority pool ratio = other high priority pool ratio ! = null ? other high priority pool ratio : config get ( rocks d b options high priority pool ratio ) ; return new config ; }


indicates whether this domain name ends in a { @ linkplain # is public suffix ( ) public suffix } , including if it is a public suffix itself for example , returns { @ code true } for { @ code www google com } , { @ code foo co uk } and { @ code com } , but not for { @ code invalid } or { @ code google invalid } this is the recommended method for determining whether a domain is potentially an addressable host note that this method is equivalent to { @ link # has registry suffix ( ) } because all registry suffixes are public suffixes and all public suffixes have registry suffixes

public boolean has public suffix ( ) { return public suffix index ! = no suffix found ; }


attempts to merge all tag changes between my and latest any conflicts will be stored in { @ link # tag conflicts } for later resolution

private void auto merge ( ) throws i o exception { / / / / get the tag managers for each of the program versions / / function manager d b my function manager d b = ( function manager d b ) my program get function manager ( ) ; function tag manager d b tag manager m y = ( function tag manager d b ) my function manager d b get function tag manager ( ) ; function manager d b latest function manager d b = ( function manager d b ) latest program get function manager ( ) ; function tag manager d b tag manager l a t e s t = ( function tag manager d b ) latest function manager d b get function tag manager ( ) ; function manager d b result function manager d b = ( function manager d b ) result program get function manager ( ) ; function tag manager d b tag manager r e s u l t = ( function tag manager d b ) result function manager d b get function tag manager ( ) ; function manager d b original function manager d b = ( function manager d b ) original program get function manager ( ) ; function tag manager d b tag manager o r i g i n a l = ( function tag manager d b ) original function manager d b get function tag manager ( ) ; / / get the i ds for all changes ( adds / edits / deletes ) we have to process note that / / the ' change ' lists contain both edits and deletes ; so we have to separate them / / into their own lists below long [ ] my addition i ds = my changes get tag creations ( ) ; long [ ] my change i ds = my changes get tag changes ( ) ; long [ ] latest addition i ds = latest changes get tag creations ( ) ; long [ ] latest change i ds = latest changes get tag changes ( ) ; list < long > my edited i ds = get edits ( my change i ds , tag manager m y , tag manager o r i g i n a l ) ; list < long > latest edited i ds = get edits ( latest change i ds , tag manager l a t e s t , tag manager o r i g i n a l ) ; list < long > my deleted i ds = get deletes ( my change i ds , tag manager m y , tag manager o r i g i n a l ) ; list < long > latest deleted i ds = get deletes ( latest change i ds , tag manager l a t e s t , tag manager o r i g i n a l ) ; / / now do the actual merging int transaction i d = result program start transaction ( get description ( ) ) ; try { merge additions ( tag manager m y , tag manager l a t e s t , tag manager r e s u l t , my addition i ds , latest addition i ds ) ; merge deletions ( tag manager r e s u l t , my edited i ds , latest edited i ds , my deleted i ds , latest deleted i ds ) ; merge edits ( tag manager m y , tag manager l a t e s t , tag manager r e s u l t , my edited i ds , latest edited i ds , latest deleted i ds ) ; } finally { result program end transaction ( transaction i d , true ) ; } }


called once the { @ link channel inbound handler # channel inactive ( channel handler context ) } event hit the end of the { @ link channel pipeline }

protected void on unhandled inbound channel inactive ( ) { }


returns a file that is properly resolved with respect to the project directory

private file resolved file ( file file ) { return file is absolute ( ) ? file : new file ( get project ( ) get base dir ( ) , file get name ( ) ) ; }


set the default compression type for sequence files

static public void set default compression type ( configuration job , compression type val ) { job set ( " io seqfile compression type " , val to string ( ) ) ; }


creates a new { @ link async session } to issue asynchronous entity operations see { @ link async session } for details

public async session start async session ( ) { return new async session ( this ) ; }


see { @ link kafka producer # close ( duration ) }


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


ensure the configured temp directory is a valid directory

public void validate tmp file ( ) throws i o exception { if ( files exists ( tmp file ) = = false ) { throw new file not found exception ( " temporary file directory [ " + tmp file + " ] does not exist or is not accessible " ) ; } if ( files is directory ( tmp file ) = = false ) { throw new i o exception ( " configured temporary file directory [ " + tmp file + " ] is not a directory " ) ; } }


public static string get user ( ) { return yarn version info get user ( ) ; }


returns true if the list selection is contiguous and only contains component rows

public boolean is contiguous component selection ( ) { return ( ( selection get num ranges ( ) = = 1 ) & & selection get field range ( 0 ) get start ( ) get index ( ) int value ( ) < get num components ( ) ) ; }


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


read value in the given time duration , usually as a linear

public list < metrics values > read labeled metrics values ( metrics condition condition , list < string > labels , duration duration ) throws i o exception { return get metric query d a o ( ) read labeled metrics values ( condition , value column metadata instance get value c name ( condition get name ( ) ) , labels , duration ) ; }


the src files are on the local disk add it to the filesystem at the given dst name del src indicates if the source should be removed

public void copy from local file ( boolean del src , boolean overwrite , path [ ] srcs , path dst ) throws i o exception { configuration conf = get conf ( ) ; file util copy ( get local ( conf ) , srcs , this , dst , del src , overwrite , conf ) ; }


returns the { @ link objc provider api } which contains information about the transitive dependencies linked into the dylib

objc provider api < file api t > get deps objc provider ( ) ;


public void remove ( ) { check state ( key ! = long min value ) ; prev next = next ; next prev = prev ; prev = next = null ; }


public void test inline object 3 ( ) { / / todo : test inline object 3 }


this test checks an edge case where , if a node had an index ( lets call it a with uuid 1 ) , then deleted it ( so a tombstone entry for a will exist in the cluster state ) , then created a new index a with uuid 2 , then shutdown , when the node comes back online , it will look at the tombstones for deletions , and it should proceed with trying to delete a with uuid 1 and not throw any errors that the index still exists in the cluster state this is a case of ensuring that tombstones that have the same name as current valid indices don ' t cause confusion by trying to delete an index that exists see https : github comelasticelasticsearchissues 1 8 0 5 4

public void test index and tombstone with same name on startup ( ) throws exception { final string index name = " test " ; final index index = new index ( index name , u u i ds random base 6 4 u u i d ( ) ) ; final indices service indices service = get indices service ( ) ; final settings idx settings = settings builder ( ) put ( index metadata setting version created , version current ) put ( index metadata setting index uuid , index get u u i d ( ) ) build ( ) ; final index metadata index metadata = new index metadata builder ( index get name ( ) ) settings ( idx settings ) number of shards ( 1 ) number of replicas ( 0 ) build ( ) ; final index tombstoned index = new index ( index name , u u i ds random base 6 4 u u i d ( ) ) ; final index graveyard graveyard = index graveyard builder ( ) add tombstone ( tombstoned index ) build ( ) ; final metadata metadata = metadata builder ( ) put ( index metadata , true ) index graveyard ( graveyard ) build ( ) ; final cluster state cluster state = new cluster state builder ( new cluster name ( " test cluster " ) ) metadata ( metadata ) build ( ) ; / / if all goes well , this won ' t throw an exception , otherwise , it will throw an illegal state exception indices service verify index is deleted ( tombstoned index , cluster state ) ; }


perform the sql call and retrieve the result by entering the execution stage

fetch spec < map < string , object > > fetch ( ) ;


set the two character to use to format date values the first character used for the date style , the second is for the time style supported characters are ' s ' = small ' m ' = medium ' l ' = long ' f ' = full ' - ' = omitted this method mimics the styles supported by joda - time

public void set style pattern ( string style pattern ) { this style pattern = style pattern ; }


parses the given value , then formats it according to the ' format ' string by default , this method simply parses the value using { @ link parser # parse } , then formats it with { @ link parser # format } however some { @ link parser } implementations override this as they can avoid parsing the value if it is already in the right format

public object parse and format object ( object value , string format ) { parsed geometry ; try ( x content parser parser = new map x content parser ( named x content registry empty , logging deprecation handler instance , collections singleton map ( " dummy field " , value ) , x content type json ) ) { parser next token ( ) ; / / start object parser next token ( ) ; / / field name parser next token ( ) ; / / field value geometry = parse ( parser ) ; } catch ( i o exception e ) { throw new unchecked i o exception ( e ) ; } catch ( parse exception e ) { throw new runtime exception ( e ) ; } return format ( geometry , format ) ; }


aggregate the current statistics with the source reference passed in the operation is synchronized

public synchronized boolean aggregate ( @ nullable i o statistics source ) { if ( source = = null ) { return false ; } aggregate maps ( counters , source counters ( ) , i o statistics binding : : aggregate counters , i o statistics binding : : passthrough fn ) ; aggregate maps ( gauges , source gauges ( ) , i o statistics binding : : aggregate gauges , i o statistics binding : : passthrough fn ) ; aggregate maps ( minimums , source minimums ( ) , i o statistics binding : : aggregate minimums , i o statistics binding : : passthrough fn ) ; aggregate maps ( maximums , source maximums ( ) , i o statistics binding : : aggregate maximums , i o statistics binding : : passthrough fn ) ; aggregate maps ( mean statistics , source mean statistics ( ) , i o statistics binding : : aggregate mean statistics , mean statistic : : copy ) ; return true ; }


set the container id - to - exception map in which the exception indicates error from per container for failed request

public abstract void set failed requests ( map < container id , serialized exception > failed containers ) ;


consumes up to 4 bytes and returns them as int ( taking into account endianess ) throws exception if specified number of bytes cannot be consumed

public static int read packed int ( input stream is , int num bytes , boolean is little endian ) throws i o exception { int value = 0 ; for ( int i = 0 ; i < num bytes ; i + + ) { int b = is read ( ) ; if ( b = = - 1 ) { throw new i o exception ( " no more bytes " ) ; } if ( is little endian ) { value | = ( b & 0x f f ) < < ( i * 8 ) ; } else { value = ( value < < 8 ) | ( b & 0x f f ) ; } } return value ; }


gets the switch cases auxiliary argument

protected final switch list get aux cases ( ) { return aux cases ; }


move the prototypes in the range to the new start location

private void move defined code units ( address start addr , address new start addr , long length , task monitor monitor ) throws i o exception , cancelled exception { lock acquire ( ) ; try { address end addr = start addr add ( length - 1 ) ; composite mgr move range ( start addr , end addr , new start addr ) ; monitor check canceled ( ) ; length mgr move range ( start addr , end addr , new start addr ) ; monitor check canceled ( ) ; inst adapter move address range ( start addr , new start addr , length , monitor ) ; data adapter move address range ( start addr , new start addr , length , monitor ) ; comment adapter move address range ( start addr , new start addr , length , monitor ) ; } finally { lock release ( ) ; } }


invalidates the update center json data for all the sites and force re - retrieval

public http response do invalidate data ( ) { for ( update site site : sites ) { site do invalidate data ( ) ; } return http responses ok ( ) ; }


validate the endpoint by checking for null fields and other invalid conditions

public static void validate endpoint ( string path , endpoint endpoint ) throws invalid record exception { if ( endpoint = = null ) { throw new invalid record exception ( path , " null endpoint " ) ; } try { endpoint validate ( ) ; } catch ( runtime exception e ) { throw new invalid record exception ( path , e to string ( ) ) ; } }


find the jta transaction manager through autodetection : checking whether the user transaction object implements the transaction manager , and checking the fallback jndi locations

protected transaction manager find transaction manager ( @ nullable user transaction ut ) { if ( ut instanceof transaction manager ) { if ( logger is debug enabled ( ) ) { logger debug ( " jta user transaction object [ " + ut + " ] implements transaction manager " ) ; } return ( transaction manager ) ut ; } / / check fallback jndi locations for ( string jndi name : fallback transaction manager names ) { try { transaction manager tm = get jndi template ( ) lookup ( jndi name , transaction manager class ) ; if ( logger is debug enabled ( ) ) { logger debug ( " jta transaction manager found at fallback jndi location [ " + jndi name + " ] " ) ; } return tm ; } catch ( naming exception ex ) { if ( logger is debug enabled ( ) ) { logger debug ( " no jta transaction manager found at fallback jndi location [ " + jndi name + " ] " , ex ) ; } } } / / ok , so no jta transaction manager is available return null ; }


public string get capital snake ( ) { return capital snake ; }


public static long get long ( memory segment [ ] segments , int offset ) { if ( in first segment ( segments , offset , 8 ) ) { return segments [ 0 ] get long ( offset ) ; } else { return get long multi segments ( segments , offset ) ; } }


get the raw list of dependencies this method is exposed for testing purposes and { @ link # get settings dependencies ( string ) } should be preferred for most all cases

public set < affix setting dependency > get dependencies ( ) { return collections unmodifiable set ( dependencies ) ; }


find the { @ link class type } { @ link event dubbo event } from the specified { @ link event listener dubbo event listener }

static class < ? extends event > find event type ( event listener < ? > listener ) { return find event type ( listener get class ( ) ) ; }


public static naming service create naming service ( string server list ) throws nacos exception { try { class < ? > driver impl class = class for name ( " com alibaba nacos client naming nacos naming service " ) ; constructor constructor = driver impl class get constructor ( string class ) ; naming service vendor impl = ( naming service ) constructor new instance ( server list ) ; return vendor impl ; } catch ( throwable e ) { throw new nacos exception ( nacos exception client invalid param , e ) ; } }


returns an immutable multiset containing the given elements , in the " grouped iteration order " described in the class documentation

public static < e > immutable multiset < e > copy of ( e [ ] elements ) { return copy from elements ( elements ) ; }