public int get per host max conn ( ) { return per host max conn ; }


insert the specified number of records using random keys

private d b record [ ] create random var key table records ( table table , int record cnt , int var data size ) throws i o exception { long tx id = dbh start transaction ( ) ; if ( table = = null ) { table = d b test utils create binary key table ( dbh , table 1 name , d b test utils all types , false ) ; } d b record [ ] recs = new d b record [ record cnt ] ; for ( int i = 0 ; i < record cnt ; i + + ) { try { recs [ i ] = d b test utils create binary key record ( table , max var key length , var data size , true ) ; } catch ( duplicate key exception e ) { assert fail ( " duplicate key error " ) ; } } dbh end transaction ( tx id , true ) ; return recs ; }


called before reading a range from the file to ensure that this range is present unlike { @ link sparse file tracker # wait for range ( tuple , tuple , action listener ) } this method does not expect the caller to fill in any gaps

public boolean wait for range if pending ( final tuple < long , long > range , final action listener < void > listener ) { final long start = range v 1 ( ) ; final long end = range v 2 ( ) ; if ( end < start | | start < 0l | | length < end ) { throw new illegal argument exception ( " invalid range [ start = " + start + " , end = " + end + " , length = " + length + " ] " ) ; } final action listener < void > wrapped listener = wrap with assertions ( listener ) ; final list < range > pending ranges = new array list < > ( ) ; synchronized ( mutex ) { assert invariant ( ) ; final range target range = new range ( start , end , null ) ; final sorted set < range > earlier ranges = ranges head set ( target range , false ) ; / / ranges with strictly earlier starts if ( earlier ranges is empty ( ) = = false ) { final range last earlier range = earlier ranges last ( ) ; if ( start < last earlier range end ) { if ( last earlier range is pending ( ) ) { pending ranges add ( last earlier range ) ; } target range start = math min ( end , last earlier range end ) ; } } while ( target range start < end ) { assert 0 < = target range start : target range ; assert invariant ( ) ; final sorted set < range > existing ranges = ranges tail set ( target range ) ; if ( existing ranges is empty ( ) ) { return false ; } else { final range first existing range = existing ranges first ( ) ; assert target range start < = first existing range start : target range + " vs " + first existing range ; if ( target range start = = first existing range start ) { if ( first existing range is pending ( ) ) { pending ranges add ( first existing range ) ; } target range start = math min ( end , first existing range end ) ; } else { return false ; } } } assert target range start = = target range end : target range ; assert target range start = = end : target range ; assert invariant ( ) ; } / / nb we work with ranges outside the mutex here , but only to interact with their completion listeners which are ` final ` so / / there is no risk of concurrent modification switch ( pending ranges size ( ) ) { case 0 : wrapped listener on response ( null ) ; break ; case 1 : final range pending range = pending ranges get ( 0 ) ; pending range completion listener add listener ( wrapped listener map ( progress - > null ) , math min ( pending range completion listener end , end ) ) ; return true ; default : final grouped action listener < long > grouped action listener = new grouped action listener < > ( wrapped listener map ( progress - > null ) , pending ranges size ( ) ) ; pending ranges for each ( r - > r completion listener add listener ( grouped action listener , math min ( r completion listener end , end ) ) ) ; return true ; } return true ; }


testing { @ link weapon factory } to produce a spear asserting that the weapon is an instance of { @ link spear }

public void test spear weapon ( ) { var weapon = factory create ( weapon type spear ) ; verify weapon ( weapon , spear class ) ; }


public void acquire lock test ( branch session branch session ) throws exception { boolean result = lock manager acquire lock ( branch session ) ; assertions assert true ( result ) ; branch session unlock ( ) ; }


get the partition metadata for the given topic this can be used for custom partitioning

public list < partition info > partitions for ( string topic ) { objects require non null ( topic , " topic cannot be null " ) ; try { return wait on metadata ( topic , null , time milliseconds ( ) , max block time ms ) cluster partitions for topic ( topic ) ; } catch ( interrupted exception e ) { throw new interrupt exception ( e ) ; } }


removes all { @ link cache span cache spans } for a resource , deleting the underlying files


attempts to asynchronously index an ilm history entry

public void put async ( i l m history item item ) { if ( ilm history enabled = = false ) { logger trace ( " not recording ilm history item because [ { } ] is [ false ] : [ { } ] " , lifecycle history index enabled setting get key ( ) , item ) ; return ; } logger trace ( " queueing ilm history item for indexing [ { } ] : [ { } ] " , ilm history data stream , item ) ; try ( x content builder builder = x content factory json builder ( ) ) { item to x content ( builder , to x content empty params ) ; index request request = new index request ( ilm history data stream ) source ( builder ) op type ( doc write request op type create ) ; / / todo : remove the threadpool wrapping when the add call is non - blocking / / ( it can currently execute the bulk request occasionally ) / / see : https : / / github com / elastic / elasticsearch / issues / 50440 thread pool executor ( thread pool names generic ) execute ( ( ) - > { try { processor add ( request ) ; } catch ( exception e ) { logger error ( new parameterized message ( " failed add ilm history item to queue for index [ { } ] : [ { } ] " , ilm history data stream , item ) , e ) ; } } ) ; } catch ( i o exception exception ) { logger error ( new parameterized message ( " failed to queue ilm history item in index [ { } ] : [ { } ] " , ilm history data stream , item ) , exception ) ; } }


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


adds a key - value mapping to the built multimap

public builder < k , v > put ( k key , v value ) { check entry not null ( key , value ) ; collection < v > value collection = builder map get ( key ) ; if ( value collection = = null ) { builder map put ( key , value collection = new mutable value collection ( ) ) ; } value collection add ( value ) ; return this ; }


specify subscriber ' s ip and look up whether data is lastest group key - > is uptodate

public static map < string , boolean > is client uptodate ( string ip ) { map < string , boolean > result = new hash map < string , boolean > ( 100 ) ; for ( map entry < string , string > entry : get client record ( ip ) get group key 2md 5 map ( ) entry set ( ) ) { string group key = entry get key ( ) ; string client md 5 = entry get value ( ) ; boolean isuptodate = config cache service is uptodate ( group key , client md 5 ) ; result put ( group key , isuptodate ) ; } return result ; }


import an external project that has been received as a tar file , expanded , and copied into our workspace directory

public boolean load project metadata ( long project i d ) { synchronized ( this ) { project metadata metadata = project metadata utilities load ( get project dir ( project i d ) ) ; if ( metadata = = null ) { metadata = project metadata utilities recover ( get project dir ( project i d ) , project i d ) ; } if ( metadata ! = null ) { projects metadata put ( project i d , metadata ) ; if ( projects tags = = null ) { projects tags = new hash map < string , integer > ( ) ; } if ( metadata ! = null & & metadata get tags ( ) ! = null ) { for ( string tag : metadata get tags ( ) ) { if ( projects tags contains key ( tag ) ) { projects tags put ( tag , projects tags get ( tag ) + 1 ) ; } else { projects tags put ( tag , 1 ) ; } } } return true ; } else { return false ; } } }


public string encoding ( ) { return encoding ; }


public statement create statement ( ) throws s q l exception { throw new s q l exception ( " simulated exception in create statement ( ) " ) ; }


validate and set layout version from { @ link properties }

protected void set layout version ( properties props , storage directory sd ) throws incorrect version exception , inconsistent f s state exception { int lv = integer parse int ( get property ( props , sd , " layout version " ) ) ; if ( lv < get service layout version ( ) ) { / / future version throw new incorrect version exception ( get service layout version ( ) , lv , " storage directory " + sd root get absolute path ( ) ) ; } layout version = lv ; }


get the memory use for the indicated node returns null if not available ( new , fetching or failed )


extract { @ code field name } from { @ code hit } and if it is a string return the string else { @ code null }

default string string field value or null ( search hit hit , string field name ) { document field doc field = hit field ( field name ) ; if ( doc field ! = null ) { object value = doc field get value ( ) ; if ( value instanceof string ) { return ( string ) value ; } } return null ; }


returns the repeat mode for the given simple exo player ' s repeat mode

public static int get repeat mode ( @ player repeat mode int exo player repeat mode ) { switch ( exo player repeat mode ) { case player repeat mode all : return session player repeat mode all ; case player repeat mode one : return session player repeat mode one ; case player repeat mode off : return session player repeat mode none ; default : throw new illegal argument exception ( ) ; } }


marks the current { @ code writer index } in this buffer you can reposition the current { @ code writer index } to the marked { @ code writer index } by calling { @ link # reset writer index ( ) } the initial value of the marked { @ code writer index } is { @ code 0 }

public abstract byte buf mark writer index ( ) ;


public method method ( ) { return this method ; }


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


gets the hash value if this data type has one

public scalar get hash value ( ) throws invalid data type exception , undefined value exception { check validity ( ) ; if ( has v f pointer ) { throw new undefined value exception ( " no hash value is defined for this type descriptor model " ) ; } / / component 0 is either vf table pointer or hash value return e h data type utilities get scalar value ( get data type ( ) , vf table or hash ordinal , get mem buffer ( ) ) ; }


sets the matrix to the given matrix as a float array the float array must have at least 9 elements ; the first 9 will be copied

public matrix 3 set ( float [ ] values ) { system arraycopy ( values , 0 , val , 0 , val length ) ; return this ; }


prepares the given { @ link dynamic table sink } it check whether the sink is compatible with the insert into clause and applies initial parameters

private static void prepare dynamic sink ( catalog sink modify operation sink operation , dynamic table sink sink , catalog table table ) { final object identifier sink identifier = sink operation get table identifier ( ) ; validate partitioning ( sink operation , sink identifier , sink , table get partition keys ( ) ) ; validate and apply overwrite ( sink operation , sink identifier , sink ) ; validate and apply metadata ( sink identifier , sink , table get schema ( ) ) ; }


the main driver for < code > load typed bytes < code >

public int run ( string [ ] args ) throws exception { if ( args length = = 0 ) { system err println ( " too few arguments ! " ) ; print usage ( ) ; return 1 ; } path path = new path ( args [ 0 ] ) ; file system fs = path get file system ( get conf ( ) ) ; if ( fs exists ( path ) ) { system err println ( " given path exists already ! " ) ; return - 1 ; } typed bytes input tbinput = new typed bytes input ( new data input stream ( system in ) ) ; sequence file writer writer = sequence file create writer ( fs , conf , path , typed bytes writable class , typed bytes writable class ) ; try { typed bytes writable key = new typed bytes writable ( ) ; typed bytes writable value = new typed bytes writable ( ) ; byte [ ] raw key = tbinput read raw ( ) ; while ( raw key ! = null ) { byte [ ] raw value = tbinput read raw ( ) ; key set ( raw key , 0 , raw key length ) ; value set ( raw value , 0 , raw value length ) ; writer append ( key , value ) ; raw key = tbinput read raw ( ) ; } } finally { writer close ( ) ; } return 0 ; }


returns the least element of the priority queue in constant time

public final t top ( ) { if ( size > 0 ) return heap [ 1 ] ; else return null ; }


public string get temp dir ( ) { return temp dir ; }


void start seek ( long target granule ) ;


can this { @ link token filter } be used in multi - term queries ?

public boolean should use filter for multiterm queries ( ) { return use filter for multiterm queries ; }


return the aop alliance method invocation object associated with the current invocation

public static method invocation current invocation ( ) throws illegal state exception { method invocation mi = invocation get ( ) ; if ( mi = = null ) { throw new illegal state exception ( " no method invocation found : check that an aop invocation is in progress and that the " + " expose invocation interceptor is upfront in the interceptor chain specifically , note that " + " advices with order highest precedence will execute before expose invocation interceptor ! " + " in addition , expose invocation interceptor and expose invocation interceptor current invocation ( ) " + " must be invoked from the same thread " ) ; } return mi ; }


given an address , get the byte block info

byte block info get byte block info ( address address ) { if ( ! program get memory ( ) contains ( address ) ) { / / this block set is out of date eventually a new / / program byte block set impl will be created return null ; } for ( int i = 0 ; i < blocks length ; i + + ) { if ( ! mem blocks [ i ] contains ( address ) ) { continue ; } try { long off = address subtract ( mem blocks [ i ] get start ( ) ) ; big integer offset = ( off < 0 ) ? big integer value of ( off + 0x 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 l ) subtract ( big integer value of ( 0x 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 l ) ) : big integer value of ( off ) ; return new byte block info ( blocks [ i ] , offset ) ; } catch ( exception e ) { return null ; } } return null ; }


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

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


protected string get delegation binding ( ) { return delegation token session binding ; }


protected string digest encoded password ( final string encoded password , final map < string , object > values ) { val hash service = new default hash service ( ) ; if ( string utils is not blank ( this static salt ) ) { hash service set private salt ( byte source util bytes ( this static salt ) ) ; } hash service set hash algorithm name ( this algorithm name ) ; if ( values contains key ( this number of iterations field name ) ) { val long as str = values get ( this number of iterations field name ) to string ( ) ; hash service set hash iterations ( integer parse int ( long as str ) ) ; } else { hash service set hash iterations ( this number of iterations ) ; } if ( ! values contains key ( this salt field name ) ) { throw new illegal argument exception ( " specified field name for salt does not exist in the results " ) ; } val dyna salt = values get ( this salt field name ) to string ( ) ; val request = new hash request builder ( ) set salt ( dyna salt ) set source ( encoded password ) build ( ) ; return hash service compute hash ( request ) to hex ( ) ; }


returns a read - only slice of this buffer ' s readable bytes , i e between { @ link # get reader index ( ) } and { @ link # get size ( ) } reader and writer indices as well as markers are not shared reference counters are shared but the slice is not { @ link # retain buffer ( ) retained } automatically


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

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


ensures that { @ code expression } is { @ code true } , throwing a { @ code verify exception } with a custom message otherwise see { @ link # verify ( boolean , string , object ) } for details

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


make a file or directory tree writable if the path is a directory , make all files under it ( and all of its subdirectories ) writable

public static void set tree writable ( path path ) throws i o exception { if ( ! files exists ( path ) ) { throw new i o exception ( string format ( " can not recursively modify files inside % s : directory does not exist " , path to absolute path ( ) to string ( ) ) ) ; } files walk file tree ( path , new simple file visitor < path > ( ) { @ override public file visit result pre visit directory ( path dir , basic file attributes attrs ) throws i o exception { if ( ! dir to file ( ) can write ( ) & & ! dir to file ( ) set writable ( true ) ) { throw new i o exception ( string format ( " can not make % s writeable " , dir to absolute path ( ) to string ( ) ) ) ; } return file visit result continue ; } @ override public file visit result visit file ( path file , basic file attributes attrs ) throws i o exception { if ( ! file to file ( ) set writable ( true ) ) { throw new i o exception ( string format ( " can not make % s writeable " , file to absolute path ( ) to string ( ) ) ) ; } return file visit result continue ; } } ) ; }


moves the viewport up the number of rows specified if moving up puts he view above the bounds of the first - visible chunk , load a previous chunk

public void move viewport up ( int rows , boolean selection ) { / / do some object checking up front and exit if these aren ' t set if ( ! is state valid ( ) ) { return ; } / / calculate the position of the viewport if we were to move it up the number of / / rows given point new viewport pos = new point ( 0 , ( int ) viewport get view position ( ) get y ( ) - ( table get row height ( ) * rows ) ) ; / / save off the new viewport pos ; this will be our new location unless we need to / / adjust it by adding / removing new chunks save position = new viewport pos y ; / / if our proposed new viewport position is less than zero , then we need to add a new / / previous chunk ( unless we ' re already at the beginning of the file ) if ( new viewport pos y < 0 ) { try { / / read in a previous chunk and make sure we get some valid lines if we don ' t get / / any valid lines , then we must be moving to the top of the file so just move / / the viewport to the top list < string > read lines = reader read previous chunk ( ) ; if ( read lines size ( ) > 0 ) { / / we have valid rows , so add them to the table ( at the top , because we ' re / / reading a previous chunk ) ( ( f v table model ) table get model ( ) ) add rows to top ( read lines ) ; / / if adding that chunk just put us over the chunk limit we want to show , we / / have to remove one from the bottom , and adjust our viewport accordingly / / / / otherwise , just move our viewport down the corresponding number of rows / / we just added if ( model get size ( ) > model max visible chunks ) { chunk chunk = model remove ( model get size ( ) - 1 ) ; new viewport pos = new point ( 0 , new viewport pos y + ( table get row height ( ) * chunk lines in chunk ) ) ; save position = new viewport pos y ; ( ( f v table model ) table get model ( ) ) remove rows from bottom ( chunk lines in chunk ) ; } else { save position + = table get row height ( ) * read lines size ( ) ; } } else { move viewport to top ( ) ; if ( selection ) { update selection to viewport top ( ) ; } return ; } } catch ( i o exception e ) { msg error ( this , " error creating loading new chunk for viewport decrement " , e ) ; } } / / at this point we should have a valid new viewport position , so set it set position ( new point ( 0 , save position ) ) ; / / and if necessary , set new selection to encompass the top row that ' s in the viewport if ( selection ) { update selection to viewport top ( ) ; } }


this method is called by when the parser successfully matches an input symbol

void report match ( parser recognizer ) ;


configure client keys to use for authorization in an ssl session use null to reset to default

public api client set key managers ( key manager [ ] managers ) { this key managers = managers ; apply ssl settings ( ) ; return this ; }


indicate whether external xml entities are processed when unmarshalling default is { @ code false } , meaning that external entities are not resolved note that processing of external entities will only be enableddisabled when the { @ code source } passed to { @ link # unmarshal ( source ) } is a { @ link s a x source } or { @ link stream source } it has no effect for { @ link d o m source } or { @ link st a x source } instances note : setting this option to { @ code true } also automatically sets { @ link # set support dtd } to { @ code true }

public void set process external entities ( boolean process external entities ) { this process external entities = process external entities ; if ( process external entities ) { this support dtd = true ; } }


returns a new range set consisting of the intersection of this range set and { @ code other } this is essentially the same as { @ code tree range set create ( this ) remove all ( other complement ( ) ) } except it returns an { @ code immutable range set }

public immutable range set < c > intersection ( range set < c > other ) { range set < c > copy = tree range set create ( this ) ; copy remove all ( other complement ( ) ) ; return copy of ( copy ) ; }


test running an analysis worker from an analysis task thread with events used by analysis at various priority levels

public void test disable resume analysis task worker invocation ( ) throws exception { env show tool ( ) ; load program ( " notepad empty " ) ; auto analysis manager mgr = auto analysis manager get analysis manager ( program ) ; schedule ( mgr , new set test property command ( " p 0 " , 500 ) , 0 ) ; schedule ( mgr , new set test property command ( " p 1 " , 500 ) , 10 ) ; worker background test cmd cmd = new worker background test cmd ( true ) ; schedule ( mgr , cmd , 0 ) ; cmd wait until finished ( ) ; if ( cmd error ! = null ) { fail with exception ( " unexpected exception " , cmd error ) ; } verify program state then undo ( true ) ; }


returns the original element list , unchanged

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


allocate a buffer for output or writing it can prepare for two kinds of data buffers : one with position as 0 , the other with position > 0

protected byte buffer allocate output buffer ( int buffer len ) {


tries to replace an instruction with a const instruction the given instruction must have a constant result for it to be replaced

private boolean try replacing with constant ( normal ssa insn insn ) { insn original rop insn = insn get original rop insn ( ) ; rop opcode = original rop insn get opcode ( ) ; register spec result = insn get result ( ) ; if ( result ! = null & & ! ssa meth is reg a local ( result ) & & opcode get opcode ( ) ! = reg ops const ) { type bearer type = insn get result ( ) get type bearer ( ) ; if ( type is constant ( ) & & type get basic type ( ) = = type bt int ) { / / replace the instruction with a constant replace plain insn ( insn , register spec list empty , reg ops const , ( constant ) type ) ; / / remove the source as well if this is a move - result - pseudo if ( opcode get opcode ( ) = = reg ops move result pseudo ) { int pred = insn get block ( ) get predecessors ( ) next set bit ( 0 ) ; array list < ssa insn > pred insns = ssa meth get blocks ( ) get ( pred ) get insns ( ) ; normal ssa insn source insn = ( normal ssa insn ) pred insns get ( pred insns size ( ) - 1 ) ; replace plain insn ( source insn , register spec list empty , reg ops goto , null ) ; } return true ; } } return false ; }


fetch invalid u r ls https : github com open refine open refineissues 1 2 1 9

public void test invalid url ( ) throws exception { try ( mock web server server = new mock web server ( ) ) { server start ( ) ; http url url = server url ( " / random " ) ; server enqueue ( new mock response ( ) ) ; row row 0 = new row ( 2 ) ; row 0 set cell ( 0 , new cell ( " auinrestrsc " , null ) ) ; / / malformed - > null project rows add ( row 0 ) ; row row 1 = new row ( 2 ) ; row 1 set cell ( 0 , new cell ( url to string ( ) , null ) ) ; / / fine project rows add ( row 1 ) ; row row 2 = new row ( 2 ) ; / / well - formed but not resolvable row 2 set cell ( 0 , new cell ( " http : / / domain invalid / random " , null ) ) ; project rows add ( row 2 ) ; engine dependent operation op = new column addition by fetching u r ls operation ( engine config , " fruits " , " value " , on error store error , " junk " , 1 , 50 , true , null ) ; run and wait ( op , 3000 ) ; int new col = project column model get column by name ( " junk " ) get cell index ( ) ; / / inspect rows assert assert equals ( project rows get ( 0 ) get cell value ( new col ) , null ) ; assert assert true ( project rows get ( 1 ) get cell value ( new col ) ! = null ) ; assert assert true ( expression utils is error ( project rows get ( 2 ) get cell value ( new col ) ) ) ; } }


start a mini - cluster , and set up everything the tests need to use it

private void init cluster ( ) throws exception { cluster = new mini d f s cluster builder ( conf ) num data nodes ( 1 ) build ( ) ; cluster wait active ( ) ; dn = cluster get data nodes ( ) get ( 0 ) ; bpos = dn get all bp os ( ) get ( 0 ) ; nn proxy = bpos get active n n ( ) ; bp registration = bpos bp registration ; bp id = bpos get block pool id ( ) ; dn storage = dn get f s dataset ( ) get block reports ( bp id ) key set ( ) iterator ( ) next ( ) ; }


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


process the bytes of the given input stream using the given processor

public static < t > t read bytes ( input stream input , byte processor < t > processor ) throws i o exception { check not null ( input ) ; check not null ( processor ) ; byte [ ] buf = create buffer ( ) ; int read ; do { read = input read ( buf ) ; } while ( read ! = - 1 & & processor process bytes ( buf , 0 , read ) ) ; return processor get result ( ) ; }


public static string format ( date value ) { return standard date format get ( ) format ( value ) ; }


publish a new item and submit an update for it if it is already published , redirects to its page

public void publish ( publishable p ) { log info ( " publish ( ) : " + p steam title ( ) ) ; if ( p has steam i d ( ) ) { log info ( " content already published , redirecting to id " ) ; view listing ( p ) ; return ; } if ( ! p pre publish ( ) ) { log info ( " rejecting due to pre - publish " ) ; return ; } show publish ( id - > update ( p , id , null ) ) ; }


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


wait for service to finish ( normally , it runs forever )

public void join ( ) { try { rpc server join ( ) ; } catch ( interrupted exception ie ) { log info ( " caught interrupted exception " , ie ) ; } }


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

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


load the image namespace from the given image file , verifying it against the md5 sum stored in its associated md 5 file

private void load f s image ( file image file , f s namesystem target , meta recovery context recovery , boolean require same layout version ) throws i o exception { m d 5 hash expected m d 5 = m d 5 file utils read stored md 5 for file ( image file ) ; if ( expected m d 5 = = null ) { throw new i o exception ( " no md5 file found corresponding to image file " + image file ) ; } load f s image ( image file , expected m d 5 , target , recovery , require same layout version ) ; }


returns true iff { @ code target } is a { @ code test suite } rule

public static boolean is test suite rule ( target target ) { return target instanceof rule & & is test suite rule name ( ( ( rule ) target ) get rule class ( ) ) ; }


adds nodes to the graph object for use by the graph layout auto

protected void add entity node ( node edit part node edit part ) { node entity node ; if ( node edit part instanceof entity part & & ( ( entity part ) node edit part ) get entity ( ) has self links ( ) ) { entity node = new subgraph ( node edit part ) ; } else { entity node = new node ( node edit part ) ; } dimension preferred size = node edit part get figure ( ) get preferred size ( - 1 , - 1 ) ; entity node width = preferred size width ; entity node height = preferred size height ; entity node set padding ( decorator get default entity insets ( ) ) ; part to nodes map put ( node edit part , entity node ) ; graph nodes add ( entity node ) ; if ( entity node instanceof subgraph ) { node source anchor = new node ( " fake node for source links " , ( subgraph ) entity node ) ; source anchor width = 0 ; source anchor height = 0 ; node target anchor = new node ( " fake node for target links " , ( subgraph ) entity node ) ; target anchor width = 0 ; target anchor height = 0 ; } / * * / }


public scheduled events query builder from ( integer from ) { this from = from ; return this ; }


return the internal { @ link byte buf } on the specified offset note that updating the indexes of the returned buffer will lead to an undefined behavior of this buffer

public byte buf internal component at offset ( int offset ) { return find component ( offset ) slice ( ) ; }


see { @ link # set padding ( float , float , float , float ) }

public void set pad right ( float right ) { this pad right = right ; }


test that negative values for new configuration keys get passed through

public void test negative values for memory params ( ) { job conf configuration = new job conf ( ) ; configuration set ( m r job config map memory mb , " - 5 " ) ; configuration set ( m r job config reduce memory mb , " - 6 " ) ; assert assert equals ( m r job config default map memory mb , configuration get memory for map task ( ) ) ; assert assert equals ( m r job config default reduce memory mb , configuration get memory for reduce task ( ) ) ; }


block until the user completes the current merge operation , or cancels the merge process

protected synchronized void wait for input ( ) { for ( ; ; ) { if ( is cancelled | | input received ) { return ; } try { prompting = true ; wait ( ) ; } catch ( interrupted exception e ) { / / loop again } } }


parse an iso local date time formatted string into a java date for backward compatibility , to support the version < = 2 8 , cannot use the date time formatter iso offset date time instead , use the iso8601 below format : yyyy - mm - dd ' t ' hh : mm : ss ' z '

static public offset date time string to date ( string s ) { / / accept timestamps with an explicit time zone try { return offset date time parse ( s ) ; } catch ( date time parse exception e ) { } / / also accept timestamps without an explicit zone and / / assume them to be in local time try { local date time local time = local date time parse ( s ) ; return offset date time of ( local time , zone id system default ( ) get rules ( ) get offset ( local time ) ) ; } catch ( date time parse exception e ) { } return null ; }


{ @ inherit doc } to provide a { @ code request callback } or { @ code response extractor } only , but not both , consider using : { @ link # accept header request callback ( class ) } { @ link # http entity callback ( object ) } { @ link # http entity callback ( object , type ) } { @ link # response entity extractor ( type ) }

public < t > t execute ( string url , http method method , @ nullable request callback request callback , @ nullable response extractor < t > response extractor , map < string , ? > uri variables ) throws rest client exception { uri expanded = get uri template handler ( ) expand ( url , uri variables ) ; return do execute ( expanded , method , request callback , response extractor ) ; }


returns whether the given class member has a new name

private boolean has name ( member member ) { return member obfuscator new member name ( member ) ! = null ; }


transform the map with accumulators into a map containing only the results

public static map < string , optional failure < object > > to result map ( map < string , accumulator < ? , ? > > accumulators ) { map < string , optional failure < object > > result map = new hash map < > ( ) ; for ( map entry < string , accumulator < ? , ? > > entry : accumulators entry set ( ) ) { result map put ( entry get key ( ) , wrap unchecked ( entry get key ( ) , ( ) - > entry get value ( ) get local value ( ) ) ) ; } return result map ; }


returns < tt > true < tt > iff the given { @ link collection } s contain exactly the same elements with exactly the same cardinalities that is , iff the cardinality of e in a is equal to the cardinality of e in b , for each element e in a or b

public static boolean is equal collection ( final collection a , final collection b ) { if ( a size ( ) ! = b size ( ) ) { return false ; } else { map mapa = get cardinality map ( a ) ; map mapb = get cardinality map ( b ) ; if ( mapa size ( ) ! = mapb size ( ) ) { return false ; } else { iterator it = mapa key set ( ) iterator ( ) ; while ( it has next ( ) ) { object obj = it next ( ) ; if ( get freq ( obj , mapa ) ! = get freq ( obj , mapb ) ) { return false ; } } return true ; } } }


adds a route to the given handler function that handles all http { @ code options } requests that match the given pattern

builder options ( string pattern , handler function < server response > handler function ) ;


database traffic metrics source the metrics base on the oal scripts

database access to database access ( ) { if ( ! request type database equals ( type ) ) { return null ; } database access database access = new database access ( ) ; database access set database type id ( component id ) ; database access set latency ( latency ) ; database access set name ( dest service name ) ; database access set status ( status ) ; database access set time bucket ( time bucket ) ; return database access ; }


public boolean is animated ( ) { return name ( ) ends with ( " anime " ) ; }


public address get l p start address ( ) { return lp start addr ; }


public static print writer create writer ( file dir , string prefix ) throws i o exception { check directory ( dir ) ; simple date format date format = new simple date format ( " - yyyy m mdd - h hmmss s s s " ) ; for ( ; ; ) { final file f = new file ( dir , prefix + date format format ( new date ( system current time millis ( ) ) ) + " txt " ) ; if ( ! f exists ( ) ) return new print writer ( new output stream writer ( new file output stream ( f ) , charsets utf 8 ) ) ; try { thread sleep ( 10 ) ; } catch ( interrupted exception e ) { } } }


encoding overhead is thrift type plus 32 - bit length prefix

@ override public int list size in bytes ( list < byte [ ] > values ) { int size in bytes = 5 ; for ( int i = 0 , length = values size ( ) ; i < length ; i + + ) { size in bytes + = values get ( i ) length ; } return size in bytes ; }


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

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


parse source and target paths is a helper method for parsing the source and target paths

private static dist cp options builder parse source and target paths ( command line command ) { path target path ; list < path > source paths = new array list < path > ( ) ; string [ ] left over args = command get args ( ) ; if ( left over args = = null | | left over args length < 1 ) { throw new illegal argument exception ( " target path not specified " ) ; } / / last argument is the target path target path = new path ( left over args [ left over args length - 1 ] trim ( ) ) ; / / copy any source paths in the arguments to the list for ( int index = 0 ; index < left over args length - 1 ; index + + ) { source paths add ( new path ( left over args [ index ] trim ( ) ) ) ; } / * if command has source file listing , use it else , fall back on source paths in args if both are present , throw exception and bail * / if ( command has option ( dist cp option switch source file listing get switch ( ) ) ) { if ( ! source paths is empty ( ) ) { throw new illegal argument exception ( " both source file listing and " + " source paths present " ) ; } return new dist cp options builder ( new path ( get val ( command , dist cp option switch source file listing get switch ( ) ) ) , target path ) ; } else { if ( source paths is empty ( ) ) { throw new illegal argument exception ( " neither source file listing nor " + " source paths present " ) ; } return new dist cp options builder ( source paths , target path ) ; } }


gets the list of " line number " entries associated with this instance

public line number list get line numbers ( ) { return line numbers ; }


transition to the completed state and set the exception

boolean set exception ( throwable t ) { return complete ( null , t , completed ) ; }


modify register value to eliminate non - flowing bits

public final register value get flow value ( register value value ) { if ( value = = null | | ! has non flowing context | | ! value get register ( ) is processor context ( ) ) { return value ; } return value clear bit values ( non flowing context register mask ) ; }


public double get double ( ) { return double ; }


create a pre - configured tokenizer that may not vary at all

public static pre configured tokenizer singleton ( string name , supplier < tokenizer > create ) { return new pre configured tokenizer ( name , caching strategy one , version - > create get ( ) ) ; }


register a resource as a default resource do not attempt to use this unless you understand that the order in which default resources are loaded affects the outcome , and that subclasses of configuration often register new default resources

public static url register default resource ( string resource ) { url res u r l = get resource url ( resource ) ; if ( res u r l ! = null ) { configuration add default resource ( resource ) ; } return res u r l ; }


execute the script for the provided { @ code doc id }

public final list < string > results for doc ( int doc id ) { results clear ( ) ; chars = 0 ; set document ( doc id ) ; execute ( ) ; return results ; }


public void write to ( annotated output out ) { int base address = user get address ( ) ; int default target = dops packed switch get format ( ) code size ( ) ; int sz = targets length ; if ( packed ) { int first case = ( sz = = 0 ) ? 0 : cases get ( 0 ) ; int last case = ( sz = = 0 ) ? 0 : cases get ( sz - 1 ) ; int out sz = last case - first case + 1 ; out write short ( opcodes packed switch payload ) ; out write short ( out sz ) ; out write int ( first case ) ; int case at = 0 ; for ( int i = 0 ; i < out sz ; i + + ) { int out case = first case + i ; int one case = cases get ( case at ) ; int rel target ; if ( one case > out case ) { rel target = default target ; } else { rel target = targets [ case at ] get address ( ) - base address ; case at + + ; } out write int ( rel target ) ; } } else { out write short ( opcodes sparse switch payload ) ; out write short ( sz ) ; for ( int i = 0 ; i < sz ; i + + ) { out write int ( cases get ( i ) ) ; } for ( int i = 0 ; i < sz ; i + + ) { int rel target = targets [ i ] get address ( ) - base address ; out write int ( rel target ) ; } } }


public void add pet ( pet pet ) throws api exception { add pet with http info ( pet ) ; }


returns a recyclable m p point f instance calculates the position around a center point , depending on the distance from the center , and the angle of the position around the center

public static m p point f get position ( m p point f center , float dist , float angle ) { m p point f p = m p point f get instance ( 0 , 0 ) ; get position ( center , dist , angle , p ) ; return p ; }


todo determine how to correctly identify toc location

private void process toc symbol ( container header header , program program , import state cache import state , message log log , task monitor monitor ) { symbol table symbol table = program get symbol table ( ) ; list < section header > sections = header get sections ( ) ; if ( sections size ( ) < 2 ) { return ; } section header data section = sections get ( 1 ) ; if ( ! data section is write ( ) ) { / / is not a data section return ; } address toc address = import state get toc address ( ) ; if ( toc address = = null ) { memory block data block = import state get memory block for section ( data section ) ; toc address = data block get start ( ) ; } try { symbol table create label ( toc address , pef constants toc , source type imported ) ; create data cmd cmd = new create data cmd ( toc address , new pointer data type ( ) ) ; cmd apply to ( program ) ; } catch ( exception e ) { log append exception ( e ) ; } }


checks whether a candidate sync word position is likely to be the position of a real sync word the caller must check that the first byte of the sync word is 0x f f before calling this method this method performs the following checks : the mpeg version of this frame must match the previously detected version the sample rate index of this frame must match the previously detected sample rate index the frame size must be at least 7 bytes the bytes following the frame must be either another sync word with the same mpeg version , or the start of an id3 header with the exception of the first check , if there is insufficient data in the buffer then checks are optimistically skipped and { @ code true } is returned

private boolean check sync position valid ( parsable byte array pes buffer , int sync position candidate ) { pes buffer set position ( sync position candidate + 1 ) ; if ( ! try read ( pes buffer , adts scratch data , 1 ) ) { return false ; } / / the mpeg version of this frame must match the previously detected version adts scratch set position ( 4 ) ; int current frame version = adts scratch read bits ( 1 ) ; if ( first frame version ! = version unset & & current frame version ! = first frame version ) { return false ; } / / the sample rate index of this frame must match the previously detected sample rate index if ( first frame sample rate index ! = c index unset ) { if ( ! try read ( pes buffer , adts scratch data , 1 ) ) { / / insufficient data for further checks return true ; } adts scratch set position ( 2 ) ; int current frame sample rate index = adts scratch read bits ( 4 ) ; if ( current frame sample rate index ! = first frame sample rate index ) { return false ; } pes buffer set position ( sync position candidate + 2 ) ; } / / the frame size must be at least 7 bytes if ( ! try read ( pes buffer , adts scratch data , 4 ) ) { / / insufficient data for further checks return true ; } adts scratch set position ( 14 ) ; int frame size = adts scratch read bits ( 13 ) ; if ( frame size < 7 ) { return false ; } / / the bytes following the frame must be either another sync word with the same mpeg version , or / / the start of an id3 header byte [ ] data = pes buffer get data ( ) ; int data limit = pes buffer limit ( ) ; int next sync position = sync position candidate + frame size ; if ( next sync position > = data limit ) { / / insufficient data for further checks return true ; } if ( data [ next sync position ] = = ( byte ) 0x f f ) { if ( next sync position + 1 = = data limit ) { / / insufficient data for further checks return true ; } return is adts sync bytes ( ( byte ) 0x f f , data [ next sync position + 1 ] ) & & ( ( data [ next sync position + 1 ] & 0x 8 ) > > 3 ) = = current frame version ; } else { if ( data [ next sync position ] ! = ' i ' ) { return false ; } if ( next sync position + 1 = = data limit ) { / / insufficient data for further checks return true ; } if ( data [ next sync position + 1 ] ! = ' d ' ) { return false ; } if ( next sync position + 2 = = data limit ) { / / insufficient data for further checks return true ; } return data [ next sync position + 2 ] = = ' 3 ' ; } }


in order to disassemble correctly , we need to set the ' ds ' register

private void set register d s ( information block ib , segment table segment table , program context context , address start , address end ) { byte progflag = ib get program flags ( ) ; boolean is single data = ( progflag & information block flags prog single data ) ! = 0 ; boolean is multiple data = ( progflag & information block flags prog multiple data ) ! = 0 ; register ds = context get register ( " ds " ) ; try { if ( is single data | | is multiple data ) { short auto data seg = ib get automatic data segment ( ) ; long regval = segment table get segments ( ) [ auto data seg - 1 ] get segment i d ( ) ; context set value ( ds , start , end , big integer value of ( regval ) ) ; } else { context remove ( start , end , ds ) ; } } catch ( context change exception e ) { / / ignore since ds register should never cause this error } }


dumps the edit and continue name list this package - protected method is for debugging only

protected void dump edit and continue name list ( writer writer ) throws i o exception { for ( string name : edit and continue name list ) { writer write ( string format ( " name : % s \ n " , name ) ) ; } }


add a production associated with a sleigh constructor semantic

public void add production ( assembly non terminal lhs , assembly sentential < assembly non terminal > rhs , disjoint pattern pattern , constructor cons , list < integer > indices ) { assembly production prod = new production ( lhs , rhs ) ; add production ( prod ) ; map < constructor , assembly constructor semantic > map = semantics get ( prod ) ; assembly constructor semantic sem = map get ( cons ) ; if ( sem = = null ) { sem = new assembly constructor semantic ( cons , indices ) ; map put ( cons , sem ) ; } else if ( ! indices equals ( sem get operand indices ( ) ) ) { throw new illegal state exception ( " productions of the same constructor must have same operand indices " ) ; } sem add pattern ( pattern ) ; }


{ @ link component host } contains the logic for setting the { @ link node info } containing the { @ link event handler } s for its delegate instance whenever it is setunset

void set node info ( node info node info ) { m node info = node info ; }


< code > optional org apache dubbo metadata definition protobuf model phone type type = 2 [ default = home ] ; < code >


check file changed status , if so , send the notification

private void check and notify ( ) { if ( system current time millis ( ) - last check timestamp < watching period in sec * 1000 ) { / / don ' t reach the period threshold , ignore this check return ; } boolean is changed = false ; for ( final watched file watched file : watched files ) { is changed = is changed | | watched file detect content changed ( ) ; } if ( is changed ) { list < byte [ ] > contents = new array list < > ( watched files size ( ) ) ; watched files for each ( file - > { contents add ( file file content ) ; } ) ; try { notifier files changed ( contents ) ; } catch ( exception e ) { log error ( " files = " + this + " notification process failure " , e ) ; } } }


add a { @ link channel promise } to this { @ link channel flush promise notifier } which will be notified after the given { @ code pending data size } was reached

public channel flush promise notifier add ( channel promise promise , long pending data size ) { object util check not null ( promise , " promise " ) ; check positive or zero ( pending data size , " pending data size " ) ; long checkpoint = write counter + pending data size ; if ( promise instanceof flush checkpoint ) { flush checkpoint cp = ( flush checkpoint ) promise ; cp flush checkpoint ( checkpoint ) ; flush checkpoints add ( cp ) ; } else { flush checkpoints add ( new default flush checkpoint ( checkpoint , promise ) ) ; } return this ; }


public s 3 a file system get deleting f s ( ) { return deleting f s ; }


group the records by their current key into a { @ link k grouped stream } while preserving the original values and default serializers and deserializers { @ link k grouped stream } can be further grouped with other streams to form a { @ link cogrouped k stream } grouping a stream on the record key is required before an aggregation operator can be applied to the data ( cf { @ link k grouped stream } ) if a record key is { @ code null } the record will not be included in the resulting { @ link k grouped stream } if a key changing operator was used before this operation ( e g , { @ link # select key ( key value mapper ) } , { @ link # map ( key value mapper ) } , { @ link # flat map ( key value mapper ) } or { @ link # transform ( transformer supplier , string ) } ) an internal repartitioning topic may need to be created in kafka if a later operator depends on the newly selected key this topic will be named " $ { application id } - & lt ; name & gt ; - repartition " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " & lt ; name & gt ; " is an internally generated name , and " - repartition " is a fixed suffix you can retrieve all generated internal topic names via { @ link topology # describe ( ) } for this case , all data of this stream will be redistributed through the repartitioning topic by writing all records to it , and rereading all records from it , such that the resulting { @ link k grouped stream } is partitioned correctly on its key if the last key changing operator changed the key type , it is recommended to use { @ link # group by key ( org apache kafka streams kstream grouped ) } instead

k grouped stream < k , v > group by key ( ) ;


imports the specified file as raw binary

public program import file as binary ( file file , language language , compiler spec compiler spec ) throws exception { return auto importer import as binary ( file , null , language , compiler spec , this , new message log ( ) , monitor ) ; }


return the request that { @ link # do filter } has been called with

public servlet request get request ( ) { return this request ; }


parses the specified http status line into a { @ link http response status } the expected formats of the line are : { @ code status code } ( e g 200 ) { @ code status code } { @ code reason phrase } ( e g 404 not found )

public static http response status parse line ( string line ) { try { int space = line index of ( ' ' ) ; return space = = - 1 ? value of ( parse int ( line ) ) : value of ( parse int ( line substring ( 0 , space ) ) , line substring ( space + 1 ) ) ; } catch ( exception e ) { throw new illegal argument exception ( " malformed status line : " + line , e ) ; } }


method useful for suppressing sysout printing

public static void pipe system out to null ( ) { system set out ( new print stream ( new blackhole output steam ( ) ) ) ; }


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


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


to test class name in snake case to test class name in snake case

public void test classname test ( ) throws api exception { client client = null ; client response = api test classname ( client ) ; / / todo : test validations }


constructs a new builder of a name resolution result

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


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

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


public static byte [ ] read sasl message ( input stream in ) throws i o exception { data transfer encryptor message proto proto = data transfer encryptor message proto parse from ( vint prefixed ( in ) ) ; if ( proto get status ( ) = = data transfer encryptor status error unknown key ) { throw new invalid encryption key exception ( proto get message ( ) ) ; } else if ( proto get status ( ) = = data transfer encryptor status error ) { throw new i o exception ( proto get message ( ) ) ; } else { return proto get payload ( ) to byte array ( ) ; } }


this tests task executor receive submit task before offer slot response

public void test submit task before accept slot ( ) throws exception { final instance i d registration id = new instance i d ( ) ; final one shot latch task executor is registered = new one shot latch ( ) ; final completable future < tuple 3 < instance i d , slot i d , allocation i d > > available slot future = new completable future < > ( ) ; final testing resource manager gateway resource manager gateway = create rm with tm register and notify slot hooks ( registration id , task executor is registered , available slot future ) ; final allocation i d allocation id 1 = new allocation i d ( ) ; final allocation i d allocation id 2 = new allocation i d ( ) ; final slot offer offer 1 = new slot offer ( allocation id 1 , 0 , resource profile any ) ; final one shot latch offer slots latch = new one shot latch ( ) ; final one shot latch task in terminal state = new one shot latch ( ) ; final completable future < collection < slot offer > > offer result future = new completable future < > ( ) ; final testing job master gateway job master gateway = create job master with slot offer and task termination hooks ( offer slots latch , task in terminal state , offer result future ) ; rpc register gateway ( resource manager gateway get address ( ) , resource manager gateway ) ; rpc register gateway ( job master gateway get address ( ) , job master gateway ) ; final task slot table < task > task slot table = task slot utils create task slot table ( 2 ) ; final task manager services task manager services = create task manager services with task slot table ( task slot table ) ; final testing task executor task manager = create testing task executor ( task manager services ) ; try { task manager start ( ) ; task manager wait until started ( ) ; final task executor gateway tm gateway = task manager get self gateway ( task executor gateway class ) ; / / wait until registered at the rm task executor is registered await ( ) ; / / request 2 slots for the given allocation ids request slots ( tm gateway , arrays as list ( allocation id 1 , allocation id 2 ) , resource manager gateway get fencing token ( ) , job master gateway get address ( ) ) ; / / notify job leader to start slot offering job manager leader retriever notify listener ( job master gateway get address ( ) , job master gateway get fencing token ( ) to u u i d ( ) ) ; / / wait until slots have been offered offer slots latch await ( ) ; submit no op invokable task ( allocation id 1 , job master gateway , tm gateway ) ; / / acknowledge the offered slots offer result future complete ( collections singleton ( offer 1 ) ) ; / / check that the rejected slot will be made available again final tuple 3 < instance i d , slot i d , allocation i d > instance i d slot i d allocation i d tuple 3 = available slot future get ( ) ; assert that ( instance i d slot i d allocation i d tuple 3 f 2 , equal to ( allocation id 2 ) ) ; / / wait for the task completion task in terminal state await ( ) ; } finally { rpc utils terminate rpc endpoint ( task manager , timeout ) ; } }


gets the offset of the vf table address in the type descriptor structure

public int get v f table address offset ( ) { return vf table or hash ordinal ; }


given a list of { @ code requested selectables } , returns all features that are enabled by the toolchain configuration a requested feature will not be enabled if the toolchain does not support it ( which may depend on other requested features ) additional features will be enabled if the toolchain supports them and they are implied by requested features if multiple threads call this method we may do additional work in initializing the cache this reinitialization is benign

public feature configuration get feature configuration ( immutable set < string > requested selectables ) throws colliding provides exception { try { if ( configuration cache = = null ) { configuration cache = build configuration cache ( ) ; } return configuration cache get ( requested selectables ) ; } catch ( execution exception e ) { throwables throw if instance of ( e get cause ( ) , colliding provides exception class ) ; throwables throw if unchecked ( e get cause ( ) ) ; throw new illegal state exception ( " unexpected checked exception encountered " , e ) ; } }


< t > invoker < t > select ( list < invoker < t > > invokers , url url , invocation invocation ) throws rpc exception ;


called when a plugin is loaded to make the { @ link servlet context } object available to a plugin this object allows plugins to talk to the surrounding environment the default implementation is no - op

public void set servlet context ( servlet context context ) { }


public static class node loader get class node loader ( ) { return the bytecode club bytecodeviewer bytecode viewer loader ; }


delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors

public void delete order test ( ) throws api exception { string order id = null ; completable future < void > response = api delete order ( order id ) ; / / todo : test validations }


opens a new { @ link writer } for writing to this sink this method returns a new , independent writer each time it is called the caller is responsible for ensuring that the returned writer is closed

public abstract writer open stream ( ) throws i o exception ;


get the jobs that match the given { @ code expression } note that when the { @ code job id } is { @ link metadata # all } all jobs are returned

public void expand jobs ( string expression , boolean allow no match , action listener < query page < job > > jobs listener ) { map < string , job > cluster state jobs = expand jobs from cluster state ( expression , allow no match , cluster service state ( ) ) ; job config provider expand jobs ( expression , allow no match , false , action listener wrap ( job builders - > { / / check for duplicate jobs for ( job builder jb : job builders ) { if ( cluster state jobs contains key ( jb get id ( ) ) ) { jobs listener on failure ( new illegal state exception ( " job [ " + jb get id ( ) + " ] configuration " + " exists in both clusterstate and index " ) ) ; return ; } } / / merge cluster state and index jobs list < job > jobs = new array list < > ( ) ; for ( job builder jb : job builders ) { jobs add ( jb build ( ) ) ; } jobs add all ( cluster state jobs values ( ) ) ; collections sort ( jobs , comparator comparing ( job : : get id ) ) ; jobs listener on response ( new query page < > ( jobs , jobs size ( ) , job results field ) ) ; } , jobs listener : : on failure ) ) ; }


performs an authentication step for the given socket connection

void authenticate ( socket sock , string hostname ) throws i o exception ;


public void swing run ( boolean is cancelled ) ;


determine the media types for the given file name , if possible

public static list < media type > get media types ( @ nullable string filename ) { list < media type > media types = null ; string ext = string utils get filename extension ( filename ) ; if ( ext ! = null ) { media types = file extension to media types get ( ext to lower case ( locale english ) ) ; } return ( media types ! = null ? media types : collections empty list ( ) ) ; }


test that a implementation of journal manager without a ( configuration , uri ) constructor throws an exception

public void test bad constructor ( ) throws exception { mini d f s cluster cluster = null ; configuration conf = new configuration ( ) ; conf set ( d f s config keys dfs namenode edits plugin prefix + " dummy " , bad constructor journal manager class get name ( ) ) ; conf set ( d f s config keys dfs namenode edits dir key , " dummy : / / test " ) ; try { cluster = new mini d f s cluster builder ( conf ) num data nodes ( 0 ) build ( ) ; cluster wait active ( ) ; fail ( " should have failed before this point " ) ; } catch ( illegal argument exception iae ) { if ( ! iae get message ( ) contains ( " unable to construct journal " ) ) { fail ( " should have failed with unable to construct exception " ) ; } } finally { if ( cluster ! = null ) { cluster shutdown ( ) ; } } }


invoked after the response is updated with the status code and headers , if the response body emitter is wrapped in a response entity , but before the response is committed , i e before the response body has been written to the default implementation is empty

protected void extend response ( server http response output message ) { }


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


what isolation strategy { @ link hystrix command # run ( ) } will be executed with if { @ link execution isolation strategy # thread } then it will be executed on a separate thread and concurrent requests limited by the number of threads in the thread - pool if { @ link execution isolation strategy # semaphore } then it will be executed on the calling thread and concurrent requests limited by the semaphore count

public hystrix property < execution isolation strategy > execution isolation strategy ( ) { return execution isolation strategy ; }


whether xhr streaming is disabled or not

public boolean is xhr streaming disabled ( ) { return this xhr streaming disabled ; }


return true if the given key is in the hashtable

public boolean contains ( short key ) { return indexer get ( key ) > = 0 ; }


default : false when true the hosts fileinclude file for the cluster is setup

public builder setup hosts file ( boolean val ) { this setup hosts file = val ; return this ; }


check that we can mount a password - protected keystore to a docker image and provide a password via a file , pointed at from an environment variable

public void test 6 1 docker environment variable password from file ( ) throws exception { assume true ( distribution ( ) is docker ( ) ) ; path temp dir = null ; try { temp dir = create temp dir ( docker tests class get simple name ( ) ) ; string password = " keystore - password " ; string password filename = " password txt " ; files write string ( temp dir resolve ( password filename ) , password + " \ n " ) ; files set posix file permissions ( temp dir resolve ( password filename ) , p 6 0 0 ) ; path docker keystore = installation config ( " elasticsearch keystore " ) ; path local keystore file = get keystore file from docker container ( password , docker keystore ) ; / / restart es with password and mounted keystore map < path , path > volumes = map of ( local keystore file , docker keystore , temp dir , path of ( " / run / secrets " ) ) ; map < string , string > env vars = map of ( " keystore password file " , " / run / secrets / " + password filename ) ; run container ( distribution ( ) , builder ( ) volumes ( volumes ) env vars ( env vars ) ) ; wait for elasticsearch ( installation ) ; server utils run elasticsearch tests ( ) ; } finally { if ( temp dir ! = null ) { rm ( temp dir ) ; } } }


the lists of indices and types are compared for equality but they are not sorted first so this test could fail simply because the indices and types lists are in different orders also note this could be a heavy operation when a query or aggregations are set as we need to convert the bytes references into maps to correctly compare them

public boolean equals ( object other ) { if ( this = = other ) { return true ; } if ( other = = null | | get class ( ) ! = other get class ( ) ) { return false ; } datafeed config that = ( datafeed config ) other ; return objects equals ( this id , that id ) & & objects equals ( this job id , that job id ) & & objects equals ( this frequency , that frequency ) & & objects equals ( this query delay , that query delay ) & & objects equals ( this indices , that indices ) & & objects equals ( as map ( this query ) , as map ( that query ) ) & & objects equals ( this scroll size , that scroll size ) & & objects equals ( as map ( this aggregations ) , as map ( that aggregations ) ) & & objects equals ( this script fields , that script fields ) & & objects equals ( this chunking config , that chunking config ) & & objects equals ( this delayed data check config , that delayed data check config ) & & objects equals ( this max empty searches , that max empty searches ) & & objects equals ( this indices options , that indices options ) & & objects equals ( this runtime mappings , that runtime mappings ) ; }


removes any unused filesystems in the cache

public synchronized void close all unused ( ) { list < f s cache info > recs to purge = get unused f ses ( ) ; if ( ! recs to purge is empty ( ) ) { msg info ( this , " removing " + recs to purge size ( ) + " unused filesystems from cache " ) ; } for ( f s cache info fsci : recs to purge ) { release ( fsci ) ; } }


public void anytype 2 test ( ) { / / todo : test anytype 2 }


the list of subject alternate names allowed for workload instances that implement this service this information is used to enforce [ secure - naming ] ( https : istio iodocsconceptssecurity # secure - naming ) if specified , the proxy will verify that the server certificate ' s subject alternate name matches one of the specified values < code > repeated string subject alt names = 8 ; < code >

com google protobuf byte string get subject alt names bytes ( int index ) ;


deselect all options that have a value matching the argument that is , when given " foo " this would deselect an option like : & lt ; option value = " foo " & gt ; bar & lt ; option & gt ;

public void deselect by value ( string value ) { if ( ! is multiple ( ) ) { throw new unsupported operation exception ( " you may only deselect options of a multi - select " ) ; } for ( web element option : find options by value ( value ) ) { set selected ( option , false ) ; } }


returns { @ code throwable } ' s cause , cast to { @ code expected cause type } prefer this method instead of manually casting an exception ' s cause for example , { @ code ( i o exception ) e get cause ( ) } throws a { @ link class cast exception } that discards the original exception { @ code e } if the cause is not an { @ link i o exception } , but { @ code throwables get cause as ( e , i o exception class ) } keeps { @ code e } as the { @ link class cast exception } ' s cause

public static < x extends throwable > x get cause as ( throwable throwable , class < x > expected cause type ) { try { return expected cause type cast ( throwable get cause ( ) ) ; } catch ( class cast exception e ) { e init cause ( throwable ) ; throw e ; } }


public void test delete ( ) throws exception { string dir = " / test namenode retry cache / test delete " ; / / two retried calls to create a non existent file new call ( ) ; nn rpc mkdirs ( dir , perm , true ) ; new call ( ) ; assert assert true ( nn rpc delete ( dir , false ) ) ; assert assert true ( nn rpc delete ( dir , false ) ) ; assert assert true ( nn rpc delete ( dir , false ) ) ; / / non - retried call fails and gets false as return new call ( ) ; assert assert false ( nn rpc delete ( dir , false ) ) ; }


return the configured free marker { @ link object wrapper } , or the { @ link object wrapper # default wrapper default wrapper } if none specified

protected object wrapper get object wrapper ( ) { object wrapper ow = obtain configuration ( ) get object wrapper ( ) ; return ( ow ! = null ? ow : new default object wrapper builder ( configuration default incompatible improvements ) build ( ) ) ; }


public static boolean check client secret ( final o auth registered service registered service , final string client secret , final cipher executor < serializable , string > cipher executor ) { logger debug ( " found : [ { } ] in secret check " , registered service ) ; var defined secret = registered service get client secret ( ) ; if ( string utils is blank ( defined secret ) ) { logger debug ( " the client secret is not defined for the registered service [ { } ] " , registered service get name ( ) ) ; return true ; } defined secret = cipher executor decode ( defined secret , new object [ ] { registered service } ) ; if ( ! string utils equals ( defined secret , client secret ) ) { logger error ( " wrong client secret for service : [ { } ] " , registered service get service id ( ) ) ; return false ; } return true ; }


get the value of a counter if the counter is null , return 0

public long get counter value ( string name ) { mutable counter long counter = lookup counter ( name ) ; return counter = = null ? 0 : counter value ( ) ; }


called when actors are added to or removed from the group


closes the file and unmaps all memory mapped regions after calling this method , access to any byte buffer obtained from this instance will cause a segmentation fault

public void close ( ) throws i o exception { i o utils close quietly ( file channel ) ; for ( byte buffer bb : memory mapped regions ) { platform dependent free direct buffer ( bb ) ; } memory mapped regions clear ( ) ; / / to make this compatible with all versions of windows , we must wait with / / deleting the file until it is unmapped / / see also / / https : / / stackoverflow com / questions / 11099295 / file - flag - delete - on - close - and - memory - mapped - files / 51649618 # 51649618 files delete ( file path ) ; }


generates code for this table , which is not supported now

public expression get expression ( class clazz ) { throw new unsupported operation exception ( ) ; }


processes the dyld cache ' s memory mappings and creates memory blocks for them

private void process dyld cache memory blocks ( ) throws exception { list < dyld cache mapping info > mapping infos = dyld cache header get mapping infos ( ) ; monitor set message ( " processing dyld mapped memory blocks " ) ; monitor initialize ( mapping infos size ( ) ) ; long end of mapped offset = 0 ; for ( dyld cache mapping info mapping info : mapping infos ) { long offset = mapping info get file offset ( ) ; long size = mapping info get size ( ) ; memory block utils create initialized block ( program , false , " dyld " , space get address ( mapping info get address ( ) ) , file bytes , offset , size , " " , " " , mapping info is read ( ) , mapping info is write ( ) , mapping info is execute ( ) , log ) ; if ( offset + size > end of mapped offset ) { end of mapped offset = offset + size ; } monitor check canceled ( ) ; monitor increment progress ( 1 ) ; } if ( end of mapped offset < provider length ( ) ) { monitor set message ( " processing dyld unmapped memory block " ) ; memory block utils create initialized block ( program , true , " file " , address space other space get address ( end of mapped offset ) , file bytes , end of mapped offset , provider length ( ) - end of mapped offset , " useful bytes that don ' t get mapped into memory " , " " , false , false , false , log ) ; } }


build a { @ link configuration metadata repository } with the current state of this builder

public configuration metadata repository build ( ) { val result = new simple configuration metadata repository ( ) ; for ( val repository : this repositories ) { result include ( repository ) ; } return result ; }


returns a new { @ link media metadata } instance with the current builder values

public media metadata build ( ) { return new media metadata ( title ) ; }


tests that we can write more than 64 values

public void test wide tuple boundary ( ) throws exception { text empty text = new text ( " should not be set written " ) ; writable [ ] values = new writable [ 65 ] ; arrays fill ( values , empty text ) ; values [ 64 ] = new text ( " should be the only value set written " ) ; tuple writable tuple = new tuple writable ( values ) ; tuple set written ( 64 ) ; for ( int pos = 0 ; pos < tuple size ( ) ; pos + + ) { boolean has = tuple has ( pos ) ; if ( pos = = 64 ) { assert true ( has ) ; } else { assert false ( " tuple position is incorrectly labelled as set : " + pos , has ) ; } } }


returns singleton instance of the resource manager

public static resource manager instance ( ) { return singleton instance ; }


defines the size of a double primitive data type

public void set double size ( int double size ) { this double size = double size ; if ( long double size < double size ) { set long double size ( double size ) ; } if ( float size > double size ) { set float size ( double size ) ; } }


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

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


factory method for an annotation matching pointcut that matches for the specified annotation at the class level

public static annotation matching pointcut for class annotation ( class < ? extends annotation > annotation type ) { assert not null ( annotation type , " annotation type must not be null " ) ; return new annotation matching pointcut ( annotation type ) ; }


invoked when a ping fails the given argument is the cause of the failure


gets the list of successors that this block may branch to

public int list get successors ( ) { return successors ; }


public task id get parent task id ( ) { return parent task id ; }


extracts the authentication from the original headers and checks that it matches the current user this function returns always < code > true < code > if the provided < code > headers < code > do not contain any authentication

boolean ensure authenticated user is same ( map < string , string > origin headers , authentication current ) throws i o exception { if ( origin headers = = null | | origin headers contains key ( authentication key ) = = false ) { / / no authorization attached to the original request return true ; } if ( current = = null ) { / / origin is an authenticated user but current is not return false ; } authentication origin = authentication context serializer decode ( origin headers get ( authentication key ) ) ; return ensure authenticated user is same ( origin , current ) ; }


returns and removes the entry associated with the lowest element in this multiset , or returns { @ code null } if this multiset is empty


customizes the aggregated result for example , summarizing or making immutable

protected o finish ( o output ) { return output ; }


public float get friction ( ) { return fixture get friction ( ) ; }


gets the file used to store the initial admin password

public file path get initial admin password file ( ) { return jenkins get ( ) get root path ( ) child ( " secrets / initial admin password " ) ; }


returns the scope annotation on { @ code type } , or null if none is specified

public static class < ? extends annotation > find scope annotation ( errors errors , class < ? > implementation ) { return find scope annotation ( errors , implementation get annotations ( ) ) ; }


get the fixed - delay tasks as an unmodifiable list of { @ link interval task } objects

public list < interval task > get fixed delay task list ( ) { return ( this fixed delay tasks ! = null ? collections unmodifiable list ( this fixed delay tasks ) : collections empty list ( ) ) ; }


returns the range if the given field at the given index is in the selection otherwise returns null

public field range get range containing ( field location loc ) { int insert index = collections binary search ( ranges , new field range ( loc , field location max ) ) ; / / exact match if ( insert index > = 0 ) { return ranges get ( insert index ) ; } / / examine range before insert index to see if we are inside it int compare index = - insert index - 2 ; if ( compare index < 0 ) { return null ; } field range compare range = ranges get ( compare index ) ; if ( compare range contains ( loc ) ) { return compare range ; } return null ; }


public void set gravity ( vector 2 gravity ) { world set gravity ( tmp set ( gravity x , gravity y ) ) ; }


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


validate the name - restricting it to the set defined in

public void validate ( string name ) { if ( ! matches ( name ) ) { throw new illegal argument exception ( string format ( e invalid name , name , pattern ) ) ; } }


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

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


returns a future which indicates whether the request was 100 % success , i e no either top level or member level error if not , the first member error shall be returned

public kafka future < void > all ( ) { final kafka future impl < void > result = new kafka future impl < > ( ) ; this future when complete ( ( member errors , throwable ) - > { if ( throwable ! = null ) { result complete exceptionally ( throwable ) ; } else { if ( remove all ( ) ) { for ( map entry < member identity , errors > entry : member errors entry set ( ) ) { exception exception = entry get value ( ) exception ( ) ; if ( exception ! = null ) { throwable ex = new kafka exception ( " encounter exception when trying to remove : " + entry get key ( ) , exception ) ; result complete exceptionally ( ex ) ; return ; } } } else { for ( member to remove member to remove : member infos ) { if ( maybe complete exceptionally ( member errors , member to remove to member identity ( ) , result ) ) { return ; } } } result complete ( null ) ; } } ) ; return result ; }


test that the sort builder mode gets transferred correctly to the sort field

public void test multi value mode ( ) throws i o exception { query shard context shard context mock = create mock shard context ( ) ; geo distance sort builder geo distance sort builder = new geo distance sort builder ( " field name " , 1 0 , 1 0 ) ; geo distance sort builder sort mode ( sort mode max ) ; sort field sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; x field comparator source comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode max , comparator source sort mode ( ) ) ; / / also use multi value mode max if no mode set but order is desc geo distance sort builder = new geo distance sort builder ( " field name " , 1 0 , 1 0 ) ; geo distance sort builder order ( sort order desc ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode max , comparator source sort mode ( ) ) ; / / use multi value mode min if no mode and order is asc geo distance sort builder = new geo distance sort builder ( " field name " , 1 0 , 1 0 ) ; / / need to use distance unit other than meters to not get back a lat lon point sort field geo distance sort builder order ( sort order asc ) unit ( distance unit inch ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode min , comparator source sort mode ( ) ) ; geo distance sort builder = new geo distance sort builder ( " field name " , 1 0 , 1 0 ) ; / / need to use distance unit other than meters to not get back a lat lon point sort field geo distance sort builder sort mode ( sort mode min ) unit ( distance unit inch ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode min , comparator source sort mode ( ) ) ; geo distance sort builder sort mode ( sort mode avg ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode avg , comparator source sort mode ( ) ) ; geo distance sort builder sort mode ( sort mode median ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode median , comparator source sort mode ( ) ) ; }


disposes the storage location this method should be called after all state objects have been released it typically disposes the base structure of the checkpoint storage , like the checkpoint directory

void dispose storage location ( ) throws i o exception ;


gets the name that the aggregator is registered under

public string get name ( ) { return name ; }


creates the standard symbol name for symbols that have the addresses appended to the name following an " @ " character in order to make it unique

public static string get address appended name ( string name , address address ) { return get address appended name ( name , address , " @ " ) ; }


gets all incoming connections of this node this method needs to be overridden by subclasses to return the children

public abstract list < dag connection > get incoming connections ( ) ;


calculates a " load " , given on two deltas

public static double calc load ( long delta cpu time , long delta uptime , long factor ) { if ( delta cpu time = = null | | delta cpu time < = 0 | | delta uptime = = 0 ) { return 0 0 ; } return delta cpu time * 1 0 0d / factor / delta uptime ; }


read an object of the given type from the given input message , and returns it

t read ( class < ? extends t > clazz , http input message input message ) throws i o exception , http message not readable exception ;


returns a { @ link yarn configuration } built from the { @ code conf } parameter that is guaranteed to have the { @ link yarn configuration # rm ha id } property set

static yarn configuration get yarn conf with rm ha id ( configuration conf ) throws i o exception { yarn configuration yarn conf = new yarn configuration ( conf ) ; if ( yarn conf get ( yarn configuration rm ha id ) = = null ) { / / if rm ha id is not configured , use the first of rm ha ids / / any valid rm ha id should work string [ ] rm ids = yarn conf get strings ( yarn configuration rm ha ids ) ; if ( ( rm ids ! = null ) & & ( rm ids length > 0 ) ) { yarn conf set ( yarn configuration rm ha id , rm ids [ 0 ] ) ; } else { throw new i o exception ( " rm ha ids property is not set for ha resource " + " manager " ) ; } } return yarn conf ; }


creates the extension archive and installation directories

public final void create extension dirs ( ) throws i o exception { resource file extension dir = g layout get extension archive dir ( ) ; if ( ! extension dir exists ( ) ) { if ( ! extension dir mkdir ( ) ) { throw new i o exception ( " failed to create extension archive directory for test " ) ; } } resource file install dir = g layout get extension installation dirs ( ) get ( 0 ) ; if ( ! install dir exists ( ) ) { if ( ! install dir mkdir ( ) ) { throw new i o exception ( " failed to create extension installation directory for test " ) ; } } }


returns a map of node id to the outgoing search requests to that node

public map < string , long > get outgoing connections ( ) { return client outgoing connections ; }


public final void write annotation ( annotated output out ) { if ( data map size ( ) = = 0 ) { return ; } out annotate ( 0 , " \ nstatistics : \ n " ) ; tree map < string , data > sorted data = new tree map < string , data > ( ) ; for ( data data : data map values ( ) ) { sorted data put ( data name , data ) ; } for ( data data : sorted data values ( ) ) { data write annotation ( out ) ; } }


public static throwable sun ssl engine unavailability cause ( ) { return unavailability cause ; } / * returns { @ code true }


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

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


the simple broker produces { @ code simp message type connect ack } that ' s not stomp specific and needs to be turned into a stomp connected frame

private stomp header accessor convert connect ackto stomp connected ( stomp header accessor connect ack headers ) { string name = stomp header accessor connect message header ; message < ? > message = ( message < ? > ) connect ack headers get header ( name ) ; if ( message = = null ) { throw new illegal state exception ( " original stomp connect not found in " + connect ack headers ) ; } stomp header accessor connect headers = message header accessor get accessor ( message , stomp header accessor class ) ; stomp header accessor connected headers = stomp header accessor create ( stomp command connected ) ; if ( connect headers ! = null ) { set < string > accept versions = connect headers get accept version ( ) ; connected headers set version ( arrays stream ( supported versions ) filter ( accept versions : : contains ) find any ( ) or else throw ( ( ) - > new illegal argument exception ( " unsupported stomp version ' " + accept versions + " ' " ) ) ) ; } long [ ] heartbeat = ( long [ ] ) connect ack headers get header ( simp message header accessor heart beat header ) ; if ( heartbeat ! = null ) { connected headers set heartbeat ( heartbeat [ 0 ] , heartbeat [ 1 ] ) ; } else { connected headers set heartbeat ( 0 , 0 ) ; } return connected headers ; }


gets a boolean at the specified absolute ( @ code index ) in this buffer this method does not modify the { @ code reader index } or { @ code writer index } of this buffer

public abstract boolean get boolean ( int index ) ;


returns the configuration option for < code > key < code > from this context if login module name is specified , return option value only from that module

public static string config entry option ( list < app configuration entry > configuration entries , string key , string login module name ) { for ( app configuration entry entry : configuration entries ) { if ( login module name ! = null & & ! login module name equals ( entry get login module name ( ) ) ) continue ; object val = entry get options ( ) get ( key ) ; if ( val ! = null ) return ( string ) val ; } return null ; }


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


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

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


a list of decommissioned component instances

public component decommissioned instances ( list < string > decommissioned instances ) { this decommissioned instances = decommissioned instances ; return this ; }


gives the ability to override the auto - generated component tree id : this is generally not useful in the majority of circumstances , so don ' t use it unless you really know what you ' re doing

public builder override component tree id ( int override component tree id ) { this override component tree id = override component tree id ; return this ; }


creates an instance of { @ link to string helper } this is helpful for implementing { @ link object # to string ( ) } specification by example : { @ code returns " class name { } " objects to string helper ( this ) to string ( ) ; returns " class name { x = 1 } " objects to string helper ( this ) add ( " x " , 1 ) to string ( ) ; returns " my object { x = 1 } " objects to string helper ( " my object " ) add ( " x " , 1 ) to string ( ) ; returns " class name { x = 1 , y = foo } " objects to string helper ( this ) add ( " x " , 1 ) add ( " y " , " foo " ) to string ( ) ; returns " class name { x = 1 } " objects to string helper ( this ) omit null values ( ) add ( " x " , 1 ) add ( " y " , null ) to string ( ) ; } note that in gwt , class names are often obfuscated

public static to string helper to string helper ( object self ) { return new to string helper ( self get class ( ) get simple name ( ) ) ; }


return value offset relative to parent structure start

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


add an aggregation to perform as part of the search

public search source builder aggregation ( pipeline aggregation builder aggregation ) { if ( aggregations = = null ) { aggregations = aggregator factories builder ( ) ; } aggregations add pipeline aggregator ( aggregation ) ; return this ; }


checks if the two actions are equivalent this method exists to support sharing actions between configured targets for cases where there is no canonical target that could own the action in the action graph construction this case shows up as two actions generating the same output file this method implements an equivalence relationship across actions , based on the action class , the key , and the list of inputs and outputs

public static boolean can be shared ( action key context action key context , action analysis metadata a , action analysis metadata b ) throws interrupted exception { if ( ! a is shareable ( ) | | ! b is shareable ( ) ) { return false ; } if ( ! a get mnemonic ( ) equals ( b get mnemonic ( ) ) ) { return false ; } / / non - actions cannot be shared if ( ! ( a instanceof action ) | | ! ( b instanceof action ) ) { return false ; } action action a = ( action ) a ; action action b = ( action ) b ; if ( ! action a get key ( action key context , / * artifact expander = * / null ) equals ( action b get key ( action key context , / * artifact expander = * / null ) ) ) { return false ; } / / don ' t bother to check input and output counts first ; the expected result for these tests is / / to always be true ( i e , that this method returns true ) if ( ! artifacts equal without owner ( action a get mandatory inputs ( ) to list ( ) , action b get mandatory inputs ( ) to list ( ) ) ) { return false ; } if ( ! artifacts equal without owner ( action a get outputs ( ) , action b get outputs ( ) ) ) { return false ; } return true ; }


configures gson to exclude all fields from consideration for serialization or deserialization that do not have the { @ link com google gson annotations expose } annotation

public gson builder exclude fields without expose annotation ( ) { excluder = excluder exclude fields without expose annotation ( ) ; return this ; }


parse the given string to a java { @ link duration } the string is in format " { length value } { time unit label } " , e g " 1 2 3ms " , " 321 s " if no time unit label is specified , it will be considered as milliseconds supported time unit labels are : days ： " d " , " day " hours ： " h " , " hour " minutes ： " min " , " minute " seconds ： " s " , " sec " , " second " milliseconds ： " ms " , " milli " , " millisecond " microseconds ： " µs " , " micro " , " microsecond " nanoseconds ： " ns " , " nano " , " nanosecond "

public static duration parse duration ( string text ) { check not null ( text ) ; final string trimmed = text trim ( ) ; check argument ( ! trimmed is empty ( ) , " argument is an empty - or whitespace - only string " ) ; final int len = trimmed length ( ) ; int pos = 0 ; char current ; while ( pos < len & & ( current = trimmed char at ( pos ) ) > = ' 0 ' & & current < = ' 9 ' ) { pos + + ; } final string number = trimmed substring ( 0 , pos ) ; final string unit label = trimmed substring ( pos ) trim ( ) to lower case ( locale us ) ; if ( number is empty ( ) ) { throw new number format exception ( " text does not start with a number " ) ; } final long value ; try { value = long parse long ( number ) ; / / this throws a number format exception on overflow } catch ( number format exception e ) { throw new illegal argument exception ( " the value ' " + number + " ' cannot be re represented as 6 4bit number ( numeric overflow ) " ) ; } if ( unit label is empty ( ) ) { return duration of ( value , chrono unit millis ) ; } chrono unit unit = label to unit map get ( unit label ) ; if ( unit ! = null ) { return duration of ( value , unit ) ; } else { throw new illegal argument exception ( " time interval unit label ' " + unit label + " ' does not match any of the recognized units : " + time unit get all units ( ) ) ; } }


return { @ code true } if the supplied node describes an advice type may be one of : ' { @ code before } ' , ' { @ code after } ' , ' { @ code after - returning } ' , ' { @ code after - throwing } ' or ' { @ code around } '

private boolean is advice node ( node a node , parser context parser context ) { if ( ! ( a node instanceof element ) ) { return false ; } else { string name = parser context get delegate ( ) get local name ( a node ) ; return ( before equals ( name ) | | after equals ( name ) | | after returning element equals ( name ) | | after throwing element equals ( name ) | | around equals ( name ) ) ; } }


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


return unicode name string offset relative to parent structure start

public long get name relative offset ( ) { if ( child size = = 0 ) { return 0 ; } return 6 ; }


convenience method to convert a csv string list to a set note that this will suppress duplicates

public static set < string > comma delimited list to set ( string str ) { set < string > set = new tree set < > ( ) ; string [ ] tokens = comma delimited list to string array ( str ) ; set add all ( arrays as list ( tokens ) ) ; return set ; }


returns the ima { @ link friendly obstruction purpose } corresponding to the given { @ link overlay info # purpose }

public static friendly obstruction purpose get friendly obstruction purpose ( @ overlay info purpose int purpose ) { switch ( purpose ) { case overlay info purpose controls : return friendly obstruction purpose video controls ; case overlay info purpose close ad : return friendly obstruction purpose close ad ; case overlay info purpose not visible : return friendly obstruction purpose not visible ; case overlay info purpose other : default : return friendly obstruction purpose other ; } }


if the action might read directories as inputs in a way that is unsound wrt dependency checking , this method must be called

protected void check inputs for directories ( event handler event handler , metadata provider metadata provider ) throws exec exception { / / report " directory dependency checking " warning only for non - generated directories ( generated / / ones will be reported earlier ) for ( artifact input : get mandatory inputs ( ) to list ( ) ) { / / assume that if the file did not exist , we would not have gotten here try { if ( input is source artifact ( ) & & metadata provider get metadata ( input ) get type ( ) is directory ( ) ) { / / todo ( ulfjack ) : what about dependency checking of special files ? event handler handle ( event warn ( get owner ( ) get location ( ) , string format ( " input ' % s ' to % s is a directory ; " + " dependency checking of directories is unsound " , input pretty print ( ) , get owner ( ) get label ( ) ) ) ) ; } } catch ( i o exception e ) { throw new environmental exec exception ( e , code input directory check io exception ) ; } } }


creates an instance for testing without actually symlinking the tools used for tests that need a set of embedded tools to be present , but not the actual files

public static bin tools for unit testing ( blaze directories directories , iterable < string > tools ) { return new bin tools ( directories , immutable list copy of ( tools ) ) ; }


this is the main interface for reading a range of bytes from the memory sate the memory bank associated with the address space of the query is looked up and the request is forwarded to the get chunk method on the memory bank if there is no registered memory bank or some other error , an exception is thrown all get long value methods utilize this method to read the bytes from the appropriate memory bank

public int get chunk ( byte [ ] res , address space spc , long off , int size , boolean stop on unintialized ) { if ( spc is constant space ( ) ) { system arraycopy ( utils long to bytes ( off , size , language is big endian ( ) ) , 0 , res , 0 , size ) ; return size ; } memory bank mspace = get memory bank ( spc ) ; if ( mspace = = null ) throw new lowlevel error ( " getting chunk from unmapped memory space : " + spc get name ( ) ) ; return mspace get chunk ( off , size , res , stop on unintialized ) ; }