test reconfiguration and check the status outputs

private void test data node get reconfiguration status ( boolean expected succuss ) throws i o exception , interrupted exception , timeout exception { reconfiguration util ru = mock ( reconfiguration util class ) ; datanode set reconfiguration util ( ru ) ; list < reconfiguration util property change > changes = new array list < > ( ) ; file new dir = new file ( cluster get data directory ( ) , " data new " ) ; if ( expected succuss ) { new dir mkdirs ( ) ; } else { / / inject failure new dir create new file ( ) ; } changes add ( new reconfiguration util property change ( dfs datanode data dir key , new dir to string ( ) , datanode get conf ( ) get ( dfs datanode data dir key ) ) ) ; changes add ( new reconfiguration util property change ( " random key " , " new 1 2 3 " , " old 4 5 6 " ) ) ; when ( ru parse changed properties ( any ( configuration class ) , any ( configuration class ) ) ) then return ( changes ) ; final int port = datanode get ipc port ( ) ; final string address = " localhost : " + port ; assert that ( admin start reconfiguration ( " datanode " , address ) , is ( 0 ) ) ; final list < string > outs = lists new array list ( ) ; final list < string > errs = lists new array list ( ) ; await reconfiguration finished ( " datanode " , address , outs , errs ) ; if ( expected succuss ) { assert that ( outs size ( ) , is ( 4 ) ) ; } else { assert that ( outs size ( ) , is ( 6 ) ) ; } list < storage location > locations = data node get storage locations ( datanode get conf ( ) ) ; if ( expected succuss ) { assert that ( locations size ( ) , is ( 1 ) ) ; assert that ( new file ( locations get ( 0 ) get uri ( ) ) , is ( new dir ) ) ; / / verify the directory is appropriately formatted assert true ( new file ( new dir , storage storage dir current ) is directory ( ) ) ; } else { assert true ( locations is empty ( ) ) ; } int offset = 1 ; if ( expected succuss ) { assert that ( outs get ( offset ) , contains string ( " success : changed property " + dfs datanode data dir key ) ) ; } else { assert that ( outs get ( offset ) , contains string ( " failed : change property " + dfs datanode data dir key ) ) ; } file dn dir 0 = cluster get instance storage dir ( 0 , 0 ) ; file dn dir 1 = cluster get instance storage dir ( 0 , 1 ) ; assert that ( outs get ( offset + 1 ) , is ( all of ( contains string ( " from : " ) , contains string ( dn dir 0 get name ( ) ) , contains string ( dn dir 1 get name ( ) ) ) ) ) ; assert that ( outs get ( offset + 2 ) , is ( not ( any of ( contains string ( dn dir 0 get name ( ) ) , contains string ( dn dir 1 get name ( ) ) ) ) ) ) ; assert that ( outs get ( offset + 2 ) , is ( all of ( contains string ( " to " ) , contains string ( " data new " ) ) ) ) ; }


read the next k , v pair into the head of this object ; return true iff the rr and this are exhausted

protected boolean next ( ) throws i o exception { empty = ! rr next ( khead , vhead ) ; return has next ( ) ; }


factory method to create the metric registry for the mini cluster

protected metric registry impl create metric registry ( configuration config ) { return new metric registry impl ( metric registry configuration from configuration ( config ) , reporter setup from configuration ( config , null ) ) ; }


sets this ray from the given starting position and direction

public ray set ( float x , float y , float z , float dx , float dy , float dz ) { this origin set ( x , y , z ) ; this direction set ( dx , dy , dz ) nor ( ) ; return this ; }


report the start a new run of the cleaner

public void report cleaning start ( ) { processed files set ( 0 ) ; deleted files set ( 0 ) ; file errors set ( 0 ) ; }


public assembly terminal get terminal ( string name ) { return terminals get ( name ) ; }


update the latest throttle count ; synchronized

public synchronized boolean probe ( ) { set read throttles ( ddbms get read throttle event count ( ) - read throttle event orig ) ; set write throttles ( ddbms get write throttle event count ( ) - write throttle event orig ) ; set batch throttles ( ddbms get batch write capacity exceeded count ( ) - batch write throttle count orig ) ; set scan throttles ( ddbms get scan throttle event count ( ) - scan throttle count orig ) ; return is throttling detected ( ) ; }


begin visiting an element that encloses another element , such as the beginning of the list of blocks that comprise a file

abstract void visit op ( f s edit log op op ) throws i o exception ;


specify the custom scopes that are to be registered the keys indicate the scope names ( of type string ) ; each value is expected to be the corresponding custom { @ link scope } instance or class name

public void set scopes ( map < string , object > scopes ) { this scopes = scopes ; }


sort calls this to generate the final merged output

private int merge pass ( path tmp dir ) throws i o exception { if ( log is debug enabled ( ) ) { log debug ( " running merge pass " ) ; } writer writer = clone file attributes ( out file suffix ( " 0 " ) , out file , null ) ; raw key value iterator r = merge ( out file suffix ( " 0 " ) , out file suffix ( " 0 index " ) , tmp dir ) ; write file ( r , writer ) ; writer close ( ) ; return 0 ; }


if true , then instructions should be readwritten

public boolean is instructions ( ) { return instructions ; }


registers a service if the constructor isn ' t finished yet ( constructor finished = = false ) , the service is just queued up in the services list if the constructor is finished , the service is added to the services list and registered with the plugin tool ' s services the { @ link # init services ( ) } handles registering the services queued during the constructor

private void do register service provided ( class < ? > interface class , object service , boolean dynamic register ) { objects require non null ( service , " service instance can not be null ! interface : " + interface class get name ( ) ) ; / / # if ( can do strict checking of service registration ) / / if ( constructor finished & & ! dynamic register ) { / / throw new illegal argument exception ( / / " services must be registered during plugin constructor : " + interface class + " , " + / / get name ( ) ) ; / / } / / # endif if ( ! plugin description get services provided ( ) contains ( interface class ) ) { / / # if ( can do strict checking of service registration ) / / throw new illegal argument exception ( / / " services must be advertised in plugin info annotation : " + interface class + " , " + / / get name ( ) ) ; / / # else msg warn ( this , " services must be advertised in @ plugin info annotation - service " + interface class + " ; from plugin " + get name ( ) ) ; / / # endif } services add ( new service interface implementation pair ( interface class , service ) ) ; if ( constructor finished ) { tool add service ( ( class < object > ) interface class , service ) ; } }


packs the color components into a 32 - bit integer with the format abgr and then converts it to a float note that no range checking is performed for higher performance

public static float to float bits ( int r , int g , int b , int a ) { int color = ( a < < 24 ) | ( b < < 16 ) | ( g < < 8 ) | r ; float float color = number utils int to float color ( color ) ; return float color ; }


creates the hadoop authentication http cookie

public static void create auth cookie ( http servlet response resp , string token , string domain , string path , long expires , boolean is cookie persistent , boolean is secure ) { string builder sb = new string builder ( authenticated u r l auth cookie ) append ( " = " ) ; if ( token ! = null & & token length ( ) > 0 ) { sb append ( " \ " " ) append ( token ) append ( " \ " " ) ; } if ( path ! = null ) { sb append ( " ; path = " ) append ( path ) ; } if ( domain ! = null ) { sb append ( " ; domain = " ) append ( domain ) ; } if ( expires > = 0 & & is cookie persistent ) { date date = new date ( expires ) ; simple date format df = new simple date format ( " eee , " + " dd - mmm - yyyy hh : mm : ss zzz " , locale us ) ; df set time zone ( time zone get time zone ( " gmt " ) ) ; sb append ( " ; expires = " ) append ( df format ( date ) ) ; } if ( is secure ) { sb append ( " ; secure " ) ; } sb append ( " ; http only " ) ; resp add header ( " set - cookie " , sb to string ( ) ) ; }


compare by reversed priority order first , and then reversed container id order

static void sort containers ( list < r m container > containers ) { collections sort ( containers , new comparator < r m container > ( ) { @ override public int compare ( r m container a , r m container b ) { int sched key comp = b get allocated scheduler key ( ) compare to ( a get allocated scheduler key ( ) ) ; if ( sched key comp ! = 0 ) { return sched key comp ; } return b get container id ( ) compare to ( a get container id ( ) ) ; } } ) ; }


gets the controller if set , null otherwise

public drawee controller get controller ( ) { return m controller ; }


fully maps a file read - only in to memory as per { @ link file channel # map ( java nio channels file channel map mode , long , long ) } files are mapped from offset 0 to its length this only works for files ≤ { @ link integer # max value } bytes

public static mapped byte buffer map ( file file ) throws i o exception { check not null ( file ) ; return map ( file , map mode read only ) ; }


returns the artifact name extension selected by the toolchain for the given artifact category

string get artifact name extension for category ( artifact category artifact category ) throws eval exception { artifact name pattern pattern for category = null ; for ( artifact name pattern artifact name pattern : artifact name patterns ) { if ( artifact name pattern get artifact category ( ) = = artifact category ) { pattern for category = artifact name pattern ; } } if ( pattern for category = = null ) { throw starlark errorf ( missing artifact name pattern error template , artifact category get category name ( ) ) ; } return pattern for category get extension ( ) ; }


exit a parse tree produced by the { @ code arithmetic unary } labeled alternative in { @ link sql base parser # value expression }

void exit arithmetic unary ( sql base parser arithmetic unary context ctx ) ;


executes the given callable after the given delay the result of the callable is returned as a { @ link scheduled future }

< v > scheduled future < v > schedule ( callable < v > callable , long delay , time unit unit ) ;


tells whether the target is a microsoft intermediate language netmodule

public boolean is microsoft intermediate language net module ( ) { return microsoft intermediate language net module ; }


returns the { @ link throwable } that caused this service to fail


public void test inline additional properties ( map < string , string > param , api client auth info auth info , handler < async result < void > > result handler ) { object local var body = param ; / / verify the required parameter ' param ' is set if ( param = = null ) { result handler handle ( api exception fail ( 400 , " missing the required parameter ' param ' when calling test inline additional properties " ) ) ; return ; } / / create path and map variables string local var path = " / fake / inline - additional properties " ; / / query params list < pair > local var query params = new array list < > ( ) ; / / header params multi map local var header params = multi map case insensitive multi map ( ) ; / / cookie params multi map local var cookie params = multi map case insensitive multi map ( ) ; / / form params / / todo : sending files within multipart / form - data is not supported yet ( because of vertx web - client ) map < string , object > local var form params = new hash map < > ( ) ; string [ ] local var accepts = { } ; string [ ] local var content types = { " application / json " } ; string [ ] local var auth names = new string [ ] { } ; api client invoke a p i ( local var path , " post " , local var query params , local var body , local var header params , local var cookie params , local var form params , local var accepts , local var content types , local var auth names , auth info , null , result handler ) ; }


appends a new { @ link model loader factory } onto the end of the existing set so that the constructed { @ link model loader } will be tried after all default and previously registered { @ link model loader } s for the given model and data classes if you ' re attempting to replace an existing { @ link model loader } , use { @ link # prepend ( class , class , model loader factory ) } this method is best for new types of models andor data or as a way to add an additional fallback loader for an existing type of modeldata if multiple { @ link model loader factory } s are registered for the same model andor data classes , the { @ link model loader } s they produce will be attempted in the order the { @ link model loader factory } s were registered only if all { @ link model loader } s fail will the entire request fail

public < model , data > registry append ( @ non null class < model > model class , @ non null class < data > data class , @ non null model loader factory < model , data > factory ) { model loader registry append ( model class , data class , factory ) ; return this ; }


triggers the program execution asynchronously the environment will execute all parts of the program that have resulted in a " sink " operation sink operations are for example printing results or forwarding them to a message queue the program execution will be logged and displayed with the provided name

public job client execute async ( string job name ) throws exception { return execute async ( get stream graph ( check not null ( job name ) ) ) ; }


state transitions - if the states are the same then no change - if either state is unset then change to the other state - if the states are conflicting then set to the conflicting state

public void merge with ( optional boolean other ) { if ( state = = other state ) { / / no change in state } else if ( state = = state unset ) { state = other state ; } else if ( other state = = state unset ) { / / no change in state } else { state = state conflicting ; } }


creates a new big - endian composite buffer which wraps the slices of the specified nio buffers without copying them a modification on the content of the specified buffers will be visible to the returned buffer

public static byte buf wrapped buffer ( int max num components , byte buffer buffers ) { return wrapped buffer ( max num components , composite byte buf byte buffer wrapper , buffers ) ; }


this member holds the section header ' s size in bytes a section header is one entry in the section header table ; all entries are the same size

public short e shentsize ( ) { return e shentsize ; }


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


return the output stream to use for writing remote invocation results , potentially decorating the given original output stream the default implementation returns the given stream as - is can be overridden , for example , for custom encryption or compression

protected output stream decorate output stream ( http servlet request request , http servlet response response , output stream os ) throws i o exception { return os ; }


the substitute method for a private instance method in an interface

public final method key substitute of interface instance method ( ) { return create ( owner ( ) , name ( ) , this instance method to static descriptor ( ) ) ; }


this tests that the creation of { @ link task manager services } correctly creates the local state root directory for the { @ link task executor local state stores manager } with the configured root directory

public void test creation from config ( ) throws exception { final configuration config = new configuration ( ) ; file new folder = temporary folder new folder ( ) ; string tmp dir = new folder get absolute path ( ) + file separator ; final string root dir string = " local state root 1 , local state root 2 , local state root 3 " replace all ( " " , tmp dir ) ; / / test configuration of the local state directories config set string ( checkpointing options local recovery task manager state root dirs , root dir string ) ; / / test configuration of the local state mode config set boolean ( checkpointing options local recovery , true ) ; task manager services task manager services = create task manager services ( create task manager service configuration ( config ) ) ; try { task executor local state stores manager task state manager = task manager services get task manager state store ( ) ; / / verify configured directories for local state string [ ] split = root dir string split ( " , " ) ; file [ ] root directories = task state manager get local state root directories ( ) ; for ( int i = 0 ; i < split length ; + + i ) { assert assert equals ( new file ( split [ i ] , task manager services local state sub directory root ) , root directories [ i ] ) ; } / / verify local recovery mode assert assert true ( task state manager is local recovery enabled ( ) ) ; assert assert equals ( " local state " , task manager services local state sub directory root ) ; for ( file root directory : root directories ) { file utils delete file or directory ( root directory ) ; } } finally { task manager services shut down ( ) ; } }


test that , if the writer crashes at the very beginning of a segment , before any transactions are written , that the next new epoch ( ) call returns the prior segment txid as its most recent segment

public void test new epoch at beginning of segment ( ) throws exception { journal new epoch ( fake nsinfo , 1 ) ; journal start log segment ( make r i ( 1 ) , 1 , name node layout version current layout version ) ; journal journal ( make r i ( 2 ) , 1 , 1 , 2 , q j m test util create txn data ( 1 , 2 ) ) ; journal finalize log segment ( make r i ( 3 ) , 1 , 2 ) ; journal start log segment ( make r i ( 4 ) , 3 , name node layout version current layout version ) ; new epoch response proto resp = journal new epoch ( fake nsinfo , 2 ) ; assert equals ( 1 , resp get last segment tx id ( ) ) ; }


get the text body of the rendered html { @ code < option > } tag

protected string get label ( ) { return this label ; }


determine if the index field value has been truncated from its ' original value

boolean uses truncated field value ( ) { return is truncated ; }


determine if the stream associated with this object is writable

boolean is writable ( ) { return window size ( ) > pending bytes ( ) & & ! cancelled ; }


returns the format based on its configuration name

public static trace format named ( string name ) { return trace format value of ( name replace ( ' - ' , ' ' ) to upper case ( us ) ) ; }


static int index for ( int h , int length ) { return h & ( length - 1 ) ; }


runs a number of steps for incremental rehashing

private void incremental rehash ( ) { state map entry < k , n , s > [ ] old map = primary table ; state map entry < k , n , s > [ ] new map = incremental rehash table ; int old capacity = old map length ; int new mask = new map length - 1 ; int required version = highest required snapshot version ; int rh idx = rehash index ; int transferred = 0 ; / / we migrate a certain minimum amount of entries from the old to the new table while ( transferred < min transferred per incremental rehash ) { state map entry < k , n , s > e = old map [ rh idx ] ; while ( e ! = null ) { / / copy - on - write check for entry if ( e entry version < required version ) { e = new state map entry < > ( e , state map version ) ; } state map entry < k , n , s > n = e next ; int pos = e hash & new mask ; e next = new map [ pos ] ; new map [ pos ] = e ; e = n ; + + transferred ; } old map [ rh idx ] = null ; if ( + + rh idx = = old capacity ) { / / here , the rehash is complete and we release resources and reset fields primary table = new map ; incremental rehash table = ( state map entry < k , n , s > [ ] ) empty table ; primary table size + = incremental rehash table size ; incremental rehash table size = 0 ; rehash index = 0 ; return ; } } / / sync our local bookkeeping the with official bookkeeping fields primary table size - = transferred ; incremental rehash table size + = transferred ; rehash index = rh idx ; }


return the level of caching that this listener container is allowed to apply

public int get cache level ( ) { return this cache level ; }


sets the alpha component of all text currently in the cache does not affect subsequently added text

public void set alphas ( float alpha ) { int alpha bits = ( ( int ) ( 254 * alpha ) ) < < 24 ; float prev = 0 , new color = 0 ; for ( int j = 0 , length = page vertices length ; j < length ; j + + ) { float [ ] vertices = page vertices [ j ] ; for ( int i = 2 , n = idx [ j ] ; i < n ; i + = 5 ) { float c = vertices [ i ] ; if ( c = = prev & & i ! = 2 ) { vertices [ i ] = new color ; } else { prev = c ; int rgba = number utils float to int color ( c ) ; rgba = ( rgba & 0x 0 0 f f f f f f ) | alpha bits ; new color = number utils int to float color ( rgba ) ; vertices [ i ] = new color ; } } } }


within the local filesystem ( not hdfs ) , all activity takes place within a subdir inside one of the local dirs ( $ { local dir } usercache $ userappcache $ app id $ cont id ) , and all sub - map tasks create the same filename ( " file out " ) rename that to something unique ( e g , " map 0 out " ) to avoid possible collisions longer - term , we ' ll modify [ something ] to use task attempt i d - based filenames instead of " file out " ( all of this is entirely internal , so there are no particular compatibility issues )

protected static map output file rename map output for reduce ( job conf conf , task attempt id map id , map output file sub map output file ) throws i o exception { file system local fs = file system get local ( conf ) ; / / move map output to reduce input path map out = sub map output file get output file ( ) ; file status m status = local fs get file status ( map out ) ; path reduce in = sub map output file get input file for write ( type converter from yarn ( map id ) get task i d ( ) , m status get len ( ) ) ; path map out index = sub map output file get output index file ( ) ; path reduce in index = new path ( reduce in to string ( ) + " index " ) ; if ( log is debug enabled ( ) ) { log debug ( " renaming map output file for task attempt " + map id to string ( ) + " from original location " + map out to string ( ) + " to destination " + reduce in to string ( ) ) ; } if ( ! local fs mkdirs ( reduce in get parent ( ) ) ) { throw new i o exception ( " mkdirs failed to create " + reduce in get parent ( ) to string ( ) ) ; } if ( ! local fs rename ( map out , reduce in ) ) throw new i o exception ( " couldn ' t rename " + map out ) ; if ( ! local fs rename ( map out index , reduce in index ) ) throw new i o exception ( " couldn ' t rename " + map out index ) ; return new renamed map output file ( reduce in ) ; }


specify whether java script should be enabled default is { @ code true }

public mock mvc html unit driver builder javascript enabled ( boolean javascript enabled ) { this javascript enabled = javascript enabled ; return this ; }


build a listing of the target files , sorted and unsorted

private path list target files ( final configuration conf , final path target listing , final path sorted target listing ) throws i o exception { copy listing target = new globbed copy listing ( new configuration ( conf ) , null ) ; path target final path = new path ( conf get ( dist cp constants conf label target final path ) ) ; list < path > targets = new array list < > ( 1 ) ; targets add ( target final path ) ; path result none path = path get path without scheme and authority ( target final path ) to string ( ) starts with ( dist cp constants hdfs reserved raw directory name ) ? dist cp constants raw none path : dist cp constants none path ; / / / / set up options to be the same from the copy listing build listing ' s / / perspective , so to collect similar listings as when doing the copy / / / / thread count is picked up from the job int threads = conf get int ( dist cp constants conf label liststatus threads , dist cp constants default liststatus threads ) ; log info ( " scanning destination directory { } with thread count : { } " , target final path , threads ) ; dist cp options options = new dist cp options builder ( targets , result none path ) with overwrite ( overwrite ) with sync folder ( sync folder ) with num liststatus threads ( threads ) build ( ) ; dist cp context dist cp context = new dist cp context ( options ) ; dist cp context set target path exists ( target path exists ) ; target build listing ( target listing , dist cp context ) ; dist cp utils sort listing ( conf , target listing , sorted target listing ) ; return target final path ; }


makes the action always execute , even if none of its inputs have changed only use this when absolutely necessary , since this is a performance hit and we ' d like to get rid of this mechanism eventually you ' ll eventually be able to declare a skyframe dependency on the build id , which would accomplish the same thing

public builder execute unconditionally ( ) { / / this should really be implemented by declaring a skyframe dependency on the build id / / instead , however , we can ' t just do that yet from within actions , so we need to go through / / action execute unconditionally ( ) which in turn is called by action cache checker this execute unconditionally = true ; return this ; }


does not use optional as return type to avoid potential performance decrease

public method descriptor get method ( string method name , string params ) { map < string , method descriptor > methods = desc to methods get ( method name ) ; if ( collection utils is not empty map ( methods ) ) { return methods get ( params ) ; } return null ; }


returns the background color at a specific location within the layout

color get background color ( field location location ) ;


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


check if authentication can be performed for a given context client credential authentication can be performed if { @ code client id } & { @ code client secret } are provided exception to this will be 1 when the grant type is { @ code password } , in which case the authentication will be performed by { @ code o auth 2 0 username password authenticator } 2 when request contains o auth { @ code code } which was issued with a { @ code code challenge } , in which case the authentication will be performed by { { @ code o auth 2 0 proof key code exchange authenticator } 3 when the grant type is { @ code refresh token } and the request doesn ' t have any { @ code client secret } , in which case the authentication will be performed by { @ code o auth 2 0 refresh token authenticator }

protected boolean can authenticate ( final web context context ) { val grant type = context get request parameter ( o auth 2 0 constants grant type ) ; if ( grant type is present ( ) & & o auth 2 0 utils is grant type ( grant type get ( ) , o auth 2 0 grant types password ) ) { logger debug ( " skipping client credential authentication to use password authentication " ) ; return false ; } if ( grant type is present ( ) & & o auth 2 0 utils is grant type ( grant type get ( ) , o auth 2 0 grant types refresh token ) & & context get request parameter ( o auth 2 0 constants client id ) is present ( ) & & ! context get request parameter ( o auth 2 0 constants client secret ) is present ( ) ) { logger debug ( " skipping client credential authentication to use refresh token authentication " ) ; return false ; } val code = context get request parameter ( o auth 2 0 constants code ) ; if ( code is present ( ) ) { logger debug ( " checking if the o auth code issued contains code challenge " ) ; val token = this ticket registry get ticket ( code get ( ) , o auth 2 0 code class ) ; if ( token ! = null & & string utils is not empty ( token get code challenge ( ) ) ) { logger debug ( " the o auth code [ { } ] issued contains code challenge which requires pkce authentication " , code get ( ) ) ; return false ; } } return true ; }


filter the list of catalogs to those visible to the identity

default set < string > filter catalogs ( identity identity , access control context context , set < string > catalogs ) { return collections empty set ( ) ; }


should the node rest actions usage statistics be returned

public nodes usage request rest actions ( boolean rest actions ) { this rest actions = rest actions ; return this ; }


return the number of keyvalue pairs stored in the hashtable

public int size ( ) { return indexer get size ( ) ; }


returns a future that can be used to do a blocking get on a background thread

public future target < transcode type > submit ( int width , int height ) { final request future target < transcode type > target = new request future target < > ( width , height ) ; return into ( target , target , executors direct executor ( ) ) ; }


gets a demangled string for the indicated mangled string

private static string get demangled string ( string mangled string ) { m d mang ghidra demangler = new m d mang ghidra ( ) ; try { m d parsable item parsable item = demangler demangle ( mangled string , true ) ; if ( parsable item instanceof m d object c p p ) { m d object c p p md object = ( m d object c p p ) parsable item ; return md object get qualified name ( ) to string ( ) ; } / / if ( parsable item instanceof m d function type ) { / / m d function type function type = ( m d function type ) parsable item ; / / return function type get name ( ) ; / / } / / if ( parsable item instanceof m d data type ) { / / m d data type data type = ( m d data type ) parsable item ; / / return data type get name ( ) ; / / } return parsable item to string ( ) ; } catch ( m d exception e ) { / / couldn ' t demangle msg info ( null , e get message ( ) ) ; return null ; } }


return the squared length of this vector

public final float length squared ( ) { return ( x * x + y * y ) ; }


a thread pool that that blocks clients submitting additional tasks if there are already { @ code active tasks } running threads and { @ code waiting tasks } tasks waiting in its queue

public static blocking thread pool executor service new instance ( int active tasks , int waiting tasks , long keep alive time , time unit unit , string prefix name ) { / * although we generally only expect up to waiting tasks tasks in the queue , we need to be able to buffer all tasks in case dequeueing is slower than enqueueing * / final blocking queue < runnable > work queue = new linked blocking queue < > ( waiting tasks + active tasks ) ; thread pool executor event processing executor = new thread pool executor ( active tasks , active tasks , keep alive time , unit , work queue , new daemon thread factory ( prefix name ) , new rejected execution handler ( ) { @ override public void rejected execution ( runnable r , thread pool executor executor ) { / / this is not expected to happen log error ( " could not submit task to executor { } " , executor to string ( ) ) ; } } ) ; event processing executor allow core thread time out ( true ) ; return new blocking thread pool executor service ( waiting tasks + active tasks , event processing executor ) ; }


adds an action to this menu can create sub menus depending on the menu path of the action

public void add action ( docking action if action ) { check for swing thread ( ) ; reset menus ( ) ; menu data menu data = use popup path ? action get popup menu data ( ) : action get menu bar data ( ) ; if ( is sub menu ( menu data ) ) { menu manager mgr = get sub menu ( menu data ) ; mgr add action ( action ) ; } else { managed menu items add ( new menu item manager ( menu handler , action , use popup path ) ) ; } }


get the text to insert when the given suggestion is activated

protected string get completion text ( t sel ) { return sel to string ( ) ; }


public void my boolean test ( ) { / / todo : test my boolean }


returns a new server - side { @ link s s l engine } with the current configuration

public final s s l engine new engine ( byte buf allocator alloc ) { return new engine ( alloc , null , - 1 ) ; }


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


process an rpc request - the connection headers and context must have been already read - based on the rpc kind , decode the rpc request - a successfully decoded rpc call will be deposited in rpc - q and its response will be sent later when the request is processed

private void process rpc request ( rpc request header proto header , rpc writable buffer buffer ) throws rpc server exception , interrupted exception { class < ? extends writable > rpc request class = get rpc request wrapper ( header get rpc kind ( ) ) ; if ( rpc request class = = null ) { log warn ( " unknown rpc kind " + header get rpc kind ( ) + " from client " + get host address ( ) ) ; final string err = " unknown rpc kind in rpc header " + header get rpc kind ( ) ; throw new fatal rpc server exception ( rpc error code proto fatal invalid rpc header , err ) ; } writable rpc request ; try { / / read the rpc request rpc request = buffer new instance ( rpc request class , conf ) ; } catch ( rpc server exception rse ) { / / lets tests inject failures throw rse ; } catch ( throwable t ) { / / includes runtime exception from new instance log warn ( " unable to read call parameters for client " + get host address ( ) + " on connection protocol " + this protocol name + " for rpc kind " + header get rpc kind ( ) , t ) ; string err = " ipc server unable to read call parameters : " + t get message ( ) ; throw new fatal rpc server exception ( rpc error code proto fatal deserializing request , err ) ; } trace scope trace scope = null ; if ( header has trace info ( ) ) { if ( tracer ! = null ) { / / if the incoming rpc included tracing info , always continue the / / trace span id parent span id = new span id ( header get trace info ( ) get trace id ( ) , header get trace info ( ) get parent id ( ) ) ; trace scope = tracer new scope ( rpc client util to trace name ( rpc request to string ( ) ) , parent span id ) ; trace scope detach ( ) ; } } caller context caller context = null ; if ( header has caller context ( ) ) { caller context = new caller context builder ( header get caller context ( ) get context ( ) ) set signature ( header get caller context ( ) get signature ( ) to byte array ( ) ) build ( ) ; } rpc call call = new rpc call ( this , header get call id ( ) , header get retry count ( ) , rpc request , proto util convert ( header get rpc kind ( ) ) , header get client id ( ) to byte array ( ) , trace scope , caller context ) ; / / save the priority level assignment by the scheduler call set priority level ( call queue get priority level ( call ) ) ; call mark call coordinated ( false ) ; if ( alignment context ! = null & & call rpc request ! = null & & ( call rpc request instanceof protobuf rpc engine 2 rpc protobuf request ) ) { / / if call rpc request is not rpc protobuf request , will skip the following / / step and treat the call as uncoordinated as currently only certain / / client protocol methods request made through rpc protobuf needs to be / / coordinated string method name ; string proto name ; protobuf rpc engine 2 rpc protobuf request req = ( protobuf rpc engine 2 rpc protobuf request ) call rpc request ; try { method name = req get request header ( ) get method name ( ) ; proto name = req get request header ( ) get declaring class protocol name ( ) ; if ( alignment context is coordinated call ( proto name , method name ) ) { call mark call coordinated ( true ) ; long state id ; state id = alignment context receive request state ( header , get max idle time ( ) ) ; call set client state id ( state id ) ; } } catch ( i o exception ioe ) { throw new rpc server exception ( " processing rpc request caught " , ioe ) ; } } try { internal queue call ( call ) ; } catch ( rpc server exception rse ) { throw rse ; } catch ( i o exception ioe ) { throw new fatal rpc server exception ( rpc error code proto error rpc server , ioe ) ; } inc rpc count ( ) ; / / increment the rpc count }


returns a splitter that behaves equivalently to { @ code this } splitter , but automatically omits empty strings from the results for example , { @ code splitter on ( ' , ' ) omit empty strings ( ) split ( " , a , , , b , c , , " ) } returns an iterable containing only { @ code [ " a " , " b " , " c " ] } if either { @ code trim results } option is also specified when creating a splitter , that splitter always trims results first before checking for emptiness so , for example , { @ code splitter on ( ' : ' ) omit empty strings ( ) trim results ( ) split ( " : : : " ) } returns an empty iterable note that it is ordinarily not possible for { @ link # split ( char sequence ) } to return an empty iterable , but when using this option , it can ( if the input sequence consists of nothing but separators )

public splitter omit empty strings ( ) { return new splitter ( strategy , true , trimmer , limit ) ; }


test { @ code text } read fieldswrite operations

public void test read write operations ( ) { string line = " adsawseeeeegqewgasddga " ; byte [ ] input bytes = line get bytes ( ) ; input bytes = bytes concat ( new byte [ ] { ( byte ) 22 } , input bytes ) ; data input buffer in = new data input buffer ( ) ; data output buffer out = new data output buffer ( ) ; text text = new text ( line ) ; try { in reset ( input bytes , input bytes length ) ; text read fields ( in ) ; } catch ( exception ex ) { fail ( " test read fields error ! ! ! " ) ; } try { text write ( out ) ; } catch ( i o exception ex ) { } catch ( exception ex ) { fail ( " test read write operations error ! ! ! " ) ; } }


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


filters all exceptions that match the predicate by applying the given response provider function for instance , the following example creates a filter that returns a 500 response status when an { @ code illegal state exception } occurs < pre class = " code " > router function & lt ; server response & gt ; filtered route = router functions route ( ) get ( " user " , this : : list users ) on error ( e - > e instanceof illegal state exception , ( e , request ) - > server response status ( http status internal server error ) build ( ) ) build ( ) ;

builder on error ( predicate < throwable > predicate , bi function < throwable , server request , server response > response provider ) ;


resets the element after this call , the iterator has one element available , which is the given element

public void set ( e current ) { this current = current ; this available = true ; }


adds a pattern to include to the glob builder for a description of the syntax of the patterns , see { @ link unix glob }

public builder add patterns ( collection < string > patterns ) { this patterns add all ( patterns ) ; return this ; }


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


signals the completion of the main sequence and switches to post - completion replay mode don ' t modify the queue after calling this method ! post - completion backpressure handles the case when a source produces values based on requests when it is active but more values are available even after its completion in this case , the on complete ( ) can ' t just emit the contents of the queue but has to coordinate with the requested amounts this requires two distinct modes : active and completed in active mode , requests flow through and the queue is not accessed but in completed mode , requests no - longer reach the upstream but help in draining the queue the algorithm utilizes the most significant bit ( bit 63 ) of a long value ( atomic long ) since request amount only goes up to { @ link long # max value } ( bits 0 - 62 ) and negative values aren ' t allowed

public static < t > void post complete ( subscriber < ? super t > actual , queue < t > queue , atomic long state , boolean supplier is cancelled ) { if ( queue is empty ( ) ) { actual on complete ( ) ; return ; } if ( post complete drain ( state get ( ) , actual , queue , state , is cancelled ) ) { return ; } for ( ; ; ) { long r = state get ( ) ; if ( ( r & completed mask ) ! = 0l ) { return ; } long u = r | completed mask ; / / ( active , r ) - > ( complete , r ) transition if ( state compare and set ( r , u ) ) { / / if the requested amount was non - zero , drain the queue if ( r ! = 0l ) { post complete drain ( u , actual , queue , state , is cancelled ) ; } return ; } } }


sets the < code > string item < code > property

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


returns the time range before and after the current reservation considered by this policy in particular , this informs the archival process for the { @ link plan } , i e , reservations regarding times before ( now - valid window ) can be deleted


returns a sequence of events based on an exponential distribution smaller intervals are more frequent than larger ones , and there is no bound on the length of an interval

public static long stream exponential ( double mean , int events ) { return generate ( new exponential generator ( mean ) , events ) ; }


adds an attribute to the builder throws an illegal state exception if an attribute of that name already exists todo ( bazel - team ) : stop using unchecked exceptions in this way

public builder add attribute ( attribute attribute ) { attribute prev val = attributes put if absent ( attribute get name ( ) , attribute ) ; if ( prev val ! = null ) { throw new illegal state exception ( string format ( " there is already a built - in attribute ' % s ' which cannot be overridden " , attribute get name ( ) ) ) ; } return this ; }


returns the most common , more general { @ link logical type } for a given set of types if such a type exists , all given types can be casted to this more general type for example : { @ code [ int , bigint , decimal ( 2 , 2 ) ] } would lead to { @ code decimal ( 21 , 2 ) } this class aims to be compatible with the sql standard it is inspired by apache calcite ' s { @ code sql type factory impl # least restrictive } method

public static optional < logical type > find common type ( list < logical type > types ) { preconditions check argument ( types size ( ) > 0 , " list of types must not be empty " ) ; / / collect statistics first boolean has raw type = false ; boolean has null type = false ; boolean has nullable types = false ; for ( logical type type : types ) { final logical type root type root = type get type root ( ) ; if ( type root = = raw ) { has raw type = true ; } else if ( type root = = null ) { has null type = true ; } if ( type is nullable ( ) ) { has nullable types = true ; } } final list < logical type > normalized types = types stream ( ) map ( t - > t copy ( true ) ) collect ( collectors to list ( ) ) ; logical type found type = find common nullable type ( normalized types , has raw type , has null type ) ; if ( found type = = null ) { found type = find common castable type ( normalized types ) ; } if ( found type ! = null ) { final logical type type with nullability = found type copy ( has nullable types ) ; / / null is reserved for untyped literals only if ( has root ( type with nullability , null ) ) { return optional empty ( ) ; } return optional of ( type with nullability ) ; } return optional empty ( ) ; }


set the duration after which the message is no longer valid , as specified by the { @ code expires } header

public void set expires ( zoned date time expires ) { set zoned date time ( expires , expires ) ; }


finds a resource with a given name this method returns null if no resource with this name is found the rules for searching resources associated with a given class are implemented by the defining class loader of the class

public static url get resource ( string filename ) { url url = class loader get resource ( filename ) ; if ( url ! = null ) { return url ; } url = get resource ( get test search paths ( ) , filename ) ; return url ; }


gets the background color of this component

public color get background ( ) { return root panel get background ( ) ; }


tests that the task manager runner startup fails synchronously when the memory configuration is wrong

public void test memory config wrong ( ) throws exception { configuration cfg = create flink configuration ( ) ; / / something invalid cfg set ( task manager options network memory min , memory size parse ( " 1 0 0m " ) ) ; cfg set ( task manager options network memory max , memory size parse ( " 1 0m " ) ) ; start task manager ( cfg , rpc service , high availability services ) ; }


public int compare to ( byte [ ] buffer 1 , int offset 1 , int length 1 , byte [ ] buffer 2 , int offset 2 , int length 2 ) { / / short circuit equal case if ( buffer 1 = = buffer 2 & & offset 1 = = offset 2 & & length 1 = = length 2 ) { return 0 ; } final int stride = 8 ; int min length = math min ( length 1 , length 2 ) ; int stride limit = min length & ~ ( stride - 1 ) ; int offset 1 adj = offset 1 + byte array base offset ; int offset 2 adj = offset 2 + byte array base offset ; int i ; / * * compare 8 bytes at a time benchmarking shows comparing 8 bytes at a * time is no slower than comparing 4 bytes at a time even on 32 - bit * on the other hand , it is substantially faster on 64 - bit * / for ( i = 0 ; i < stride limit ; i + = stride ) { long lw = the unsafe get long ( buffer 1 , offset 1 adj + ( long ) i ) ; long rw = the unsafe get long ( buffer 2 , offset 2 adj + ( long ) i ) ; if ( lw ! = rw ) { if ( ! little endian ) { return less than unsigned ( lw , rw ) ? - 1 : 1 ; } / * * we want to compare only the first index where left [ index ] ! = * right [ index ] this corresponds to the least significant nonzero * byte in lw ^ rw , since lw and rw are little - endian * long number of trailing zeros ( diff ) tells us the least significant * nonzero bit , and zeroing out the first three bits of l n t z gives * us the shift to get that least significant nonzero byte this * comparison logic is based on unsigned bytes from guava v 2 1 * / int n = long number of trailing zeros ( lw ^ rw ) & ~ 0x 7 ; return ( ( int ) ( ( lw > > > n ) & 0x f f ) ) - ( ( int ) ( ( rw > > > n ) & 0x f f ) ) ; } } / / the epilogue to cover the last ( min length % 8 ) elements for ( ; i < min length ; i + + ) { int result = unsigned bytes compare ( buffer 1 [ offset 1 + i ] , buffer 2 [ offset 2 + i ] ) ; if ( result ! = 0 ) { return result ; } } return length 1 - length 2 ; }


should we track blocks in safe mode < p > never track blocks incrementally in non - ha code < p > in the ha case , the standby node can be in safemode while the namespace is modified by the edit log tailer in this case , the number of total blocks changes as edits are processed ( eg blocks are added and deleted ) however , we don ' t want to do the incremental tracking during the startup - time loading process - - only once the initial total has been set after the image has been loaded

boolean is safe mode tracking blocks ( ) { assert namesystem has write lock ( ) ; return ha enabled & & status ! = b m safe mode status off ; }


public static node api versions create ( collection < api version > overrides ) { list < api version > api versions = new linked list < > ( overrides ) ; for ( api keys api key : api keys enabled apis ( ) ) { boolean exists = false ; for ( api version api version : api versions ) { if ( api version api key = = api key id ) { exists = true ; break ; } } if ( ! exists ) { api versions add ( new api version ( api key ) ) ; } } return new node api versions ( api versions ) ; }


translates this node into a flink operator note : this method should return same translate result if called multiple times

transformation < t > translate to plan ( planner planner ) ;


returns the { @ link artifact root } of a package , given its { @ link package identifier } may be null if the given { @ code package identifier } does not correspond to a package in this build however , if there is a unique source root for all packages , this may return that root even if the { @ code package identifier } given does not correspond to any packages

root get root for package ( package identifier package identifier ) ;


returns the rich header from the pe image

public rich header get rich header ( ) { return rich header ; }


obtain a " shortcut " singleton factory bean instance to use for a { @ code get object type ( ) } call , without full initialization of the factory bean

private factory bean < ? > get singleton factory bean for type check ( string bean name , root bean definition mbd ) { synchronized ( get singleton mutex ( ) ) { bean wrapper bw = this factory bean instance cache get ( bean name ) ; if ( bw ! = null ) { return ( factory bean < ? > ) bw get wrapped instance ( ) ; } object bean instance = get singleton ( bean name , false ) ; if ( bean instance instanceof factory bean ) { return ( factory bean < ? > ) bean instance ; } if ( is singleton currently in creation ( bean name ) | | ( mbd get factory bean name ( ) ! = null & & is singleton currently in creation ( mbd get factory bean name ( ) ) ) ) { return null ; } object instance ; try { / / mark this bean as currently in creation , even if just partially before singleton creation ( bean name ) ; / / give bean post processors a chance to return a proxy instead of the target bean instance instance = resolve before instantiation ( bean name , mbd ) ; if ( instance = = null ) { bw = create bean instance ( bean name , mbd , null ) ; instance = bw get wrapped instance ( ) ; } } catch ( unsatisfied dependency exception ex ) { / / don ' t swallow , probably misconfiguration throw ex ; } catch ( bean creation exception ex ) { / / instantiation failure , maybe too early if ( logger is debug enabled ( ) ) { logger debug ( " bean creation exception on singleton factory bean type check : " + ex ) ; } on suppressed exception ( ex ) ; return null ; } finally { / / finished partial creation of this bean after singleton creation ( bean name ) ; } factory bean < ? > fb = get factory bean ( bean name , instance ) ; if ( bw ! = null ) { this factory bean instance cache put ( bean name , bw ) ; } return fb ; } }


provides an on click for the portion of the main view that is dimmed the listener is not triggered if the panel is in a collapsed or a hidden position if the on click listener is not provided , the clicks on the dimmed area are passed through to the main layout

public void set fade on click listener ( view on click listener listener ) { m fade on click listener = listener ; }


creates an empty { @ code linked blocking queue } with the given ( fixed ) capacity

public static < e > linked blocking queue < e > new linked blocking queue ( int capacity ) { return new linked blocking queue < e > ( capacity ) ; }


public boolean is symlink ( ) { return false ; }


inflates a new hierarchy builder from xml the builder can then be modified in order to override xml attributes if necessary

public static generic drawee hierarchy builder inflate builder ( context context , @ nullable attribute set attrs ) { if ( fresco systrace is tracing ( ) ) { fresco systrace begin section ( " generic drawee hierarchy builder # inflate builder " ) ; } resources resources = context get resources ( ) ; generic drawee hierarchy builder builder = new generic drawee hierarchy builder ( resources ) ; builder = update builder ( builder , context , attrs ) ; if ( fresco systrace is tracing ( ) ) { fresco systrace end section ( ) ; } return builder ; }


return true if this user has permission of write or admin

public boolean has write permission ( ) { return permission = = write | | permission = = admin ; }


completes the current method declaration

public void end method ( ) throws i o exception { scope popped = pop scope ( ) ; if ( popped = = scope non abstract method ) { indent ( ) ; out write ( " } \ n " ) ; } else if ( popped ! = scope abstract method ) { throw new illegal state exception ( ) ; }


return whether it is a image according to the file name

public static boolean is image ( final file file ) { if ( file = = null | | ! file exists ( ) ) { return false ; } return is image ( file get path ( ) ) ; }


public < t extends comparable < ? super t > > list < t > sort ( list < t > data ) { list < t > dup = new array list < t > ( ) ; dup add all ( data ) ; collections sort ( dup ) ; return dup ; }


marks that this connection should do a decoupled data exchange ( such as batched ) rather then pipeline data connections are marked as pipeline breakers to avoid deadlock situations

public void mark breaks pipeline ( ) { this break pipeline = true ; }


returns the count of { @ code node } ' s incoming edges ( equal to { @ code predecessors ( node ) size ( ) } ) in a directed graph in an undirected graph , returns the { @ link # degree ( object ) } if the count is greater than { @ code integer max value } , returns { @ code integer max value }


return the configured { @ link # set default data mime type default data mime type } , or { @ code null }

public mime type get default data mime type ( ) { return this default data mime type ; }


ignore { @ code constructor } in the tests that follow returns this object

public null pointer tester ignore ( constructor < ? > constructor ) { ignored members add ( check not null ( constructor ) ) ; return this ; }


prevent system exit ( ) from ever being called

@ override public void check exit ( int code ) { if ( enabled ) { throw new security exception ( " test code should never call system exit ( ) " ) ; } }


return the name of the current lock owner or { @ code " < unknown > " } if not locked or could not be determined

public string get lock owner ( ) { return get lock owner ( false ) ; }


repeatedly applies this instance ' s input value to the given function until one of the following occurs : the function returns neither null nor false the function throws an unignored exception the timeout expires the current thread is interrupted

public < v > v until ( function < ? super t , v > is true ) { instant end = clock instant ( ) plus ( timeout ) ; throwable last exception ; while ( true ) { try { v value = is true apply ( input ) ; if ( value ! = null & & ( boolean class ! = value get class ( ) | | boolean true equals ( value ) ) ) { return value ; } / / clear the last exception ; if another retry or timeout exception would / / be caused by a false or null value , the last exception is not the / / cause of the timeout last exception = null ; } catch ( throwable e ) { last exception = propagate if not ignored ( e ) ; } / / check the timeout after evaluating the function to ensure conditions / / with a zero timeout can succeed if ( end is before ( clock instant ( ) ) ) { string message = message supplier ! = null ? message supplier get ( ) : null ; string timeout message = string format ( " expected condition failed : % s ( tried for % d second ( s ) with % d milliseconds interval ) " , message = = null ? " waiting for " + is true : message , timeout get seconds ( ) , interval to millis ( ) ) ; throw timeout exception ( timeout message , last exception ) ; } try { sleeper sleep ( interval ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new web driver exception ( e ) ; } } }


releases all resources acquired by this { @ link timer } and cancels all tasks which were scheduled but not executed yet


sets the version on each process definition entity , and the identifier if the map contains an older version for a process definition , then the version is set to that older entity ' s version plus one ; otherwise it is set to 1 also dispatches an entity created event

protected void set process definition versions and ids ( parsed deployment parsed deployment , map < process definition entity , process definition entity > map new to old process definitions ) { command context command context = context get command context ( ) ; if ( parsed deployment get deployment ( ) get project release version ( ) ! = null ) { integer version = parsed deployment get deployment ( ) get version ( ) ; for ( process definition entity process definition : parsed deployment get all process definitions ( ) ) { process definition set version ( version ) ; process definition set id ( get id for new process definition ( process definition ) ) ; if ( command context get process engine configuration ( ) get event dispatcher ( ) is enabled ( ) ) { command context get process engine configuration ( ) get event dispatcher ( ) dispatch event ( activiti event builder create entity event ( activiti event type entity created , process definition ) ) ; } } } else { for ( process definition entity process definition : parsed deployment get all process definitions ( ) ) { int version = 1 ; process definition entity latest = map new to old process definitions get ( process definition ) ; if ( latest ! = null ) { version = latest get version ( ) + 1 ; } process definition set version ( version ) ; process definition set id ( get id for new process definition ( process definition ) ) ; if ( command context get process engine configuration ( ) get event dispatcher ( ) is enabled ( ) ) { command context get process engine configuration ( ) get event dispatcher ( ) dispatch event ( activiti event builder create entity event ( activiti event type entity created , process definition ) ) ; } } } }


< code > optional string msg = 1 ; < code >

public com google protobuf byte string get msg bytes ( ) { object ref = msg ; if ( ref instanceof string ) { com google protobuf byte string b = com google protobuf byte string copy from utf 8 ( ( string ) ref ) ; msg = b ; return b ; } else { return ( com google protobuf byte string ) ref ; } }


deep comparison of array of < code > boolean < code > length and all values are compared the method { @ link # append ( boolean , boolean ) } is used

public equals builder append ( boolean [ ] lhs , boolean [ ] rhs ) { if ( ! is equals ) { return this ; } if ( lhs = = rhs ) { return this ; } if ( lhs = = null | | rhs = = null ) { this set equals ( false ) ; return this ; } if ( lhs length ! = rhs length ) { this set equals ( false ) ; return this ; } for ( int i = 0 ; i < lhs length & & is equals ; + + i ) { append ( lhs [ i ] , rhs [ i ] ) ; } return this ; }


helper method to set username for the first http basic authentication

public void set username ( string username ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof http basic auth ) { ( ( http basic auth ) auth ) set username ( username ) ; return ; } } throw new runtime exception ( " no http basic authentication configured ! " ) ; }


public long get teardown worker validity interval ( ) { return long parse long ( configs map get ( master teardown worker validity interval ms ) ) ; }


is the file a magic file : this predicate doesn ' t check for the fs actually having the magic bit being set

private boolean is magic file ( list < string > elements ) { return is magic path ( elements ) & & ! is commit metadata file ( elements ) ; }


returns the total number of processing runs that have been made

public long get processing total ( ) { return processing total ; }


public void direct map test ( ) { / / todo : test direct map }


exit call just in a function call to enable testing

protected void sysexit ( ) { system exit ( 0 ) ; }


return a ' merged ' bean definition for the given bean name , merging a child bean definition with its parent if necessary this { @ code get merged bean definition } considers bean definition in ancestors as well

public bean definition get merged bean definition ( string name ) throws beans exception { string bean name = transformed bean name ( name ) ; / / efficiently check whether bean definition exists in this factory if ( ! contains bean definition ( bean name ) & & get parent bean factory ( ) instanceof configurable bean factory ) { return ( ( configurable bean factory ) get parent bean factory ( ) ) get merged bean definition ( bean name ) ; } / / resolve merged bean definition locally return get merged local bean definition ( bean name ) ; }


@ t c description : @ test step : @ expect result :

public void multiple tenant deregister instance ( ) throws exception { string service name = random domain name ( ) ; naming 1 register instance ( service name , " 11 11 11 11 " , test port , " c 1 " ) ; naming 1 register instance ( service name , " 22 22 22 22 " , test port , " c 1 " ) ; naming 2 register instance ( service name , " 22 22 22 22 " , test port , " c 1 " ) ; list < instance > instances = naming 1 get all instances ( service name ) ; verify instance list for naming ( naming 1 , 2 , service name ) ; assert assert equals ( 2 , naming 1 get all instances ( service name ) size ( ) ) ; naming 1 deregister instance ( service name , " 22 22 22 22 " , test port , " c 1 " ) ; time unit seconds sleep ( 12 ) ; assert assert equals ( 1 , naming 1 get all instances ( service name ) size ( ) ) ; assert assert equals ( 1 , naming 2 get all instances ( service name ) size ( ) ) ; }


calculates the approximate size of a text , depending on a demo text avoid repeated calls ( e g inside drawing methods )

public static void calc text size ( paint paint , string demo text , f size output f size ) { rect r = m calc text size rect ; r set ( 0 , 0 , 0 , 0 ) ; paint get text bounds ( demo text , 0 , demo text length ( ) , r ) ; output f size width = r width ( ) ; output f size height = r height ( ) ; }


test a thread command execution that fails synchronously but has a fallback

public void test thread isolated observe sync failure with fallback ( ) { test observe failure with fallback ( execution isolation strategy thread , false ) ; }


install the app silently without root permission must hold { @ code android : shared user id = " android uid shell " } and { @ code < uses - permission android : name = " android permission install packages " > }

public static boolean install app silent ( final string file path , final string params ) { return install app silent ( get file by path ( file path ) , params ) ; }


add the given { @ link property source } to the end of the chain

public void add property source ( property source < ? > property source ) { this property sources add ( property source ) ; }


delete user this can only be done by the logged in user

public single < void > rx delete user ( string username ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate delete user ( username , fut ) ) ) ; }


returns { @ code true } if the provided keys are among the keys provided when the table was constructed

public boolean contains ( @ nullable object row key , @ nullable object column key ) { return contains row ( row key ) & & contains column ( column key ) ; }


simple acl tests on a directory : set a default acl , remove default acls

private void test dir acls ( ) throws exception { if ( is local f s ( ) ) { return ; } final string def user 1 = " default : user : glarch : r - x " ; file system proxy fs = file system get ( get proxied f s conf ( ) ) ; file system httpfs = get http f s file system ( ) ; path dir = get proxied f s test dir ( ) ; / * acl status on a directory * / acl status proxy acl stat = proxy fs get acl status ( dir ) ; acl status httpfs acl stat = httpfs get acl status ( dir ) ; assert same acls ( httpfs acl stat , proxy acl stat ) ; assert same acls ( httpfs , proxy fs , dir ) ; / * set a default acl on the directory * / httpfs set acl ( dir , ( acl entry parse acl spec ( def user 1 , true ) ) ) ; proxy acl stat = proxy fs get acl status ( dir ) ; httpfs acl stat = httpfs get acl status ( dir ) ; assert same acls ( httpfs acl stat , proxy acl stat ) ; assert same acls ( httpfs , proxy fs , dir ) ; / * remove the default acl * / httpfs remove default acl ( dir ) ; proxy acl stat = proxy fs get acl status ( dir ) ; httpfs acl stat = httpfs get acl status ( dir ) ; assert same acls ( httpfs acl stat , proxy acl stat ) ; assert same acls ( httpfs , proxy fs , dir ) ; }


executes the given pipeline with for this document unless the pipeline has already been executed for this document

public void execute pipeline ( pipeline pipeline , bi consumer < ingest document , exception > handler ) { if ( executed pipelines add ( pipeline get id ( ) ) ) { object previous pipeline = ingest metadata put ( " pipeline " , pipeline get id ( ) ) ; pipeline execute ( this , ( result , e ) - > { executed pipelines remove ( pipeline get id ( ) ) ; if ( previous pipeline ! = null ) { ingest metadata put ( " pipeline " , previous pipeline ) ; } else { ingest metadata remove ( " pipeline " ) ; } handler accept ( result , e ) ; } ) ; } else { handler accept ( null , new illegal state exception ( pipeline cycle error message + pipeline get id ( ) ) ) ; } }


deletes all children of this directory , recursively

public void empty directory ( ) { throw new gdx runtime exception ( " not available on gwt " ) ; }


returns an iterator that returns the long [ ] representation of each bucket the value inside each long will be a fingerprint ( or 0l , representing empty ) expert - level api

iterator < long [ ] > get buckets ( ) { return new iterator < > ( ) { int current = 0 ; @ override public boolean has next ( ) { return current < num buckets ; } @ override public long [ ] next ( ) { long [ ] values = new long [ entries per bucket ] ; int offset = get offset ( current , 0 ) ; data get ( offset , values , 0 , entries per bucket ) ; current + = 1 ; return values ; } } ; }


generate xml for comments of a certain type

private void generate comment x m l ( address set view addrset , address addr , string builder buf , int commenttype ) { string typename ; switch ( commenttype ) { case code unit eol comment : typename = " user 1 " ; break ; case code unit pre comment : typename = " user 2 " ; break ; case code unit post comment : typename = " user 3 " ; break ; case code unit plate comment : typename = " header " ; break ; default : typename = " " ; break ; } address iterator iter = listing get comment address iterator ( commenttype , addrset , true ) ; while ( iter has next ( ) ) { address commaddr = iter next ( ) ; string text = listing get comment ( commenttype , commaddr ) ; if ( text ! = null ) { if ( commenttype = = code unit plate comment ) { / / plate comments on the function entry / / address are considered part of the header if ( commaddr equals ( addr ) ) { continue ; } } buf append ( " < comment " ) ; spec xml utils encode string attribute ( buf , " type " , typename ) ; buf append ( " > \ n " ) ; buf append ( varnode build x m l address ( addr ) ) ; buf append ( varnode build x m l address ( commaddr ) ) ; buf append ( " \ n < text > " ) ; spec xml utils xml escape ( buf , text ) ; buf append ( " < / text > \ n " ) ; buf append ( " < / comment > \ n " ) ; } } }


public static int get max not writeable retry ( ) { return max not writeable retry ; }


creates the { @ link d b options } for this pre - defined setting

public abstract d b options create d b options ( collection < auto closeable > handles to close ) ;


set the body of the response to the given { @ code object } and return it the parameter { @ code body type } is used to capture the generic type

< t > server response body ( t body , parameterized type reference < t > body type ) ;


records a miss when the hot and cold set are full

private void on full miss ( node node ) { if ( node status = = status cold non res ) { on non resident full miss ( node ) ; } else if ( node status = = status out of clock ) { on out of clock full miss ( node ) ; } else { throw new illegal state exception ( ) ; } }


overridden to paint the hint text over the field when it ' s empty

public void paint component ( graphics g ) { super paint component ( g ) ; if ( ! get text ( ) is empty ( ) | | hint = = null ) { return ; } graphics 2 d g 2 = ( graphics 2 d ) g ; g 2 set color ( color light gray ) ; g 2 set rendering hint ( rendering hints key antialiasing , rendering hints value antialias on ) ; rectangle bounds = get bounds ( ) ; int x = 10 ; / / offset int y = bounds height - bounds y ; / / baseline of text ; bottom of the text field g 2 draw string ( hint , x , y ) ; }


returns a resource on the classpath as a reader object

public static reader get resource as reader ( string resource ) throws i o exception { reader reader ; if ( charset = = null ) { reader = new input stream reader ( get resource as stream ( resource ) ) ; } else { reader = new input stream reader ( get resource as stream ( resource ) , charset ) ; } return reader ; }


assert the response status code is { @ code http status proxy authentication required } ( 407 )

public result matcher is proxy authentication required ( ) { return matcher ( http status proxy authentication required ) ; }


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


returns a { @ link bitmap transition options } object that enables a cross fade animation

public static bitmap transition options with cross fade ( @ non null drawable cross fade factory builder builder ) { return new bitmap transition options ( ) cross fade ( builder ) ; }


can disable a plugin with an optional dependent plugin with strategy none

public void can disable plugin with optional depender strategy none ( ) { assert that ( disable plugins c li command ( " - strategy " , " none " , " dependee " ) , succeeded ( ) ) ; assert plugin disabled ( " dependee " ) ; } @ test @ issue ( " jenkins - 27177 " ) @ with plugin ( { " depender - 0 0 2 hpi " , " dependee - 0 0 2 hpi " , " mandatory - depender - 0 0 2 hpi " }


updates a pet in the store with form data

public void update pet with form ( @ path param ( " pet id " ) long pet id , @ multipart ( value = " name " , required = false ) string name , @ multipart ( value = " status " , required = false ) string status ) ;


set the < code > node label expression < code > of the request

public resource request builder node label expression ( string node label expression ) { resource request set node label expression ( node label expression ) ; return this ; }


add an async wait operator the order to process input records is guaranteed to be the same as input ones

public static < in , out > single output stream operator < out > ordered wait ( data stream < in > in , async function < in , out > func , long timeout , time unit time unit ) { return add operator ( in , func , time unit to millis ( timeout ) , default queue capacity , output mode ordered ) ; }


returns an { @ link escaper } instance that escapes special characters in a string so it can safely be included in xml document as an attribute value see section < a href = " http : www w 3 org t r 2 0 0 8 r e c - xml - 20081126 # a v normalize " > 3 3 3 of the xml specification this escaper substitutes { @ code 0x f f f d } for non - whitespace control characters and the character values { @ code 0x f f f e } and { @ code 0x f f f f } which are not permitted in xml for more detail see section < a href = " http : www w 3 org t r 2 0 0 8 r e c - xml - 20081126 # charsets " > 2 2 of the xml specification this escaper does not escape non - ascii characters to their numeric character references ( ncr ) however , horizontal tab { @ code ' \ t ' } , line feed { @ code ' \ n ' } and carriage return { @ code ' \ r ' } are escaped to a corresponding ncr { @ code " & # x 9 ; " } , { @ code " & # x a ; " } , and { @ code " & # x d ; " } respectively any other non - ascii characters appearing in the input will be preserved in the output this escaper does not treat surrogate pairs specially and does not perform unicode validation on its input

public static escaper xml attribute escaper ( ) { return xml attribute escaper ; }


creates a new builder for the given target that will be resolved by { @ link io grpc name resolver }

public static ok http channel builder for target ( string target , channel credentials creds ) { ssl socket factory result result = ssl socket factory from ( creds ) ; if ( result error ! = null ) { throw new illegal argument exception ( result error ) ; } return new ok http channel builder ( target , result factory , result call credentials ) ; }


set the writer ( andor writer group ) list string

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


public void test big cat ( ) { / / todo : test big cat }


deals with one to any association conditions e g song and album an album have many songs , and a song belongs to one album so if there ' s an album model defined in song with private modifier , and in album there ' s a list or set with generic type of song and declared as private modifier , they are one 2many association if there ' s no list or set defined in album , they will become one 2one associations if there ' s also a song model defined in album with private modifier , maybe the album just have one song , they are one 2one association too when it ' s many 2one association , it ' s easy to just simply add a foreign id column to the many side model ' s table but when it comes to many 2many association , it can not be done without intermediate join table in database lite pal assumes that this join table ' s name is the concatenation of the two target table names in alphabetical order

private void many to any conditions ( string class name , field field , int action ) throws class not found exception { if ( is collection ( field get type ( ) ) ) { string generic type name = get generic type name ( field ) ; / / if the mapping list contains the generic type name , begin to check / / this generic type name class if ( lite pal attr get instance ( ) get class names ( ) contains ( generic type name ) ) { class < ? > reverse dynamic class = class for name ( generic type name ) ; field [ ] reverse fields = reverse dynamic class get declared fields ( ) ; / / look up if there ' s a reverse association / / definition in the reverse class boolean reverse associations = false ; for ( field reverse field : reverse fields ) { / / only map private fields if ( ! modifier is static ( reverse field get modifiers ( ) ) ) { class < ? > reverse field type class = reverse field get type ( ) ; / / if there ' s a from class name defined in the reverse / / class , they are many 2one bidirectional / / associations if ( class name equals ( reverse field type class get name ( ) ) ) { if ( action = = get associations action ) { add into association model collection ( class name , generic type name , generic type name , const model many to one ) ; } else if ( action = = get association info action ) { add into association info collection ( class name , generic type name , generic type name , field , reverse field , const model many to one ) ; } reverse associations = true ; } / / if there ' s a list or set contains from class name / / defined in the reverse class , they are many 2many / / association else if ( is collection ( reverse field type class ) ) { string reverse generic type name = get generic type name ( reverse field ) ; if ( class name equals ( reverse generic type name ) ) { if ( action = = get associations action ) { if ( class name equals ignore case ( generic type name ) ) { / / this is m2m self association condition regard as generic model condition generic model generic model = new generic model ( ) ; generic model set table name ( d b utility get generic table name ( class name , field get name ( ) ) ) ; generic model set value column name ( d b utility get m 2 m self ref column name ( field ) ) ; generic model set value column type ( " integer " ) ; generic model set value id column name ( d b utility get generic value id column name ( class name ) ) ; m generic models add ( generic model ) ; } else { add into association model collection ( class name , generic type name , null , const model many to many ) ; } } else if ( action = = get association info action ) { if ( ! class name equals ignore case ( generic type name ) ) { add into association info collection ( class name , generic type name , null , field , reverse field , const model many to many ) ; } } reverse associations = true ; } } } } / / if there ' s no from class in the defined class , they / / are many 2one unidirectional associations if ( ! reverse associations ) { if ( action = = get associations action ) { add into association model collection ( class name , generic type name , generic type name , const model many to one ) ; } else if ( action = = get association info action ) { add into association info collection ( class name , generic type name , generic type name , field , null , const model many to one ) ; } } } else if ( base utility is generic type supported ( generic type name ) & & action = = get associations action ) { generic model generic model = new generic model ( ) ; generic model set table name ( d b utility get generic table name ( class name , field get name ( ) ) ) ; generic model set value column name ( d b utility convert to valid column name ( field get name ( ) ) ) ; generic model set value column type ( get column type ( generic type name ) ) ; generic model set value id column name ( d b utility get generic value id column name ( class name ) ) ; m generic models add ( generic model ) ; } } }


create a hibernate template for the given session factory only invoked if populating the dao with a session factory reference ! can be overridden in subclasses to provide a hibernate template instance with different configuration , or a custom hibernate template subclass

protected hibernate template create hibernate template ( session factory session factory ) { return new hibernate template ( session factory ) ; }


public undo info < e > modify ( final e old element , final e new element ) { preconditions check argument ( old element ! = new element , " they are the same object : old element = = new element = % s " , new element ) ; preconditions check argument ( old element compare to ( new element get key ( ) ) = = 0 , " the names do not match : old element = % s , new element = % s " , old element , new element ) ; final int c = search ( created , new element get key ( ) ) ; e previous = null ; integer d = null ; if ( c > = 0 ) { / / case 1 1 3 and 2 3 3 : element is already in c - list , previous = created set ( c , new element ) ; / / for previous ! = old element , set it to old element previous = old element ; } else { d = search ( deleted , old element get key ( ) ) ; if ( d < 0 ) { / / case 2 3 : neither in c - list nor d - list add created ( new element , c ) ; add deleted ( old element , d ) ; } } return new undo info < e > ( c , previous , d ) ; }


makes { @ link # visit end } generate a bridge method for the given method handle if the referenced method will be invisible to the generated lambda class

private method reference bridge info queue up bridge method if needed ( handle invoked method ) throws class not found exception { if ( invoked method get name ( ) starts with ( " lambda $ " ) ) { / / we adjust lambda bodies to be visible return method reference bridge info no bridge ( invoked method ) ; } / / invoked method is a method reference if we get here executable invoked = find target method ( invoked method ) ; if ( is visible to lambda class ( invoked , invoked method get owner ( ) ) ) { / / referenced method is visible to the generated class , so nothing to do return method reference bridge info no bridge ( invoked method ) ; } / / we need a bridge method if we get here check state ( ! is interface , " % s is an interface and shouldn ' t need bridge to % s " , internal name , invoked method ) ; check state ( ! invoked method is interface ( ) , " % s ' s lambda classes can ' t see interface method : % s " , internal name , invoked method ) ; method reference bridge info result = bridge methods get ( invoked method ) ; if ( result ! = null ) { return result ; / / we ' re already queued up a bridge method for this method reference } string name = unique in package ( internal name , " bridge $ lambda $ " + bridge methods size ( ) ) ; handle bridge method ; switch ( invoked method get tag ( ) ) { case opcodes h invokestatic : bridge method = new handle ( invoked method get tag ( ) , internal name , name , invoked method get desc ( ) , / * itf * / false ) ; break ; case opcodes h invokevirtual : case opcodes h invokespecial : / / we end up calling these using invokevirtual bridge method = new handle ( opcodes h invokevirtual , internal name , name , invoked method get desc ( ) , / * itf * / false ) ; break ; case opcodes h newinvokespecial : { / / call invisible constructor through generated bridge " factory " method , so we need to / / compute the descriptor for the bridge method from the constructor ' s descriptor string desc = type get method descriptor ( type get object type ( invoked method get owner ( ) ) , type get argument types ( invoked method get desc ( ) ) ) ; bridge method = new handle ( opcodes h invokestatic , internal name , name , desc , / * itf * / false ) ; break ; } case opcodes h invokeinterface : / / shouldn ' t get here default : throw new unsupported operation exception ( " cannot bridge " + invoked method ) ; } result = method reference bridge info bridge ( invoked method , invoked , bridge method ) ; method reference bridge info old = bridge methods put ( invoked method , result ) ; check state ( old = = null , " already had bridge % s so we don ' t also want % s " , old , result ) ; return result ; }


get the erasure coding policy information for specified path

static erasure coding policy get erasure coding policy ( final f s namesystem fsn , final string src , f s permission checker pc ) throws i o exception , access control exception { assert fsn has read lock ( ) ; if ( f s directory is exact reserved name ( src ) ) { return null ; } f s directory fsd = fsn get f s directory ( ) ; final i nodes in path iip = fsd resolve path ( pc , src , dir op read ) ; if ( fsn is permission enabled ( ) ) { fsn get f s directory ( ) check path access ( pc , iip , fs action read ) ; } erasure coding policy ec policy ; if ( iip is dot snapshot dir ( ) ) { ec policy = null ; } else if ( iip get last i node ( ) = = null ) { throw new file not found exception ( " path not found : " + src ) ; } else { ec policy = get erasure coding policy for path ( fsd , iip ) ; } if ( ec policy ! = null & & ec policy is replication policy ( ) ) { ec policy = null ; } return ec policy ; }


initialize global build parameters this method accepts and a initialization function which in turn accepts a { @ link mutable build params } initialization can be done in " stages " , therefore changes override existing values , and values from previous calls to { @ link # init ( consumer ) } carry forward in cases where you want to clear existing values { @ link mutable build params # reset ( ) } may be used

public static void init ( consumer < mutable build params > initializer ) { initializer accept ( mutable build params instance ) ; }


public string get allocation id ( ) { return allocation id ; }


checks if the given type is a composite type use { @ link # get field count ( logical type ) } , { @ link # get field names ( logical type ) } , { @ link # get field types ( logical type ) } for unified handling of composite types

public static boolean is composite type ( logical type logical type ) { if ( logical type instanceof distinct type ) { return is composite type ( ( ( distinct type ) logical type ) get source type ( ) ) ; } logical type root type root = logical type get type root ( ) ; return type root = = logical type root structured type | | type root = = logical type root row ; }


recursively applies { @ link # thumbnail ( request builder ) } so that the { @ link request builder } s are loaded as thumbnails in the given priority order { @ link # thumbnail ( request builder ) } is applied in the order given so that the { @ link request builder } at position 0 has the { @ link request builder } at position 1 applied as using its thumbnail method , the { @ link request builder } at position 1 has the { @ link request builder } at position 2 applied using its thumbnail method and so on calling this method with a { @ code null } list of { @ link request builder } thumbnails or an empty list of { @ link request builder } thumbnails is equivalent to calling { @ link # thumbnail ( request builder ) } with { @ code null } any individual { @ link request builder } in the list of thumbnails provided here may be { @ code null } { @ code null } { @ link request builder } s are ignored and excluded from the recursive chain the { @ link request builder } objects provided here may be mutated and have any previous calls to this method or { @ link # thumbnail ( request builder ) } methods overridden overrides any previous calls to { @ link # thumbnail ( request builder ) } , { @ link # thumbnail ( float ) } and this method

public request builder < transcode type > thumbnail ( @ nullable list < request builder < transcode type > > thumbnails ) { if ( thumbnails = = null | | thumbnails is empty ( ) ) { return thumbnail ( ( request builder < transcode type > ) null ) ; } request builder < transcode type > previous = null ; / / start with the lowest priority thumbnail so that we can safely handle mutations if / / auto clone ( ) is enabled by assigning the result of calling thumbnail ( ) during the iteration / / starting with the highest priority thumbnail would prevent us from assigning the result of / / thumbnail because the mutated request wouldn ' t be used in the next iteration for ( int i = thumbnails size ( ) - 1 ; i > = 0 ; i - - ) { request builder < transcode type > current = thumbnails get ( i ) ; / / ignore null thumbnails if ( current = = null ) { continue ; } if ( previous = = null ) { / / if we don ' t yet have our first non - null request , set it and continue previous = current ; } else { / / otherwise make our next lowest priority request the thumbnail of our current request previous = current thumbnail ( previous ) ; } } return thumbnail ( previous ) ; }


script contexts supported by this engine

set < script context < ? > > get supported contexts ( ) ;


should be called by threads running { @ link g tree task } s

void set thread local monitor ( task monitor monitor ) { thread local monitor set ( monitor ) ; }


increment the write operation counter this is somewhat inaccurate , as it appears to be invoked more often than needed in progress callbacks

public void increment write operations ( ) { statistics increment write ops ( 1 ) ; }


set potential locations of properties files for scripts ( including subscripts ) this should be used when the properties file is not located in the same directory as the script , and the user has supplied one or more potential locations for the properties file ( s )

public void set potential properties file locations ( list < resource file > locations ) { potential properties file locs = locations ; }


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


verify that an object ' s string value path has a single trailing symbol ; returns the object

private static < t > t verify trailing slash ( string role , t o ) { string s = o to string ( ) ; assert true ( role + " lacks trailing slash " + s , s ends with ( " / " ) ) ; assert false ( role + " has double trailing slash " + s , s ends with ( " / / " ) ) ; return o ; }


public mongo database get mongo database ( ) { return database ; }


reallocates the underlying array if necessary calls to this method should be guarded by a test of { @ link # stretchy }

private void ensure capacity ( int desired size ) { if ( data length < desired size ) { byte [ ] new data = new byte [ desired size * 2 + 1000 ] ; system arraycopy ( data , 0 , new data , 0 , cursor ) ; data = new data ; } }


creates a garbage object that counts down the latch in its finalizer sequestered into a separate method to make it somewhat more likely to be unreachable

private static void create unreachable latch finalizer ( final count down latch latch ) { new object ( ) { @ override protected void finalize ( ) { latch count down ( ) ; } } ; }


test for the case when the sbn is configured to checkpoint based on a time period , but no transactions are happening on the active thus , it would want to save a second checkpoint at the same txid , which is a no - op this test makes sure this doesn ' t cause any problem

public void test checkpoint when no new transactions happened ( ) throws exception { / / checkpoint as fast as we can , in a tight loop cluster get configuration ( 1 ) set int ( d f s config keys dfs namenode checkpoint period key , 0 ) ; cluster restart name node ( 1 ) ; nns [ 1 ] = cluster get name node ( 1 ) ; f s image spy image 1 = name node adapter spy on fs image ( nns [ 1 ] ) ; / / we shouldn ' t save any checkpoints at txid = 0 thread sleep ( 1000 ) ; mockito verify ( spy image 1 , mockito never ( ) ) save namespace ( any ( ) ) ; / / roll the primary and wait for the standby to catch up h a test util wait for standby to catch up ( nns [ 0 ] , nns [ 1 ] ) ; thread sleep ( 2000 ) ; / / we should make exactly one checkpoint at this new txid mockito verify ( spy image 1 , mockito times ( 1 ) ) save namespace ( any ( ) , mockito eq ( name node file image ) , any ( ) ) ; }


this lookup provides access to the source for the given hit document note that it should always be set to the correct doc id and { @ link leaf reader context } in most cases , the hit document ' s source is loaded eagerly at the start of the { @ link fetch phase } this lookup will contain the preloaded source

public source lookup source lookup ( ) { return source lookup ; }


flush a { @ link flushable } , with control over whether an { @ code i o exception } may be thrown if { @ code swallow i o exception } is true , then we don ' t rethrow { @ code i o exception } , but merely log it

public static void flush ( flushable flushable , boolean swallow i o exception ) throws i o exception { try { flushable flush ( ) ; } catch ( i o exception e ) { if ( swallow i o exception ) { logger log ( level warning , " i o exception thrown while flushing flushable " , e ) ; } else { throw e ; } } }


public void destroy ( ) { if ( this servlet instance ! = null ) { this servlet instance destroy ( ) ; } }


returns a handle to the sibling with the specified name @ throw gdx runtime exception if this file handle is a { @ link file type # classpath } or { @ link file type # internal } and the sibling doesn ' t exist , or this file is the root

public file handle sibling ( string name ) { throw new gdx runtime exception ( " stub " ) ; }


determines the address ranges that the two programs memories must be broken into for properly comparing the programs each of these address ranges will exist in the first program , the second program or both programs

private void compute ranges ( ) throws program conflict exception { program memory comparator mem comp = new program memory comparator ( program 1 , program 2 ) ; array list < address range > range list = new array list < address range > ( ) ; address range iterator range iter = mem comp get address ranges ( ) ; while ( range iter has next ( ) ) { range list add ( range iter next ( ) ) ; } ranges = range list to array ( new address range [ range list size ( ) ] ) ; }


create rel node tree that produces a list of correlated variables

private rel node create value generator ( iterable < cor ref > correlations , int value gen field offset , sorted map < cor def , integer > cor def outputs ) { final map < rel node , list < integer > > map new input to outputs = new hash map < > ( ) ; final map < rel node , integer > map new input to new offset = new hash map < > ( ) ; / / input provides the definition of a correlated variable / / add to map all the referenced positions ( relative to each input rel ) for ( cor ref cor var : correlations ) { final int old cor var offset = cor var field ; final rel node old input = get cor rel ( cor var ) ; assert old input ! = null ; final frame frame = get frame ( old input , true ) ; assert frame ! = null ; final rel node new input = frame r ; final list < integer > new local outputs ; if ( ! map new input to outputs contains key ( new input ) ) { new local outputs = new array list < > ( ) ; } else { new local outputs = map new input to outputs get ( new input ) ; } final int new cor var offset = frame old to new outputs get ( old cor var offset ) ; / / add all unique positions referenced if ( ! new local outputs contains ( new cor var offset ) ) { new local outputs add ( new cor var offset ) ; } map new input to outputs put ( new input , new local outputs ) ; } int offset = 0 ; / / project only the correlated fields out of each input / / and join the project together / / to make sure the plan does not change in terms of join order , / / join these rels based on their occurrence in cor var list which / / is sorted final set < rel node > joined inputs = new hash set < > ( ) ; rel node r = null ; for ( cor ref cor var : correlations ) { final rel node old input = get cor rel ( cor var ) ; assert old input ! = null ; final rel node new input = get frame ( old input , true ) r ; assert new input ! = null ; if ( ! joined inputs contains ( new input ) ) { final list < integer > positions = map new input to outputs get ( new input ) ; final list < string > field names = new input get row type ( ) get field names ( ) ; rel node distinct = rel builder push ( new input ) project ( rel builder fields ( positions ) ) distinct ( ) build ( ) ; rel opt cluster cluster = distinct get cluster ( ) ; joined inputs add ( new input ) ; map new input to new offset put ( new input , offset ) ; offset + = distinct get row type ( ) get field count ( ) ; if ( r = = null ) { r = distinct ; } else { r = rel builder push ( r ) push ( distinct ) join ( join rel type inner , cluster get rex builder ( ) make literal ( true ) ) build ( ) ; } } } / / translate the positions of correlated variables to be relative to / / the join output , leaving room for value gen field offset because / / value generators are joined with the original left input of the rel / / referencing correlated variables for ( cor ref cor ref : correlations ) { / / the first input of a correlate is always the rel defining / / the correlated variables final rel node old input = get cor rel ( cor ref ) ; assert old input ! = null ; final frame frame = get frame ( old input , true ) ; final rel node new input = frame r ; assert new input ! = null ; final list < integer > new local outputs = map new input to outputs get ( new input ) ; final int new local output = frame old to new outputs get ( cor ref field ) ; / / new output is the index of the cor var in the referenced / / position list plus the offset of referenced position list of / / each new input final int new output = new local outputs index of ( new local output ) + map new input to new offset get ( new input ) + value gen field offset ; cor def outputs put ( cor ref def ( ) , new output ) ; } return r ; }


scales the font by the specified amount in both directions

public void set scale ( float scale x y ) { set scale ( scale x y , scale x y ) ; }


public string get name ( ) { return name ; }


all the ark apk in meta file exist ? fast check , only check whether exist

public static boolean check complete ( string directory , share security check security check , intent intent result ) { string meta = security check get meta content map ( ) get ( ark meat file ) ; if ( meta = = null ) { return true ; } ark hot apk info clear ( ) ; array list < share ark hot diff patch info > all dex info = new array list < > ( ) ; share ark hot diff patch info parse diff patch info ( meta , all dex info ) ; if ( all dex info is empty ( ) ) { return true ; } hash map < string , string > apks = new hash map < > ( 1 ) ; for ( share ark hot diff patch info info : all dex info ) { / / for dalvik , ignore art support dex if ( ! share ark hot diff patch info check diff patch info ( info ) ) { intent result put extra ( share intent util intent patch package patch check , share constants error package check dex meta corrupted ) ; share intent util set intent return code ( intent result , share constants error load patch package check fail ) ; return false ; } if ( is ark hot runing & & share constants arkhot patch name equals ( info name ) ) { ark hot apk info add ( info ) ; } } if ( is ark hot runing & & ! ark hot apk info is empty ( ) ) { apks put ( share constants arkhot patch name , " " ) ; } string apk directory = directory + " / " + arkhot path + " / " ; file dex dir = new file ( apk directory ) ; if ( ! dex dir exists ( ) | | ! dex dir is directory ( ) ) { share intent util set intent return code ( intent result , share constants error load patch version dex directory not exist ) ; return false ; } / / fast check whether there is any dex files missing for ( string name : apks key set ( ) ) { file apk file = new file ( apk directory + name ) ; if ( ! share patch file util is legal file ( apk file ) ) { try { intent result put extra ( share intent util intent patch missing dex path , apk file get canonical path ( ) ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } share intent util set intent return code ( intent result , share constants error load patch version dex file not exist ) ; return false ; } } / / if is ok , add to result intent intent result put extra ( share intent util intent patch dexes path , apks ) ; return true ; }


specify the format name , to be resolved by the jsr - 354 provider at runtime default is none , obtaining a { @ link monetary amount format } based on the current locale

public void set format name ( string format name ) { this format name = format name ; }


atomically removes all of the elements from this queue the queue will be empty after this call returns

public void clear ( ) { final e [ ] items = this items ; final monitor monitor = this monitor ; monitor enter ( ) ; try { int i = take index ; int k = count ; while ( k - - > 0 ) { items [ i ] = null ; i = inc ( i ) ; } count = 0 ; put index = 0 ; take index = 0 ; } finally { monitor leave ( ) ; } }