computes an updated { @ link snapshots in progress } that takes into account an updated version of { @ link snapshot deletions in progress } that has a { @ link snapshot deletions in progress entry } removed from it relative to the { @ link snapshot deletions in progress } found in { @ code current state } the removal of a delete from the cluster state can trigger two possible actions on in - progress snapshots : snapshots that had unfinished shard snapshots in state { @ link shard snapshot status # unassigned queued } that could not be started because the delete was running can have those started snapshots that had all their shards reach a completed state while a delete was running ( e g as a result of nodes dropping out of the cluster or another incoming delete aborting them ) need not be updated in the cluster state but need to have their finalization triggered now that it ' s possible with the removal of the delete from the state

private snapshots in progress updated snapshots in progress ( cluster state current state , snapshot deletions in progress updated deletions ) { final snapshots in progress snapshots in progress = current state custom ( snapshots in progress type , snapshots in progress empty ) ; final list < snapshots in progress entry > snapshot entries = new array list < > ( ) ; / / keep track of shard ids that we started snapshots for as a result of removing this delete so we don ' t assign / / them to multiple snapshots by accident final map < string , set < integer > > reassigned shard ids = new hash map < > ( ) ; boolean changed = false ; final string local node id = current state nodes ( ) get local node id ( ) ; final string repo name = delete entry repository ( ) ; / / computing the new assignments can be quite costly , only do it once below if actually needed immutable open map < shard id , shard snapshot status > shard assignments = null ; in flight shard snapshot states in flight shard states = null ; for ( snapshots in progress entry entry : snapshots in progress entries ( ) ) { if ( entry repository ( ) equals ( repo name ) ) { if ( entry state ( ) completed ( ) = = false ) { / / todo : dry up redundant computation and code between clone and non - clone case , in particular reuse / / ` in flight shard states ` across both clone and standard snapshot code if ( entry is clone ( ) ) { / / collect waiting shards from that entry that we can assign now that we are done with the deletion final list < repository shard id > can be updated = new array list < > ( ) ; for ( object object cursor < repository shard id , shard snapshot status > value : entry clones ( ) ) { if ( value value equals ( shard snapshot status unassigned queued ) & & already reassigned ( value key index name ( ) , value key shard id ( ) , reassigned shard ids ) = = false ) { can be updated add ( value key ) ; } } / / todo : the below logic is very similar to that in # start cloning and both could be dried up against each other / / also the code for standard snapshots could make use of this breakout as well if ( can be updated is empty ( ) | | updated deletions get entries ( ) stream ( ) any match ( e - > e repository ( ) equals ( repo name ) & & e state ( ) = = snapshot deletions in progress state started ) ) { / / no shards can be updated in this snapshot so we just add it as is again snapshot entries add ( entry ) ; } else { if ( in flight shard states = = null ) { in flight shard states = in flight shard snapshot states for repo ( repo name , snapshots in progress entries ( ) ) ; } final immutable open map builder < repository shard id , shard snapshot status > updated assignments builder = immutable open map builder ( entry clones ( ) ) ; for ( repository shard id shard id : can be updated ) { if ( in flight shard states is active ( shard id index name ( ) , shard id shard id ( ) ) = = false ) { mark shard reassigned ( shard id index name ( ) , shard id shard id ( ) , reassigned shard ids ) ; updated assignments builder put ( shard id , new shard snapshot status ( local node id , in flight shard states generation for shard ( shard id index ( ) , shard id shard id ( ) , repository data shard generations ( ) ) ) ) ; } } snapshot entries add ( entry with clones ( updated assignments builder build ( ) ) ) ; changed = true ; } } else { / / collect waiting shards that in entry that we can assign now that we are done with the deletion final list < shard id > can be updated = new array list < > ( ) ; for ( object object cursor < shard id , shard snapshot status > value : entry shards ( ) ) { if ( value value equals ( shard snapshot status unassigned queued ) & & already reassigned ( value key get index name ( ) , value key get id ( ) , reassigned shard ids ) = = false ) { can be updated add ( value key ) ; } } if ( can be updated is empty ( ) ) { / / no shards can be updated in this snapshot so we just add it as is again snapshot entries add ( entry ) ; } else { if ( shard assignments = = null ) { shard assignments = shards ( snapshots in progress , updated deletions , current state metadata ( ) , current state routing table ( ) , entry indices ( ) , entry version ( ) on or after ( shard gen in repo data version ) , repository data , repo name ) ; } final immutable open map builder < shard id , shard snapshot status > updated assignments builder = immutable open map builder ( entry shards ( ) ) ; for ( shard id shard id : can be updated ) { final shard snapshot status updated = shard assignments get ( shard id ) ; if ( updated = = null ) { / / we don ' t have a new assignment for this shard because its index was concurrently deleted assert current state routing table ( ) has index ( shard id get index ( ) ) = = false : " missing assignment for [ " + shard id + " ] " ; updated assignments builder put ( shard id , shard snapshot status missing ) ; } else { mark shard reassigned ( shard id get index name ( ) , shard id id ( ) , reassigned shard ids ) ; updated assignments builder put ( shard id , updated ) ; } } snapshot entries add ( entry with started shards ( updated assignments builder build ( ) ) ) ; changed = true ; } } } else { / / entry is already completed so we will finalize it now that the delete doesn ' t block us after / / this cs update finishes new finalizations add ( entry ) ; snapshot entries add ( entry ) ; } } else { / / entry is for another repository we just keep it as is snapshot entries add ( entry ) ; } } return changed ? snapshots in progress of ( snapshot entries ) : null ; }


protected boolean is association valid ( final association association ) { return association ! = null & & ! association has expired ( ) ; }


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


protected void deallocate item storage ( string folder path , string item name ) { / / nothing to do for mangled name allocation }


returns true if this file is a directory always returns false for classpath files on android , an { @ link file type # internal } handle to an empty directory will return false on the desktop , an { @ link file type # internal } handle to a directory on the classpath will return false

public boolean is directory ( ) { return preloader is directory ( file ) ; }


compute the maximum resource am can use the value is the result of multiplying fair share and max a m share if fair share is zero , use min ( max share , available resource ) instead to prevent zero value for maximum am resource since it forbids any job running in the queue

private resource compute max a m resource ( ) { resource max resource = resources clone ( get fair share ( ) ) ; resource max share = get max share ( ) ; if ( max resource get memory size ( ) = = 0 ) { max resource set memory size ( math min ( scheduler get root queue metrics ( ) get available m b ( ) , max share get memory size ( ) ) ) ; } if ( max resource get virtual cores ( ) = = 0 ) { max resource set virtual cores ( math min ( scheduler get root queue metrics ( ) get available virtual cores ( ) , max share get virtual cores ( ) ) ) ; } scheduler get root queue metrics ( ) fill in values from available resources ( max share , max resource ) ; / / round up to allow am to run when there is only one vcore on the cluster return resources multiply and round up ( max resource , max a m share ) ; }


optional : minimum tls protocol version < code > istio networking v 1alpha 3 server t l s options t l s protocol min protocol version = 7 ; < code >

public builder clear min protocol version ( ) { min protocol version = 0 ; on changed ( ) ; return this ; }


finds missing try { } finally { join pool ( e ) ; }

void check fork join pool thread leaks ( ) throws interrupted exception { thread [ ] survivors = new thread [ 5 ] ; int count = thread enumerate ( survivors ) ; for ( int i = 0 ; i < count ; i + + ) { thread thread = survivors [ i ] ; string name = thread get name ( ) ; if ( name starts with ( " fork join pool - " ) ) { / / give thread some time to terminate thread join ( long delay ms ) ; if ( ! thread is alive ( ) ) { continue ; } thread stop ( ) ; throw new assertion failed error ( string format ( " found leaked fork join pool thread test = % s thread = % s % n " , to string ( ) , name ) ) ; } } }


returns finalizer class or null if this loader shouldn ' t or can ' t load it


reads a coff archive member header from the specified { @ link binary reader reader } , leaving the file position at the start of the this member ' s payload the archive member ' s name is fixed up using the specified { @ link long names member long names } object

public static coff archive member header read ( binary reader reader , long names member long names ) throws i o exception { align ( reader ) ; long header offset = reader get pointer index ( ) ; / * * decoding the name field : * * " / nnn " - a slash followed by a ascii integer string indicates that the actual name * is located at offset " nnn " in the " longnames " string table * * " # 1 / nnn " - a " # 1 / " , followed by an ascii integer string indicates that the * actual name is located at the beginning of the payload of this member , and its * length is ' nnn ' bytes the actual payload starts after the end of the name and * its effective size needs to be reduced by the filename length * * " name / " * the field gives the name of the archive member directly * * " / " * the archive member is one of the two linker members * both of the linker members have this name * * " / / " * the archive member is the longname member , which * consists of a series of terminated ascii strings * the longnames member is the third archive member * / string name = reader read fixed len ascii string ( header offset + camh name off , camh name len ) trim ( ) ; / * * the number of seconds since 1 / 1 / 1970 uct * / string date str = reader read fixed len ascii string ( header offset + camh date off , camh date len ) trim ( ) ; / * * ascii integer string or blank * / string user id = reader read fixed len ascii string ( header offset + camh userid off , camh userid len ) trim ( ) ; / * * ascii integer string or blank * / string group id = reader read fixed len ascii string ( header offset + camh groupid off , camh groupid len ) trim ( ) ; / * * ascii integer string of st mode value from the c run - time function wstat * / string mode = reader read fixed len ascii string ( header offset + camh mode off , camh mode len ) trim ( ) ; / * * ascii integer string representing the total size of the archive member , * not including the header if the name is stored at the beginning of the * payload ( ie name = = " # 1 / nnn " ) , the member ' s effective size needs to be adjusted * / string size str = reader read fixed len ascii string ( header offset + camh size off , camh size len ) trim ( ) ; / * * two byte ascii string 0x 6 0 0x 0a ( " ' \ n " ) * / string end of header = reader read fixed len ascii string ( header offset + camh eoh off , camh eoh len ) ; if ( ! end of header equals ( camh eoh magic ) ) { throw new i o exception ( " bad eoh magic string : " + end of header ) ; } long payload offset = header offset + camh payload off ; long size ; try { size = long parse long ( size str ) ; } catch ( number format exception nfe ) { throw new i o exception ( " bad size value : " + size str ) ; } if ( name starts with ( " # 1 / " ) ) { try { int name len = integer parse int ( name substring ( 3 ) ) ; / / name seems to be padded with trailing nulls to put payload at aligned offset name = string utilities trim trailing nulls ( reader read fixed len ascii string ( payload offset , name len ) ) ; size - = name len ; payload offset + = name len ; } catch ( number format exception nfe ) { throw new i o exception ( " bad name len value : " + name ) ; } } else if ( name matches ( " / [ 0 - 9 ] + " ) & & long names ! = null ) { try { long offset = long parse long ( name substring ( 1 ) ) ; name = long names get string at offset ( reader get byte provider ( ) , offset ) ; if ( name ends with ( " / " ) ) { name = name substring ( 0 , name length ( ) - 1 ) ; } } catch ( number format exception nfe ) { throw new i o exception ( " bad long name offset : " + name ) ; } } else if ( name starts with ( " / " ) ) { / / don ' t do any tweaking of the name , keeps " / " and " / / " intact } else if ( name ends with ( " / " ) ) { name = name substring ( 0 , name length ( ) - 1 ) ; } long date = 0 ; try { if ( ! date str is empty ( ) ) { date = long parse long ( date str ) * 1000 / * convert from seconds to millis * / ; } } catch ( number format exception nfe ) { msg warn ( null , " coff archive : bad date value : [ " + date str + " ] in " + reader get byte provider ( ) get name ( ) + " for [ " + name + " ] at file offset 0x " + long to hex string ( header offset ) ) ; } reader set pointer index ( payload offset ) ; return new coff archive member header ( name , date , user id , group id , mode , size , payload offset , header offset ) ; }


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


the indirect symbols need to be applied across the import segment the individual section do not really matter except the number of bytes between each symbol varies based on section

private void process indirect symbols ( ) throws exception { monitor set message ( " processing indirect symbols " ) ; symbol table command symbol table command = macho header get first load command ( symbol table command class ) ; dynamic symbol table command dynamic command = macho header get first load command ( dynamic symbol table command class ) ; if ( dynamic command = = null ) { return ; } int [ ] indirect symbols = dynamic command get indirect symbols ( ) ; if ( indirect symbols length = = 0 ) { return ; } int [ ] section types = new int [ ] { section types s non lazy symbol pointers , section types s lazy symbol pointers , section types s symbol stubs } ; list < section > sections = get sections with types ( section types ) ; for ( section section : sections ) { if ( monitor is cancelled ( ) ) { return ; } if ( section get size ( ) = = 0 ) { continue ; } namespace namespace = create namespace for section ( section ) ; int indirect symbol table index = section get reserved 1 ( ) ; int symbol size = macho header get address size ( ) ; if ( section get type ( ) = = section types s symbol stubs ) { symbol size = section get reserved 2 ( ) ; } int n symbols = ( int ) section get size ( ) / symbol size ; address start addr = space get address ( section get address ( ) ) ; for ( int i = indirect symbol table index ; i < indirect symbol table index + n symbols ; + + i ) { if ( monitor is cancelled ( ) ) { break ; } int symbol index = indirect symbols [ i ] ; n list symbol = symbol table command get symbol at ( symbol index ) ; if ( symbol ! = null ) { string name = generate valid name ( symbol get string ( ) ) ; if ( name ! = null & & name length ( ) > 0 ) { try { program get symbol table ( ) create label ( start addr , name , namespace , source type imported ) ; } catch ( exception e ) { log append msg ( " unable to create indirect symbol " + name ) ; log append exception ( e ) ; } } } start addr = start addr add ( symbol size ) ; } } }


public string get description ( ) { return description ; }


sets the color for the following drawing operations

public void set color ( int color ) { this color = color ; }


return the parameter name discoverer to use for resolving method parameter names if needed ( may be { @ code null } in order to skip parameter detection )

protected parameter name discoverer get parameter name discoverer ( ) { return this parameter name discoverer ; }


strips any of a set of characters from the end of a string a { @ code null } input string returns { @ code null } an empty string ( " " ) input returns the empty string if the strip chars string is { @ code null } , whitespace is stripped as defined by { @ link character # is whitespace ( char ) } string utils strip end ( null , ) = null string utils strip end ( " " , ) = " " string utils strip end ( " abc " , " " ) = " abc " string utils strip end ( " abc " , null ) = " abc " string utils strip end ( " abc " , null ) = " abc " string utils strip end ( " abc " , null ) = " abc " string utils strip end ( " abc " , null ) = " abc " string utils strip end ( " abcyx " , " xyz " ) = " abc " string utils strip end ( " 120 00 " , " 0 " ) = " 12 "

public static string strip end ( final string str , final string strip chars ) { int end ; if ( str = = null | | ( end = str length ( ) ) = = 0 ) { return str ; } if ( strip chars = = null ) { while ( end ! = 0 & & character is whitespace ( str char at ( end - 1 ) ) ) { end - - ; } } else if ( strip chars is empty ( ) ) { return str ; } else { while ( end ! = 0 & & strip chars index of ( str char at ( end - 1 ) ) ! = index not found ) { end - - ; } } return str substring ( 0 , end ) ; }


transforms the obfuscated frame into one or more original frames , if the frame contains information about a field that can be remapped

private void transform field info ( frame info obfuscated frame , string original class name , list < frame info > original field frames ) { / / class name - > obfuscated field names map < string , set < field info > > field map = class field map get ( original class name ) ; if ( field map ! = null ) { / / obfuscated field names - > fields string obfuscated field name = obfuscated frame get field name ( ) ; set < field info > field set = field map get ( obfuscated field name ) ; if ( field set ! = null ) { string obfuscated type = obfuscated frame get type ( ) ; string original type = obfuscated type = = null ? null : original type ( obfuscated type ) ; / / find all matching fields iterator < field info > field info iterator = field set iterator ( ) ; while ( field info iterator has next ( ) ) { field info field info = field info iterator next ( ) ; if ( field info matches ( original type ) ) { original field frames add ( new frame info ( field info original class name , source file name ( field info original class name ) , obfuscated frame get line number ( ) , field info original type , field info original name , obfuscated frame get method name ( ) , obfuscated frame get arguments ( ) ) ) ; } } } } }


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

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


public path as apk path ( ) { return paths get ( uri ) ; }


public shard id get shard id ( ) { return shard id ( ) ; }


userlist assumes one user per line each line in users - list - file is of the form & lt ; username & gt ; [ , group ] < br > group names are ignored ( they are not parsed at all )

private list < user group information > parse user list ( uri user uri , configuration conf ) throws i o exception { if ( null = = user uri ) { return collections empty list ( ) ; } final path userloc = new path ( user uri to string ( ) ) ; final text raw ugi = new text ( ) ; final file system fs = userloc get file system ( conf ) ; final array list < user group information > ugi list = new array list < user group information > ( ) ; line reader in = null ; try { in = new line reader ( fs open ( userloc ) ) ; while ( in read line ( raw ugi ) > 0 ) { / / line is of the form username [ , group ] * if ( raw ugi to string ( ) trim ( ) equals ( " " ) ) { continue ; / / continue on empty line } / / e is end position of user name in this line int e = raw ugi find ( " , " ) ; if ( e = = 0 ) { throw new i o exception ( " missing username : " + raw ugi ) ; } if ( e = = - 1 ) { e = raw ugi get length ( ) ; } final string username = text decode ( raw ugi get bytes ( ) , 0 , e ) trim ( ) ; user group information ugi = null ; try { ugi = user group information create proxy user ( username , user group information get login user ( ) ) ; } catch ( i o exception ioe ) { log error ( " error while creating a proxy user " , ioe ) ; } if ( ugi ! = null ) { ugi list add ( ugi ) ; } / / no need to parse groups , even if they exist go to next line } } finally { if ( in ! = null ) { in close ( ) ; } } return ugi list ; }


records an exception so that it can be rethrown later in the test harness thread , triggering a test case failure only the first failure is recorded ; subsequent calls to this method from within the same test have no effect

public void thread record failure ( throwable t ) { thread failure compare and set ( null , t ) ; }


expect a provider to raise an exception on failure

private i o exception expect provider instantiation failure ( class a class , string expected error text ) throws exception { return expect provider instantiation failure ( build class list string ( collections singleton list ( a class ) ) , expected error text ) ; }


this method is called whenever the status of the job changes

void job status changes ( job i d job id , job status new job status , long timestamp , throwable error ) ;


set whether to keep the command file for debugging

public static void set keep command file ( job conf conf , boolean keep ) { conf set boolean ( submitter preserve commandfile , keep ) ; }


returns true if the builder is winding down ( i e cancelling outstanding actions and preparing to abort ) the builder is winding down iff : we had an execution error we are not running with - - keep going

private boolean is builder aborting ( ) { return had execution error & & ! options get options ( keep going option class ) keep going ; }


to test special tags to test special tags and operation id starting with number

public void call 1 2 3test special tags test ( ) { client body = null ; / / client response = api call 1 2 3test special tags ( body ) ; / / todo : test validations }


get output compressed bytes , return num bytes if there is no compression

public abstract long get num compressed bytes ( ) throws i o exception ;


public void show warning ( ) { show warning ( false ) ; }


public string [ ] get script args ( ) { return script args ; }


public static smtp request mail ( char sequence sender , char sequence mail parameters ) { if ( mail parameters = = null | | mail parameters length = = 0 ) { return new default smtp request ( smtp command mail , sender ! = null ? " from : < " + sender + ' > ' : from null sender ) ; } else { list < char sequence > params = new array list < char sequence > ( mail parameters length + 1 ) ; params add ( sender ! = null ? " from : < " + sender + ' > ' : from null sender ) ; collections add all ( params , mail parameters ) ; return new default smtp request ( smtp command mail , params ) ; } }


if set , this node is an elementtag < code > optional aapt pb xml element element = 1 ; < code >

public com android aapt resources xml element get element ( ) { return instance get element ( ) ; }


verifies change requested in < a href = " https : jira spring iobrowse s p r - 11634 " > spr - 11634

void resolve config attributes with locations and classes ( ) { list < context configuration attributes > attributes list = resolve context configuration attributes ( locations and classes class ) ; assert that ( attributes list ) is not null ( ) ; assert that ( attributes list size ( ) ) is equal to ( 1 ) ; }


tests that a dependency is invalid when both rules add environments to their defaults and the depender adds environments not added by the dependency

public void invalid compatibility constraints ( ) throws exception { new environment group maker ( " buildenv / foo " ) set environments ( " a " , " b " , " c " ) set defaults ( " a " ) make ( ) ; scratch file ( " hello / build " , get dependency rule ( compatible with ( " / / buildenv / foo : c " ) ) , get depending rule ( compatible with ( " / / buildenv / foo : b " , " / / buildenv / foo : c " ) ) ) ; reporter remove handler ( fail fast handler ) ; assert that ( get configured target ( " / / hello : main " ) ) is null ( ) ; assert contains event ( " dependency / / hello : dep doesn ' t support expected environment : / / buildenv / foo : b " ) ; }


create a data block and obtain an output stream for adding data into the block there can only be one block appender stream active at any time data blocks may not be created after the first meta blocks the caller must call block appender close ( ) to conclude the block creation

public block appender prepare data block ( ) throws i o exception { if ( blk in progress = = true ) { throw new illegal state exception ( " cannot create data block until previous block is closed " ) ; } if ( meta blk seen = = true ) { throw new illegal state exception ( " cannot create data block after meta blocks " ) ; } data block register dbr = new data block register ( ) ; w block state wbs = new w block state ( get default compression algorithm ( ) , out , fs output buffer , conf ) ; block appender ba = new block appender ( dbr , wbs ) ; blk in progress = true ; return ba ; }


fills a circle with the center at x , y and a radius using the current color

public void fill circle ( int x , int y , int radius ) { pixmap fill circle ( x , y , radius , color ) ; }


returns the data flavors for the types of data that this transferable supports , based upon the given selection

public data flavor [ ] get transfer data flavors ( ) { return transfer handler get supported data flavors ( selected data ) ; }


encode a { @ link char sequence } in < a href = " https : en wikipedia orgwiki a s c i i " > ascii and write it to a { @ link byte buf } allocated with { @ code alloc }

public static byte buf write ascii ( byte buf allocator alloc , char sequence seq ) { / / ascii uses 1 byte per char byte buf buf = alloc buffer ( seq length ( ) ) ; write ascii ( buf , seq ) ; return buf ; }


transfers the content of the specified stream to this buffer starting at the current { @ code writer index } and increases the { @ code writer index } by the number of the transferred bytes

int write bytes ( input stream src , int length ) throws i o exception ;


find purchase order by id for valid response try integer i ds with value & lt ; & # x 3 d ; 5 or & gt ; 10 other values will generated exceptions

public single < order > rx get order by id ( long order id , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate get order by id ( order id , auth info , fut ) ) ) ; }


check on whether or not a parameter should be serialized

boolean check ( boolean include defaults , boolean is configured , t value ) ;


sets whether the chart should keep its position ( zoom scroll ) after a rotation ( orientation change )

public void set keep position on rotation ( boolean keep position on rotation ) { m keep position on rotation = keep position on rotation ; }


public string get description ( ) { return description ; }


public static < t extends agent typed s p i > t get registered service ( final class < t > typed s p i class , final string type ) { optional < t > service instance = agent service loader get service loader ( typed s p i class ) new service instances ( ) stream ( ) filter ( each - > each get type ( ) equals ignore case ( type ) ) find first ( ) ; if ( service instance is present ( ) ) { return service instance get ( ) ; } throw new agent service provider not found exception ( typed s p i class , type ) ; }


merge in the statistics of a single input stream into the filesystem - wide metrics counters this does not update the fs i o statistics values

private void promote input stream counters to metrics ( ) { / / iterate through all the counters local i o statistics ( ) counters ( ) key set ( ) stream ( ) for each ( e - > promote i o counter ( e ) ) ; }


public string get job name ( ) { if ( state = = job state define | | status = = null ) { return super get job name ( ) ; } ensure state ( job state running ) ; return status get job name ( ) ; }


test " read ops " ( e g list , list status ) on internal dirs of mount table these operations should succeed

public void test list on internal dirs of mount table ( ) throws i o exception { / / list on slash file status [ ] dir paths = fc view util ( ) list status ( new path ( " / " ) ) ; file status fs ; assert assert equals ( 7 , dir paths length ) ; fs = file context test helper contains path ( fc view , " / user " , dir paths ) ; assert assert not null ( fs ) ; assert assert true ( " a mount should appear as symlink " , fs is symlink ( ) ) ; fs = file context test helper contains path ( fc view , " / data " , dir paths ) ; assert assert not null ( fs ) ; assert assert true ( " a mount should appear as symlink " , fs is symlink ( ) ) ; fs = file context test helper contains path ( fc view , " / internal dir " , dir paths ) ; assert assert not null ( fs ) ; assert assert true ( " internal dirs should appear as dir " , fs is directory ( ) ) ; fs = file context test helper contains path ( fc view , " / dangling link " , dir paths ) ; assert assert not null ( fs ) ; assert assert true ( " a mount should appear as symlink " , fs is symlink ( ) ) ; fs = file context test helper contains path ( fc view , " / link to a file " , dir paths ) ; assert assert not null ( fs ) ; assert assert true ( " a mount should appear as symlink " , fs is symlink ( ) ) ; / / list on internal dir dir paths = fc view util ( ) list status ( new path ( " / internal dir " ) ) ; assert assert equals ( 2 , dir paths length ) ; fs = file context test helper contains path ( fc view , " / internal dir / internal dir 2 " , dir paths ) ; assert assert not null ( fs ) ; assert assert true ( " internal dirs should appear as dir " , fs is directory ( ) ) ; fs = file context test helper contains path ( fc view , " / internal dir / link to dir 2 " , dir paths ) ; assert assert not null ( fs ) ; assert assert true ( " a mount should appear as symlink " , fs is symlink ( ) ) ; }


test iteration job , check slot sharing group and co - location group

public void test iteration ( ) { stream execution environment env = stream execution environment get execution environment ( ) ; data stream < integer > source = env from elements ( 1 , 2 , 3 ) name ( " source " ) ; iterative stream < integer > iteration = source iterate ( 3000 ) ; iteration name ( " iteration " ) set parallelism ( 2 ) ; data stream < integer > map = iteration map ( x - > x + 1 ) name ( " map " ) set parallelism ( 2 ) ; data stream < integer > filter = map filter ( ( x ) - > false ) name ( " filter " ) set parallelism ( 2 ) ; iteration close with ( filter ) print ( ) ; final resource spec resources = resource spec new builder ( 1 0 , 100 ) build ( ) ; iteration get transformation ( ) set resources ( resources , resources ) ; stream graph stream graph = env get stream graph ( ) ; for ( tuple 2 < stream node , stream node > iteration pair : stream graph get iteration source sink pairs ( ) ) { assert not null ( iteration pair f 0 get co location group ( ) ) ; assert equals ( iteration pair f 0 get co location group ( ) , iteration pair f 1 get co location group ( ) ) ; assert equals ( stream graph generator default slot sharing group , iteration pair f 0 get slot sharing group ( ) ) ; assert equals ( iteration pair f 0 get slot sharing group ( ) , iteration pair f 1 get slot sharing group ( ) ) ; final resource spec source min resources = iteration pair f 0 get min resources ( ) ; final resource spec sink min resources = iteration pair f 1 get min resources ( ) ; final resource spec iteration resources = source min resources merge ( sink min resources ) ; assert that ( iteration resources , equals resource spec ( resources ) ) ; } }


private static float [ ] [ ] generate pascals triangle ( int level ) { if ( level < 2 ) level = 2 ; float [ ] [ ] triangle = new float [ level ] [ ] ; triangle [ 0 ] = new float [ 1 ] ; triangle [ 1 ] = new float [ 2 ] ; triangle [ 0 ] [ 0 ] = 1 0f ; triangle [ 1 ] [ 0 ] = 1 0f ; triangle [ 1 ] [ 1 ] = 1 0f ; for ( int i = 2 ; i < level ; i + + ) { triangle [ i ] = new float [ i + 1 ] ; triangle [ i ] [ 0 ] = 1 0f ; triangle [ i ] [ i ] = 1 0f ; for ( int j = 1 ; j < triangle [ i ] length - 1 ; j + + ) triangle [ i ] [ j ] = triangle [ i - 1 ] [ j - 1 ] + triangle [ i - 1 ] [ j ] ; } return triangle ; }


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


optional < local over window > get over window ( expression alias ) ;


sets whether native statistics gathering is enabled on a cache

public void set native statistics enabled ( boolean enabled ) { this native statistics = enabled ; }


sets the minimum word length below which words will be ignored defaults to { @ code 0 }

public more like this query builder min word length ( int min word length ) { this min word length = min word length ; return this ; }


called to provide a fallback if a supported lifecycle method throws an exception it is possible to either recover from the error here or reraise the exception to catch it at a higher level or crash the application

protected void on error ( component context c , exception e ) { event handler < error event > event handler = c get error event handler ( ) ; if ( event handler = = null ) { if ( e instanceof runtime exception ) { throw ( runtime exception ) e ; } else { throw new runtime exception ( e ) ; } } error event error event = new error event ( ) ; error event exception = e ; event handler dispatch event ( error event ) ; }


field get primary table key type ( ) { return primary table get schema ( ) get key field type ( ) ; }


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


public list < setting < ? > > get settings ( ) { return list of ( eql enabled setting ) ; }


protected object select body ( object obj , multi value map < string , object > form params , media type content type ) { boolean is form = media type multipart form data is compatible with ( content type ) | | media type application form urlencoded is compatible with ( content type ) ; return is form ? form params : obj ; }


respond to http request with simple diagnostics primarily used to test the low - level connectivity

private void respond hello ( string header , socket s ) throws i o exception { try { data output stream out = new data output stream ( s get output stream ( ) ) ; string response ; if ( header starts with ( " get / " ) ) { response = " http / 1 0 200 ok \ r \ n " + " content - type : text / plain ; charset = utf - 8 \ r \ n " + " \ r \ n " + " jenkins - agent - protocols : " + get agent protocol names ( ) + " \ r \ n " + " jenkins - version : " + jenkins version + " \ r \ n " + " jenkins - session : " + jenkins session hash + " \ r \ n " + " client : " + s get inet address ( ) get host address ( ) + " \ r \ n " + " server : " + s get local address ( ) get host address ( ) + " \ r \ n " + " remoting - minimum - version : " + get remoting minimum version ( ) + " \ r \ n " ; } else { response = default response 404 ; } out write ( response get bytes ( standard charsets utf 8 ) ) ; out flush ( ) ; s shutdown output ( ) ; input stream i = s get input stream ( ) ; i o utils copy ( i , null output stream null output stream ) ; s shutdown input ( ) ; } finally { s close ( ) ; } }


the configured default locale , if any this method may be overridden in subclasses

public locale get default locale ( ) { return this default locale ; }


the maximum number of requests allowed in a batch before triggering a batch execution

public hystrix property < integer > max requests in batch ( ) { return max requests in batch ; }


restore this symbol object and its associated mappings from an xml description in the given stream

public void restore x m l ( xml pull parser parser ) throws pcode x m l exception { xml element symel = parser start ( " symbol " ) ; restore x m l header ( symel ) ; type = dtmanage read x m l data type ( parser ) ; parser end ( symel ) ; if ( category index > = 0 & & name starts with ( " $ $ undef " ) ) { / / use default parameter name name = " param " + integer to string ( category index + 1 ) ; } while ( parser peek ( ) is start ( ) ) { xml element el = parser peek ( ) ; symbol entry entry ; if ( el get name ( ) equals ( " hash " ) ) { entry = new dynamic entry ( this ) ; } else if ( this instanceof high code symbol ) { entry = new mapped data entry ( this ) ; } else { entry = new mapped entry ( this ) ; } entry restore x m l ( parser ) ; add map entry ( entry ) ; } if ( ( is this | | is hidden ) & & entry list ! = null ) { symbol entry entry = entry list [ 0 ] ; variable storage storage = entry get storage ( ) ; auto parameter type auto type = is this ? auto parameter type this : auto parameter type return storage ptr ; try { variable storage new storage = new dynamic variable storage ( storage get program ( ) , auto type , storage get first varnode ( ) ) ; entry list [ 0 ] = new mapped entry ( this , new storage , entry get p c adress ( ) ) ; } catch ( invalid input exception e ) { throw new pcode x m l exception ( " unable to parse auto - parameter " ) ; } } }


this method enables conversion of truefalse strings in config additional properties ( configurationconfig options ) to proper booleans this enables mustache files to handle the properties better

private void adjust additional properties ( final codegen config config ) { map < string , object > config additional properties = config additional properties ( ) ; set < string > key set = config additional properties key set ( ) ; for ( string key : key set ) { object value = config additional properties get ( key ) ; if ( value ! = null ) { if ( value instanceof string ) { string string value = ( string ) value ; if ( string value equals ignore case ( " true " ) ) { config additional properties put ( key , boolean true ) ; } else if ( string value equals ignore case ( " false " ) ) { config additional properties put ( key , boolean false ) ; } } } else { config additional properties put ( key , boolean false ) ; } } }


set the negative button text for the rationale dialog should it be shown the default is { @ link android r string # cancel }

public builder set negative button text ( @ nullable string negative button text ) { m negative button text = negative button text ; return this ; }


returns the key of this parameter , e g " jobid "

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


configures the given map maker to use weak keys , if possible ; does nothing otherwise ( i e , in gwt ) this is sometimes acceptable , when only server - side code could generate enough volume that reclamation becomes important

static map maker try weak keys ( map maker map maker ) { return map maker weak keys ( ) ; }


performance test for jvm metrics # get metrics , comparing performance of getting thread usage from thread m x bean with that from thread group

public void test get metrics perf ( ) { jvm metrics jvm metrics use m x bean = new jvm metrics ( " test " , " test " , true ) ; jvm metrics jvm metrics = new jvm metrics ( " test " , " test " , false ) ; metrics collector impl collector = new metrics collector impl ( ) ; / / warm up jvm metrics get metrics ( collector , true ) ; jvm metrics use m x bean get metrics ( collector , true ) ; / / test cases with different numbers of threads int [ ] num threads cases = { 100 , 200 , 500 , 1000 , 2000 , 3000 } ; list < test thread > threads = new array list ( ) ; for ( int num threads : num threads cases ) { update threads and wait ( threads , num threads ) ; long start ns = system nano time ( ) ; jvm metrics use m x bean get metrics ( collector , true ) ; long processing ns from m x bean = system nano time ( ) - start ns ; start ns = system nano time ( ) ; jvm metrics get metrics ( collector , true ) ; long processing ns from group = system nano time ( ) - start ns ; system out println ( " # threads = " + num threads + " , thread m x bean = " + processing ns from m x bean + " ns , thread group = " + processing ns from group + " ns , ratio : " + ( processing ns from m x bean / processing ns from group ) ) ; } / / cleanup update threads and wait ( threads , 0 ) ; }


returns the class of rule that this rule class represents ( e g " cc library " )

public string get name ( ) { return name ; }


returns true if x 1 is less than x 2 , when both values are treated as unsigned

static boolean less than unsigned ( long x 1 , long x 2 ) { return ( x 1 + long min value ) < ( x 2 + long min value ) ; }


returns an { @ link ascii string } containing the given string and retainscaches the input string for later use in { @ link # to string ( ) } used for the constants ( which already stored in the jvm ' s string table ) and in cases where the guaranteed use of the { @ link # to string ( ) } method

public static ascii string cached ( string string ) { ascii string ascii string = new ascii string ( string ) ; ascii string string = string ; return ascii string ; }


delete the event - time trigger for the given time

void delete event time timer ( long time ) ;


return a { @ code request predicate } that matches if the request ' s path matches the given predicate

public static request predicate path extension ( predicate < string > extension predicate ) { return new path extension predicate ( extension predicate ) ; }


public static boolean internal user ( ) { return get boolean ( internal user , false ) ; }


given an index in the range < code > 0 size ( ) - 1 < code > , returns the key from the < code > index < code > th key - value mapping that this sparse array stores

public long key at ( int index ) { if ( m garbage ) { gc ( ) ; } return m keys [ index ] ; }


stop the current task this will print done and the elapsed time since the start of the task the " current task " is determined from the stack

public void stop ( ) { long time = system current time millis ( ) - time stack pop ( ) ; flush ( ) ; println ( " done after " + time + " ms " ) ; }


marks the branch targets of the given jump offsets for the instruction at the given offset

private void mark branch targets ( clazz clazz , method method , code attribute code attribute , int offset , int [ ] jump offsets ) { for ( int index = 0 ; index < jump offsets length ; index + + ) { mark code ( clazz , method , code attribute , offset + jump offsets [ index ] ) ; } }


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


enables ignoring null values , treats null values as unset and avoids writing null fields and creating tombstones this call has no effect if { @ link cassandra sink builder # enable write ahead log ( ) } is called

public cassandra sink builder < in > enable ignore null fields ( ) { this config builder set ignore null fields ( true ) ; return this ; }


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


create from unmasked mode and umask if the mode is already an fs create modes object , return it

public static fs permission apply u mask ( fs permission mode , fs permission umask ) { if ( mode get unmasked ( ) ! = null ) { return mode ; } return create ( mode apply u mask ( umask ) , mode ) ; }


exception messages might contain local subcluster paths this method generates a new exception with the proper message

private i o exception process exception ( i o exception ioe , remote location context loc ) { if ( ioe instanceof remote exception ) { remote exception re = ( remote exception ) ioe ; string new msg = process exception msg ( re get message ( ) , loc get dest ( ) , loc get src ( ) ) ; remote exception new exception = new remote exception ( re get class name ( ) , new msg ) ; new exception set stack trace ( ioe get stack trace ( ) ) ; return new exception ; } if ( ioe instanceof file not found exception ) { string new msg = process exception msg ( ioe get message ( ) , loc get dest ( ) , loc get src ( ) ) ; file not found exception new exception = new file not found exception ( new msg ) ; new exception set stack trace ( ioe get stack trace ( ) ) ; return new exception ; } if ( ioe instanceof snapshot exception ) { string new msg = process exception msg ( ioe get message ( ) , loc get dest ( ) , loc get src ( ) ) ; snapshot exception new exception = new snapshot exception ( new msg ) ; new exception set stack trace ( ioe get stack trace ( ) ) ; return new exception ; } return ioe ; }


specify a hibernate { @ link metadata sources } service to use ( e g reusing an existing one ) , potentially populated with a custom hibernate bootstrap { @ link org hibernate service service registry } as well

public void set metadata sources ( metadata sources metadata sources ) { this metadata sources accessed = true ; this metadata sources = metadata sources ; }


call org jenkinsci plugins dependencytest depender depender get value ( )

private string call depender value ( ) throws exception { class < ? > c = r jenkins get plugin manager ( ) uber class loader load class ( " org jenkinsci plugins dependencytest depender depender " ) ; method m = c get method ( " get value " ) ; return ( string ) m invoke ( null ) ; }


< code > required string message = 1 ; < code >

public builder set message bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; message = value ; on changed ( ) ; return this ; }


sets the maximum frame that the animation will end at when playing or looping the value will be clamped to the composition bounds for example , setting integer max value would result in the same thing as composition end frame

public void set max frame ( final int max frame ) { if ( composition = = null ) { lazy composition tasks add ( new lazy composition task ( ) { @ override public void run ( lottie composition composition ) { set max frame ( max frame ) ; } } ) ; return ; } animator set max frame ( max frame + 0 9 9f ) ; }


create a new index on the singleton node with the provided index settings

protected index service create index ( string index , settings settings , string type , string mappings ) { create index request builder create index request builder = client ( ) admin ( ) indices ( ) prepare create ( index ) set settings ( settings ) ; if ( type ! = null ) { create index request builder set mapping ( mappings ) ; } return create index ( index , create index request builder ) ; }


replaces type bearers in source register specs with constant type bearers if possible these are then referenced in later optimization steps

private void replace constants ( ) { for ( int reg = 0 ; reg < reg count ; reg + + ) { if ( lattice values [ reg ] ! = constant ) { continue ; } if ( ! ( lattice constants [ reg ] instanceof typed constant ) ) { / / we can ' t do much with these continue ; } ssa insn defn = ssa meth get definition for register ( reg ) ; type bearer type bearer = defn get result ( ) get type bearer ( ) ; if ( type bearer is constant ( ) ) { / * * the definition was a constant already * the uses should be as well * / continue ; } / / update the destination register spec with the constant value register spec dest = defn get result ( ) ; register spec new dest = dest with type ( ( typed constant ) lattice constants [ reg ] ) ; defn set result ( new dest ) ; / * * update the sources register spec ' s of all non - move uses * these will be used in later steps * / for ( ssa insn insn : ssa meth get use list for register ( reg ) ) { if ( insn is phi or move ( ) ) { continue ; } normal ssa insn n insn = ( normal ssa insn ) insn ; register spec list sources = insn get sources ( ) ; int index = sources index of register ( reg ) ; register spec spec = sources get ( index ) ; register spec new spec = spec with type ( ( typed constant ) lattice constants [ reg ] ) ; n insn change one source ( index , new spec ) ; } } }


retrieve the data type with the fully qualified path so you can get the data named " bar " in the category " foo " by calling get data type ( " foobar " ) this method can be problematic now that datatype names can contain slashes it will work provided that the part of the datatype name that precedes its internal slash is not also the name of a category in the same category as the datatype for example , if you call get data type ( " abc " ) , and " bc " is the name of your datatype , it will find it unless there is also a category " b " under category " a " a better solution is to use the { @ link # get data type ( data type path ) } method because the data type path keeps the category and datatype name separate

public data type get data type ( string data type path ) ;


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


returns a new hash set using the smallest initial table size that can hold { @ code expected size } elements without resizing note that this is not what { @ link hash set # hash set ( int ) } does , but it is what most users want and expect it to do this behavior can ' t be broadly guaranteed , but has been tested with open j d k 1 7 and 1 8

public static < e > hash set < e > new hash set with expected size ( int expected size ) { return new hash set < e > ( maps capacity ( expected size ) ) ; }


protected async dispatcher create n m dispatcher ( ) { return new async dispatcher ( " nm event dispatcher " ) ; }


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

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


delete a snapshot of a snapshottable directory

public void delete snapshot ( string snapshot root , string snapshot name ) throws i o exception { check open ( ) ; try ( trace scope ignored = tracer new scope ( " delete snapshot " ) ) { namenode delete snapshot ( snapshot root , snapshot name ) ; } catch ( remote exception re ) { throw re unwrap remote exception ( ) ; } }


returns the configuration - independent root where the build - data should be placed , given the { @ link blaze directories } of this server instance nothing else should be placed here

public artifact root get build data directory ( string workspace name ) { return artifact root as derived root ( get exec root ( workspace name ) , get relative output path ( product name ) ) ; }


exclude the " contexts " field from recursive random shuffling in from x content tests or else the equals ( ) test will fail because their { @ link bytes reference } representation isn ' t the same

protected string [ ] shuffle protected fields ( ) { return shuffle protected fields ; }


records the successful load of a new entry this should be called when a cache request causes an entry to be loaded , and the loading completes successfully in contrast to { @ link # record misses } , this method should only be called by the loading thread

void record load success ( long load time ) ;


called by the { @ link transport } implementation when an incoming request arrives but before any parsing of it has happened ( with the exception of the request id and action )

public void on request received ( long request id , string action ) { if ( handle incoming requests get ( ) = = false ) { throw new illegal state exception ( " transport not ready yet to handle incoming requests " ) ; } if ( tracer log is trace enabled ( ) & & should trace action ( action ) ) { tracer log trace ( " [ { } ] [ { } ] received request " , request id , action ) ; } message listener on request received ( request id , action ) ; }


set the mappings of bean keys to a comma - separated list of method names the property key should match the bean key and the property value should match the list of method names when searching for method names for a bean , spring will check these mappings first

public void set method mappings ( properties mappings ) { this method mappings = new hash map < > ( ) ; for ( enumeration < ? > en = mappings keys ( ) ; en has more elements ( ) ; ) { string bean key = ( string ) en next element ( ) ; string [ ] method names = string utils comma delimited list to string array ( mappings get property ( bean key ) ) ; this method mappings put ( bean key , new hash set < > ( arrays as list ( method names ) ) ) ; } }


advances the ticker value by { @ code time } in { @ code time unit }

public synchronized fake test clock advance ( duration duration ) { monotonic = monotonic plus ( duration ) ; return this ; }


adds an unnamed value to the formatted output it is strongly encouraged to use { @ link # add ( string , long ) } instead and give value a readable name

public to string helper add value ( long value ) { return add holder ( string value of ( value ) ) ; }


return the list of return value handlers to use including built - in and custom handlers provided via { @ link # set return value handlers }

private list < handler method return value handler > get default return value handlers ( ) { list < handler method return value handler > handlers = new array list < > ( 20 ) ; / / single - purpose return value types handlers add ( new model and view method return value handler ( ) ) ; handlers add ( new model method processor ( ) ) ; handlers add ( new view method return value handler ( ) ) ; handlers add ( new response body emitter return value handler ( get message converters ( ) , this reactive adapter registry , this task executor , this content negotiation manager ) ) ; handlers add ( new streaming response body return value handler ( ) ) ; handlers add ( new http entity method processor ( get message converters ( ) , this content negotiation manager , this request response body advice ) ) ; handlers add ( new http headers return value handler ( ) ) ; handlers add ( new callable method return value handler ( ) ) ; handlers add ( new deferred result method return value handler ( ) ) ; handlers add ( new async task method return value handler ( this bean factory ) ) ; / / annotation - based return value types handlers add ( new servlet model attribute method processor ( false ) ) ; handlers add ( new request response body method processor ( get message converters ( ) , this content negotiation manager , this request response body advice ) ) ; / / multi - purpose return value types handlers add ( new view name method return value handler ( ) ) ; handlers add ( new map method processor ( ) ) ; / / custom return value types if ( get custom return value handlers ( ) ! = null ) { handlers add all ( get custom return value handlers ( ) ) ; } / / catch - all if ( ! collection utils is empty ( get model and view resolvers ( ) ) ) { handlers add ( new model and view resolver method return value handler ( get model and view resolvers ( ) ) ) ; } else { handlers add ( new servlet model attribute method processor ( true ) ) ; } return handlers ; }


returns true if the current build is likely stuck this is a heuristics based approach , but if the build is suspiciously taking for a long time , this method returns true

public boolean is likely stuck ( ) { lock read lock ( ) lock ( ) ; try { if ( executable = = null ) { return false ; } } finally { lock read lock ( ) unlock ( ) ; } long elapsed = get elapsed time ( ) ; long d = executable estimated duration ; if ( d > = 0 ) { / / if it ' s taking 10 times longer than eta , consider it stuck return d * 10 < elapsed ; } else { / / if no eta is available , a build taking longer than a day is considered stuck return time unit milliseconds to hours ( elapsed ) > 24 ; } }


sets { @ link align # top } and clears { @ link align # bottom } for the alignment of widgets within each row

public horizontal group row top ( ) { row align | = align top ; row align & = ~ align bottom ; return this ; }


try to consume the { @ link # start comment } token

private int start comment ( string line ) { return comment token ( line , start comment , true ) ; }


returns the " initialized " abstract type corresponding to the given abstract type

private int get initialized type ( final symbol table symbol table , final int abstract type ) { if ( abstract type = = uninitialized this | | ( abstract type & ( dim mask | kind mask ) ) = = uninitialized kind ) { for ( int i = 0 ; i < initialization count ; + + i ) { int initialized type = initializations [ i ] ; int dim = initialized type & dim mask ; int kind = initialized type & kind mask ; int value = initialized type & value mask ; if ( kind = = local kind ) { initialized type = dim + input locals [ value ] ; } else if ( kind = = stack kind ) { initialized type = dim + input stack [ input stack length - value ] ; } if ( abstract type = = initialized type ) { if ( abstract type = = uninitialized this ) { return reference kind | symbol table add type ( symbol table get class name ( ) ) ; } else { return reference kind | symbol table add type ( symbol table get type ( abstract type & value mask ) value ) ; } } } } return abstract type ; } / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / main method , to simulate the execution of each instruction on the output frame / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


maps any parameter that isn ' t local - associated , which can happen in the case where there is no java debug info

private void handle unassociated parameters ( ) { int sz ssa regs = ssa meth get reg count ( ) ; for ( int ssa reg = 0 ; ssa reg < sz ssa regs ; ssa reg + + ) { if ( ssa regs mapped get ( ssa reg ) ) { / / we already did this one above continue ; } int param index = get parameter index for reg ( ssa reg ) ; register spec ssa spec = get definition spec for ssa reg ( ssa reg ) ; if ( param index > = 0 ) { add mapping ( ssa spec , param index ) ; } } }


builds a new map for the refresh transition this should be called in before refresh ( )

maps build transition map ( ) { return new maps ( new version lookup ( concurrent collections new concurrent map with aggressive concurrency ( current size ( ) ) ) , current , should inherit safe access ( ) ) ; }


deletes all files and subdirectories in directory ( doesn ' t delete the directory passed as parameter )

public static boolean delete contents ( file directory ) { file [ ] files = directory list files ( ) ; boolean success = true ; if ( files ! = null ) { for ( file file : files ) { success & = delete recursively ( file ) ; } } return success ; }


verify that users can use the { @ link instruction search api } to bring up the { @ link instruction search dialog } loaded with instructions derived from a given string of bytes ( hex format only )

public void test api load search dialog bytes ( ) { close dialog ( ) ; / / using new search dialog below instruction search api api = new instruction search api ( ) ; string bytes = " 10011011 " ; run swing ( ( ) - > api load instructions ( bytes , plugin get tool ( ) ) ) ; wait for swing ( ) ; dialog = wait for dialog component ( instruction search dialog class ) ; component = dialog get component ( ) ; instruction table = dialog get table panel ( ) get table ( ) ; preview table = dialog get preview table panel ( ) get table ( ) ; assert equals ( 2 , dialog get search data ( ) get instructions ( ) size ( ) ) ; assert equals ( 2 , instruction table get row count ( ) ) ; assert equals ( 3 , instruction table get column count ( ) ) ; instruction table data object obj 0 0 = ( instruction table data object ) instruction table get model ( ) get value at ( 0 , 0 ) ; assert equals ( " adc " , obj 0 0 get data ( ) ) ; }


get the # of degrees an image must be rotated to match the given exif orientation

public static int get exif orientation degrees ( int exif orientation ) { final int degrees to rotate ; switch ( exif orientation ) { case exif interface orientation transpose : case exif interface orientation rotate 90 : degrees to rotate = 90 ; break ; case exif interface orientation rotate 180 : case exif interface orientation flip vertical : degrees to rotate = 180 ; break ; case exif interface orientation transverse : case exif interface orientation rotate 270 : degrees to rotate = 270 ; break ; default : degrees to rotate = 0 ; break ; } return degrees to rotate ; }


verify that a node without the leader in its view will not attempt to connect to the leader

public void test leader out of view ( ) throws exception { client base setup test env ( ) ; int num servers = 3 ; / / used for assertions later boolean found leading = false ; boolean found following = false ; / / capture quorum peer logging byte array output stream os = new byte array output stream ( ) ; writer appender appender = get console appender ( os , level debug ) ; logger qlogger = logger get logger ( " org apache zookeeper server quorum " ) ; qlogger add appender ( appender ) ; try { servers svrs = new servers ( ) ; svrs client ports = new int [ num servers ] ; for ( int i = 0 ; i < num servers ; i + + ) { svrs client ports [ i ] = port assignment unique ( ) ; } string quorum cfg incomplete = get unique port cfg for id ( 1 ) + " \ n " + get unique port cfg for id ( 2 ) ; string quorum cfg complete = quorum cfg incomplete + " \ n " + get unique port cfg for id ( 3 ) ; svrs mt = new main thread [ 3 ] ; / / node 1 is started without the leader ( 3 ) in its config view svrs mt [ 0 ] = new main thread ( 1 , svrs client ports [ 0 ] , quorum cfg incomplete ) ; for ( int i = 1 ; i < num servers ; i + + ) { svrs mt [ i ] = new main thread ( i + 1 , svrs client ports [ i ] , quorum cfg complete ) ; } / / node 1 must be started first , before quorum is formed , to trigger the attempted invalid connection to 3 svrs mt [ 0 ] start ( ) ; quorum peer quorum peer 1 = wait for quorum peer ( svrs mt [ 0 ] , connection timeout ) ; assert true ( quorum peer 1 get peer state ( ) = = quorum peer server state looking ) ; / / node 3 started second to avoid 1 and 2 forming a quorum before 3 starts up int highest server index = num servers - 1 ; svrs mt [ highest server index ] start ( ) ; quorum peer quorum peer 3 = wait for quorum peer ( svrs mt [ highest server index ] , connection timeout ) ; assert true ( quorum peer 3 get peer state ( ) = = quorum peer server state looking ) ; / / node 2 started last , kicks off leader election for ( int i = 1 ; i < highest server index ; i + + ) { svrs mt [ i ] start ( ) ; } / / nodes 2 and 3 now form quorum and fully start 1 attempts to vote for 3 , fails , returns to looking state for ( int i = 1 ; i < num servers ; i + + ) { assert true ( client base wait for server up ( " 127 0 0 1 : " + svrs client ports [ i ] , connection timeout ) , " waiting for server to start " ) ; } assert true ( svrs mt [ 0 ] get quorum peer ( ) get peer state ( ) = = quorum peer server state looking ) ; assert true ( svrs mt [ highest server index ] get quorum peer ( ) get peer state ( ) = = quorum peer server state leading ) ; for ( int i = 1 ; i < highest server index ; i + + ) { assert true ( svrs mt [ i ] get quorum peer ( ) get peer state ( ) = = quorum peer server state following ) ; } / / look through the logs for output that indicates node 1 is leading or following line number reader r = new line number reader ( new string reader ( os to string ( ) ) ) ; pattern leading = pattern compile ( " * myid = 1 * quorum peer * leading * " ) ; pattern following = pattern compile ( " * myid = 1 * quorum peer * following * " ) ; string line ; while ( ( line = r read line ( ) ) ! = null & & ! found leading & & ! found following ) { found leading = leading matcher ( line ) matches ( ) ; found following = following matcher ( line ) matches ( ) ; } } finally { qlogger remove appender ( appender ) ; } assert false ( found leading , " corrupt peer should never become leader " ) ; assert false ( found following , " corrupt peer should not attempt connection to out of view leader " ) ; }


returns the set of empty init py ( c ) files to be added to a given set of files to allow the python runtime to find the < code > py < code > and < code > so < code > files present in the tree

private immutable set < path fragment > get init py files ( set < path fragment > manifest files ) { set < path fragment > result = new hash set < > ( ) ; / / a set of directories that already have package init files set < path fragment > has package init dirs = new hash set < > ( ) ; / / for b / 142135992 / / find directories containing python package init files based on a caller supplied test in / / order to support non - standard python package init naming schemes / / this loop is done prior to the one below as we assume no order in the set and that we may / / find inits in parent directories listed after subdirectories which the nested loop below / / would need to know of for ( path fragment source : manifest files ) { if ( is package init test ( source ) ) { has package init dirs add ( source get parent directory ( ) ) ; } } for ( path fragment source : manifest files ) { / / if we have a python or so file at this level if ( requires init py matches ( source ) ) { / / then record that we need an init py in this and all parents directories while ( source segment count ( ) > 1 ) { source = source get parent directory ( ) ; / / unless it ' s a python pyc cache or we already have init there if ( ! source ends with ( pycache ) & & ! has package init dirs contains ( source ) ) { path fragment initpy = source get relative ( init py ) ; path fragment initpyc = source get relative ( init pyc ) ; if ( ! manifest files contains ( initpy ) & & ! manifest files contains ( initpyc ) ) { result add ( initpy ) ; } } } } } return immutable set copy of ( result ) ; }


returns the largest power of two less than or equal to { @ code x } this is equivalent to { @ code big integer value of ( 2 ) pow ( log 2 ( x , floor ) ) }

public static big integer floor power of two ( big integer x ) { return big integer zero set bit ( log 2 ( x , floor ) ) ; }


get the { @ code class } reference for the actual annotation type


callback for use in progress callbacks from putmultipart upload events increments those statistics which are expected to be updated during the ongoing upload operation

public void increment put progress statistics ( string key , long bytes ) { progress debug ( " put { } : { } bytes " , key , bytes ) ; increment write operations ( ) ; if ( bytes > 0 ) { statistics increment bytes written ( bytes ) ; } }


get the change in the stack pointer resulting from calling this function


a container is promoted if its execution type is changed from opportunistic to guaranteed it id demoted if the change is from guaranteed to opportunistic

private list < container > pull newly updated containers ( map < container id , r m container > newly updated containers , container update type update tpe ) { list < container > updated containers = new array list < > ( ) ; if ( opp container context = = null & & ( container update type demote execution type = = update tpe | | container update type promote execution type = = update tpe ) ) { return updated containers ; } write lock lock ( ) ; try { iterator < map entry < container id , r m container > > i = newly updated containers entry set ( ) iterator ( ) ; while ( i has next ( ) ) { map entry < container id , r m container > entry = i next ( ) ; container id matched container id = entry get key ( ) ; r m container temp r m container = entry get value ( ) ; r m container existing r m container = get r m container ( matched container id ) ; if ( existing r m container ! = null ) { / / swap containers existing r m container = get update context ( ) swap container ( temp r m container , existing r m container , update tpe ) ; get update context ( ) remove from outstanding update ( temp r m container get allocated scheduler key ( ) , existing r m container get container ( ) ) ; container updated container = update container and n m token ( existing r m container , update tpe ) ; updated containers add ( updated container ) ; } temp container to kill add ( temp r m container ) ; i remove ( ) ; } / / release all temporary containers iterator < r m container > temp iter = temp container to kill iterator ( ) ; while ( temp iter has next ( ) ) { r m container c = temp iter next ( ) ; / / mark container for release ( set r rs to null , so rm does not think / / it is a recoverable container ) ( ( r m container impl ) c ) set container request ( null ) ; / / release this container async - ly so as to prevent / / ' leaf queue : : completed container ( ) ' from trying to acquire a lock / / on the app and queue which can contended for in the reverse order / / by the scheduler thread ( ( abstract yarn scheduler ) rm context get scheduler ( ) ) async container release ( c ) ; temp iter remove ( ) ; } return updated containers ; } finally { write lock unlock ( ) ; } }


public static symbol table read ( @ non null file file , @ nullable string table package ) throws i o exception { return read ( file , table package , atlas symbol io in order handler : : new ) ; }


find all annotations of the specified { @ code annotation types } within the annotation hierarchy above the supplied { @ code element } ; and for each annotation found , merge that annotation ' s attributes with matching attributes from annotations in lower levels of the annotation hierarchy and synthesize the results back into an annotation of the corresponding { @ code annotation type } { @ link alias for @ alias for } semantics are fully supported , both within a single annotation and within annotation hierarchies this method follows find semantics as described in the { @ linkplain annotated element utils class - level javadoc }

public static set < annotation > find all merged annotations ( annotated element element , set < class < ? extends annotation > > annotation types ) { return find annotations ( element ) stream ( ) filter ( merged annotation predicates type in ( annotation types ) ) sorted ( high aggregate indexes first ( ) ) collect ( merged annotation collectors to annotation set ( ) ) ; }


return a set of { @ link reservation allocation } identified by any user

set < reservation allocation > get reservations ( reservation id reservation i d , reservation interval interval ) ;


public cst string get signature ( ) { return spec get local item ( ) get signature ( ) ; }


remove the specified number of blocks to be invalidated

public block [ ] get invalidate blocks ( int maxblocks ) { synchronized ( invalidate blocks ) { block [ ] delete list = invalidate blocks poll to array ( new block [ math min ( invalidate blocks size ( ) , maxblocks ) ] ) ; return delete list length = = 0 ? null : delete list ; } }


whether this { @ link sort buffer } is finished or not


check if the submission of an application to the target queue is allowed

private boolean access to target queue allowed ( user group information caller u g i , r m app application , string target queue ) { return queue a c ls manager check access ( caller u g i , queue a c l submit applications , application , server get remote address ( ) , null , target queue ) | | queue a c ls manager check access ( caller u g i , queue a c l administer queue , application , server get remote address ( ) , null , target queue ) ; }


final name of the symlink relative to the fileset ' s output directory

public abstract path fragment get name ( ) ;


private subscriber exception context context ( object event ) { return new subscriber exception context ( bus , event , target , method ) ; }


test of next header from method , of class zip in

public void test next header from long ( ) throws exception { int count = entry count ; string filename = " test jar " ; zip file builder builder = new zip file builder ( ) ; for ( int i = 0 ; i < count ; i + + ) { builder add ( " pkg / f " + i + " class " , " all day long " ) ; } builder create ( filename ) ; final zip in zip in = new zip in ( filename ) ; zip in end of central directory ( ) ; count = 0 ; int offset = 0 ; local file header header ; do { header = zip in next header from ( offset ) ; string name = " pkg / f " + count + " class " ; if ( header ! = null ) { assert that ( header get filename ( ) ) is equal to ( name ) ; count + + ; offset = ( int ) header file offset ( ) + 4 ; } } while ( header ! = null ) ; assert that ( count ) is equal to ( entry count ) ; }


values that have more chars than the return value of this method will be skipped at parsing time

int ignore above ( ) { return ignore above ; }


returns all ancestors for the given vertices in the given graph ancestors for a given vertex are all nodes at the incoming side of an edge , as well as their incoming vertices , etc

public static < v , e extends g edge < v > > set < v > get ancestors ( g directed graph < v , e > g , collection < v > vertices ) { set < e > edges = get edges from ( g , vertices , false ) ; set < v > ancestors = to vertices ( edges ) ; return ancestors ; }


set calls to the entry point to non - returning calls

protected void set no fall thru ( program cp , address entry ) { reference iterator ref iter = program get reference manager ( ) get references to ( entry ) ; while ( ref iter has next ( ) ) { reference ref = ref iter next ( ) ; if ( ! ref get reference type ( ) is call ( ) ) { continue ; } address from addr = ref get from address ( ) ; instruction instr = program get listing ( ) get instruction at ( from addr ) ; if ( instr = = null ) { continue ; } address fallthru addr = instr get fall through ( ) ; if ( fallthru addr ! = null ) { instr set flow override ( flow override call return ) ; } } }


the close operation relays to { @ link # finish ( ) } implementing it allows duration instances to be automatically finish ( ) ' d in java 7 try blocks for when used in measuring durations

public final void close ( ) { finish ( ) ; }


returns the full ( the actual ) shape of a vertex this can be used to determine if a mouse point intersects a vertex or to get the real bounding - box of a vertex

default public shape get full shape ( ) { return get compact shape ( ) ; }


tests if a symbol can successfully be created this is useful when creating symbol types that require unique names such as namespaces , libraries , and classes

private static boolean is unique symbol name ( symbol table symbol table , namespace namespace , string name , address address , symbol type type ) { if ( address is external address ( ) ) { return false ; } if ( symbol table get symbol ( name , address , namespace ) ! = null ) { return false ; } if ( type allows duplicates ( ) ) { return true ; } list < symbol > symbols = symbol table get symbols ( name , namespace ) ; for ( symbol symbol : symbols ) { if ( ! symbol get symbol type ( ) allows duplicates ( ) ) { return false ; } } return true ; }


returns the number of times { @ link cache } lookup methods failed to load a new value , either because no value was found or an exception was thrown while loading this is always incremented in conjunction with { @ code miss count } , though { @ code miss count } is also incremented when cache loading completes successfully ( see { @ link # load success count } ) multiple concurrent misses for the same key will result in a single load operation

public long load failure count ( ) { return load failure count ; }


the instance entry point for the yarn task executor obtains user group information and calls the main work method { @ link task manager runner # run task manager ( configuration , plugin manager ) } as a privileged action

private static void run task manager securely ( string [ ] args ) { try { log debug ( " all environment variables : { } " , env ) ; final string curr dir = env get ( environment pwd key ( ) ) ; log info ( " current working directory : { } " , curr dir ) ; final configuration configuration = task manager runner load configuration ( args ) ; setup and modify configuration ( configuration , curr dir , env ) ; task manager runner run task manager securely ( configuration ) ; } catch ( throwable t ) { final throwable stripped throwable = exception utils strip exception ( t , undeclared throwable exception class ) ; / / make sure that everything whatever ends up in the log log error ( " yarn task manager initialization failed " , stripped throwable ) ; system exit ( init error exit code ) ; } }


clamps the value to the progress bar ' s minmax range this can be overridden to allow a range different from the progress bar knob ' s range

protected float clamp ( float value ) { return math utils clamp ( value , min , max ) ; }


return the current number of { @ link byte buf } ' s that are composed in this instance

public int num components ( ) { return component count ; }


returns true if the item ' s processing was cancelled

public boolean is cancelled ( ) { return error instanceof cancellation exception ; }


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


try to mark the { @ link promise } as failure and log if { @ code logger } is not { @ code null } in case this fails

public static void try failure ( promise < ? > p , throwable cause , internal logger logger ) { if ( ! p try failure ( cause ) & & logger ! = null ) { throwable err = p cause ( ) ; if ( err = = null ) { logger warn ( " failed to mark a promise as failure because it has succeeded already : { } " , p , cause ) ; } else if ( logger is warn enabled ( ) ) { logger warn ( " failed to mark a promise as failure because it has failed already : { } , unnotified cause : { } " , p , throwable util stack trace to string ( err ) , cause ) ; } } }


utility method for getting a hostname resolved to a node in the network topology this method doesn ' t initialize the class call { @ link # init ( configuration ) } explicitly

public static node resolve ( string host name ) { if ( ! init called ) { throw new illegal state exception ( " rack resolver class not yet initialized " ) ; } return core resolve ( host name ) ; }


public int do end tag ( ) { if ( this previous nested path ! = null ) { / / expose previous nested path value this page context set attribute ( nested path variable name , this previous nested path , page context request scope ) ; } else { / / remove exposed nested path value this page context remove attribute ( nested path variable name , page context request scope ) ; } return eval page ; }


verify that state of separate windows does not leak into other windows

public void test window separation and firing ( ) throws exception { trigger test harness < object , time window > test harness = new trigger test harness < > ( count trigger < time window > of ( 3 ) , new time window serializer ( ) ) ; assert equals ( trigger result continue , test harness process element ( new stream record < object > ( 1 ) , new time window ( 0 , 2 ) ) ) ; assert equals ( trigger result continue , test harness process element ( new stream record < object > ( 1 ) , new time window ( 2 , 4 ) ) ) ; / / shouldn ' t have any timers assert equals ( 0 , test harness num processing time timers ( ) ) ; assert equals ( 0 , test harness num event time timers ( ) ) ; assert equals ( 2 , test harness num state entries ( ) ) ; assert equals ( 1 , test harness num state entries ( new time window ( 0 , 2 ) ) ) ; assert equals ( 1 , test harness num state entries ( new time window ( 2 , 4 ) ) ) ; assert equals ( trigger result continue , test harness process element ( new stream record < object > ( 1 ) , new time window ( 0 , 2 ) ) ) ; assert equals ( trigger result fire , test harness process element ( new stream record < object > ( 1 ) , new time window ( 0 , 2 ) ) ) ; assert equals ( trigger result continue , test harness process element ( new stream record < object > ( 1 ) , new time window ( 2 , 4 ) ) ) ; / / right now , count trigger will clear it ' s state in on element when firing / / ideally , this should be moved to on fire ( ) assert equals ( 1 , test harness num state entries ( ) ) ; assert equals ( 0 , test harness num state entries ( new time window ( 0 , 2 ) ) ) ; assert equals ( 1 , test harness num state entries ( new time window ( 2 , 4 ) ) ) ; assert equals ( trigger result fire , test harness process element ( new stream record < object > ( 1 ) , new time window ( 2 , 4 ) ) ) ; / / now all state should be gone assert equals ( 0 , test harness num state entries ( ) ) ; }


shift jis is a multi - byte character encoding in it , 0x 8 2 0x 8 3 is モ , and 0x 8 3 0x 8 2 is ｃ so if aren ' t careful , we ' ll parse the text incorrectly

public void tail shift j i s ( ) throws exception { file f = tmp new file ( ) ; text file t = new text file ( f ) ; try ( output stream o = new file output stream ( f ) ) { for ( int i = 0 ; i < 80 ; i + + ) { for ( int j = 0 ; j < 40 ; j + + ) { o write ( 0x 8 3 ) ; o write ( 0x 8 2 ) ; } o write ( 0x 0 a ) ; } } string tail = t fast tail ( 35 , charset for name ( " shift jis " ) ) ; assert equals ( string utils repeat ( " \ u 3 0e 2 " , 34 ) + " \ n " , tail ) ; assert equals ( 35 , tail length ( ) ) ; / / add one more byte to force fast tail to read from one byte ahead / / between this and the previous case , it should start parsing text incorrectly , until it hits nl / / where it comes back in sync try ( output stream o = new file output stream ( f , true ) ) { o write ( 0x 0 a ) ; } tail = t fast tail ( 35 , charset for name ( " shift jis " ) ) ; assert equals ( string utils repeat ( " \ u 3 0e 2 " , 33 ) + " \ n \ n " , tail ) ; assert equals ( 35 , tail length ( ) ) ; }


format url template using default server variables

public string url ( ) { return url ( null ) ; }


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


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


if this exception was thrown by a multi - request then the ( partial ) results and error codes can be retrieved using this getter

public list < op result > get results ( ) { return results ! = null ? new array list < op result > ( results ) : null ; }


returns the setting value ( as long ) associated with the setting key if it does not exists , returns the default value provided

public long get as long ( string setting , long default value ) { string s value = get ( setting ) ; if ( s value = = null ) { return default value ; } try { return long parse long ( s value ) ; } catch ( number format exception e ) { throw new settings exception ( " failed to parse long setting [ " + setting + " ] with value [ " + s value + " ] " , e ) ; } }


just like assert null ( x ) , but additionally recording ( using thread record failure ) any assertion failed error thrown , so that the current testcase will fail

public void thread assert null ( object x ) { try { assert null ( x ) ; } catch ( assertion failed error t ) { thread record failure ( t ) ; throw t ; } }


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


get the preferred socket sendreceive buffer size to be used

protected int get preferred buffer size ( ) { return ( get block size ( ) + 4 ) * 12 ; }


return the number of days since the last usage relevant only if the last use date is not null

public long get num days use ( ) { return last use date = = null ? 0 : util days elapsed since ( last use date ) ; }


returns the prerequisite referred to by the specified attribute also checks whether the attribute is marked as executable and that the target referred to can actually be executed

public files to run provider get executable prerequisite ( string attribute name ) { attribute rule definition = attributes ( ) get attribute definition ( attribute name ) ; if ( rule definition = = null ) { throw new illegal state exception ( get rule class name for logging ( ) + " attribute " + attribute name + " is not defined " ) ; } if ( ! rule definition is executable ( ) ) { throw new illegal state exception ( get rule class name for logging ( ) + " attribute " + attribute name + " is not configured to be executable " ) ; } transitive info collection prerequisite = get prerequisite ( attribute name ) ; if ( prerequisite = = null ) { return null ; } files to run provider result = prerequisite get provider ( files to run provider class ) ; if ( result = = null | | result get executable ( ) = = null ) { attribute error ( attribute name , prerequisite get label ( ) + " does not refer to a valid executable target " ) ; } return result ; }


get the { @ link category path } associated with the namespace specified by the { @ link symbol path } , rooting it either at the category path root or the pdb category

category path get category ( symbol path symbol path , boolean add pdb root ) { category path category = add pdb root ? pdb category : category path root ; if ( symbol path ! = null ) { list < string > names = symbol path as list ( ) ; for ( string name : names ) { category = new category path ( category , name ) ; } } return category ; }


the total period of time in microseconds for how frequently the elasticsearch control group ' s access to cpu resources will be reallocated

private long get cgroup cpu acct cpu cfs period micros ( final string control group ) throws i o exception { return long parse long ( read sys fs cgroup cpu acct cpu cfs period ( control group ) ) ; }


like { @ link # resolve ( string , string ) } , but returns a { @ link uri } instead of a { @ link string }

public static uri resolve to uri ( @ nullable string base uri , @ nullable string reference uri ) { return uri parse ( resolve ( base uri , reference uri ) ) ; }


enables integrating hamcrest matchers that match primitive < code > long < code > arguments note that { @ link # arg that } will not work with primitive < code > long < code > matchers due to < code > null pointer exception < code > auto - unboxing caveat < p > see examples in javadoc for { @ link mockito hamcrest } class

public static long long that ( matcher < long > matcher ) { report matcher ( matcher ) ; return 0 ; }


renew a token from a file in the local filesystem , matching alias

public static void renew token file ( file token file , string file format , text alias , configuration conf ) throws i o exception , interrupted exception { credentials creds = credentials read token storage file ( token file , conf ) ; for ( token < ? > token : creds get all tokens ( ) ) { if ( token is managed ( ) & & match alias ( token , alias ) ) { long result = token renew ( conf ) ; log info ( " renewed " + token get kind ( ) + " : " + token get service ( ) + " until " + format date ( result ) ) ; } } do formatted write ( token file , file format , creds , conf ) ; }


returns the host this response was received from , or null if it was not set

public string get target host ( ) { return ( string ) get attribute ( http target host ) ; }


< code > optional bytes data = 1 ; < code >

public com google protobuf byte string get data ( ) { return instance get data ( ) ; }


returns a string indicating the current phase of the external merge

string get conflict type ( ) { return conflict type ; }


public string get path ( ) { return path ; }


returns vertices scaled , rotated , and offset by the polygon position

public float [ ] get transformed vertices ( ) { if ( ! dirty ) return world vertices ; dirty = false ; final float [ ] local vertices = this local vertices ; if ( world vertices = = null | | world vertices length < local vertices length ) world vertices = new float [ local vertices length ] ; final float [ ] world vertices = this world vertices ; final float position x = x ; final float position y = y ; final float origin x = this origin x ; final float origin y = this origin y ; final float scale x = this scale x ; final float scale y = this scale y ; final boolean scale = scale x ! = 1 | | scale y ! = 1 ; final float rotation = this rotation ; final float cos = math utils cos deg ( rotation ) ; final float sin = math utils sin deg ( rotation ) ; for ( int i = 0 , n = local vertices length ; i < n ; i + = 2 ) { float x = local vertices [ i ] - origin x ; float y = local vertices [ i + 1 ] - origin y ; / / scale if needed if ( scale ) { x * = scale x ; y * = scale y ; } / / rotate if needed if ( rotation ! = 0 ) { float old x = x ; x = cos * x - sin * y ; y = sin * old x + cos * y ; } world vertices [ i ] = position x + x + origin x ; world vertices [ i + 1 ] = position y + y + origin y ; } return world vertices ; }


inspect source changes and report differences

void report source index changes ( final set < string > last source indexes , final set < string > new source indexes ) { / / spam protection : only warn the first time if ( new source indexes is empty ( ) & & last source indexes is empty ( ) = = false ) { string message = " source did not resolve to any open indexes " ; logger warn ( " [ { } ] { } " , transform config get id ( ) , message ) ; transform auditor warning ( transform config get id ( ) , message ) ; } else { set < string > removed indexes = sets difference ( last source indexes , new source indexes ) ; set < string > added indexes = sets difference ( new source indexes , last source indexes ) ; if ( removed indexes size ( ) + added indexes size ( ) > audit concreted source index changes ) { string message = " source index resolve found more than " + audit concreted source index changes + " changes , [ " + removed indexes size ( ) + " ] removed indexes , [ " + added indexes size ( ) + " ] new indexes " ; logger debug ( " [ { } ] { } " , transform config get id ( ) , message ) ; transform auditor info ( transform config get id ( ) , message ) ; } else if ( removed indexes size ( ) + added indexes size ( ) > 0 ) { string message = " source index resolve found changes , removed indexes : " + removed indexes + " , new indexes : " + added indexes ; logger debug ( " [ { } ] { } " , transform config get id ( ) , message ) ; transform auditor info ( transform config get id ( ) , message ) ; } } }


rename a single file across snapshottable dirs

public void test rename file across snapshottable dirs ( ) throws exception { final path sdir 1 = new path ( " / dir 1 " ) ; final path sdir 2 = new path ( " / dir 2 " ) ; hdfs mkdirs ( sdir 1 ) ; hdfs mkdirs ( sdir 2 ) ; final path foo = new path ( sdir 2 , " foo " ) ; d f s test util create file ( hdfs , foo , blocksize , repl , seed ) ; snapshot test helper create snapshot ( hdfs , sdir 1 , " s 1 " ) ; snapshot test helper create snapshot ( hdfs , sdir 2 , " s 2 " ) ; hdfs create snapshot ( sdir 1 , " s 3 " ) ; final path newfoo = new path ( sdir 1 , " foo " ) ; hdfs rename ( foo , newfoo ) ; / / change the replication factor of foo hdfs set replication ( newfoo , repl 1 ) ; / / / dir 2 / snapshot / s 2 / foo should still work final path foo s 2 = snapshot test helper get snapshot path ( sdir 2 , " s 2 " , " foo " ) ; assert true ( hdfs exists ( foo s 2 ) ) ; file status status = hdfs get file status ( foo s 2 ) ; assert equals ( repl , status get replication ( ) ) ; final path foo s 3 = snapshot test helper get snapshot path ( sdir 1 , " s 3 " , " foo " ) ; assert false ( hdfs exists ( foo s 3 ) ) ; i node directory sdir 2 node = fsdir get i node ( sdir 2 to string ( ) ) as directory ( ) ; snapshot s 2 = sdir 2 node get snapshot ( d f s util string 2 bytes ( " s 2 " ) ) ; i node file sfoo = fsdir get i node ( newfoo to string ( ) ) as file ( ) ; assert equals ( s 2 get id ( ) , sfoo get diffs ( ) get last snapshot id ( ) ) ; }


the operation primary term of the primary note : { @ link sequence numbers # unassigned primary term } indicates primary term was not assigned by primary

public long get term ( ) { return term ; }


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


determine if ping frame should automatically be acknowledged or not

protected b auto ack ping frame ( boolean auto ack ping frame ) { enforce non codec constraints ( " auto ack ping frame " ) ; this auto ack ping frame = auto ack ping frame ; return self ( ) ; }


parses the classpath into a set of u r ls for testing

static set < url > parse class path ( string class path ) { string path separator = system get property ( " path separator " ) ; string file separator = system get property ( " file separator " ) ; string elements [ ] = class path split ( path separator ) ; set < url > url elements = new linked hash set < > ( ) ; / / order is already lost , but some filesystems have it for ( string element : elements ) { / / technically empty classpath element behaves like cwd / / so below is the " correct " code , however in practice with es , this is usually just a misconfiguration , / / from old shell scripts left behind or something : / / if ( element is empty ( ) ) { / / element = system get property ( " user dir " ) ; / / } / / instead we just throw an exception , and keep it clean if ( element is empty ( ) ) { throw new illegal state exception ( " classpath should not contain empty elements ! ( outdated shell script from a previous " + " version ? ) classpath = ' " + class path + " ' " ) ; } / / we should be able to just paths get ( ) each element , but unfortunately this is not the / / whole story on how classpath parsing works : if you want to know , start at sun misc launcher , / / be sure to stop before you tear out your eyes we just handle the " alternative " filename / / specification which java seems to allow , explicitly , right here if ( element starts with ( " / " ) & & " \ \ " equals ( file separator ) ) { / / " correct " the entry to become a normal entry / / change to correct file separators element = element replace ( " / " , " \ \ " ) ; / / if there is a drive letter , nuke the leading separator if ( element length ( ) > = 3 & & element char at ( 2 ) = = ' : ' ) { element = element substring ( 1 ) ; } } / / now just parse as ordinary file try { if ( element equals ( " / " ) ) { / / eclipse adds this to the classpath when running unit tests continue ; } url url = path utils get ( element ) to uri ( ) to u r l ( ) ; / / junit 4 childvm count if ( url elements add ( url ) = = false & & element ends with ( " jar " ) ) { throw new illegal state exception ( " jar hell ! " + system line separator ( ) + " duplicate jar [ " + element + " ] on classpath : " + class path ) ; } } catch ( malformed u r l exception e ) { / / should not happen , as we use the filesystem api throw new runtime exception ( e ) ; } } return collections unmodifiable set ( url elements ) ; }


checks the classes mentioned in the given keep specifications , printing notes if necessary

public void check class specifications ( list keep specifications ) { if ( keep specifications ! = null ) { / / go over all individual keep specifications for ( int index = 0 ; index < keep specifications size ( ) ; index + + ) { keep class specification keep class specification = ( keep class specification ) keep specifications get ( index ) ; / / is the keep specification more specific than a general / / wildcard ? keep name = keep class specification class name ; if ( keep name ! = null ) { / / doesn ' t the specification match any program classes ? class counter program class counter = new class counter ( ) ; program class pool accept ( class specification visitor factory create class pool visitor ( keep class specification , program class counter , null ) ) ; if ( program class counter get count ( ) = = 0 ) { / / print out notes about any matched library classes library class pool accept ( class specification visitor factory create class pool visitor ( keep class specification , this , null ) ) ; } } } } }


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

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


get the { @ link application home sub cluster } representing the mapping of the application to it ' s home sub - cluster

public abstract application home sub cluster get application home sub cluster ( ) ;


initialize this shader , causing all registered uniformsattributes to be fetched

public void init ( final shader program program , final renderable renderable ) { if ( locations ! = null ) throw new gdx runtime exception ( " already initialized " ) ; if ( ! program is compiled ( ) ) throw new gdx runtime exception ( program get log ( ) ) ; this program = program ; final int n = uniforms size ; locations = new int [ n ] ; for ( int i = 0 ; i < n ; i + + ) { final string input = uniforms get ( i ) ; final validator validator = validators get ( i ) ; final setter setter = setters get ( i ) ; if ( validator ! = null & & ! validator validate ( this , i , renderable ) ) locations [ i ] = - 1 ; else { locations [ i ] = program fetch uniform location ( input , false ) ; if ( locations [ i ] > = 0 & & setter ! = null ) { if ( setter is global ( this , i ) ) global uniforms add ( i ) ; else local uniforms add ( i ) ; } } if ( locations [ i ] < 0 ) { validators set ( i , null ) ; setters set ( i , null ) ; } } if ( renderable ! = null ) { final vertex attributes attrs = renderable mesh part mesh get vertex attributes ( ) ; final int c = attrs size ( ) ; for ( int i = 0 ; i < c ; i + + ) { final vertex attribute attr = attrs get ( i ) ; final int location = program get attribute location ( attr alias ) ; if ( location > = 0 ) attributes put ( attr get key ( ) , location ) ; } } }