given a partition of the graph into sets of nodes , returns the image of this graph under the function which maps each node to the partition - set in which it appears the labels of the new graph are the ( immutable ) sets of the partition , and the edges of the new graph are the edges of the original graph , mapped via the same function note : the resulting graph may contain self - edges if these are not wanted , call < code > remove self edges ( ) < code > > on the result interesting special case : if the partition is the set of strongly - connected components , the result of this function is the strong - component graph

public digraph < set < node < t > > > create image under partition ( collection < set < node < t > > > partition ) { / / build mapping function : each node label is mapped to its equiv class : map < t , set < node < t > > > label to image = new hash map < > ( ) ; for ( set < node < t > > set : partition ) { / / it ' s important to use immutable sets of node labels when sets are keys / / in a map ; see immutable set class for explanation set < node < t > > image set = immutable set copy of ( set ) ; for ( node < t > node : image set ) { label to image put ( node get label ( ) , image set ) ; } } if ( label to image size ( ) ! = get node count ( ) ) { throw new illegal argument exception ( " create image under partition ( ) : argument is not a partition " ) ; } return create image under mapping ( label to image ) ; }


creates a new symbol path composed of the list of names in this path followed by the list of names in the given path

public symbol path append ( symbol path path ) { list < string > list = as list ( ) ; list add all ( path as list ( ) ) ; return new symbol path ( list ) ; }


returns whether the given partition is available

boolean is available ( intermediate result partition i d result partition i d ) ;


iterates over all sub - partitions and collects the total number of queued buffers in a best - effort way

long refresh and get total ( ) { return partition get number of queued buffers ( ) ; }


unsupported always throws { @ link unsupported operation exception }


subclasses may implement special handling when the query threadpool shutdown process is interrupted this isn ' t likely to happen unless there ' s a bug in the lifecycle management of query tasks

protected void handle interrupted shutdown ( ) { }


specify the statement separator used in all sql scripts , if a custom one defaults to { @ code " ; " } if not specified and falls back to { @ code " \ n " } as a last resort ; may be set to { @ link script utils # eof statement separator } to signal that each script contains a single statement without a separator

public embedded database builder set separator ( string separator ) { this database populator set separator ( separator ) ; return this ; }


get an array of the data for tasks performed

public task info [ ] get task info ( ) { if ( ! this keep task list ) { throw new unsupported operation exception ( " task info is not being kept ! " ) ; } return this task list to array ( new task info [ 0 ] ) ; }


public register tree get parent ( ) { return parent ; }


public void incr client backoff ( ) { rpc client backoff incr ( ) ; }


adds or replace a block in the output result if this is a replacement , then any extra blocks that got added with the original get removed as a result of calling this method

private boolean add or replace block ( basic block block , int list subroutines ) { if ( block = = null ) { throw new null pointer exception ( " block = = null " ) ; } int idx = label to result index ( block get label ( ) ) ; boolean ret ; if ( idx < 0 ) { ret = false ; } else { / * * we are replacing a pre - existing block , so find any * blocks that got added as part of the original and * remove those too such blocks are ( possibly indirect ) * successors of this block which are out of the range of * normally - translated blocks * / remove block and special successors ( idx ) ; ret = true ; } result add ( block ) ; subroutines throw if mutable ( ) ; result subroutines add ( subroutines ) ; return ret ; }


registers a cache aspect < pre class = " code " > & lt ; bean id = " cache aspect " class = " org springframework cache aspectj annotation cache aspect " factory - method = " aspect of " & gt ; & lt ; property name = " cache manager " ref = " cache manager " & gt ; & lt ; property name = " key generator " ref = " key generator " & gt ; & lt ; bean & gt ;

private static void register cache aspect ( element element , parser context parser context ) { if ( ! parser context get registry ( ) contains bean definition ( cache management config utils cache aspect bean name ) ) { root bean definition def = new root bean definition ( ) ; def set bean class name ( cache aspect class name ) ; def set factory method name ( " aspect of " ) ; parse cache resolution ( element , def , false ) ; cache namespace handler parse key generator ( element , def ) ; parser context register bean component ( new bean component definition ( def , cache management config utils cache aspect bean name ) ) ; } }


returns the md5 string associated with this file null if no md5 value present

public string get m d 5 ( ) { return md 5 ; }


abstract void generate inputs ( int [ ] ops per thread ) throws i o exception ;


returns whether the extractor should decode a container atom with type { @ code atom }

private static boolean should parse container atom ( int atom ) { return atom = = atom type moov | | atom = = atom type trak | | atom = = atom type mdia | | atom = = atom type minf | | atom = = atom type stbl | | atom = = atom type moof | | atom = = atom type traf | | atom = = atom type mvex | | atom = = atom type edts ; }


public string to operation id ( string operation id ) { / / throw exception if method name is empty if ( string utils is empty ( operation id ) ) { throw new runtime exception ( " empty method name ( operation id ) not allowed " ) ; } return operation id ; }


called to allow this plugin to flush any caches to the domain object before it is saved

protected void prepare to save ( domain object d obj ) { / / do nothing by default ; subclasses should override as needed }


check if the routing table has changed and local shards are affected

private boolean has shard allocation id changed ( string watch index , cluster state state ) { list < shard routing > all started relocated shards = state get routing table ( ) index ( watch index ) shards with state ( started ) ; all started relocated shards add all ( state get routing table ( ) index ( watch index ) shards with state ( relocating ) ) ; / / exit early , when there are shards , but the current configuration is inactive if ( all started relocated shards is empty ( ) = = false & & configuration = = inactive ) { return true ; } / / check for different shard ids string local node id = state nodes ( ) get local node id ( ) ; set < shard id > cluster state local shard ids = state get routing nodes ( ) node ( local node id ) shards with state ( watch index , started , relocating ) stream ( ) map ( shard routing : : shard id ) collect ( collectors to set ( ) ) ; set < shard id > configured local shard ids = new hash set < > ( configuration local shards key set ( ) ) ; set < shard id > difference set = sets difference ( cluster state local shard ids , configured local shard ids ) ; if ( difference set is empty ( ) = = false ) { return true ; } map < shard id , list < string > > shards = all started relocated shards stream ( ) collect ( collectors grouping by ( shard routing : : shard id , collectors mapping ( sr - > sr allocation id ( ) get id ( ) , collectors to collection ( array list : : new ) ) ) ) ; / / sort the collection , so we have a stable order shards values ( ) for each ( collections : : sort ) ; / / check for different allocation ids for ( map entry < shard id , shard allocation configuration > entry : configuration local shards entry set ( ) ) { if ( shards contains key ( entry get key ( ) ) = = false ) { return true ; } collection < string > allocation ids = shards get ( entry get key ( ) ) ; if ( allocation ids equals ( entry get value ( ) allocation ids ) = = false ) { return true ; } } return false ; }


public string command ( string command ) throws i o exception { assert that ( " ; automatically added " , command , not ( ends with ( " ; " ) ) ) ; logger info ( " out : { } ; " , command ) ; out write ( command + " ; \ n " ) ; out flush ( ) ; for ( string echo : expected command echos ( command ) ) { assert equals ( echo , read line ( ) ) ; } return read line ( ) ; }


returns the defined data whose min address equals the specified address

public data get defined data at ( address address ) { return get defined data at ( addr map get key ( address , false ) ) ; }


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


execute a method in a new http client instance if the auth failed , authenticate then retry the method

private < m extends http uri request > http response exec ( http client client , m req ) throws i o exception { http response resp = exec with debug output ( req , client ) ; int status code = resp get status line ( ) get status code ( ) ; if ( ( status code = = http status sc unauthorized | | status code = = http status sc bad request ) & & req instanceof auth post request & & ! use keystone authentication ) { if ( log is debug enabled ( ) ) { log debug ( " operation failed with status " + status code + " attempting keystone auth " ) ; } / / if rackspace key authentication failed - try custom keystone authentication use keystone authentication = true ; final auth post request authentication = ( auth post request ) req ; / / replace rackspace auth with keystone one authentication set entity ( get authentication requst ( keystone auth request ) ) ; resp = exec with debug output ( req , client ) ; } if ( status code = = http status sc unauthorized ) { / / unauthed - or the auth uri rejected it if ( req instanceof auth post request ) { / / unauth response from the auth uri itself throw new swift authentication failed exception ( auth request to string ( ) , " auth " , auth uri , resp ) ; } / / any other url : try again if ( log is debug enabled ( ) ) { log debug ( " reauthenticating " ) ; } / / re - auth , this may recurse into the same dir authenticate ( ) ; if ( log is debug enabled ( ) ) { log debug ( " retrying original request " ) ; } resp = exec with debug output ( req , client ) ; } return resp ; }


sets the workspace status action factory contributed by this module only one factory per workspace is allowed

public workspace builder set workspace status action factory ( workspace status action factory workspace status action factory ) { preconditions check state ( this workspace status action factory = = null , " at most one workspace status action factory supported but found two : % s and % s " , this workspace status action factory , workspace status action factory ) ; this workspace status action factory = preconditions check not null ( workspace status action factory ) ; return this ; }


public channel credentials build ( ) { return new tls channel credentials ( this ) ; }


public object get ( ) { return instance ; }


performs auto merge of bytes and code units followed by merge of byte and code unit conflicts

private void merge external functions ( task monitor monitor ) throws program conflict exception , memory access exception , cancelled exception { empty listing view for programs ( ) ; display initial phase message ( externals phase , " merge of external function and label changes " ) ; conflict info panel set conflict type ( external function merger get conflict type ( ) ) ; current merger = external function merger ; / / only one merger so it gets all of the progress bar to fill in int progress min = 0 ; int progress max = 100 ; external function merger auto merge ( progress min , progress max , monitor ) ; progress min = progress max ; merge manager show progress icon ( false ) ; external function merger merge conflicts ( conflict option , conflict info panel , monitor ) ; merge manager show progress icon ( true ) ; remove bottom component ( ) ; merge manager set completed ( externals phase ) ; set listing views to entire program ( ) ; external function merger dispose ( ) ; }


to test no data is lost or duplicated end - 2 - end with time characteristic : ingestion time producer parallelism = 1 ; kafka partition # = 1 ; consumer parallelism = 1

public void test simple ingestion time ( ) throws exception { test kafka shuffle ( 200000 , ingestion time ) ; }


returns the target model class that should be used to deserialize the input data this function can be invoked for any ofone of composed models with discriminator mappings the discriminator mappings are used to determine the target model class

class < ? > get class for element ( json node node , set < class < ? > > visited classes ) { if ( visited classes contains ( model class ) ) { / / class has already been visited return null ; } / / determine the value of the discriminator property in the input data string discr value = get discriminator value ( node ) ; if ( discr value = = null ) { return null ; } class < ? > cls = discriminator mappings get ( discr value ) ; / / it may not be sufficient to return this cls directly because that target class / / may itself be a composed schema , possibly with its own discriminator visited classes add ( model class ) ; for ( class < ? > child class : discriminator mappings values ( ) ) { class discriminator mapping child cdm = model discriminators get ( child class ) ; if ( child cdm = = null ) { continue ; } if ( ! discriminator name equals ( child cdm discriminator name ) ) { discr value = get discriminator value ( node ) ; if ( discr value = = null ) { continue ; } } if ( child cdm ! = null ) { / / recursively traverse the discriminator mappings class < ? > child discr = child cdm get class for element ( node , visited classes ) ; if ( child discr ! = null ) { return child discr ; } } } return cls ; }


deletes the given blob , taking special care that if we get a blob - not - found exception upon retrying the operation , we just swallow the error since what most probably happened is that the first operation succeeded on the server

private void safe delete ( cloud blob wrapper blob , self renewing lease lease ) throws storage exception { operation context operation context = get instrumented context ( ) ; try { blob delete ( operation context , lease ) ; } catch ( storage exception e ) { if ( ! native azure file system helper is file not found exception ( e ) ) { log error ( " encountered storage exception for delete on blob : { } " + " , exception details : { } error code : { } " , blob get uri ( ) , e get message ( ) , e get error code ( ) ) ; } / / on exception , check that if : / / 1 it ' s a blob not found exception and / / 2 it got there after one - or - more retries then / / we swallow the exception if ( e get error code ( ) ! = null & & " blob not found " equals ( e get error code ( ) ) & & operation context get request results ( ) size ( ) > 1 & & operation context get request results ( ) get ( 0 ) get exception ( ) ! = null ) { log debug ( " swallowing delete exception on retry : { } " , e get message ( ) ) ; return ; } else { throw e ; } } finally { if ( lease ! = null ) { lease free ( ) ; } } }


test regex mount pointes with named capture group

public void test conf link regex named group mapping ( ) throws exception { / / config : / / < property > / / < name > fs viewfs mounttable test view file system link regex cluster / / link regex ^ / ( ? < first dir > \ w + ) < / name > / / < value > / target test root / $ first dir < / value > / / < / property > / / dir path to test : / test conf link regex named group mapping 1 / / expect path : / target test root / test conf link regex named group mapping 1 uri view fs uri = new uri ( fs constants viewfs scheme , cluster name , " / " , null , null ) ; string regex str = " ^ / ( ? < first dir > \ \ w + ) " ; string dst path str = target test root + " $ first dir " ; path src path = new path ( " / test conf link regex named group mapping 1 " ) ; path expected resolve result = new path ( dst path str replace ( " $ first dir " , " test conf link regex named group mapping 1 " ) ) ; test regex mountpoint ( new configuration ( conf ) , regex str , dst path str , null , src path , expected resolve result , 3 ) ; / / config : / / < property > / / < name > fs viewfs mounttable test view file system link regex cluster / / link regex ^ / ( ? < first dir > \ w + ) < / name > / / < value > / target test root / $ { first dir } < / value > / / < / property > / / dir path to test : / test conf link regex named group mapping 2 / / expect path : / target test root / test conf link regex named group mapping 2 dst path str = target test root + " $ { first dir } " ; src path = new path ( " / test conf link regex named group mapping 2 " ) ; expected resolve result = new path ( dst path str replace ( " $ { first dir } " , " test conf link regex named group mapping 2 " ) ) ; test regex mountpoint ( new configuration ( conf ) , regex str , dst path str , null , src path , expected resolve result , 5 ) ; }


void transfer data 2 target ( byte [ ] packet buf ) throws i o exception { if ( target buffer remaining ( ) = = 0 ) { return ; } if ( target buffer is direct ( ) ) { byte buffer direct check sum buf = buffer pool get buffer ( true , striped writer get checksum buf ( ) length ) ; striped writer get checksum ( ) calculate chunked sums ( target buffer , direct check sum buf ) ; direct check sum buf get ( striped writer get checksum buf ( ) ) ; buffer pool put buffer ( direct check sum buf ) ; } else { striped writer get checksum ( ) calculate chunked sums ( target buffer array ( ) , 0 , target buffer remaining ( ) , striped writer get checksum buf ( ) , 0 ) ; } int ck off = 0 ; while ( target buffer remaining ( ) > 0 ) { d f s packet packet = new d f s packet ( packet buf , striped writer get max chunks per packet ( ) , block offset 4 target , seq no 4 target + + , striped writer get checksum size ( ) , false ) ; int max bytes to packet = striped writer get max chunks per packet ( ) * striped writer get bytes per checksum ( ) ; int to write = target buffer remaining ( ) > max bytes to packet ? max bytes to packet : target buffer remaining ( ) ; int ck len = ( ( to write - 1 ) / striped writer get bytes per checksum ( ) + 1 ) * striped writer get checksum size ( ) ; packet write checksum ( striped writer get checksum buf ( ) , ck off , ck len ) ; ck off + = ck len ; packet write data ( target buffer , to write ) ; / / send packet packet write to ( target output stream ) ; block offset 4 target + = to write ; striped writer get reconstructor ( ) incr bytes written ( to write ) ; } }


the size of the component we will be calling out

dimension get size ( ) { return size ; }


{ @ link # load ( ) } in the descriptor is not a real load activity , so locking against " this " is enough

protected object get load lock ( ) { / / get a lock for the singleton extension list to prevent deadlocks ( jenkins - 55361 ) return get descriptor extension list ( ) get load lock ( ) ; }


sets the timeout , in milliseconds , after which the executed command will be terminated

builder set timeout ( long timeout ) { preconditions check argument ( timeout > 0 , " timeout must be a positive number " ) ; this timeout = timeout ; return this ; }


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

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


public void destroy ( ) { this mapped file queue destroy ( ) ; }


remove the class of a plugin event that a plugin produces

public void remove event producer ( class < ? extends plugin event > event class ) { string name = plugin event lookup tool event name ( event class ) ; if ( name = = null ) { return ; } counter counter = producer map get ( name ) ; if ( - - counter count = = 0 ) { producer map remove ( name ) ; } }


similar to load 6 4 , but allows offset + 8 > input length , padding the result with zeroes this has to explicitly reverse the order of the bytes as it packs them into the result which makes it slower than the native version

static long load 6 4 safely ( byte [ ] input , int offset , int length ) { long result = 0 ; / / due to the way we shift , we can stop iterating once we ' ve run out of data , the rest / / of the result already being filled with zeros / / this loop is critical to performance , so please check hash benchmark if altering it int limit = math min ( length , 8 ) ; for ( int i = 0 ; i < limit ; i + + ) { / / shift value left while iterating logically through the array result | = ( input [ offset + i ] & 0x f f l ) < < ( i * 8 ) ; } return result ; }


check whether a temporary system function is already registered

public boolean has temporary system function ( string function name ) { return temp system functions contains key ( function name ) ; }


public erasure coding policy [ ] get enabled policies ( ) { return enabled policies ; }


validates and packages merged resources specifically , validates that : there are no conflicts between resources ( though currently we just warn ) each reference to a resource in resources and manifest are satisfied and packs resources into : r java and r txt files a resource - only apk ( deprecated ) when building with aapt 2 , aapt 2 equivalents of the above when building with aapt 2 , a compiled symbols zip

public static validated android resources validate from ( android data context data context , merged android resources merged ) throws interrupted exception { artifact r txt out = data context create output artifact ( android rule classes android r txt ) ; artifact source jar out = data context create output artifact ( android rule classes android java source jar ) ; artifact apk out = data context create output artifact ( android rule classes android library apk ) ; busy box action builder create ( data context , " link static library " ) add aapt ( ) add input ( " - - libraries " , data context get sdk ( ) get android jar ( ) ) add input ( " - - compiled " , merged get compiled symbols ( ) ) add input ( " - - manifest " , merged get manifest ( ) ) / / sets an alternative java package for the generated r java / / this allows android rules to generate resources outside of the java { , tests } tree maybe add flag ( " - - package for r " , merged get java package ( ) ) add transitive vectored input ( " - - compiled dep " , merged get resource dependencies ( ) get transitive compiled symbols ( ) ) add output ( " - - source jar out " , source jar out ) add output ( " - - r txt out " , r txt out ) add output ( " - - static library out " , apk out ) build and register ( " linking static android resource library " , " android resource link " ) ; return of ( merged , r txt out , source jar out , apk out , / / todo : remove below three when incompatible prohibit aapt 1 is on by default r txt out , source jar out , apk out , data context get android config ( ) use r txt from merged resources ( ) ) ; }


public future < update center job > deploy backup ( ) { jenkins get ( ) check permission ( jenkins administer ) ; update center uc = jenkins get ( ) get update center ( ) ; return uc add job ( uc new plugin downgrade job ( this , update site this , jenkins get authentication 2 ( ) ) ) ; }


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


set the host of the registry for the exported rmi service , i e { @ code rmi : host : portname } default is localhost

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


returns a normalizer mapped to the given name or < code > null < code > if not present

public named analyzer get normalizer ( string name ) { return normalizers get ( name ) ; }


public void set active ( boolean active ) { this active = active ; }


returns the { @ code short } nearest in value to { @ code value }

public static short saturated cast ( long value ) { if ( value > short max value ) { return short max value ; } if ( value < short min value ) { return short min value ; } return ( short ) value ; }


this is the jvm entry point for the service launcher converts the arguments to a list , then invokes { @ link # service main ( list , abstract s 3 guard dynamo d b diagnostic ) }

public static void main ( string [ ] args ) { try { service main ( arrays as list ( args ) , new dump s 3 guard dynamo table ( ) ) ; } catch ( exit util exit exception e ) { exit util terminate ( e ) ; } }


called when the audio sink handles a buffer whose timestamp is discontinuous with the last buffer handled since it was reset


needs to be called when the shape is no longer used , e g after a fixture was created based on the shape


return the application object main process get app by utils file provider , and other process get app by reflect

public static application get app ( ) { if ( s app ! = null ) return s app ; init ( utils bridge get application by reflect ( ) ) ; if ( s app = = null ) throw new null pointer exception ( " reflect failed " ) ; log i ( " utils " , utils bridge get current process name ( ) + " reflect app success " ) ; return s app ; }


format the provided { @ linkplain sql query response } for the set format without the header lines

public string format without header ( list < list < object > > rows ) { return format without header ( new string builder ( estimate size ( rows size ( ) ) ) , rows ) ; }


removes a subscriber who no longer wishes to receive provider activation events

public void remove provider listener ( component provider activation listener listener ) { listeners remove ( listener ) ; }


test convert non - nullable data type to avro schema then converts back

public void test data type to schema to data type non nullable ( ) { data type data type = data types row ( data types field ( " f boolean " , data types boolean ( ) not null ( ) ) , / / tinyint and smallint all convert to int data types field ( " f int " , data types int ( ) not null ( ) ) , data types field ( " f bigint " , data types bigint ( ) not null ( ) ) , data types field ( " f float " , data types float ( ) not null ( ) ) , data types field ( " f double " , data types double ( ) not null ( ) ) , / / char converts to string data types field ( " f string " , data types string ( ) not null ( ) ) , / / binary converts to bytes data types field ( " f varbinary " , data types bytes ( ) not null ( ) ) , data types field ( " f timestamp " , data types timestamp ( 3 ) not null ( ) ) , data types field ( " f date " , data types date ( ) not null ( ) ) , data types field ( " f time " , data types time ( 3 ) not null ( ) ) , data types field ( " f decimal " , data types decimal ( 10 , 0 ) not null ( ) ) , data types field ( " f row " , data types row ( data types field ( " f 0 " , data types int ( ) not null ( ) ) , data types field ( " f 1 " , data types timestamp ( 3 ) not null ( ) ) ) not null ( ) ) , / / multiset converts to map / / map key is always not null data types field ( " f map " , data types map ( data types string ( ) not null ( ) , data types int ( ) not null ( ) ) not null ( ) ) , data types field ( " f array " , data types array ( data types int ( ) not null ( ) ) not null ( ) ) ) not null ( ) ; schema schema = avro schema converter convert to schema ( data type get logical type ( ) ) ; data type converted = avro schema converter convert to data type ( schema to string ( ) ) ; assert equals ( data type , converted ) ; }


public duration get search timeout ( ) { return beans new duration ( properties get search timeout ( ) ) ; }


set the count of all of the unnamed parameters in the sql statement

void set unnamed parameter count ( int unnamed parameter count ) { this unnamed parameter count = unnamed parameter count ; }


applies { @ code function } to each element of this fluent iterable and returns a fluent iterable with the concatenated combination of results { @ code function } returns an iterable of results the returned fluent iterable ' s iterator supports { @ code remove ( ) } if this function - returned iterables ' iterator does after a successful { @ code remove ( ) } call , the returned fluent iterable no longer contains the corresponding element < b > { @ code stream } equivalent : < b > { @ link stream # flat map } ( using a function that produces streams , not iterables )

public < t > fluent iterable < t > transform and concat ( function < ? super e , ? extends iterable < ? extends t > > function ) { return fluent iterable concat ( transform ( function ) ) ; }


we consider an annotation to be valid for extraction if it ' s not an internal annotation ( i e is in the < code > com facebook litho < code > package and is not a source - only annotation

private static boolean is valid annotation ( project project , psi annotation psi annotation ) { final string text = psi annotation get qualified name ( ) ; if ( text starts with ( " com facebook " ) ) { return false ; } psi class annotation class = psi search utils find class ( project , psi annotation get qualified name ( ) ) ; if ( annotation class = = null ) { throw new runtime exception ( " annotation class not found , text is : " + text ) ; } final retention retention = psi annotation proxy utils find annotation in hierarchy ( annotation class , retention class ) ; return retention = = null | | retention value ( ) ! = retention policy source ; }


gets the total file size , if known this is package - scope in order to allow the { @ link header section } to set itself up properly

public int get file size ( ) { if ( file size < 0 ) { throw new runtime exception ( " file size not yet known " ) ; } return file size ; }


returns a list of all the fid files know to the application

public list < fid file > get fid files ( ) { load fid files ( ) ; list < fid file > files = new array list < > ( fid files ) ; collections sort ( files ) ; return files ; }


public list < duration stats > get operation statistics ( ) { return store get operation statistics ( ) ; }


returns whether the given class would introduce any unwanted fields in the target class

private boolean introduces unwanted fields ( program class program class , program class target class ) { / / it ' s ok if the target class is never instantiated , without any other / / subclasses except for maybe the source class if ( ! instantiation class marker is instantiated ( target class ) & & ( target class sub classes = = null | | is only sub class ( program class , target class ) ) ) { return false ; } member counter counter = new member counter ( ) ; / / count all non - static fields in the the source class program class fields accept ( new member access filter ( 0 , class constants acc static , counter ) ) ; return counter get count ( ) > 0 ; }


sets drawable to be reused when creating new one

public t with ( gif drawable drawable ) { m old drawable = drawable ; return self ( ) ; }


returns the index of the key if already present , else - ( index + 1 ) for the next empty index this can be overridden in this pacakge to compare for equality differently than { @ link object # equals ( object ) }

int locate key ( k key ) { if ( key = = null ) throw new illegal argument exception ( " key cannot be null " ) ; k [ ] key table = this key table ; for ( int i = place ( key ) ; ; i = i + 1 & mask ) { k other = key table [ i ] ; if ( other = = null ) return - ( i + 1 ) ; / / empty space is available if ( other equals ( key ) ) return i ; / / same key was found } }


register this implementation as the default in the system

public static void register ( ) { if ( main is unit test & & jenkins loc = = null ) { mock off ( ) ; return ; } class filter set default ( new class filter impl ( ) ) ; if ( suppress all ) { logger warning ( " all class filtering suppressed your jenkins installation is at risk from known attacks see https : / / jenkins io / redirect / class - filter / " ) ; } else if ( suppress whitelist ) { logger warning ( " jep - 200 class filtering by whitelist suppressed your jenkins installation may be at risk see https : / / jenkins io / redirect / class - filter / " ) ; } }


returns the minimum of the two values if the values compare as 0 , the first is returned the recommended solution for finding the { @ code minimum } of some values depends on the type of your data and the number of elements you have read more in the guava user guide article on < a href = " https : github comgoogleguavawiki collection utilities explained # comparators " > { @ code comparators }

public static < t extends comparable < ? super t > > t min ( t a , t b ) { return ( a compare to ( b ) < = 0 ) ? a : b ; }


public method get commit method ( ) { return commit method ; }


flatten a sequence of entries into a single map

private static map < path fragment , artifact > entries to map ( nested set < symlink entry > entry set , @ nullable conflict checker checker ) { checker = ( checker ! = null ) ? checker : conflict checker ignore checker ; map < path fragment , artifact > map = new linked hash map < > ( ) ; for ( symlink entry entry : entry set to list ( ) ) { checker put ( map , entry get path ( ) , entry get artifact ( ) ) ; } return map ; }


register custom http message readers or writers in addition to the ones registered by default


this test validates the correctness of { @ link r m web service protocol # get app queue ( ) } inside router

public void test app queue x m l ( ) throws exception { string app id = submit application ( ) ; list < app queue > responses = perform get calls ( rm web service path + format ( apps appid queue , app id ) , app queue class , null , null ) ; app queue router response = responses get ( 0 ) ; app queue rm response = responses get ( 1 ) ; assert not null ( router response ) ; assert not null ( rm response ) ; assert equals ( rm response get queue ( ) , router response get queue ( ) ) ; }


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

public static void write signed leb 1 2 8 ( byte array output stream out , int value ) { int remaining = value > > 7 ; boolean has more = true ; int end = ( ( value & integer min value ) = = 0 ) ? 0 : - 1 ; while ( has more ) { has more = ( remaining ! = end ) | | ( ( remaining & 1 ) ! = ( ( value > > 6 ) & 1 ) ) ; out write ( ( byte ) ( ( value & 0x 7f ) | ( has more ? 0x 8 0 : 0 ) ) ) ; value = remaining ; remaining > > = 7 ; } }


gets the default edge weight of this graph specified at creation time

public double get default edge weight ( ) { return default value ; }


use the given { @ link hostname verifier } instance note that if { @ link io dropwizard client ssl tls configuration # is verify hostname ( ) } returns false , all host name verification is bypassed , including host name verification performed by a verifier specified through this interface

public jersey client builder using ( hostname verifier verifier ) { apache http client builder using ( verifier ) ; return this ; }


this does actual copy it should be called only when we hold locks on both this and other objects

private void do copy ( final int offset , final memory chunk other , final int other offset , final int count ) { if ( ! ( other instanceof buffer memory chunk ) ) { throw new illegal argument exception ( " cannot copy two incompatible memory chunks " ) ; } preconditions check state ( ! is closed ( ) ) ; preconditions check state ( ! other is closed ( ) ) ; memory chunk util check bounds ( offset , other get size ( ) , other offset , count , m size ) ; m buffer position ( offset ) ; / / byte buffer can ' t be null at this point other get byte buffer ( ) position ( other offset ) ; / / recover the necessary part to be copied as a byte array / / this requires a copy , for now there is not a more efficient alternative byte [ ] b = new byte [ count ] ; m buffer get ( b , 0 , count ) ; other get byte buffer ( ) put ( b , 0 , count ) ; }


determine whether there are currently thread - bound credentials , using them if available , falling back to the statically specified username and password ( i e values of the bean properties ) else

public final topic connection create topic connection ( ) throws j m s exception { jms user credentials thread credentials = this thread bound credentials get ( ) ; if ( thread credentials ! = null ) { return do create topic connection ( thread credentials username , thread credentials password ) ; } else { return do create topic connection ( this username , this password ) ; } }


config info wrapper query config info ( final string data id , final string group , final string tenant ) ;


short - circuit integer : no threadsemaphore : thread thread pool full integer : no thread pool queue full integer : no timeout : no execution result : asynchronous hystrix bad request exception

public void test execution hook thread async bad request exception ( ) { assert hooks on failure ( 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 async bad request ) ; } } , 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 ( 0 , 1 , 0 ) ) ; assert true ( hook execution events match ( 0 , 1 , 0 ) ) ; assert true ( hook fallback events match ( 0 , 0 , 0 ) ) ; assert equals ( hystrix bad request exception class , hook get command exception ( ) get class ( ) ) ; assert equals ( hystrix bad request exception class , hook get execution exception ( ) get class ( ) ) ; assert equals ( " on start - on thread start - ! on run start - on execution start - on execution error - ! on run error - on thread complete - on error - " , command get builder ( ) execution hook execution sequence to string ( ) ) ; } } ) ; }


build an array to hold the " top " buckets for each ordinal

abstract b [ ] [ ] build top buckets per ord ( int size ) ;


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


setup and return the underlying { @ link file system } mock

static file system setup ( ) throws i o exception { if ( mock fs = = null ) { mock fs = mock ( file system class ) ; } reset ( mock fs ) ; configuration conf = new configuration ( ) ; conf set ( " fs default f s " , " mockfs : / / / " ) ; conf set class ( " fs mockfs impl " , mock file system class , file system class ) ; when ( mock fs get conf ( ) ) then return ( conf ) ; return mock fs ; }


creates a new root resource file for a given jar file

public static resource file open jar resource file ( file jar file , jar entry filter filter ) throws i o exception { jar resource root = new jar resource ( jar file , filter ) ; resource file root resource file = new resource file ( root ) ; jar roots map put ( jar file get canonical path ( ) , root ) ; return root resource file ; }


returns a list of all data including { @ code default data }

public array list < fake data > get all data ( ) { array list < fake data > fake datas = new array list < > ( data map values ( ) ) ; if ( default data ! = null ) { fake datas add ( default data ) ; } return fake datas ; }


public boolean remove file ( final string file name ) { files remove ( file name ) ; return true ; }


stop all name node threads and wait for all to finish

public void stop ( ) { synchronized ( this ) { if ( stop requested ) return ; stop requested = true ; } try { if ( state ! = null ) { state exit state ( ha context ) ; } } catch ( service failed exception e ) { log warn ( " encountered exception while exiting state " , e ) ; } finally { stop metrics logger ( ) ; stop common services ( ) ; if ( metrics ! = null ) { metrics shutdown ( ) ; } if ( namesystem ! = null ) { namesystem shutdown ( ) ; } if ( name node status bean name ! = null ) { m beans unregister ( name node status bean name ) ; name node status bean name = null ; } if ( level d b alias map server ! = null ) { level d b alias map server close ( ) ; } } tracer close ( ) ; }


gets the index of the address range containing the indicated address , if it is contained in the list ; otherwise , < tt > ( - ( insertion point ) - 1 ) < tt >

private int get address range index ( address address ) { int low = 0 ; int high = diffs length - 1 ; while ( low < = high ) { int mid = ( low + high ) > > 1 ; address range range = ranges [ mid ] ; if ( range contains ( address ) ) { return mid ; } else if ( address compare to ( range get min address ( ) ) < 0 ) { high = mid - 1 ; } else { low = mid + 1 ; } } return - ( low + 1 ) ; / / not found }


schedule prepare bulk request runnable to run after some delay this is where throttling plugs into reindexing so the request can be rescheduled over and over again

public void delay prepare bulk request ( thread pool thread pool , long last batch start time n s , int last batch size , abstract runnable prepare bulk request runnable ) { / / synchronize so we are less likely to schedule the same request twice synchronized ( delayed prepare bulk request reference ) { time value delay = throttle wait time ( last batch start time n s , system nano time ( ) , last batch size ) ; logger debug ( " [ { } ] : preparing bulk request for [ { } ] " , task get id ( ) , delay ) ; try { delayed prepare bulk request reference set ( new delayed prepare bulk request ( thread pool , get requests per second ( ) , delay , new run once ( prepare bulk request runnable ) ) ) ; } catch ( es rejected execution exception e ) { prepare bulk request runnable on rejection ( e ) ; } } }


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

public locale get locale ( ) { return this locales get first ( ) ; }


method to form a string of all abfs output stream statistics and their values


returns the environment variables that should be set for c + + compile actions

immutable map < string , string > get environment ( ) throws command line expansion exception { try { return feature configuration get environment variables ( action name , variables ) ; } catch ( expansion exception e ) { throw new command line expansion exception ( e get message ( ) ) ; } }


protected static secret key create secret key ( byte [ ] key ) { return new secret key spec ( key , default hmac algorithm ) ; }


return a read - only list with the registered handlers , or an empty list

public list < handler method return value handler > get handlers ( ) { return collections unmodifiable list ( this return value handlers ) ; }


checks if the given operation has been processed in this engine or not

protected final boolean has been processed before ( operation op ) { if ( assertions enabled ) { assert op seq no ( ) ! = sequence numbers unassigned seq no : " operation is not assigned seq no " ; if ( op operation type ( ) = = operation type no op ) { assert no op keyed lock is held by current thread ( op seq no ( ) ) ; } else { assert version map assert keyed lock held by current thread ( op uid ( ) bytes ( ) ) ; } } return local checkpoint tracker has processed ( op seq no ( ) ) ; }


return true if this pet object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } pet pet = ( pet ) o ; return objects equals ( this id , pet id ) & & objects equals ( this category , pet category ) & & objects equals ( this name , pet name ) & & objects equals ( this photo urls , pet photo urls ) & & objects equals ( this tags , pet tags ) & & objects equals ( this status , pet status ) ; }


delete fake : fake endpoint to test group parameters ( optional ) fake endpoint to test group parameters ( optional )

default response entity < void > test group parameters ( @ not null @ api param ( value = " required string in group parameters " , required = true ) @ valid @ request param ( value = " required string group " , required = true ) integer required string group , @ api param ( value = " required boolean in group parameters " , required = true ) @ request header ( value = " required boolean group " , required = true ) boolean required boolean group , @ not null @ api param ( value = " required integer in group parameters " , required = true ) @ valid @ request param ( value = " required int 6 4 group " , required = true ) long required int 6 4 group , @ api param ( value = " string in group parameters " ) @ valid @ request param ( value = " string group " , required = false ) integer string group , @ api param ( value = " boolean in group parameters " ) @ request header ( value = " boolean group " , required = false ) boolean boolean group , @ api param ( value = " integer in group parameters " ) @ valid @ request param ( value = " int 6 4 group " , required = false ) long int 6 4 group ) { return new response entity < > ( http status not implemented ) ; }


this method repopulates the { @ link cache service } by looking at the files on the disk and for each file found , retrieves the latest synchronized information and puts the cache file into the searchable snapshots cache this method iterates over all node data paths and all shard directories in order to found the " snapshot cache " directories that contain the cache files when such a directory is found , the method iterates over the cache files and looks up their name u u i d in the existing lucene documents that were loaded when instanciating the persistent cache index ) if no information is found ( ie no matching docs in the map of lucene documents ) then the file is deleted from disk if a doc is found the stored fields are extracted from the lucene document and are used to rebuild the necessary { @ link cache key } , { @ link snapshot id } , { @ link index id } , { @ link shard id } and cache file ranges objects the lucene document is then indexed again in the new persistent cache index ( the current { @ link cache index writer } ) and the cache file is added back to the searchable snapshots cache again note that adding cache file to the cache service might trigger evictions so previously reindexed lucene cache files might be delete again ( see cache service # on cache file removal ( cache file ) method which calls { @ link # remove cache file ( cache file ) }

void repopulate cache ( cache service cache service ) { ensure open ( ) ; if ( started compare and set ( false , true ) ) { try { for ( cache index writer writer : writers ) { final node environment node path node path = writer node path ( ) ; logger debug ( " loading persistent cache on data path [ { } ] " , node path ) ; for ( string index u u i d : node environment available index folders for path ( node path ) ) { for ( shard id shard id : node environment find all shard ids ( new index ( " unknown " , index u u i d ) ) ) { final path shard data path = writer node path ( ) resolve ( shard id ) ; final path shard cache path = get shard cache path ( new shard path ( false , shard data path , shard data path , shard id ) ) ; if ( files is directory ( shard cache path ) ) { logger trace ( " found snapshot cache dir at [ { } ] , loading cache files from disk and index " , shard cache path ) ; files walk file tree ( shard cache path , new simple file visitor < > ( ) { @ override public file visit result visit file ( path file , basic file attributes attrs ) { try { final string id = build id ( file ) ; final document cache document = documents get ( id ) ; if ( cache document ! = null ) { logger trace ( " indexing cache file with id [ { } ] in persistent cache index " , id ) ; writer update cache file ( id , cache document ) ; final cache key cache key = build cache key ( cache document ) ; final long file length = get file length ( cache document ) ; final sorted set < tuple < long , long > > ranges = build cache file ranges ( cache document ) ; logger trace ( " adding cache file with [ id = { } , key = { } , ranges = { } ] " , id , cache key , ranges ) ; cache service put ( cache key , file length , file get parent ( ) , id , ranges ) ; } else { logger trace ( " deleting cache file [ { } ] ( does not exist in persistent cache index ) " , file ) ; files delete ( file ) ; } } catch ( exception e ) { throw exceptions helper convert to runtime ( e ) ; } return file visit result continue ; } } ) ; } } } } for ( cache index writer writer : writers ) { writer commit ( ) ; } logger info ( " persistent cache index loaded " ) ; documents clear ( ) ; } catch ( i o exception e ) { try { close ( ) ; } catch ( exception e 2 ) { logger warn ( " failed to close persistent cache index " , e 2 ) ; e add suppressed ( e 2 ) ; } throw new unchecked i o exception ( " failed to load persistent cache " , e ) ; } finally { close if any index writer has tragedy or is closed ( ) ; } } else { assert false : " persistent cache is already loaded " ; } }


public boolean add child ( i node node , final boolean set mod time , final int latest snapshot id ) { final int low = search children ( node get local name bytes ( ) ) ; if ( low > = 0 ) { return false ; } if ( is in latest snapshot ( latest snapshot id ) ) { / / create snapshot feature if necessary directory with snapshot feature sf = this get directory with snapshot feature ( ) ; if ( sf = = null ) { sf = this add snapshot feature ( null ) ; } return sf add child ( this , node , set mod time , latest snapshot id ) ; } add child ( node , low ) ; if ( set mod time ) { / / update modification time of the parent directory update modification time ( node get modification time ( ) , latest snapshot id ) ; } return true ; }


return the topic creation groups defined for a source connector as a map of topic creation group name to topic creation group instance this map maintains all the optionally defined groups besides the default group which is defined for any connector when topic creation is enabled

public map < string , topic creation group > topic groups ( ) { return topic groups ; }


removes all headers with the specified { @ code name }


returns a string which describes this node todo rename to ` get description ` once all exec nodes do not extend from flink physical rel , because rel node already has ` get description ` method


return language which has modified context field offsetssizes , register offsets , and compiler - spec id ' s notes : 1 translation can not be handled by default language transaltor 2 simple language transaltor should handle it

private old language get lang 3 ( ) throws exception { return read old language ( " < ? xml version = \ " 1 0 \ " encoding = \ " utf - 8 \ " ? > " + " < language version = \ " 3 \ " endian = \ " little \ " > " + " < description > " + " < id > x 8 6 : le : 32 : test < / id > " + " < processor > x 8 6 < / processor > " + " < variant > test < / variant > " + " < size > 32 < / size > " + " < / description > " + " < compiler name = \ " abc \ " id = \ " abc \ " / > " + " < compiler name = \ " xyz \ " id = \ " xyz \ " / > " + " < spaces > " + " < space name = \ " ram \ " type = \ " ram \ " size = \ " 4 \ " default = \ " yes \ " / > " + " < space name = \ " register \ " type = \ " register \ " size = \ " 4 \ " / > " + " < / spaces > " + " < registers > " + " < context register name = \ " contextreg \ " offset = \ " 0x 3 0 0 0 \ " bitsize = \ " 32 \ " > " + " < field name = \ " a \ " range = \ " 0 , 3 \ " / > " + " < field name = \ " b \ " range = \ " 4 , 4 \ " / > " + " < field name = \ " c \ " range = \ " 5 , 5 \ " / > " + " < / context register > " + " < register name = \ " rax2 \ " offset = \ " 0x 8 \ " bitsize = \ " 64 \ " / > " + " < register name = \ " eax2 \ " offset = \ " 0x 8 \ " bitsize = \ " 32 \ " / > " + " < register name = \ " ax2 \ " offset = \ " 0x 8 \ " bitsize = \ " 16 \ " / > " + " < register name = \ " al2 \ " offset = \ " 0x 8 \ " bitsize = \ " 8 \ " / > " + " < register name = \ " ah2 \ " offset = \ " 0x 9 \ " bitsize = \ " 8 \ " / > " + " < register name = \ " xx2 \ " offset = \ " 0x 2 0 \ " bitsize = \ " 16 \ " / > " + " < register name = \ " xl2 \ " offset = \ " 0x 2 1 \ " bitsize = \ " 8 \ " / > " + " < / registers > " + " < / language > " ) ; }


return whether object 1 is equals to object 2

public static boolean equals ( final object o 1 , final object o 2 ) { return o 1 = = o 2 | | ( o 1 ! = null & & o 1 equals ( o 2 ) ) ; }


default void create role ( connector session session , string role , optional < presto principal > grantor ) { throw new presto exception ( not supported , " this connector does not support create role " ) ; }


tests to verify the behaviours of three different processes if the number of available buffers is less than required buffers recycle the floating buffer recycle the exclusive buffer decrease the sender ' s backlog

public void test available buffers less than required buffers ( ) throws exception { / / setup final network buffer pool network buffer pool = new network buffer pool ( 16 , 32 ) ; final int num floating buffers = 14 ; final single input gate input gate = create single input gate ( 1 , network buffer pool ) ; final remote input channel input channel = create remote input channel ( input gate ) ; input gate set input channels ( input channel ) ; throwable thrown = null ; try { final buffer pool buffer pool = spy ( network buffer pool create buffer pool ( num floating buffers , num floating buffers ) ) ; input gate set buffer pool ( buffer pool ) ; input gate setup channels ( ) ; input channel request subpartition ( 0 ) ; / / prepare the exclusive and floating buffers to verify recycle logic later final buffer exclusive buffer = input channel request buffer ( ) ; assert not null ( exclusive buffer ) ; final int num recycle floating buffers = 2 ; final array deque < buffer > floating buffer queue = new array deque < > ( num recycle floating buffers ) ; for ( int i = 0 ; i < num recycle floating buffers ; i + + ) { buffer floating buffer = buffer pool request buffer ( ) ; assert not null ( floating buffer ) ; floating buffer queue add ( floating buffer ) ; } verify ( buffer pool , times ( num recycle floating buffers ) ) request buffer ( ) ; / / receive the producer ' s backlog more than the number of available floating buffers input channel on sender backlog ( 14 ) ; / / the channel requests ( backlog + num exclusive buffers ) floating buffers from local / / pool / / it does not get enough floating buffers and register as buffer listener verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 13 buffers available in the channel " , 13 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 16 buffers required in the channel " , 16 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / increase the backlog input channel on sender backlog ( 16 ) ; / / the channel is already in the status of waiting for buffers and will not request any / / more verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 13 buffers available in the channel " , 13 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 18 buffers required in the channel " , 18 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / recycle one exclusive buffer exclusive buffer recycle buffer ( ) ; / / the exclusive buffer is returned to the channel directly verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 14 buffers available in the channel " , 14 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 18 buffers required in the channel " , 18 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / recycle one floating buffer floating buffer queue poll ( ) recycle buffer ( ) ; / / assign the floating buffer to the listener and the channel is still waiting for more / / floating buffers verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 15 buffers available in the channel " , 15 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 18 buffers required in the channel " , 18 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / decrease the backlog input channel on sender backlog ( 13 ) ; / / only the number of required buffers is changed by ( backlog + num exclusive buffers ) verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 15 buffers available in the channel " , 15 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 15 buffers required in the channel " , 15 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / recycle one more floating buffer floating buffer queue poll ( ) recycle buffer ( ) ; / / return the floating buffer to the buffer pool and the channel is not waiting for more / / floating buffers verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 15 buffers available in the channel " , 15 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 15 buffers required in the channel " , 15 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 1 buffers available in local pool " , 1 , buffer pool get number of available memory segments ( ) ) ; assert false ( input channel is waiting for floating buffers ( ) ) ; / / increase the backlog again input channel on sender backlog ( 15 ) ; / / the floating buffer is requested from the buffer pool and the channel is registered / / as listener again verify ( buffer pool , times ( 17 ) ) request buffer ( ) ; verify ( buffer pool , times ( 2 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 16 buffers available in the channel " , 16 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 17 buffers required in the channel " , 17 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; } catch ( throwable t ) { thrown = t ; } finally { cleanup ( network buffer pool , null , null , thrown , input channel ) ; } }


applies the given { @ link # get revision id ( object metadata , string ) revision id } as a server - side qualification on the { @ code copy object request }

public abstract void apply revision constraint ( copy object request request , string revision id ) ;


get the installed extension provider if the parse method has not yet been invoked , the default adapter will be returned

public elf load adapter get load adapter ( ) { return elf load adapter ; }


drop the specified handle to this repository

public void drop handle ( repository handle impl handle ) { synchronized ( handle list ) { handle list remove ( handle ) ; } }


public int get total reduces ( ) { return datum get total reduces ( ) ; }


public int get module index ( ) { return internals get module index ( ) ; }


public int get capacity ( ) { return capacity ; }


{ @ inherit doc } a { @ link run action 2 } is handled specially

public void add action ( @ non null action a ) { super add action ( a ) ; if ( a instanceof run action 2 ) { ( ( run action 2 ) a ) on attached ( this ) ; } else if ( a instanceof run action ) { ( ( run action ) a ) on attached ( this ) ; } }


creates traversal request parameters for a fileset entry wrapping another fileset

public static fileset traversal params nested traversal ( label owner label , artifact artifact , path fragment dest path , @ nullable set < string > excludes ) { return nested traversal params get nested traversal ( owner label , artifact , dest path , excludes ) ; }


performs one pass of generating more equivalences by rewriting sub - expressions in terms of known equivalences

private void generate more equivalences ( ) { collection < set < row expression > > equivalent classes = equalities get equivalent classes ( ) ; / / map every expression to the set of equivalent expressions immutable map builder < row expression , set < row expression > > map builder = immutable map builder ( ) ; for ( set < row expression > expressions : equivalent classes ) { expressions for each ( expression - > map builder put ( expression , expressions ) ) ; } / / for every non - derived expression , extract the sub - expressions and see if they can be rewritten as other expressions if so , / / use this new information to update the known equalities map < row expression , set < row expression > > map = map builder build ( ) ; for ( row expression expression : map key set ( ) ) { if ( ! derived expressions contains ( expression ) ) { for ( row expression sub expression : filter ( unique sub expressions ( expression ) , not ( equal to ( expression ) ) ) ) { set < row expression > equivalent sub expressions = map get ( sub expression ) ; if ( equivalent sub expressions ! = null ) { for ( row expression equivalent sub expression : filter ( equivalent sub expressions , not ( equal to ( sub expression ) ) ) ) { row expression rewritten = row expression tree rewriter rewrite with ( new row expression node inliner ( immutable map of ( sub expression , equivalent sub expression ) ) , expression ) ; equalities find and union ( expression , rewritten ) ; derived expressions add ( rewritten ) ; } } } } } }


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


public acl create sasl a c l from current user ( int perms ) throws i o exception { user group information current user = user group information get current user ( ) ; if ( current user has kerberos credentials ( ) ) { return create sasl a c l ( current user , perms ) ; } else { return null ; } }


query that the state is in a specific state

public boolean is in state ( service state proposed ) { return state equals ( proposed ) ; }


sets the maximum number of bytes to read per individual read operation if this value is greater than 1 , an event loop might attempt to read multiple times to procure bytes

max bytes recv byte buf allocator max bytes per individual read ( int max bytes per individual read ) ;


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


temporary path for writing to the partition , unpartitioned table or the query it may be the same as { @ code target path }

public path get write path ( ) { return write path ; }


sets the output buffer to be rendered the renderer is responsible for releasing the buffer

void set output buffer ( video decoder output buffer output buffer ) ;


register the set of mapper outputs created by a local job runner - based job with this reduce task so it knows where to fetch from this should not be called in normal ( networked ) execution

public void set local map files ( map < task attempt i d , map output file > map files ) { this local map files = map files ; }


the yarn router will forward to the respective yarn rm in which the am is running possible failure : client : identical behavior as { @ code client r m service } router : the client will timeout and resubmit the request resource manager : the router will timeout and the call will fail state store : the router will timeout and it will retry depending on the federation facade settings - if the failure happened before the select operation

public get application report response get application report ( get application report request request ) throws yarn exception , i o exception { long start time = clock get time ( ) ; if ( request = = null | | request get application id ( ) = = null ) { router metrics incr apps failed retrieved ( ) ; router server util log and throw exception ( " missing get application report request or application id information " , null ) ; } sub cluster id sub cluster id = null ; try { sub cluster id = federation facade get application home sub cluster ( request get application id ( ) ) ; } catch ( yarn exception e ) { router metrics incr apps failed retrieved ( ) ; router server util log and throw exception ( " application " + request get application id ( ) + " does not exist in federation state store " , e ) ; } application client protocol client r m proxy = get client r m proxy for sub cluster ( sub cluster id ) ; get application report response response = null ; try { response = client r m proxy get application report ( request ) ; } catch ( exception e ) { router metrics incr apps failed retrieved ( ) ; log error ( " unable to get the application report for " + request get application id ( ) + " to sub cluster " + sub cluster id get id ( ) , e ) ; throw e ; } if ( response = = null ) { log error ( " no response when attempting to retrieve the report of " + " the application " + request get application id ( ) + " to sub cluster " + sub cluster id get id ( ) ) ; } long stop time = clock get time ( ) ; router metrics succeeded apps retrieved ( stop time - start time ) ; return response ; }


this implementation returns the name of the file that this external resource refers to

public string get filename ( ) { return string utils get filename ( get path ( ) ) ; }


get the name used for any logging messages

public string get name ( ) { return name ; }


returns the sum of { @ code a } and { @ code b } , provided it does not overflow

public static long checked add ( long a , long b ) { long result = a + b ; check no overflow ( ( a ^ b ) < 0 | ( a ^ result ) > = 0 , " checked add " , a , b ) ; return result ; }


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

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


implements first - edge ( loop entry ) elimination as an optimization during closure operations see antlrantlr 4 # 1398 the optimization is to avoid adding the loop entry config when the exit path can only lead back to the same star loop entry state after popping context at the rule end state ( traversing only epsilon edges , so we ' re still in closure , in this same rule ) we need to detect any state that can reach loop entry on epsilon wo exiting rule we don ' t have to look at follow links , just ensure that all stack tops for config refer to key states in lr rule to verify we are in the right situation we must first check closure is at a star loop entry state generated during lr removal then we check that each stack top of context is a return state from one of these cases : 1 ' not ' expr , ' ( ' type ' ) ' expr the return state points at loop entry state 2 expr op expr the return state is the block end of internal block of ( ) 3 ' between ' expr ' and ' expr the return state of 2nd expr reference that state points at block end of internal block of ( ) 4 expr ' ? ' expr ' : ' expr the return state points at block end , which points at loop entry state if any is true for each stack top , then closure does not add a config to the current config set for edge [ 0 ] , the loop entry branch conditions fail if any context for the current config is : a empty ( we ' d fall out of expr to do a global follow which could even be to some weird spot in expr ) or , b lies outside of expr or , c lies within expr but at a state not the block end state generated during lr removal do we need to evaluate predicates ever in closure for this case ? no predicates , including precedence predicates , are only evaluated when computing a dfa start state i e , only before the lookahead ( but not parser ) consumes a token there are no epsilon edges allowed in lr rule alt blocks or in the " primary " part ( id here ) if closure is in star loop entry state any lookahead operation will have consumed a token as there are no epsilon - paths that lead to star loop entry state we do not have to evaluate predicates therefore if we are in the generated star loop entry state of a lr rule note that when making a prediction starting at that decision point , decision d = 2 , compute - start - state performs closure starting at edges [ 0 ] , edges [ 1 ] emanating from star loop entry state that means it is not performing closure on star loop entry state during compute - start - state how do we know this always gives same prediction answer ? without predicates , loop entry and exit paths are ambiguous upon remaining input + b ( in , say , a + b ) either paths lead to valid parses closure can lead to consuming + immediately or by falling out of this call to expr back into expr and loop back again to star loop entry state to match + b in this special case , we choose the more efficient path , which is to take the bypass path the lookahead language has not changed because closure chooses one path over the other both paths lead to consuming the same remaining input during a lookahead operation if the next token is an operator , lookahead will enter the choice block with operators if it is not , lookahead will exit expr same as if closure had chosen to enter the choice block immediately closure is examining one config ( some loopentrystate , some alt , context ) which means it is considering exactly one alt closure always copies the same alt to any derived configs how do we know this optimization doesn ' t mess up precedence in our parse trees ? looking through expr from left edge of stat only has to confirm that an input , say , a + b + c ; begins with any valid interpretation of an expression the precedence actually doesn ' t matter when making a decision in stat seeing through expr it is only when parsing rule expr that we must use the precedence to get the right interpretation and , hence , parse tree

protected boolean can drop loop entry edge in left recursive rule ( a t n config config ) { if ( turn off lr loop entry branch opt ) return false ; a t n state p = config state ; / / first check to see if we are in star loop entry state generated during / / left - recursion elimination for efficiency , also check if / / the context has an empty stack case if so , it would mean / / global follow so we can ' t perform optimization if ( p get state type ( ) ! = a t n state star loop entry | | ! ( ( star loop entry state ) p ) is precedence decision | | / / are we the special loop entry / exit state ? config context is empty ( ) | | / / if sll wildcard config context has empty path ( ) ) { return false ; } / / require all return states to return back to the same rule / / that p is in int num ctxs = config context size ( ) ; for ( int i = 0 ; i < num ctxs ; i + + ) { / / for each stack context a t n state return state = atn states get ( config context get return state ( i ) ) ; if ( return state rule index ! = p rule index ) return false ; } block start state decision start state = ( block start state ) p transition ( 0 ) target ; int block end state num = decision start state end state state number ; block end state block end state = ( block end state ) atn states get ( block end state num ) ; / / verify that the top of each stack context leads to loop entry / exit / / state through epsilon edges and w / o leaving rule for ( int i = 0 ; i < num ctxs ; i + + ) { / / for each stack context int return state number = config context get return state ( i ) ; a t n state return state = atn states get ( return state number ) ; / / all states must have single outgoing epsilon edge if ( return state get number of transitions ( ) ! = 1 | | ! return state transition ( 0 ) is epsilon ( ) ) { return false ; } / / look for prefix op case like ' not expr ' , ( ' type ' ) ' expr a t n state return state target = return state transition ( 0 ) target ; if ( return state get state type ( ) = = block end & & return state target = = p ) { continue ; } / / look for ' expr op expr ' or case where expr ' s return state is block end / / of ( ) * internal block ; the block end points to loop back / / which points to p but we don ' t need to check that if ( return state = = block end state ) { continue ; } / / look for ternary expr ? expr : expr the return state points at block end , / / which points at loop entry state if ( return state target = = block end state ) { continue ; } / / look for complex prefix ' between expr and expr ' case where 2nd expr ' s / / return state points at block end state of ( ) * internal block if ( return state target get state type ( ) = = block end & & return state target get number of transitions ( ) = = 1 & & return state target transition ( 0 ) is epsilon ( ) & & return state target transition ( 0 ) target = = p ) { continue ; } / / anything else ain ' t conforming return false ; } return true ; }


returns the corresponding conversion class for representing values if no conversion class was defined manually , the default conversion defined by the logical type is used

public class < ? > get conversion class ( ) { return conversion class ; }


create label op tpl uses overloaded pcode op ptradd with input [ 0 ] = label index

private op tpl get label op template ( address factory addr factory , int label index ) { const tpl offset tpl = new const tpl ( const tpl real , label index ) ; const tpl space tpl = new const tpl ( addr factory get constant space ( ) ) ; const tpl size tpl = new const tpl ( const tpl real , 8 ) ; varnode tpl input = new varnode tpl ( space tpl , offset tpl , size tpl ) ; return new op tpl ( pcode op ptradd , null , new varnode tpl [ ] { input } ) ; }


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


public long renew ( final token < ? > token , configuration conf ) throws i o exception , interrupted exception { log debug ( " renewing the delegation token " ) ; return get instance ( conf ) renew delegation token ( token ) ; }


writes properties and their attributes ( final and resource ) to the given { @ link writer } when property name is not empty , and the property exists in the configuration , the format of the output would be , { " property " : { " key " : " key 1 " , " value " : " value 1 " , " is final " : " key 1 is final " , " resource " : " key 1 resource " } } when property name is null or empty , it behaves same as { @ link # dump configuration ( configuration , writer ) } , the output would be , { " properties " : [ { key : " key 1 " , value : " value 1 " , is final : " key 1 is final " , resource : " key 1 resource " } , { key : " key 2 " , value : " value 2 " , is final : " ke 2 is final " , resource : " key 2 resource " } ] } when property name is not empty , and the property is not found in the configuration , this method will throw an { @ link illegal argument exception }

public static void dump configuration ( configuration config , string property name , writer out ) throws i o exception { if ( strings is null or empty ( property name ) ) { dump configuration ( config , out ) ; } else if ( strings is null or empty ( config get ( property name ) ) ) { throw new illegal argument exception ( " property " + property name + " not found " ) ; } else { json factory dump factory = new json factory ( ) ; json generator dump generator = dump factory create generator ( out ) ; dump generator write start object ( ) ; dump generator write field name ( " property " ) ; append j s o n property ( dump generator , config , property name , new config redactor ( config ) ) ; dump generator write end object ( ) ; dump generator flush ( ) ; } }


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

private boolean mkdirs ( f t p client client , path file , fs permission permission ) throws i o exception { boolean created = true ; path work dir = new path ( client print working directory ( ) ) ; path absolute = make absolute ( work dir , file ) ; string path name = absolute get name ( ) ; if ( ! exists ( client , absolute ) ) { path parent = absolute get parent ( ) ; created = ( parent = = null | | mkdirs ( client , parent , fs permission get dir default ( ) ) ) ; if ( created ) { string parent dir = parent to uri ( ) get path ( ) ; client change working directory ( parent dir ) ; created = created & & client make directory ( path name ) ; } } else if ( is file ( client , absolute ) ) { throw new parent not directory exception ( string format ( " can ' t make directory for path % s since it is a file " , absolute ) ) ; } return created ; }


expects that after the test , the rule will fire specific exception with specific exception message

public void expect failure ( final class < ? extends throwable > expected , final string expected message ) { this expect failure ( new failure assert ( ) { public void do assert ( throwable t ) { assert throwable ( t , expected ) has message ( expected message ) ; } } ) ; }


update query and header parameters based on authentication settings

protected void update params for auth ( string [ ] auth names , list < pair > query params , map < string , string > header params , map < string , string > cookie params , string payload , string method , uri uri ) throws api exception { for ( string auth name : auth names ) { authentication auth = authentications get ( auth name ) ; if ( auth = = null ) { continue ; } auth apply to params ( query params , header params , cookie params , payload , method , uri ) ; } }


set the flag whether to use native library used for testing non - native libraries

public static void set native zlib loaded ( final boolean is loaded ) { zlib factory native zlib loaded = is loaded ; }


a helper api for creating an audit event object

static audit event create log event ( string user , string operation , result result ) { audit event event = new audit event ( result ) ; event add entry ( field name user , user ) ; event add entry ( field name operation , operation ) ; return event ; }


extracts an avro { @ link schema } from a { @ link specific record } we do this either via { @ link specific data } or by instantiating a record and extracting the schema from the instance

public static < t > schema extract avro specific schema ( class < t > type , specific data specific data ) { optional < schema > new schema optional = try extract avro schema via instance ( type ) ; return new schema optional or else get ( ( ) - > specific data get schema ( type ) ) ; }


public void warn ( throwable cause , char sequence message ) { this log warn ( message , cause ) ; }


method : only for ' ' match pattern , return true of false

public static boolean is match pattern ( final string string , final string pattern string ) { boolean result = false ; if ( string ! = null & & pattern string ! = null ) { if ( pattern string index of ( metch pattern ) > = 0 ) { string match pattern = constant symbol xor + pattern string replace all ( metch pattern regex , metch pattern replacement ) + constant symbol dollar ; result = is match regex ( string , match pattern ) ; } else { if ( string equals ( pattern string ) ) { result = true ; } } } return result ; }


whether url lookups should always use the full path within the current web application context , i e within { @ link javax servlet servlet context # get context path ( ) } if set to { @ literal false } the path within the current servlet mapping is used instead if applicable ( i e in the case of a prefix based servlet mapping such as " my servlet " ) by default this is set to " false "

public void set always use full path ( boolean always use full path ) { check read only ( ) ; this always use full path = always use full path ; }


reverses the elements of { @ code array } this is equivalent to { @ code collections reverse ( floats as list ( array ) ) } , but is likely to be more efficient

public static void reverse ( float [ ] array ) { check not null ( array ) ; reverse ( array , 0 , array length ) ; }


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


writes the index state this method is public for testing purposes

public long write index ( string reason , index metadata index metadata ) throws write state exception { final index index = index metadata get index ( ) ; logger trace ( " [ { } ] writing state , reason [ { } ] " , index , reason ) ; try { long generation = index metadata format write ( index metadata , node env index paths ( index metadata get index ( ) ) ) ; logger trace ( " [ { } ] state written " , index ) ; return generation ; } catch ( write state exception ex ) { throw new write state exception ( false , " [ " + index + " ] : failed to write index state " , ex ) ; } }


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


set value of context register between begad and endad

public void set variable region ( string nm , address begad , address endad , int value ) { context bit range bitrange = get variable ( nm ) ; vector s t l < int [ ] > vec = new vector s t l < int [ ] > ( ) ; get region ( vec , begad , endad ) ; for ( int i = 0 ; i < vec size ( ) ; + + i ) { bitrange set value ( vec get ( i ) , value ) ; } }


add a new script to the existing stored scripts based on a user - specified id if a script with the same id already exists it will be overwritten

public builder store script ( string id , stored script source source ) { scripts put ( id , source ) ; return this ; }


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

public void find pets by tags test ( ) { list < string > tags = null ; / / list < pet > response = api find pets by tags ( tags ) ; / / assert not null ( response ) ; / / todo : test validations }


exposes the best available session mutex

protected object get flash maps mutex ( http servlet request request ) { return web utils get session mutex ( request get session ( ) ) ; }


invoked from a container thread when an async request completed for any reason including timeout and network error this method is useful for detecting that a { @ code deferred result } instance is no longer usable

default < t > void after completion ( native web request request , deferred result < t > deferred result ) throws exception { }


each entry in the exception table array describes one exception handler in the code array the order of the handlers in the exception table array is significant

public exception handler java [ ] get exception table ( ) { return exception table ; }


determines whether or not the user is being prompted to resolve a conflict

public synchronized boolean is prompting user ( ) { return prompting ; }


returns the magic number corresponding to the given target api level

public static string api to magic ( int target api level ) { string version ; if ( target api level > = api current ) { version = version current ; } else { version = version for api 13 ; } return magic prefix + version + magic suffix ; }


{ @ code opens to count } indicates the number of entries in the { @ code opens to index } table

public int get opens to count ( ) { return opens to count & 0xffff ; }


public static boolean is service running ( @ non null final class < ? > cls ) { return is service running ( cls get name ( ) ) ; }


get the { @ link feign request } from { @ link enhanced instance } , then create { @ link abstract span } and set host , port , kind , component , url from { @ link feign request } through the reflection of the way , set the http header of context data into { @ link feign request # headers }

public void before method ( enhanced instance obj inst , method method , object [ ] all arguments , class < ? > [ ] arguments types , method intercept result result ) throws throwable { request request = ( request ) all arguments [ 0 ] ; url url = new url ( request url ( ) ) ; context carrier context carrier = new context carrier ( ) ; int port = url get port ( ) = = - 1 ? 80 : url get port ( ) ; string remote peer = url get host ( ) + " : " + port ; string operation name = url get path ( ) ; feign resolved u r l feign resolved u r l = path var interceptor url context get ( ) ; if ( feign resolved u r l ! = null ) { try { operation name = operation name replace ( feign resolved u r l get url ( ) , feign resolved u r l get origin url ( ) ) ; } finally { path var interceptor url context remove ( ) ; } } if ( operation name length ( ) = = 0 ) { operation name = " / " ; } abstract span span = context manager create exit span ( operation name , context carrier , remote peer ) ; span set component ( components define feign ) ; tags http method set ( span , request method ( ) ) ; tags url set ( span , request url ( ) ) ; span layer as http ( span ) ; if ( feign plugin config plugin feign collect request body ) { boolean need collect http body = false ; iterator < string > string iterator = values or empty ( request headers ( ) , content type header ) iterator ( ) ; string content type header value = string iterator has next ( ) ? string iterator next ( ) : " " ; for ( string content type : feign plugin config plugin feign supported content types prefix split ( " , " ) ) { if ( content type header value starts with ( content type ) ) { need collect http body = true ; break ; } } if ( need collect http body ) { collect http body ( request , span ) ; } } field headers field = request class get declared field ( " headers " ) ; headers field set accessible ( true ) ; map < string , collection < string > > headers = new linked hash map < string , collection < string > > ( ) ; carrier item next = context carrier items ( ) ; while ( next has next ( ) ) { next = next next ( ) ; list < string > context collection = new array list < string > ( 1 ) ; context collection add ( next get head value ( ) ) ; headers put ( next get head key ( ) , context collection ) ; } headers put all ( request headers ( ) ) ; headers field set ( request , collections unmodifiable map ( headers ) ) ; }


return the path of storageemulated 0 androiddatapackagefiles ringtones

public static string get external app ringtones path ( ) { if ( ! utils bridge is s d card enable by environment ( ) ) return " " ; return get absolute path ( utils get app ( ) get external files dir ( environment directory ringtones ) ) ; }


generates the clickable map info and sends that to the response

public static void generate clickable map ( stapler request req , stapler response rsp , final j free chart chart , int default w , int default h ) throws i o exception { new graph ( - 1 , default w , default h ) { protected j free chart create graph ( ) { return chart ; } } do map ( req , rsp ) ; }


this method reads the modes which are located at the very end of the vorbis setup header that ' s why we need to partially decode or at least read the entire setup header to know where to start reading the modes

public static mode [ ] read vorbis modes ( parsable byte array header data , int channels ) throws parser exception { verify vorbis header capture pattern ( 0x 0 5 , header data , false ) ; int number of books = header data read unsigned byte ( ) + 1 ; vorbis bit array bit array = new vorbis bit array ( header data get data ( ) ) ; bit array skip bits ( header data get position ( ) * 8 ) ; for ( int i = 0 ; i < number of books ; i + + ) { read book ( bit array ) ; } int time count = bit array read bits ( 6 ) + 1 ; for ( int i = 0 ; i < time count ; i + + ) { if ( bit array read bits ( 16 ) ! = 0x 0 0 ) { throw new parser exception ( " placeholder of time domain transforms not zeroed out " ) ; } } read floors ( bit array ) ; read residues ( bit array ) ; read mappings ( channels , bit array ) ; mode [ ] modes = read modes ( bit array ) ; if ( ! bit array read bit ( ) ) { throw new parser exception ( " framing bit after modes not set as expected " ) ; } return modes ; }


static collection < object [ ] > data provider ( ) { return list of ( new object [ ] { new melee strategy ( ) , " with your excalibur you sever the dragon ' s head ! " } , new object [ ] { new projectile strategy ( ) , " you shoot the dragon with the magical crossbow and it falls dead on the ground ! " } , new object [ ] { new spell strategy ( ) , " you cast the spell of disintegration and the dragon vaporizes in a pile of dust ! " } ) ; }


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

@ override public t visit statement ( eql base parser statement context ctx ) { return visit children ( ctx ) ; }


gets the stream if it exists if not , returns { @ code null }

http 2 stream stream ( int stream id ) ;


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


create a builder with the { @ linkplain http message reader message readers } , method name , uri , headers , cookies , and attributes of the given request

static builder from ( server request other ) { return new default server request builder ( other ) ; }


calculate the amount of bytes that can be sent by { @ code state } the lower bound is { @ code 0 }

public static int streamable bytes ( stream byte distributor stream state state ) { return max ( 0 , ( int ) min ( state pending bytes ( ) , state window size ( ) ) ) ; }


for internal use in logging at the http adapter layer

string get log prefix ( ) { if ( this log prefix = = null ) { this log prefix = " [ " + get id ( ) + " ] " ; } return this log prefix ; }


set the delivery mode to use when sending a message default is the jms message default : " persistent "

public void set delivery mode ( int delivery mode ) { this delivery mode = delivery mode ; }


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


tests if the currently received samples for a given track are already a ' chunk ' as we want to have it the next sample will not be part of the chunk will be added to the fragment buffer later

private boolean is chunk ready ( streaming track streaming track , streaming sample next ) { final long ts = objects require non null ( next sample start time get ( streaming track ) ) ; final long cfst = objects require non null ( next chunk create start time get ( streaming track ) ) ; return ( ts > = cfst + 2 * streaming track get timescale ( ) ) ; / / chunk interleave of 2 seconds }


get { @ link application attempt id } of the application master

public application attempt id get application attempt id ( ) { return app scheduling info get application attempt id ( ) ; }


configure the bean instance subclasses can override this to provide custom configuration logic typically called by an aspect , for all bean instances matched by a pointcut

public void configure bean ( object bean instance ) { if ( this bean factory = = null ) { if ( logger is debug enabled ( ) ) { logger debug ( " bean factory has not been set on " + class utils get short name ( get class ( ) ) + " : " + " make sure this configurer runs in a spring container unable to configure bean of type [ " + class utils get descriptive type ( bean instance ) + " ] proceeding without injection " ) ; } return ; } bean wiring info resolver bwi resolver = this bean wiring info resolver ; assert state ( bwi resolver ! = null , " no bean wiring info resolver available " ) ; bean wiring info bwi = bwi resolver resolve wiring info ( bean instance ) ; if ( bwi = = null ) { / / skip the bean if no wiring info given return ; } configurable listable bean factory bean factory = this bean factory ; assert state ( bean factory ! = null , " no bean factory available " ) ; try { string bean name = bwi get bean name ( ) ; if ( bwi indicates autowiring ( ) | | ( bwi is default bean name ( ) & & bean name ! = null & & ! bean factory contains bean ( bean name ) ) ) { / / perform autowiring ( also applying standard factory / post - processor callbacks ) bean factory autowire bean properties ( bean instance , bwi get autowire mode ( ) , bwi get dependency check ( ) ) ; bean factory initialize bean ( bean instance , ( bean name ! = null ? bean name : " " ) ) ; } else { / / perform explicit wiring based on the specified bean definition bean factory configure bean ( bean instance , ( bean name ! = null ? bean name : " " ) ) ; } } catch ( bean creation exception ex ) { throwable root cause = ex get most specific cause ( ) ; if ( root cause instanceof bean currently in creation exception ) { bean creation exception bce = ( bean creation exception ) root cause ; string bce bean name = bce get bean name ( ) ; if ( bce bean name ! = null & & bean factory is currently in creation ( bce bean name ) ) { if ( logger is debug enabled ( ) ) { logger debug ( " failed to create target bean ' " + bce get bean name ( ) + " ' while configuring object of type [ " + bean instance get class ( ) get name ( ) + " ] - probably due to a circular reference this is a common startup situation " + " and usually not fatal proceeding without injection original exception : " + ex ) ; } return ; } } throw ex ; } }


returns a { @ link virtual channel } that ' s connected to the privilege - escalated environment

public static virtual channel start ( final task listener listener , final string root username , final string root password ) throws i o exception , interrupted exception { if ( file path separator char = = ' ; ' ) / / on windows return new local channel ( ) ; / / todo : perhaps use run as to run as an administrator ? string os = util fix null ( system get property ( " os name " ) ) ; if ( os equals ( " linux " ) ) return new unix su ( ) { protected string sudo exe ( ) { return " sudo " ; } protected process sudo with pass ( argument list builder args ) throws i o exception { args prepend ( sudo exe ( ) , " - s " ) ; listener get logger ( ) println ( " $ " + util join ( args to list ( ) , " " ) ) ; process builder pb = new process builder ( args to command array ( ) ) ; process p = pb start ( ) ; / / todo : use - p to detect prompt / / todo : detect if the password didn ' t work print stream ps = new print stream ( p get output stream ( ) ) ; ps println ( root password ) ; ps println ( root password ) ; ps println ( root password ) ; return p ; } } start ( listener , root password ) ; if ( os equals ( " sun o s " ) ) return new unix su ( ) { protected string sudo exe ( ) { return " / usr / bin / pfexec " ; } protected process sudo with pass ( argument list builder args ) throws i o exception { listener get logger ( ) println ( " running with embedded su " ) ; process builder pb = new process builder ( args prepend ( sudo exe ( ) ) to command array ( ) ) ; return embedded su start with su ( root username , root password , pb ) ; } / / in solaris , pfexec never asks for a password , so username = = null means / / we won ' t be using password this helps disambiguate empty password } start ( listener , root username = = null ? null : root password ) ; / / todo : mac ? / / unsupported platform , take a chance return new local channel ( ) ; }


a callback called after the result is successfully computed by { @ link # call ( ) } in our implementation this method is called in context of background thread but in some variants , such as android where only ui thread can change the state of ui widgets , this method is called in context of ui thread


if the request corresponding to this response did not acknowledge licensing changes that would result from starting a trial license ( see { @ link # is acknowledged ( ) } ) , returns a message describing how the user must acknowledge licensing changes as a result of such a request returns null otherwise

public string get acknowledge header ( ) { return acknowledge header ; }


returns the maximum number of parallel downloads

public int get max parallel downloads ( ) { return max parallel downloads ; }


returns true if the only uses of this register form a circle of operations with no side effects

private boolean is circular no side effect ( int reg v , bit set set ) { if ( ( set ! = null ) & & set get ( reg v ) ) { return true ; } for ( ssa insn use : use list [ reg v ] ) { if ( has side effect ( use ) ) { return false ; } } if ( set = = null ) { set = new bit set ( reg count ) ; } / / this register is only used in operations that have no side effect set set ( reg v ) ; for ( ssa insn use : use list [ reg v ] ) { register spec result = use get result ( ) ; if ( result = = null | | ! is circular no side effect ( result get reg ( ) , set ) ) { return false ; } } return true ; }


get the { @ link session context } when initialize the execution context it ' s usually used when resetting the session properties

public session context get original session context ( ) { return this original session context ; }


the same as get group name ( snapshot current state id )

public final string get group name ( ) { return get group name ( snapshot current state id ) ; }


set the list of { @ link reservation request } representing the resources required by the application

public abstract void set reservation resources ( list < reservation request > reservation resources ) ;