returns a local artifact and puts its metadata into the action input map

private artifact create local artifact ( string path fragment , string contents , action input map inputs ) throws i o exception { path p = output root get root ( ) as path ( ) get relative ( path fragment ) ; file system utils write content ( p , standard charsets utf 8 , contents ) ; artifact a = actions test util create artifact ( output root , p ) ; path path = a get path ( ) ; / / caution : there ' s a race condition between stating the file and computing the / / digest we need to stat first , since we ' re using the stat to detect changes / / we follow symlinks here to be consistent with get digest inputs put with no dep owner ( a , file artifact value create from stat ( path , path stat ( symlinks follow ) , true ) ) ; return a ; }


gets the required project from the data store if project does not already exist in memory , it is loaded from the data store

public project get project ( long id ) { synchronized ( this ) { if ( projects contains key ( id ) ) { return projects get ( id ) ; } else { project project = load project ( id ) ; if ( project ! = null ) { projects put ( id , project ) ; } return project ; } } }


returns the closest target enemy first , units are checked , then tile entities

public static teamc closest target ( team team , float x , float y , float range , boolf < unit > unit pred , boolf < building > tile pred ) { if ( team = = team derelict ) return null ; unit unit = closest enemy ( team , x , y , range , unit pred ) ; if ( unit ! = null ) { return unit ; } else { return find enemy tile ( team , x , y , range , tile pred ) ; } }


assign a new , unique port to the test this method works by assigning ports from a valid port range as identified by the total number of concurrent test processes and the id of this test process each concurrent test process uses an isolated range , so it ' s not possible for multiple test processes to collide on the same port within the port range , ports are assigned in monotonic increasing order , wrapping around to the beginning of the range if needed as an extra precaution , the method attempts to bind to the port and immediately close it before returning it to the caller if the port cannot be bound , then it tries the next one in the range this provides some resiliency in case the port is otherwise occupied , such as a developer running other servers on the machine running the tests

public static synchronized int unique ( ) { if ( port range = = null ) { integer thread id = integer get integer ( " zookeeper junit threadid " ) ; port range = setup port range ( system get property ( " test junit threads " ) , thread id ! = null ? " threadid = " + thread id : system get property ( " sun java command " ) ) ; next port = port range get minimum ( ) ; } int candidate port = next port ; for ( ; ; ) { + + candidate port ; if ( candidate port > port range get maximum ( ) ) { candidate port = port range get minimum ( ) ; } if ( candidate port = = next port ) { throw new illegal state exception ( string format ( " could not assign port from range % s the entire range has been exhausted " , port range ) ) ; } try { server socket s = new server socket ( candidate port ) ; s close ( ) ; next port = candidate port ; log info ( " assigned port { } from range { } " , next port , port range ) ; return next port ; } catch ( i o exception e ) { log debug ( " could not bind to port { } from range { } attempting next port " , candidate port , port range , e ) ; } } }


writes a data set using a { @ link file output format } to a specified location this method adds a data sink to the program

public data sink < t > write ( file output format < t > output format , string file path ) { preconditions check not null ( file path , " file path must not be null " ) ; preconditions check not null ( output format , " output format must not be null " ) ; output format set output file path ( new path ( file path ) ) ; return output ( output format ) ; }


public list < object > get pk values by default ( ) throws s q l exception { / / current version 1 2 only support postgresql map < string , column meta > pk meta map = get table meta ( ) get primary key map ( ) ; column meta pk meta = pk meta map values ( ) iterator ( ) next ( ) ; string column def = pk meta get column def ( ) ; / / sample : nextval ( ' test id seq ' : : regclass ) string seq = org apache commons lang string utils substring between ( column def , " ' " , " ' " ) ; string function = org apache commons lang string utils substring between ( column def , " " , " ( " ) ; if ( string utils is blank ( seq ) ) { throw new should never happen exception ( " get primary key value failed , cause column def is " + column def ) ; } return get pk values by sequence ( new sql sequence expr ( " ' " + seq + " ' " , function ) ) ; }


get a snapshot of the cluster configuration

public cluster config state config snapshot ( ) { return config snapshot ; }


returns the current value for the current thread

public final v get ( ) { internal thread local map thread local map = internal thread local map get ( ) ; object v = thread local map indexed variable ( index ) ; if ( v ! = internal thread local map unset ) { return ( v ) v ; } return initialize ( thread local map ) ; }


this method is handling the illegal access exceptions of field get ( )

public final object access field ( field field , object object ) { try { object = field get ( object ) ; } catch ( null pointer exception npex ) { throw new null key field exception ( " unable to access field " + field + " on object " + object ) ; } catch ( illegal access exception iaex ) { throw new runtime exception ( " this should not happen since we call set accesssible ( true ) in the ctor " + " fields : " + field + " obj : " + object ) ; } return object ; }


given arbitrary rectangle , return a rectangle with upper - left start and positive width and height

public static rectangle abs rect ( rectangle src ) { rectangle dest = new rectangle ( 0 , 0 , 0 , 0 ) ; if ( src width < 0 ) { dest x = src x + src width + 1 ; dest width = - src width ; } else { dest x = src x ; dest width = src width ; } if ( src height < 0 ) { dest y = src y + src height + 1 ; dest height = - src height ; } else { dest y = src y ; dest height = src height ; } return dest ; }


allocates shards to nodes in the cluster an implementation of this method should : - assign unassigned shards - relocate shards that cannot stay on a node anymore - relocate shards to find a good shard balance in the cluster

void allocate ( routing allocation allocation ) ;


determine whether the transactional resource is ready for local optimizations


protected object get target bean ( ) { assert not null ( this application context , " application context must no be null " ) ; return this application context get bean ( this bean name ) ; }


efficient method to check if a range of bits is set , or not set

public boolean is range ( int start , int end , boolean value ) { if ( end < start | | start < 0 | | end > size ) { throw new illegal argument exception ( ) ; } if ( end = = start ) { return true ; / / empty range matches } end - - ; / / will be easier to treat this as the last actually set bit - - inclusive int first int = start / 32 ; int last int = end / 32 ; for ( int i = first int ; i < = last int ; i + + ) { int first bit = i > first int ? 0 : start & 0x 1 f ; int last bit = i < last int ? 31 : end & 0x 1 f ; / / ones from first bit to last bit , inclusive int mask = ( 2 < < last bit ) - ( 1 < < first bit ) ; / / return false if we ' re looking for 1s and the masked bits [ i ] isn ' t all 1s ( that is , / / equals the mask , or we ' re looking for 0s and the masked portion is not all 0s if ( ( bits [ i ] & mask ) ! = ( value ? mask : 0 ) ) { return false ; } } return true ; }


convenience method to get this array as a double if it contains a single element

public double get as double ( ) { if ( elements size ( ) = = 1 ) { return elements get ( 0 ) get as double ( ) ; } throw new illegal state exception ( ) ; }


reads the next word of the configuration in the ' next word ' field

private void read next word ( ) throws i o exception { read next word ( false ) ; }


advance the iterator to exactly { @ code target } and return whether { @ code target } has a value { @ code target } must be greater than or equal to the current doc id and must be a valid doc id , ie & ge ; 0 and & lt ; { @ code max doc }

public abstract boolean advance exact ( int target ) throws i o exception ;


public object mapper get mapper ( ) { return mapper ; }


creates list of users with given input array

public void create users with list input test ( ) { list < user > body = null ; / / api create users with list input ( body ) ; / / todo : test validations }


annotates the current position in the output log by using the given annotation if the implementation doesn ' t support annotated output log , this method might be no - op

default void annotate ( console note ann ) throws i o exception { ann encode to ( get logger ( ) ) ; }


convenience method for constructing composite formats given operation ( op ) , object class ( inf ) , set of paths ( p ) return : { @ code ( tbl ( < inf > , < p 1 > ) , tbl ( < inf > , < p 2 > ) , , tbl ( < inf > , < pn > ) ) }

public static string compose ( string op , class < ? extends input format > inf , string path ) { final string infname = inf get name ( ) ; string buffer ret = new string buffer ( op + ' ( ' ) ; for ( string p : path ) { compose ( infname , p , ret ) ; ret append ( ' , ' ) ; } ret set char at ( ret length ( ) - 1 , ' ) ' ) ; return ret to string ( ) ; }


recursively import every path under path

private long import dir ( ) throws i o exception { preconditions check argument ( status is directory ( ) ) ; long total count of entries written = 0 ; final path base path = status get path ( ) ; final metadata store ms = get store ( ) ; log info ( " importing directory { } " , base path ) ; try ( bulk operation state operation state = ms initiate bulk write ( bulk operation state operation type import , base path ) ) { long count of files written = 0 ; long count of dirs written = 0 ; remote iterator < s 3 a located file status > it = get filesystem ( ) list files and empty directories force non auth ( base path , true ) ; while ( it has next ( ) ) { s 3 a located file status located = it next ( ) ; s 3 a file status child ; final path path = located get path ( ) ; final boolean is directory = located is directory ( ) ; if ( is directory ) { child = dynamo d b metadata store make dir status ( path , located get owner ( ) ) ; dir cache add ( path ) ; / / and update the dir count count of dirs written + + ; } else { child = located to s 3 a file status ( ) ; } int parents written = put parents if not present ( child , operation state ) ; log debug ( " wrote { } parent entries " , parents written ) ; / / we don ' t blindly overwrite any existing file entry in s 3 guard with a / / new one , because that may lose the version information / / instead we merge them if ( ! is directory ) { final path metadata existing entry = s 3 guard get with ttl ( ms , path , null , false , true ) ; if ( existing entry ! = null ) { final s 3 a file status existing status = existing entry get file status ( ) ; if ( existing status is file ( ) ) { / / source is also a file / / we only worry about an update if the timestamp is different , final string existing etag = existing status get e tag ( ) ; final string child etag = child get e tag ( ) ; if ( child get modification time ( ) ! = existing status get modification time ( ) | | existing status get len ( ) ! = child get len ( ) | | existing etag = = null | | ! existing etag equals ( child etag ) ) { / / files are potentially different , though a modtime change / / can just be a clock skew problem / / so if the etag is unchanged , we propagate any version i d if ( child etag equals ( existing etag ) ) { / / copy over any version id child set version id ( existing status get version id ( ) ) ; } } else { / / the entry modtimes match child = null ; } } } if ( child ! = null ) { count of files written + + ; } } if ( child ! = null ) { / / there ' s an entry to add / / log entry spaced to same width string t = is directory ? " dir " : " file " ; if ( verbose ) { log info ( " { } { } " , t , path ) ; } else { log debug ( " { } { } " , t , path ) ; } s 3 guard put with ttl ( ms , new path metadata ( child ) , get filesystem ( ) get ttl time provider ( ) , operation state ) ; total count of entries written + + ; } } log info ( " updated s 3 guard with { } files and { } directory entries " , count of files written , count of dirs written ) ; / / here all entries are imported / / tell the store that everything should be marked as auth if ( authoritative ) { log info ( " marking directory tree { } as authoritative " , base path ) ; ms mark as authoritative ( base path , operation state ) ; } } return total count of entries written ; }


tests to make sure we ' re getting human readable quota exception messages test for @ link { n s quota exceeded exception , d s quota exceeded exception }

public void test d s quota exceeded exception is human readable ( ) { integer bytes = 1024 ; try { throw new d s quota exceeded exception ( bytes , bytes ) ; } catch ( d s quota exceeded exception e ) { assert equals ( " the disk space quota is exceeded : quota = 1024 b = 1 kb " + " but diskspace consumed = 1024 b = 1 kb " , e get message ( ) ) ; } }


called before the azure storage sdk sends a request

public void event occurred ( sending request event event ) { sending request ( event ) ; }


flushes this writer implementations of this method should ensure that all buffered characters are written to the target

public abstract void flush ( ) throws i o exception ;


public < t extends renderable provider > void analyze ( base light light , camera camera , iterable < t > renderable providers ) ;


defines and displays a component for resolving merge conflicts

void set merge component ( j component component , string component i d ) { if ( current component ! = null ) { card layout remove layout component ( current component ) ; } current component = component ; conflict panel add ( component , component i d ) ; card layout show ( conflict panel , component i d ) ; }


loads the data from the disk into this object

public synchronized void load ( ) throws i o exception { xml file file = get config file ( ) ; if ( file exists ( ) ) { try { sites replace by ( ( ( persisted list ) file unmarshal ( sites ) ) to list ( ) ) ; } catch ( i o exception e ) { logger log ( level warning , " failed to load " + file , e ) ; } boolean default site exists = false ; for ( update site site : sites ) { / / replace the legacy site with the new site if ( site is legacy default ( ) ) { sites remove ( site ) ; } else if ( id default equals ( site get id ( ) ) ) { default site exists = true ; } } if ( ! default site exists ) { sites add ( create default update site ( ) ) ; } } else { if ( sites is empty ( ) ) { / / if there aren ' t already any update sources , add the default one / / to maintain compatibility with existing update center configuration , create the default one as specified by update center configuration sites add ( create default update site ( ) ) ; } } site data loading = false ; }


method to create the { @ link data type } based upon the type indices of the calling convention , return type , and arguments list

protected data type apply function ( calling convention calling convention param , boolean has this pointer param ) throws pdb exception , cancelled exception { / / string func name = applicator get category utils ( ) get next anonymous function name ( ) ; / / function definition data type function definition = new function definition data type ( / / applicator get category utils ( ) get anonymous functions category ( ) , func name , / / applicator get data type manager ( ) ) ; this calling convention = calling convention param ; this has this pointer = has this pointer param ; return applier = get return type applier ( ) ; args list applier = get args list applier ( ) ; apply or defer for dependencies ( ) ; / / apply internal ( ) ; / / 20190725 remove for second pass in applicator / / / / todo : what handler should we really use ? / / data type resolved function definition = applicator resolve ( function definition ) ; / / / / if ( resolved function definition = = null ) { / / applicator get log ( ) append msg ( " function definition type not resolved for " + function definition get name ( ) ) ; / / return null ; / / } / / if ( ! ( resolved function definition instanceof function definition ) ) { / / / / error can this happen ? / / / / remove what was just created ? / / applicator get log ( ) append msg ( " non - function resolved for " + function definition get name ( ) ) ; / / return null ; / / } / / / / only update if successful / / applicator get category utils ( ) increment next anonymous function name ( ) ; / / return resolved function definition ; return function definition ; }


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


like assert not equals , but fails at the end of the test ( during tear down )

public void verify not equals ( object s 1 , object s 2 ) { stb verify not equals ( s 1 , s 2 ) ; }


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


returns the relative path name ( dot notation ) for this field

public string get component path name ( ) { string parent path = parent get component path name ( ) ; return get component name ( parent path ) ; }


find the fields constant that matches name , or null if its not found

public static fields find by name ( string name ) { return by name get ( name ) ; }


transition from in maintenance to decommissioned

public void test transition to decommission ( ) throws i o exception { log info ( " starting test transition to decommission " ) ; final int num namenodes = 1 ; final int num datanodes = 4 ; start cluster ( num namenodes , num datanodes ) ; final path file = new path ( " test transition to decommission dat " ) ; final int replicas = 3 ; file system file sys = get cluster ( ) get file system ( 0 ) ; f s namesystem ns = get cluster ( ) get namesystem ( 0 ) ; write file ( file sys , file , replicas , 25 ) ; datanode info node outof service = take node outof service ( 0 , get first block first replica uuid ( file sys , file ) , long max value , null , admin states in maintenance ) ; d f s client client = get dfs client ( 0 ) ; assert equals ( " all datanodes must be alive " , num datanodes , client datanode report ( datanode report type live ) length ) ; / / test 1 , verify the replica in in maintenance state isn ' t in located block check with retry ( ns , file sys , file , replicas - 1 , node outof service ) ; take node outof service ( 0 , node outof service get datanode uuid ( ) , 0 , null , admin states decommissioned ) ; / / test 2 after decommission has completed , the replication count is / / replicas + 1 which includes the decommissioned node check with retry ( ns , file sys , file , replicas + 1 , null ) ; / / test 3 , put the node in service , replication count should restore put node in service ( 0 , node outof service get datanode uuid ( ) ) ; check with retry ( ns , file sys , file , replicas , null ) ; cleanup file ( file sys , file ) ; }


generate dynamic delegate for byte buddy

private static boolean prepare j r e instrumentation ( plugin finder plugin finder , map < string , byte [ ] > classes type map ) throws plugin exception { type pool type pool = type pool default of ( bootstrap instrument boost class get class loader ( ) ) ; list < abstract class enhance plugin define > bootstrap class match defines = plugin finder get bootstrap class match define ( ) ; for ( abstract class enhance plugin define define : bootstrap class match defines ) { for ( instance methods intercept point point : define get instance methods intercept points ( ) ) { if ( point is override args ( ) ) { generate delegator ( classes type map , type pool , instance method with override args delegate template , point get methods interceptor ( ) ) ; } else { generate delegator ( classes type map , type pool , instance method delegate template , point get methods interceptor ( ) ) ; } } for ( constructor intercept point point : define get constructors intercept points ( ) ) { generate delegator ( classes type map , type pool , constructor delegate template , point get constructor interceptor ( ) ) ; } for ( static methods intercept point point : define get static methods intercept points ( ) ) { if ( point is override args ( ) ) { generate delegator ( classes type map , type pool , static method with override args delegate template , point get methods interceptor ( ) ) ; } else { generate delegator ( classes type map , type pool , static method delegate template , point get methods interceptor ( ) ) ; } } } return bootstrap class match defines size ( ) > 0 ; }


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


returns whether the device is required to be idle

public boolean is idle required ( ) { return ( requirements & device idle ) ! = 0 ; }


test the property ' array array of integer '

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


return the namespace id inherent in the currently running namenode if no namenode is running , return the namespace id of the master namenode storage directory the upgrade utilities initialize ( ) method must be called once before calling this method

public static int get current namespace i d ( mini d f s cluster cluster ) throws i o exception { if ( cluster ! = null ) { return cluster get name node rpc ( ) version request ( ) get namespace i d ( ) ; } return namenode storage namespace i d ; }


return a single domain of the given domain id

public timeline domain get domain ( @ context http servlet request req , @ context http servlet response res , @ path param ( " domain id " ) string domain id ) { init ( res ) ; domain id = parse str ( domain id ) ; if ( domain id = = null | | domain id length ( ) = = 0 ) { throw new bad request exception ( " domain id is not specified " ) ; } timeline domain domain = null ; try { domain = timeline data manager get domain ( parse str ( domain id ) , get user ( req ) ) ; } catch ( exception e ) { log error ( " error getting domain " , e ) ; throw new web application exception ( e , response status internal server error ) ; } if ( domain = = null ) { throw new not found exception ( " timeline domain [ " + domain id + " ] is not found " ) ; } return domain ; }


public map < string , big decimal > get map number ( ) { return map number ; }


void receive config info ( final string config info ) ;


the number of try items for this instance if non - zero , then these appear as the tries array just after the insns in this instance

public short get tries size ( ) { return tries size ; }


actually execute the given { @ code runnable } ( which may be a user - supplied task or a wrapper around a user - supplied task ) with the given executor

protected void do execute ( executor concurrent executor , @ nullable task decorator task decorator , runnable runnable ) throws rejected execution exception { concurrent executor execute ( task decorator ! = null ? task decorator decorate ( runnable ) : runnable ) ; }


a query that matches documents within an range of terms

public static range query builder range query ( string name ) { return new range query builder ( name ) ; }


simulates a user click in the code browser plugin

private void simulate button press ( final code browser plugin cbp ) { run swing ( ( ) - > click ( cbp , 1 ) ) ; }


the smallest integer allowed for this xml attribute only makes sense if the format includes format flags : : integer < code > optional int 3 2 min int = 2 ; < code >

public int get min int ( ) { return min int ; }


calculate additional empty files to add based on the existing manifest paths

iterable < path fragment > get extra paths ( set < path fragment > manifest paths ) ;


test that get additional block ( ) and close ( ) are idempotent this allows a client to safely retry a call and still produce a correct file see hdfs - 3031

public void test idempotent allocate block and close ( ) throws exception { final string src = " / test idempotent allocate block " ; path file = new path ( src ) ; conf set int ( d f s config keys dfs block size key , 4096 ) ; final mini d f s cluster cluster = new mini d f s cluster builder ( conf ) build ( ) ; try { cluster wait active ( ) ; file system fs = cluster get file system ( ) ; namenode protocols pre spy n n = cluster get name node rpc ( ) ; namenode protocols spy n n = spy ( pre spy n n ) ; d f s client client = new d f s client ( null , spy n n , conf , null ) ; / / make the call to add block ( ) get called twice , as if it were retried / / due to an ipc issue do answer ( new answer < located block > ( ) { private int get block count ( located block ret ) throws i o exception { located blocks lb = cluster get name node rpc ( ) get block locations ( src , 0 , long max value ) ; assert equals ( lb get last located block ( ) get block ( ) , ret get block ( ) ) ; return lb get located blocks ( ) size ( ) ; } @ override public located block answer ( invocation on mock invocation ) throws throwable { log info ( " called add block : " + arrays to string ( invocation get arguments ( ) ) ) ; / / call first time / / warp not replicated yet exception with remote exception as rpc does final located block ret ; try { ret = ( located block ) invocation call real method ( ) ; } catch ( not replicated yet exception e ) { throw new remote exception ( e get class ( ) get name ( ) , e get message ( ) ) ; } final int block count = get block count ( ret ) ; / / retrying should result in a new block at the end of the file / / ( abandoning the old one ) / / it should not have not replicated yet exception final located block ret 2 ; try { ret 2 = ( located block ) invocation call real method ( ) ; } catch ( not replicated yet exception e ) { throw new assertion error ( " unexpected exception " , e ) ; } final int block count 2 = get block count ( ret 2 ) ; / / we shouldn ' t have gained an extra block by the rpc assert equals ( block count , block count 2 ) ; return ret 2 ; } } ) when ( spy n n ) add block ( mockito any string ( ) , mockito any string ( ) , mockito < extended block > any ( ) , mockito < datanode info [ ] > any ( ) , mockito any long ( ) , mockito < string [ ] > any ( ) , mockito < enum set < add block flag > > any ( ) ) ; do answer ( new answer < boolean > ( ) { @ override public boolean answer ( invocation on mock invocation ) throws throwable { / / complete ( ) may return false a few times before it returns / / true we want to wait until it returns true , and then / / make it retry one more time after that log info ( " called complete : " ) ; if ( ! ( boolean ) invocation call real method ( ) ) { log info ( " complete call returned false , not faking a retry rpc " ) ; return false ; } / / we got a successful close call it again to check idempotence try { boolean ret = ( boolean ) invocation call real method ( ) ; log info ( " complete call returned true , faked second rpc " + " returned : " + ret ) ; return ret ; } catch ( throwable t ) { log error ( " idempotent retry threw exception " , t ) ; throw t ; } } } ) when ( spy n n ) complete ( mockito any string ( ) , mockito any string ( ) , mockito < extended block > any ( ) , any long ( ) ) ; output stream stm = client create ( file to string ( ) , true ) ; try { append test util write ( stm , 0 , 10000 ) ; stm close ( ) ; stm = null ; } finally { i o utils cleanup with logger ( log , stm ) ; } / / make sure the mock was actually properly injected mockito verify ( spy n n , mockito at least once ( ) ) add block ( mockito any string ( ) , mockito any string ( ) , mockito < extended block > any ( ) , mockito < datanode info [ ] > any ( ) , mockito any long ( ) , mockito < string [ ] > any ( ) , mockito < enum set < add block flag > > any ( ) ) ; mockito verify ( spy n n , mockito at least once ( ) ) complete ( mockito any string ( ) , mockito any string ( ) , mockito < extended block > any ( ) , any long ( ) ) ; append test util check ( fs , file , 10000 ) ; } finally { cluster shutdown ( ) ; } }


constructs an { @ code array list multimap } with the same mappings as the specified multimap this method will soon be deprecated in favor of { @ code multimap builder hash keys ( ) array list values ( ) build ( multimap ) }

public static < k , v > array list multimap < k , v > create ( multimap < ? extends k , ? extends v > multimap ) { return new array list multimap < > ( multimap ) ; }


returns the media types for this condition excluding negated expressions

public set < media type > get consumable media types ( ) { set < media type > result = new linked hash set < > ( ) ; for ( consume media type expression expression : this expressions ) { if ( ! expression is negated ( ) ) { result add ( expression get media type ( ) ) ; } } return result ; }


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


override this if you want to return a typeface from a font family

public typeface fetch font ( string font family ) { return null ; }


the certificate chain , as a new byte array generally should be pem - encoded

public byte [ ] get certificate chain ( ) { return arrays copy of ( certificate chain , certificate chain length ) ; }


returns { @ code true } if information about disk usage and shard sizes should also be returned

public boolean include disk info ( ) { return this include disk info ; }


sets the bounds on the given view if the view doesn ' t already have those bounds ( or if ' force ' is supplied )

private static void apply bounds to view ( view view , int left , int top , int right , int bottom , @ nullable rect padding , boolean force ) { final int width = right - left ; final int height = bottom - top ; if ( padding ! = null & & ! ( view instanceof host ) ) { view set padding ( padding left , padding top , padding right , padding bottom ) ; } if ( force | | view get measured height ( ) ! = height | | view get measured width ( ) ! = width ) { view measure ( make measure spec ( width , view measure spec exactly ) , make measure spec ( height , view measure spec exactly ) ) ; } if ( force | | view get left ( ) ! = left | | view get top ( ) ! = top | | view get right ( ) ! = right | | view get bottom ( ) ! = bottom ) { view layout ( left , top , right , bottom ) ; } }


sets the maximum progress that the animation will end at when playing or looping

public void set max progress ( @ float range ( from = 0f , to = 1f ) float end progress ) { lottie drawable set max progress ( end progress ) ; }


execute the given single statement , and return the execution result the statement can be ddldmldqlshowdescribeexplainuse for dml and dql , this method returns table result once the job has been submitted for ddl and dcl statements , table result is returned once the operation has finished

table result execute sql ( string statement ) ;


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

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


use alternate mutation accessors instead

public java util map < string , phone number > get mutable double map ( ) { return internal get mutable double map ( ) get mutable map ( ) ; }


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

builder head ( request predicate predicate , handler function < server response > handler function ) ;


returns the address for the given symbol if the { @ link pdb applicator options } address remap option is turned on is turned on , it will attempt to map the address to a new address in the current program

address get address ( address ms symbol symbol ) { return get address ( symbol get segment ( ) , symbol get offset ( ) ) ; }


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

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


public string get sc a e t h flow points ( ) { return sc a e t h flow points ; }


returns a { @ link database provider } that provides an in - memory database

public static database provider get in memory database provider ( ) { return new default database provider ( new s q lite open helper ( / * context = * / null , / * name = * / null , / * factory = * / null , / * version = * / 1 ) { @ override public void on create ( s q lite database db ) { / / do nothing } @ override public void on upgrade ( s q lite database db , int old version , int new version ) { / / do nothing } } ) ; }


creates a new driver instance the specified capabilities are to be passed to the driver constructor

web driver new instance ( capabilities capabilities ) ;


a convenience method for getting the window for < code > component < code > and then calling { @ link # get instance for window ( window ) }

public static synchronized docking window manager get instance ( component component ) { window window = window utilities window for component ( component ) ; while ( window ! = null ) { docking window manager window manager = get instance for window ( window ) ; if ( window manager ! = null ) { return window manager ; } window = window get owner ( ) ; } return null ; }


public builder wait safe mode ( boolean val ) { this wait safe mode = val ; return this ; }


return true if there is a need for checksum verification

protected synchronized boolean need checksum ( ) { return verify checksum & & sum ! = null ; }


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


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case success : return is set success ( ) ; } throw new illegal state exception ( ) ; }


public put role response put role ( final put role request request , final request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , security request converters : : put role , options , put role response : : from x content , empty set ( ) ) ; }


public void set min resource ( resource min resource ) { this min resource = min resource ; }


because derby ' s database table name is uppercase , you need to do a conversion to the insert statement that was inserted

public static string insert statement correction ( string sql ) { matcher matcher = insert into pattern matcher ( sql ) ; if ( ! matcher find ( ) ) { return sql ; } final string target = matcher group ( 0 ) ; final string upper case = target to upper case ( ) replace ( " ` " , " " ) ; return sql replace first ( insert into values , upper case ) replace ( " ; " , " " ) ; }


get the set of values of the target expression

public set < string > get target values ( ) { return target values ; }


create the throttling policy this will be called from the s 3 a retry policy constructor , so subclasses must assume they are not initialized

protected retry policy create throttle retry policy ( final configuration conf ) { return exponential backoff retry ( conf get int ( retry throttle limit , retry throttle limit default ) , conf get time duration ( retry throttle interval , retry throttle interval default , time unit milliseconds ) , time unit milliseconds ) ; }


returns true if folder has complete list of children

boolean visited ( ) { return visited ; }


true means that this line has been matched against another line , < b > regardless of whether the two lines are the same or not < b >


the attributes of this element < code > repeated aapt pb xml attribute attribute = 4 ; < code >

public int get attribute count ( ) { return attribute size ( ) ; }


return { @ code true } if objects of { @ code source type } can be converted to the { @ code target type } the type descriptors provide additional context about the source and target locations where conversion would occur , often object fields or property locations if this method returns { @ code true } , it means { @ link # convert ( object , type descriptor , type descriptor ) } is capable of converting an instance of { @ code source type } to { @ code target type } special note on collections , arrays , and maps types : for conversion between collection , array , and map types , this method will return { @ code true } even though a convert invocation may still generate a { @ link conversion exception } if the underlying elements are not convertible callers are expected to handle this exceptional case when working with collections and maps

boolean can convert ( @ nullable type descriptor source type , type descriptor target type ) ;


resolve $ { } placeholders in the given text , replacing them with corresponding property values as resolved by { @ link # get property } unresolvable placeholders with no default value will cause an illegal argument exception to be thrown

string resolve required placeholders ( string text ) throws illegal argument exception ;


an expectation for checking web element with given locator has attribute which contains specific value

public static expected condition < boolean > attribute contains ( final by locator , final string attribute , final string value ) { return new expected condition < boolean > ( ) { @ override public boolean apply ( web driver driver ) { return get attribute or css value ( driver find element ( locator ) , attribute ) map ( seen - > seen contains ( value ) ) or else ( false ) ; } @ override public string to string ( ) { return string format ( " value found by % s to contain \ " % s \ " " , locator , value ) ; } } ; }


the tap square will no longer be used for the current touch

public void invalidate tap square ( ) { touch down x = - 1 ; touch down y = - 1 ; }


returns buffer count for original buffer file

public int get original buffer count ( ) { return original buf count ; }


private void layout changed ( string layout name ) { if ( layout transition manager ! = null ) { new task launcher ( new set layout task ( viewer , layout transition manager , layout name ) , null , 1000 ) ; } }


expands a data object from the store into an record object default store data type is a string override if additional serialization is required

private static < t > t from string ( string data , class < t > clazz ) { if ( data equals ( " null " ) ) { return null ; } else if ( clazz = = string class ) { return ( t ) data ; } else if ( clazz = = long class | | clazz = = long class ) { return ( t ) long value of ( data ) ; } else if ( clazz = = integer class | | clazz = = int class ) { return ( t ) integer value of ( data ) ; } else if ( clazz = = double class | | clazz = = double class ) { return ( t ) double value of ( data ) ; } else if ( clazz = = float class | | clazz = = float class ) { return ( t ) float value of ( data ) ; } else if ( clazz = = boolean class | | clazz = = boolean class ) { return ( t ) boolean value of ( data ) ; } else if ( clazz is enum ( ) ) { return ( t ) enum value of ( ( class < enum > ) clazz , data ) ; } return null ; }


cause the previous suggestion to be selected , wrapping if applicable

protected void select prev ( ) { int index = list get selected index ( ) ; int size = list model get size ( ) ; if ( index > = 0 ) { index - - ; } if ( index < 0 ) { index + = size ; } select ( index ) ; }


set a custom scheme for the target service , for example ' https '

public api client set scheme ( string scheme ) { this scheme = scheme ; return this ; }


called by { @ link executor } to perform the task

@ override void run ( ) throws asynchronous execution ;


allocate a number of workers based on the input param

private int allocate resources ( int worker num ) { int allocated worker num = 0 ; for ( int i = 0 ; i < worker num ; + + i ) { if ( allocate resource ( default slot resource profile ) is present ( ) ) { + + allocated worker num ; } else { break ; } } return allocated worker num ; }


public string type name ( ) { return " annotation " ; }


restricted constructors to ensure v 1 or v 2 , not both

public static s 3 list request v 1 ( list objects request request ) { return new s 3 list request ( request , null ) ; }


tsi handshaker new handshaker ( @ nullable string authority ) ;


the value assigned to this element < code > optional aapt pb item item = 3 ; < code >

com android aapt resources item get item ( ) ;


increments , logs and then returns the block id

private long next block id ( block type block type ) throws i o exception { assert has write lock ( ) ; check name node safe mode ( " cannot get next block id " ) ; final long block id = block manager next block id ( block type ) ; get edit log ( ) log allocate block id ( block id ) ; / / nb : callers sync the log return block id ; }


static annotation strategy strategy for ( annotation annotation ) { objects require non null ( annotation , " annotation " ) ; class < ? extends annotation > annotation type = annotation annotation type ( ) ; ensure retained at runtime ( annotation type ) ; ensure is binding annotation ( annotation type ) ; if ( annotation type get methods ( ) length = = 0 ) { return new annotation type strategy ( annotation type , annotation ) ; } return new annotation instance strategy ( annotation ) ; }


return the mapping paths that are not patterns

public set < string > get direct paths ( ) { if ( is empty path mapping ( ) ) { return empty path pattern ; } set < string > result = collections empty set ( ) ; for ( string pattern : this patterns ) { if ( ! this path matcher is pattern ( pattern ) ) { result = ( result is empty ( ) ? new hash set < > ( 1 ) : result ) ; result add ( pattern ) ; } } return result ; }


testcase to reproduce act - 950 ( https : jira codehaus orgbrowse a c t - 950 )

public void test find active activity id process with error event and sub process ( ) { process instance process instance = process engine get runtime service ( ) start process instance by key ( " error event subprocess " ) ; list < string > active activities = runtime service get active activity ids ( process instance get id ( ) ) ; assert that ( active activities ) has size ( 5 ) ; list < task > tasks = task service create task query ( ) list ( ) ; assert that ( tasks ) has size ( 2 ) ; task parallel user task = null ; for ( task task : tasks ) { assert that ( task get name ( ) ) as ( " expected : < parallel user task > or < main user task > but was < " + task get name ( ) + " > " ) is in ( " parallel user task " , " main user task " ) ; if ( task get name ( ) equals ( " parallel user task " ) ) { parallel user task = task ; } } assert that ( parallel user task ) is not null ( ) ; task service complete ( parallel user task get id ( ) ) ; execution execution = runtime service create execution query ( ) process instance id ( process instance get id ( ) ) activity id ( " subprocess 1 wait before error " ) single result ( ) ; runtime service trigger ( execution get id ( ) ) ; active activities = runtime service get active activity ids ( process instance get id ( ) ) ; assert that ( active activities ) has size ( 4 ) ; tasks = task service create task query ( ) list ( ) ; assert that ( tasks ) has size ( 2 ) ; task before error user task = null ; for ( task task : tasks ) { assert that ( task get name ( ) ) as ( " expected : < before error > or < main user task > but was < " + task get name ( ) + " > " ) is in ( " before error " , " main user task " ) ; if ( task get name ( ) equals ( " before error " ) ) { before error user task = task ; } } assert that ( before error user task ) is not null ( ) ; task service complete ( before error user task get id ( ) ) ; active activities = runtime service get active activity ids ( process instance get id ( ) ) ; assert that ( active activities ) has size ( 2 ) ; tasks = task service create task query ( ) list ( ) ; assert that ( tasks ) has size ( 2 ) ; task after error user task = null ; for ( task task : tasks ) { assert that ( task get name ( ) ) as ( " expected : < after error > or < main user task > but was < " + task get name ( ) + " > " ) is in ( " after error " , " main user task " ) ; if ( task get name ( ) equals ( " after error " ) ) { after error user task = task ; } } assert that ( after error user task ) is not null ( ) ; task service complete ( after error user task get id ( ) ) ; tasks = task service create task query ( ) list ( ) ; assert that ( tasks ) has size ( 1 ) ; assert that ( tasks get ( 0 ) get name ( ) ) is equal to ( " main user task " ) ; active activities = runtime service get active activity ids ( process instance get id ( ) ) ; assert that ( active activities ) has size ( 1 ) ; assert that ( active activities get ( 0 ) ) is equal to ( " main user task " ) ; task service complete ( tasks get ( 0 ) get id ( ) ) ; assert process ended ( process instance get id ( ) ) ; }


returns the exception that caused the job to fail this is the first root exception that was not recoverable and triggered job failure

string get failure cause as string ( ) ;


return a new instance with the give ( reduced ) set of columns

default local property < e > constrain ( set < e > columns ) { if ( ! columns equals ( get columns ( ) ) ) { throw new illegal argument exception ( string format ( " cannot constrain % s with % s " , this , columns ) ) ; } return this ; }


moves the clock forward , for tests that require moving the clock forward it is the transport subclass ' s responsibility to implement this method

protected void advance clock ( long offset , time unit unit ) { throw new unsupported operation exception ( ) ; }


writes 3 applications each with a different run id and version for the same { cluster , user , flow } they should be getting inserted into one record in the flow activity table with 3 columns , one per run id

public void test flow activity table one flow multiple run ids ( ) throws i o exception { string cluster = " test many runs flow activity cluster 1 " ; string user = " test many runs flow activity c user 1 " ; string flow = " flow activity test flow name " ; string flow version 1 = " a122110f135bc4 " ; long runid 1 = 11111111111l ; string flow version 2 = " a12222222222c4 " ; long runid 2 = 2222222222222l ; string flow version 3 = " a1333333333c4 " ; long runid 3 = 3333333333333l ; timeline entities te = new timeline entities ( ) ; long app created time = 1425016501000l ; timeline entity entity app 1 = test flow data generator get flow app 1 ( app created time ) ; te add entity ( entity app 1 ) ; h base timeline writer impl hbi = null ; configuration c 1 = util get configuration ( ) ; try { hbi = new h base timeline writer impl ( ) ; hbi init ( c 1 ) ; user group information remote user = user group information create remote user ( user ) ; string app name = " application 11888888888 1111 " ; hbi write ( new timeline collector context ( cluster , user , flow , flow version 1 , runid 1 , app name ) , te , remote user ) ; / / write an application with to this flow but a different runid / version te = new timeline entities ( ) ; te add entity ( entity app 1 ) ; app name = " application 11888888888 2222 " ; hbi write ( new timeline collector context ( cluster , user , flow , flow version 2 , runid 2 , app name ) , te , remote user ) ; / / write an application with to this flow but a different runid / version te = new timeline entities ( ) ; te add entity ( entity app 1 ) ; app name = " application 11888888888 3333 " ; hbi write ( new timeline collector context ( cluster , user , flow , flow version 3 , runid 3 , app name ) , te , remote user ) ; hbi flush ( ) ; } finally { if ( hbi ! = null ) { hbi close ( ) ; } } / / check flow activity check flow activity table several runs ( cluster , user , flow , c 1 , flow version 1 , runid 1 , flow version 2 , runid 2 , flow version 3 , runid 3 , app created time ) ; / / use the timeline reader to verify data h base timeline reader impl hbr = null ; try { hbr = new h base timeline reader impl ( ) ; hbr init ( c 1 ) ; hbr start ( ) ; set < timeline entity > entities = hbr get entities ( new timeline reader context ( cluster , null , null , null , null , timeline entity type yarn flow activity to string ( ) , null ) , new timeline entity filters builder ( ) entity limit ( 10l ) build ( ) , new timeline data to retrieve ( ) ) ; assert equals ( 1 , entities size ( ) ) ; for ( timeline entity e : entities ) { flow activity entity flow activity = ( flow activity entity ) e ; assert equals ( cluster , flow activity get cluster ( ) ) ; assert equals ( user , flow activity get user ( ) ) ; assert equals ( flow , flow activity get flow name ( ) ) ; long day ts = h base timeline schema utils get top of the day timestamp ( app created time ) ; assert equals ( day ts , flow activity get date ( ) get time ( ) ) ; set < flow run entity > flow runs = flow activity get flow runs ( ) ; assert equals ( 3 , flow runs size ( ) ) ; for ( flow run entity flow run : flow runs ) { long run id = flow run get run id ( ) ; string version = flow run get version ( ) ; if ( run id = = runid 1 ) { assert equals ( flow version 1 , version ) ; } else if ( run id = = runid 2 ) { assert equals ( flow version 2 , version ) ; } else if ( run id = = runid 3 ) { assert equals ( flow version 3 , version ) ; } else { fail ( " unknown run id : " + run id ) ; } } } } finally { if ( hbr ! = null ) { hbr close ( ) ; } } }


public map < variable reference expression , sort order > get orderings map ( ) { return orderings ; }


parses the given buffer as an iso9660 timestamp and returns it as a human readable string representation invalid buffers that are still big enough to hold a timestamp are still parsed and converted , albeit they are marked as invalid when presented to the user

protected string create date time string ( byte [ ] byte array ) { if ( byte array = = null | | byte array length < 17 ) { return " invalid ( truncated or missing ) " ; } string s 1 , s 2 , s 3 , s 4 , s 5 , s 6 , s 7 ; / / time zone offset from gmt in 15 minute intervals , / / starting at interval - 48 ( west ) and running up to / / interval 52 ( east ) int time offset = byte array [ byte array length - 1 ] ; string b string = new string ( byte array ) ; s 1 = b string substring ( 0 , 4 ) ; / / year 1 to 9999 s 2 = b string substring ( 4 , 6 ) ; / / month 1 to 12 s 3 = b string substring ( 6 , 8 ) ; / / day 1 to 31 s 4 = b string substring ( 8 , 10 ) ; / / hour 0 to 23 s 5 = b string substring ( 10 , 12 ) ; / / minute 0 to 59 s 6 = b string substring ( 12 , 14 ) ; / / second 0 to 59 s 7 = b string substring ( 14 , 16 ) ; / / ms 0 to 99 / / validate strings first boolean valid buffer = is digits string valid ( s 1 ) & & is digits string valid ( s 2 ) & & is digits string valid ( s 3 ) & & is digits string valid ( s 4 ) & & is digits string valid ( s 5 ) & & is digits string valid ( s 6 ) & & is digits string valid ( s 7 ) ; try { / / the buffer contains an invalid date / time local date time of ( integer parse int ( s 1 ) , integer parse int ( s 2 ) , integer parse int ( s 3 ) , integer parse int ( s 4 ) , integer parse int ( s 5 ) , integer parse int ( s 6 ) ) ; } catch ( number format exception | date time exception e ) { valid buffer = false ; } / / the buffer contains an invalid timezone offset if ( time offset < - 48 | | time offset > 52 ) { valid buffer = false ; } / * * time zone offset from gmt in 15 minute intervals , * starting at interval - 48 ( west ) and running up to * interval 52 ( east ) * / int timezone integral = time offset / 4 ; int timezone fractional = ( math abs ( time offset ) % 4 ) * 15 ; string builder builder = new string builder ( ) ; if ( ! valid buffer ) { builder append ( " invalid ( " ) ; } builder append ( string format ( " % s - % s - % s % s : % s : % s % s gmt % c % 0 2d % 0 2d " , s 1 , s 2 , s 3 , s 4 , s 5 , s 6 , s 7 , timezone integral < 0 ? ' - ' : ' + ' , timezone integral , timezone fractional ) ) ; if ( ! valid buffer ) { builder append ( " ) " ) ; } return builder to string ( ) ; }


create { @ link test input topic } to be used for piping records to topic uses provided start timestamp and auto advance parameter for records

public final < k , v > test input topic < k , v > create input topic ( final string topic name , final serializer < k > key serializer , final serializer < v > value serializer , final instant start timestamp , final duration auto advance ) { return new test input topic < > ( this , topic name , key serializer , value serializer , start timestamp , auto advance ) ; }


returns the number of logical segment descriptors

public short get logical segment descriptor count ( ) { return c seg log ; }


returns a new collection consisting of the elements of input collection transformed by the given transformer if the input transformer is null , the result is an empty list

public static < e1 , e2 > collection < e2 > collect ( final collection < e1 > input collection , final transformer < e1 , e2 > transformer ) { list < e2 > answer = new array list < > ( ) ; if ( input collection = = null | | transformer = = null ) return answer ; for ( e1 e 1 : input collection ) { answer add ( transformer transform ( e 1 ) ) ; } return answer ; }


returns the number of signals received during command execution , if available

public long get signals received ( ) { return resource usage proto get nsignals ( ) ; }


returns the section header with the specified name , or null if no section exists with that name

public elf section header get section ( string name ) { list < elf section header > list = new array list < > ( ) ; for ( elf section header section header : section headers ) { if ( name ! = null & & name equals ( section header get name as string ( ) ) ) { list add ( section header ) ; } } if ( list size ( ) = = 0 ) { return null ; } if ( list size ( ) > 1 ) { throw new runtime exception ( " > 1 section with name of " + name ) ; } return list get ( 0 ) ; }


get the first offset for the given partitions this method does not change the current consumer position of the partitions

public map < topic partition , long > beginning offsets ( collection < topic partition > partitions , duration timeout ) { acquire and ensure open ( ) ; try { return fetcher beginning offsets ( partitions , time timer ( timeout ) ) ; } finally { release ( ) ; } }


public double delta ( ) { return delta ; }


public string insn arg string ( dalv insn insn ) { register spec list regs = insn get registers ( ) ; return regs get ( 0 ) reg string ( ) + " , " + regs get ( 1 ) reg string ( ) ; }


wait until an attempt has reached a specified state the timeout is 40 seconds

public void wait for state ( application attempt id attempt id , r m app attempt state final state ) throws interrupted exception { wait for state ( attempt id , final state , timeout ms for attempt ) ; }


public unmarshaller get unmarshaller ( ) { return this unmarshaller ; }


add the given annotated packages in a batch

public local session factory builder add packages ( string annotated packages ) { for ( string annotated package : annotated packages ) { add package ( annotated package ) ; } return this ; }


sets the maximum number of queued control frames that are allowed before the connection is closed this allows to protected against various attacks that can lead to high cpu memory usage if the remote - peer floods us with frames that would have us produce control frames , but stops to read from the underlying socket { @ code 0 } means no protection should be applied

protected b encoder enforce max queued control frames ( int max queued control frames ) { enforce non codec constraints ( " encoder enforce max queued control frames " ) ; this max queued control frames = object util check positive or zero ( max queued control frames , " max queued control frames " ) ; return self ( ) ; }


get native memory address wrapped by the given { @ link byte buffer }

static long get byte buffer address ( byte buffer buffer ) { preconditions check not null ( buffer , " buffer is null " ) ; preconditions check argument ( buffer is direct ( ) , " can ' t get address of a non - direct byte buffer " ) ; try { return unsafe get long ( buffer , buffer address field offset ) ; } catch ( throwable t ) { throw new error ( " could not access direct byte buffer address field " , t ) ; } }


returns mapping from exec path to root root will be null if the path has no containing package

map < path fragment , root > find package roots for files ( iterable < path fragment > exec paths ) throws interrupted exception ;


shorthand for { @ link query builder # build ( ) build ( ) } { @ link query # unique ( ) unique ( ) } ; see { @ link query # unique ( ) } for details to execute a query more than once , you should build the query and keep the { @ link query } object for efficiency reasons

public t unique ( ) { return build ( ) unique ( ) ; }


the list of subtasks for this parent task

list < task > get sub tasks ( string parent task id ) ;


alternative to { @ link # annotation introspector ( annotation introspector ) } that allows combining with rather than replacing the currently set introspector , e g via { @ link annotation introspector pair # pair ( annotation introspector , annotation introspector ) }

public jackson 2 object mapper builder annotation introspector ( function < annotation introspector , annotation introspector > pairing function ) { this annotation introspector = pairing function apply ( this annotation introspector ) ; return this ; }


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


reports whether int x exactly equals float y

static boolean int equals float ( starlark int x , starlark float y ) { double yf = y to double ( ) ; return ! double is na n ( yf ) & & compare int and double ( x , yf ) = = 0 ; }


returns the timeout for the cached ssl session objects , in seconds

public abstract long session timeout ( ) ;


get the number of elements in this queue added via one of the { @ link # add ( byte buf ) } methods

protected final int size ( ) { return buf and listener pairs size ( ) ; }


gets a new target address from the untried target list if it can find one not already in the disassembled address set that is passed in

private address get next target ( address set body , array list < address > untried target list ) { address new target = null ; / / no new target , try to get it from the target list if ( ! untried target list is empty ( ) ) { iterator < address > iter = untried target list iterator ( ) ; while ( iter has next ( ) ) { address possible target = iter next ( ) ; if ( ! body contains ( possible target ) ) { new target = possible target ; iter remove ( ) ; break ; } } } return new target ; }


return true if this category object is equal to o

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


determine the deselect type should be handled or not

public boolean contains ( de select type type ) { return types contains ( type ) ; }


disposes of all resources this vertex buffer object uses

public void dispose ( ) { gl20 gl = gdx gl 2 0 ; gl gl bind buffer ( gl20 gl array buffer , 0 ) ; gl gl delete buffer ( buffer handle ) ; buffer handle = 0 ; if ( owns buffer ) buffer utils dispose unsafe byte buffer ( byte buffer ) ; }


writes out the given local info the written string will be something like : " local var " : ljavalang string ; , " some signature " " local var " : ljavalang string ; " local var " : v , " some signature " null : ljavalang string ; , " some signature " null : v , " some signature " one of name , type or signature must be non - null

public static void write local ( @ nonnull indenting writer writer , @ nullable string name , @ nullable string type , @ nullable string signature ) throws i o exception { if ( name ! = null ) { reference formatter write string reference ( writer , name ) ; } else { writer write ( " null " ) ; } writer write ( ' : ' ) ; if ( type ! = null ) { writer write ( type ) ; } else { writer write ( " v " ) ; } if ( signature ! = null ) { writer write ( " , " ) ; reference formatter write string reference ( writer , signature ) ; } }


adds a self - unregistering listener to a task it works as a normal listener except it retrieves a partial response and unregister itself from the task if timeout occurs

public static < response extends action response , task extends stored async task < response > > void add completion listener ( thread pool thread pool , task task , action listener < stored async response < response > > listener , time value timeout ) { if ( timeout get millis ( ) < = 0 ) { get current result ( task , listener ) ; } else { task add completion listener ( listener timeouts wrap with timeout ( thread pool , timeout , thread pool names search , action listener wrap ( r - > listener on response ( new stored async response < > ( r , task get expiration time millis ( ) ) ) , e - > listener on response ( new stored async response < > ( e , task get expiration time millis ( ) ) ) ) , wrapper - > { / / timeout was triggered task remove completion listener ( wrapper ) ; get current result ( task , listener ) ; } ) ) ; } }


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


creates a new instance of { @ link schema coder } each time it should create a new instance , as it will be called on multiple nodes


public boolean is checked ( int position ) { return touch listener is checked ( position ) ; }


creates and returns the task manager services

public static task manager services from configuration ( task manager services configuration task manager services configuration , permanent blob service permanent blob service , metric group task manager metric group , executor service io executor , fatal error handler fatal error handler ) throws exception { / / pre - start checks check temp dirs ( task manager services configuration get tmp dir paths ( ) ) ; final task event dispatcher task event dispatcher = new task event dispatcher ( ) ; / / start the i / o manager , it will create some temp directories final i o manager io manager = new i o manager async ( task manager services configuration get tmp dir paths ( ) ) ; final shuffle environment < ? , ? > shuffle environment = create shuffle environment ( task manager services configuration , task event dispatcher , task manager metric group , io executor ) ; final int listening data port = shuffle environment start ( ) ; final kv state service kv state service = kv state service from configuration ( task manager services configuration ) ; kv state service start ( ) ; final unresolved task manager location unresolved task manager location = new unresolved task manager location ( task manager services configuration get resource i d ( ) , task manager services configuration get external address ( ) , / / we expose the task manager location with the listening port / / iff the external data port is not explicitly defined task manager services configuration get external data port ( ) > 0 ? task manager services configuration get external data port ( ) : listening data port ) ; final broadcast variable manager broadcast variable manager = new broadcast variable manager ( ) ; final task slot table < task > task slot table = create task slot table ( task manager services configuration get number of slots ( ) , task manager services configuration get task executor resource spec ( ) , task manager services configuration get timer service shutdown timeout ( ) , task manager services configuration get page size ( ) , io executor ) ; final job table job table = default job table create ( ) ; final job leader service job leader service = new default job leader service ( unresolved task manager location , task manager services configuration get retrying registration configuration ( ) ) ; final string [ ] state root directory strings = task manager services configuration get local recovery state root directories ( ) ; final file [ ] state root directory files = new file [ state root directory strings length ] ; for ( int i = 0 ; i < state root directory strings length ; + + i ) { state root directory files [ i ] = new file ( state root directory strings [ i ] , local state sub directory root ) ; } final task executor local state stores manager task state manager = new task executor local state stores manager ( task manager services configuration is local recovery enabled ( ) , state root directory files , io executor ) ; final boolean fail on jvm metaspace oom error = task manager services configuration get configuration ( ) get boolean ( core options fail on user class loading metaspace oom ) ; final boolean check class loader leak = task manager services configuration get configuration ( ) get boolean ( core options check leaked classloader ) ; final library cache manager library cache manager = new blob library cache manager ( permanent blob service , blob library cache manager default class loader factory ( task manager services configuration get class loader resolve order ( ) , task manager services configuration get always parent first loader patterns ( ) , fail on jvm metaspace oom error ? fatal error handler : null , check class loader leak ) ) ; return new task manager services ( unresolved task manager location , task manager services configuration get managed memory size ( ) get bytes ( ) , io manager , shuffle environment , kv state service , broadcast variable manager , task slot table , job table , job leader service , task state manager , task event dispatcher , io executor , library cache manager ) ; }


return the default lazy - init flag for the document that ' s currently parsed

public string get lazy init ( ) { return this lazy init ; }


convert a remote iterator over file status results into a list the utility equivalents in commons collection and guava cannot be used here , as this is a different interface , one whose operators can throw i o es

public static list < located file status > to list ( remote iterator < located file status > iterator ) throws i o exception { array list < located file status > list = new array list < > ( ) ; while ( iterator has next ( ) ) { list add ( iterator next ( ) ) ; } return list ; }


get the number of properties on this page

int get size ( ) { return key set size ( ) ; }


synchronize client metadata state in some file system implementations such as hdfs metadata synchronization is essential to guarantee consistency of read requests particularly in ha setting

public void msync ( ) throws i o exception , unsupported operation exception { throw new unsupported operation exception ( get class ( ) get canonical name ( ) + " does not support method msync " ) ; }


this is called by the a ms started on this node to unregister from the rm this method does the initial authorization and then forwards the request to the application instance specific intercepter chain

public finish application master response finish application master ( finish application master request request ) throws yarn exception , i o exception { long start time = clock get time ( ) ; try { request interceptor chain wrapper pipeline = authorize and get interceptor chain ( ) ; log info ( " finishing application master for { } tracking url : { } " , pipeline get application attempt id ( ) , request get tracking url ( ) ) ; finish application master response response = pipeline get root interceptor ( ) finish application master ( request ) ; long end time = clock get time ( ) ; this metrics succeeded finish a m requests ( end time - start time ) ; log info ( " finish a m finished with is unregistered = { } in { } ms for { } " , response get is unregistered ( ) , end time - start time , pipeline get application attempt id ( ) ) ; return response ; } catch ( throwable t ) { this metrics incr failed finish a m requests ( ) ; throw t ; } }


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

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


finds the first file that exists with the relative path in any module

public static resource file find data file in any module ( string relative path ) { check app initialized ( ) ; return app find module data file ( relative path ) ; }


public int get cache count ( ) { return m memory cache size ( ) ; }


bridge to controller method - level annotations

public < a extends annotation > boolean has method annotation ( class < a > annotation type ) { return servlet invocable handler method this has method annotation ( annotation type ) ; }


returns true if the bit is set in the specified index

public boolean get ( int index ) { preconditions check argument ( index < bit length & & index > = 0 ) ; int byte index = index > > > 3 ; byte current = memory segment get ( offset + byte index ) ; return ( current & ( 1 < < ( index & byte index mask ) ) ) ! = 0 ; }


find the nearest overridden { @ link method method } from the inherited class

static method find nearest overridden method ( method overrider ) { class < ? > declaring class = overrider get declaring class ( ) ; method overridden method = null ; for ( class < ? > inherited type : get all inherited types ( declaring class ) ) { overridden method = find overridden method ( overrider , inherited type ) ; if ( overridden method ! = null ) { break ; } } return overridden method ; }


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


upgrade table actions include remove dump columns , add new columns and change column types all the actions above will be done by the description order

private void upgrade table ( ) { if ( has new unique or not null column ( ) ) { / / need to drop the table and create new one cause unique column can not be added , and null data can not be migrated create or upgrade table ( m table model , m db , true ) ; / / add foreign keys of the table collection < associations info > associations info = get association info ( m table model get class name ( ) ) ; for ( associations info info : associations info ) { if ( info get association type ( ) = = const model many to one | | info get association type ( ) = = const model one to one ) { if ( info get class holds foreign key ( ) equals ignore case ( m table model get class name ( ) ) ) { string associated table name = d b utility get table name by class name ( info get associated class name ( ) ) ; add foreign key column ( m table model get table name ( ) , associated table name , m table model get table name ( ) , m db ) ; } } } } else { has constraint changed = false ; remove columns ( find columns to remove ( ) ) ; add columns ( find columns to add ( ) ) ; change columns type ( find column types to change ( ) ) ; change columns constraints ( ) ; } }


test serialization of outer number types

public void fake outer number serialize ( big decimal body , handler < async result < big decimal > > result handler ) { delegate fake outer number serialize ( body , result handler ) ; }


public api response < model api response > upload file with required file with http info ( long pet id , file required file , string additional metadata ) throws api exception { okhttp 3 call local var call = upload file with required file validate before call ( pet id , required file , additional metadata , null ) ; type local var return type = new type token < model api response > ( ) { } get type ( ) ; return local var api client execute ( local var call , local var return type ) ; }


must be called at the end of each subclass ' s constructor this method performs the " real " initialization ; we can ' t put this in the constructor because , in the case where futures are already complete , we would not initialize the subclass before calling { @ link # collect value from non cancelled future } as this is called after the subclass is constructed , we ' re guaranteed to have properly initialized the subclass

final void init ( ) { / / corner case : list is empty if ( futures is empty ( ) ) { handle all completed ( ) ; return ; } / / note : if we ever want to use a custom executor here , have a look at combined future as we ' ll / / need to handle rejected execution exception if ( all must succeed ) { / / we need fail fast , so we have to keep track of which future failed so we can propagate / / the exception immediately / / register a listener on each future in the list to update the state of this future / / note that if all the futures on the list are done prior to completing this loop , the last / / call to add listener ( ) will callback to set one value ( ) , transitively call our cleanup / / listener , and set this futures to null / / this is not actually a problem , since the foreach only needs this futures to be non - null / / at the beginning of the loop int i = 0 ; for ( final listenable future < ? extends input t > future : futures ) { final int index = i + + ; future add listener ( new runnable ( ) { @ override public void run ( ) { try { if ( future is cancelled ( ) ) { / / clear futures prior to cancelling children this sets our own state but lets / / the input futures keep running , as some of them may be used elsewhere futures = null ; cancel ( false ) ; } else { collect value from non cancelled future ( index , future ) ; } } finally { / * * " null " means : there is no need to access ` futures ` again during * ` process completed ` because we ' re reading each value during a call to * handle one input done * / decrement count and maybe complete ( null ) ; } } } , direct executor ( ) ) ; } } else { / * * we ' ll call the user callback or collect the values only when all inputs complete , * regardless of whether some failed this lets us avoid calling expensive methods like * future get ( ) when we don ' t need to ( specifically , for when all complete ( ) call * ( ) ) , and it * lets all futures share the same listener * * we store ` local futures ` inside the listener because ` this futures ` might be nulled out by * the time the listener runs for the final future - - at which point we need to check all * inputs for exceptions * if * we ' re collecting values if we ' re not , then the listener doesn ' t * need access to the futures again , so we can just pass ` null ` * * todo ( b / 112550045 ) : allocating a single , cheaper listener is ( i think ) only an optimization * if we make some other optimizations , this one will no longer be necessary the optimization * could actually hurt in some cases , as it forces us to keep all inputs in memory until the * final input completes * / final immutable collection < ? extends future < ? extends input t > > local futures = collects values ? futures : null ; runnable listener = new runnable ( ) { @ override public void run ( ) { decrement count and maybe complete ( local futures ) ; } } ; for ( listenable future < ? extends input t > future : futures ) { future add listener ( listener , direct executor ( ) ) ; } } }


check if executor is ready to accept tasks this method becomes the critical one since 1 536 , which introduces the on - demand creation of executor threads callers should use this method instead of { @ link # is alive ( ) } , which would be incorrect for non - started threads or running { @ link asynchronous execution }

public boolean is active ( ) { lock read lock ( ) lock ( ) ; try { return ! started | | asynchronous execution ! = null | | is alive ( ) ; } finally { lock read lock ( ) unlock ( ) ; } }


static inferred type create ( string descriptor ) { if ( uninitialized prefix equals ( descriptor ) ) { return uninitialized ; } char first char = descriptor char at ( 0 ) ; if ( first char = = ' l ' | | first char = = ' [ ' ) { / / reference , array return new auto value bytecode type inference inferred type ( descriptor ) ; } switch ( descriptor ) { case " z " : return boolean ; case " b " : return byte ; case " i " : return int ; case " f " : return float ; case " j " : return long ; case " d " : return double ; case " top " : return top ; case " null " : return null ; case " uninitialized this " : return uninitialized this ; default : throw new runtime exception ( " invalid descriptor : " + descriptor ) ; } }


returns the operation code for gap - free dup operations with a single instruction support by their type sizes on stack top

public static int get type size aligned dup opcode ( immutable list < type > elements to dup ) { return get type size aligned dup opcode ( elements to dup , immutable list of ( ) ) ; }


return the interval as a date time unit if applicable , regardless of how it was configured if this returns { @ code null } then it means that the interval is expressed as a fixed { @ link time value } and may be accessed via { @ link # try interval as fixed unit ( ) }

date time unit try interval as calendar unit ( ) { if ( interval type equals ( interval type enum calendar ) | | interval type equals ( interval type enum legacy date histo ) ) { return date histogram aggregation builder date field units get ( date histogram interval to string ( ) ) ; } return null ; }


resolves the given { @ code type } against the type context represented by this type for example : { @ code new type token < list < string > > ( ) { } resolve type ( list class get method ( " get " , int class ) get generic return type ( ) ) = > string class }

public final type token < ? > resolve type ( type type ) { check not null ( type ) ; / / being conservative here because the user could use resolve type ( ) to resolve a type in an / / invariant context return of ( get invariant type resolver ( ) resolve type ( type ) ) ; }


returns an image descriptor for the image file at the given plug - in relative path

public static image descriptor get image descriptor ( string path ) { return image descriptor from plugin ( plugin id , path ) ; }


adds a single { @ link starlark builtin doc } entry to { @ code modules } representing the given { @ code module class } , if it is a documented module

private static void collect starlark module ( class < ? > module class , map < string , starlark builtin doc > modules ) { if ( module class equals ( top level module class ) ) { / / the top level module doc is a special case and is handled separately return ; } starlark builtin module annotation = preconditions check not null ( module class get annotation ( starlark builtin class ) ) ; if ( module annotation documented ( ) ) { starlark builtin doc previous module doc = modules get ( module annotation name ( ) ) ; if ( previous module doc = = null ) { modules put ( module annotation name ( ) , new starlark builtin doc ( module annotation , module annotation name ( ) , module class ) ) ; } else { / / handle a strange corner - case : if module class has a subclass which is also / / annotated with { @ link starlark builtin } with the same name , and also has the same / / module - level docstring , then the subclass takes precedence / / ( this is useful if one module is a " common " stable module , and its subclass is / / an experimental module that also supports all stable methods ) validate compatible modules ( previous module doc get class object ( ) , module class ) ; if ( previous module doc get class object ( ) is assignable from ( module class ) ) { / / the new module is a subclass of the old module , so use the subclass modules put ( module annotation name ( ) , new starlark builtin doc ( module annotation , / * title = * / module annotation name ( ) , module class ) ) ; } } } }


creates a builder for the { @ link external sorter }

public static < e > external sorter builder < e > new builder ( memory manager memory manager , abstract invokable parent task , type serializer < e > serializer , type comparator < e > comparator ) { return new external sorter builder < > ( check not null ( memory manager ) , check not null ( parent task ) , check not null ( serializer ) , check not null ( comparator ) ) ; }


parse a precision that can be expressed as an integer or a distance measure like " 1km " , " 1 0m " the precision is expressed as a number between 1 and 12 and indicates the length of geohash used to represent geo points

public static int parse precision ( x content parser parser ) throws i o exception , elasticsearch parse exception { x content parser token token = parser current token ( ) ; if ( token equals ( x content parser token value number ) ) { return x content map values node integer value ( parser int value ( ) ) ; } else { string precision = parser text ( ) ; try { / / we want to treat simple integer strings as precision levels , not distances return x content map values node integer value ( precision ) ; } catch ( number format exception e ) { / / try to parse as a distance value final int parsed precision = geo utils geo hash levels for precision ( precision ) ; try { return check precision range ( parsed precision ) ; } catch ( illegal argument exception e 2 ) { / / this happens when distance too small , so precision > 12 we ' d like to see the original string throw new illegal argument exception ( " precision too high [ " + precision + " ] " , e 2 ) ; } } } }


returns true if the supplied class has an annotation of the given type

static public boolean is annotation present ( class c , class < ? extends java lang annotation annotation > annotation type ) { annotation [ ] annotations = get annotations ( c ) ; for ( annotation annotation : annotations ) { if ( annotation get annotation type ( ) equals ( annotation type ) ) return true ; } return false ; }


public get data frame analytics response get data frame analytics ( get data frame analytics request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , m l request converters : : get data frame analytics , options , get data frame analytics response : : from x content , collections empty set ( ) ) ; }


public void timeout ( time value timeout ) { this timeout = timeout ; }


times and records the duration of event should not throw exceptions , for that use the { @ link # time ( callable ) } method

public < t > t time supplier ( supplier < t > event ) { final long start time = clock get tick ( ) ; try { return event get ( ) ; } finally { update ( clock get tick ( ) - start time ) ; } }


return the list of configured resource transformers

public list < resource transformer > get resource transformers ( ) { return this resource transformers ; }


build a new < code > argument captor < code > note that an < code > argument captor < code > < b > doesn ' t do any type checks < b > it is only there to avoid casting in your code this might however change ( type checks could be added ) in a future major release

public static < u , s extends u > argument captor < u > for class ( class < s > clazz ) { return new argument captor < u > ( clazz ) ; }


returns either an { @ link animatable path value } or an { @ link animatable split dimension path value }

static animatable value < point f , point f > parse split path ( json reader reader , lottie composition composition ) throws i o exception { animatable path value path animation = null ; animatable float value x animation = null ; animatable float value y animation = null ; boolean has expressions = false ; reader begin object ( ) ; while ( reader peek ( ) ! = json reader token end object ) { switch ( reader select name ( names ) ) { case 0 : path animation = animatable path value parser parse ( reader , composition ) ; break ; case 1 : if ( reader peek ( ) = = json reader token string ) { has expressions = true ; reader skip value ( ) ; } else { x animation = animatable value parser parse float ( reader , composition ) ; } break ; case 2 : if ( reader peek ( ) = = json reader token string ) { has expressions = true ; reader skip value ( ) ; } else { y animation = animatable value parser parse float ( reader , composition ) ; } break ; default : reader skip name ( ) ; reader skip value ( ) ; } } reader end object ( ) ; if ( has expressions ) { composition add warning ( " lottie doesn ' t support expressions " ) ; } if ( path animation ! = null ) { return path animation ; } return new animatable split dimension path value ( x animation , y animation ) ; }


sets the minimum decode interval decoding of intermediate results won ' t happen more often that interval ms if another intermediate result comes too soon , it will be decoded only after interval ms since the last decode if there were more intermediate results in between , only the last one gets decoded

public t set min decode interval ms ( int interval ms ) { m min decode interval ms = interval ms ; return get this ( ) ; }


creates a replaying connectable observable with a size and time bound buffer

public static < t > connectable observable < t > create ( observable source < t > source , final long max age , final time unit unit , final scheduler scheduler , final int buffer size , boolean eager truncate ) { return create ( source , new scheduled replay supplier < > ( buffer size , max age , unit , scheduler , eager truncate ) ) ; }


removes the given method note that removing a method that is still being referenced can cause unpredictable effects

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


by default only the edge set is processed for the computation of degree when this flag is set an additional join is performed against the vertex set in order to output vertices with an out - degree of zero

public vertex out degree < k , vv , ev > set include zero degree vertices ( boolean include zero degree vertices ) { this include zero degree vertices set ( include zero degree vertices ) ; return this ; }


use { @ link # get initial resource versions map ( ) } instead

public java util map < java lang string , java lang string > get initial resource versions ( ) { return get initial resource versions map ( ) ; }


void rename schema ( session session , catalog schema name source , string target ) ;


returns { @ link call options } with the corresponding { @ link client calls stub type } set

public static call options set stub type ( call options call options , stub type stub type ) { return call options with option ( client calls stub type option , stub type internal type ) ; }


checks that thread does not terminate within the given millisecond delay

void assert thread stays alive ( thread thread , long millis ) { try { / / no need to optimize the failing case via thread join delay ( millis ) ; assert true ( thread is alive ( ) ) ; } catch ( interrupted exception ie ) { fail ( " unexpected interrupted exception " ) ; } }


skips exactly bytes count bytes in input stream unless end of stream is reached first

public static long skip ( final input stream input stream , final long bytes count ) throws i o exception { preconditions check not null ( input stream ) ; preconditions check argument ( bytes count > = 0 ) ; long to skip = bytes count ; while ( to skip > 0 ) { final long skipped = input stream skip ( to skip ) ; if ( skipped > 0 ) { to skip - = skipped ; continue ; } if ( input stream read ( ) ! = - 1 ) { to skip - - ; continue ; } return bytes count - to skip ; } return bytes count ; }


public void run from config ( server config config ) throws i o exception , admin server exception { log info ( " starting server " ) ; file txn snap log txn log = null ; try { try { metrics provider = metrics provider bootstrap start metrics provider ( config get metrics provider class name ( ) , config get metrics provider configuration ( ) ) ; } catch ( metrics provider life cycle exception error ) { throw new i o exception ( " cannot boot metrics provider " + config get metrics provider class name ( ) , error ) ; } server metrics metrics provider initialized ( metrics provider ) ; provider registry initialize ( ) ; / / note that this thread isn ' t going to be doing anything else , / / so rather than spawning another thread , we will just call / / run ( ) in this thread / / create a file logger url from the command line args txn log = new file txn snap log ( config data log dir , config data dir ) ; jvm pause monitor jvm pause monitor = null ; if ( config jvm pause monitor to run ) { jvm pause monitor = new jvm pause monitor ( config ) ; } final zoo keeper server zk server = new zoo keeper server ( jvm pause monitor , txn log , config tick time , config min session timeout , config max session timeout , config listen backlog , null , config initial config ) ; txn log set server stats ( zk server server stats ( ) ) ; / / registers shutdown handler which will be used to know the / / server error or shutdown state changes final count down latch shutdown latch = new count down latch ( 1 ) ; zk server register server shutdown handler ( new zoo keeper server shutdown handler ( shutdown latch ) ) ; / / start admin server admin server = admin server factory create admin server ( ) ; admin server set zoo keeper server ( zk server ) ; admin server start ( ) ; boolean need start z k server = true ; if ( config get client port address ( ) ! = null ) { cnxn factory = server cnxn factory create factory ( ) ; cnxn factory configure ( config get client port address ( ) , config get max client cnxns ( ) , config get client port listen backlog ( ) , false ) ; cnxn factory startup ( zk server ) ; / / zk server has been started so we don ' t need to start it again in secure cnxn factory need start z k server = false ; } if ( config get secure client port address ( ) ! = null ) { secure cnxn factory = server cnxn factory create factory ( ) ; secure cnxn factory configure ( config get secure client port address ( ) , config get max client cnxns ( ) , config get client port listen backlog ( ) , true ) ; secure cnxn factory startup ( zk server , need start z k server ) ; } container manager = new container manager ( zk server get z k database ( ) , zk server first processor , integer get integer ( " znode container check interval ms " , ( int ) time unit minutes to millis ( 1 ) ) , integer get integer ( " znode container max per minute " , 10000 ) , long get long ( " znode container max never used interval ms " , 0 ) ) ; container manager start ( ) ; z k audit provider add z k start stop audit log ( ) ; / / watch status of zoo keeper server it will do a graceful shutdown / / if the server is not running or hits an internal error shutdown latch await ( ) ; shutdown ( ) ; if ( cnxn factory ! = null ) { cnxn factory join ( ) ; } if ( secure cnxn factory ! = null ) { secure cnxn factory join ( ) ; } if ( zk server can shutdown ( ) ) { zk server shutdown ( true ) ; } } catch ( interrupted exception e ) { / / warn , but generally this is ok log warn ( " server interrupted " , e ) ; } finally { if ( txn log ! = null ) { txn log close ( ) ; } if ( metrics provider ! = null ) { try { metrics provider stop ( ) ; } catch ( throwable error ) { log warn ( " error while stopping metrics " , error ) ; } } } }


helper method to configure the bearer token

public void set bearer token ( string bearer token ) { for ( request interceptor api authorization : api authorizations values ( ) ) { if ( api authorization instanceof http bearer auth ) { ( ( http bearer auth ) api authorization ) set bearer token ( bearer token ) ; return ; } } throw new runtime exception ( " no bearer authentication configured ! " ) ; }


returns { @ code true } if the { @ link item # wipeout } permission is enabled , { @ code false } otherwise the " wipe out workspace " action available on jobs is controlled by the { @ link item # build } permission for some specific projects , however , it is not acceptable to let users have this possibility , even it they can trigger builds as such , when enabling the { @ code hudson security wipe out permission } system property , a new " wipe out " permission will allow to have greater control on the " wipe out workspace " action

public static boolean is wipe out permission enabled ( ) { return system properties get boolean ( " hudson security wipe out permission " ) ; }


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

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


returns true if this dialog was ever made visible

public boolean was shown ( ) { return shown get ( ) ; }


a sensible definition of { @ link # contains } in terms of the { @ code first ( ) } method of { @ link # tail set } if you override { @ link # tail set } , you may wish to override { @ link # contains } to forward to this implementation

protected boolean standard contains ( @ nullable object object ) { try { / / any class cast exceptions are caught @ suppress warnings ( " unchecked " ) sorted set < object > self = ( sorted set < object > ) this ; object ceiling = self tail set ( object ) first ( ) ; return unsafe compare ( ceiling , object ) = = 0 ; } catch ( class cast exception | no such element exception | null pointer exception e ) { return false ; } }


get the header value ( s ) , if any , for the header of the given name returns an empty list if no header values are found

list < string > header ( string header name ) ;


public static void set non full screen ( @ non null final activity activity ) { activity get window ( ) clear flags ( window manager layout params flag fullscreen ) ; }


updates the plugin ' s state based on the data stored in the state object the state object is the object that was returned by this plugin in the { @ link # get undo redo state ( domain object ) }

public void restore undo redo state ( domain object domain object , object state ) { / / do nothing by default ; subclasses should override as needed }


after the block pool has contacted the nn , registers that block pool with the secret manager , updating it with the secrets provided by the nn

private synchronized void register block pool with secret manager ( datanode registration bp registration , string block pool id ) throws i o exception { exported block keys keys = bp registration get exported keys ( ) ; if ( ! has any block pool registered ) { has any block pool registered = true ; is block token enabled = keys is block token enabled ( ) ; } else { if ( is block token enabled ! = keys is block token enabled ( ) ) { throw new runtime exception ( " inconsistent configuration of block access " + " tokens either all block pools must be configured to use block " + " tokens , or none may be " ) ; } } if ( ! is block token enabled ) return ; if ( ! block pool token secret manager is block pool registered ( block pool id ) ) { long block key update interval = keys get key update interval ( ) ; long block token lifetime = keys get token lifetime ( ) ; log info ( " block token params received from nn : " + " for block pool { } key update interval = { } min ( s ) , " + " token lifetime = { } min ( s ) " , block pool id , block key update interval / ( 60 * 1000 ) , block token lifetime / ( 60 * 1000 ) ) ; final boolean enable protobuf = get conf ( ) get boolean ( d f s config keys dfs block access token protobuf enable , d f s config keys dfs block access token protobuf enable default ) ; final block token secret manager secret mgr = new block token secret manager ( 0 , block token lifetime , block pool id , dn conf encryption algorithm , enable protobuf ) ; block pool token secret manager add block pool ( block pool id , secret mgr ) ; } }


guaranteed to throw an exception and leave the map unmodified

public < t extends b > t put instance ( type token < t > type , t value ) { throw new unsupported operation exception ( ) ; }


sets a ping interval for this connection profile

public builder set ping interval ( time value ping interval ) { this ping interval = ping interval ; return this ; }


calls { @ link channel handler context # fire channel read complete ( ) } to forward to the next { @ link channel inbound handler } in the { @ link channel pipeline } sub - classes may override this method to change behavior

public void channel read complete ( channel handler context ctx ) throws exception { ctx fire channel read complete ( ) ; }


test serialization of outer string types

public void fake outer string serialize test ( ) { string body = null ; / / string response = api fake outer string serialize ( body ) ; / / todo : test validations }


returns the difference of { @ code a } and { @ code b } unless it would overflow or underflow in which case { @ code long max value } or { @ code long min value } is returned , respectively

public static long saturated subtract ( long a , long b ) { long naive difference = a - b ; if ( ( a ^ b ) > = 0 | ( a ^ naive difference ) > = 0 ) { / / if a and b have the same signs or a has the same sign as the result then there was no / / overflow , return return naive difference ; } / / we did over / under flow return long max value + ( ( naive difference > > > ( long size - 1 ) ) ^ 1 ) ; }