helper method to create instances of object using the class name specified in the configuration object

@ suppress warnings ( " unchecked " ) public static < t > t create provider instance ( configuration conf , string configured class name , string default value , class < t > type ) throws resource estimator exception { string class name = conf get ( configured class name ) ; if ( class name = = null ) { class name = default value ; } try { class < ? > concrete class = class for name ( class name ) ; if ( type is assignable from ( concrete class ) ) { constructor < t > meth = ( constructor < t > ) concrete class get declared constructor ( empty array ) ; meth set accessible ( true ) ; return meth new instance ( ) ; } else { string builder err msg = new string builder ( ) ; err msg append ( " class : " ) append ( class name ) append ( " not instance of " ) append ( type get canonical name ( ) ) ; throw new resource estimator exception ( err msg to string ( ) ) ; } } catch ( class not found exception e ) { string builder err msg = new string builder ( ) ; err msg append ( " could not instantiate : " ) append ( class name ) append ( " due to exception : " ) append ( e get cause ( ) ) ; throw new resource estimator exception ( err msg to string ( ) ) ; } catch ( reflective operation exception e ) { string builder err msg = new string builder ( ) ; err msg append ( " could not instantiate : " ) append ( class name ) append ( " due to exception : " ) append ( e get cause ( ) ) ; throw new resource estimator exception ( err msg to string ( ) ) ; } }


returns the field format model for this location

public field format model get model ( ) { return model ; }


determine if { @ code c } lies within the range of values defined for < a href = " https : unicode orgglossary # surrogate code point " > surrogate code point

public static boolean is surrogate ( char c ) { return c > = ' \ u d 8 0 0 ' & & c < = ' \ u d f f f ' ; }


returns an unmodifiable view of the specified { @ code set multimap } query operations on the returned multimap " read through " to the specified multimap , and attempts to modify the returned multimap , either directly or through the multimap ' s views , result in an { @ code unsupported operation exception } the returned multimap will be serializable if the specified multimap is serializable

public static < k , v > set multimap < k , v > unmodifiable set multimap ( set multimap < k , v > delegate ) { if ( delegate instanceof unmodifiable set multimap | | delegate instanceof immutable set multimap ) { return delegate ; } return new unmodifiable set multimap < > ( delegate ) ; }


instantiate the web application context for this servlet , either a default { @ link org springframework web context support xml web application context } or a { @ link # set context class custom context class } , if set this implementation expects custom contexts to implement the { @ link org springframework web context configurable web application context } interface can be overridden in subclasses do not forget to register this servlet instance as application listener on the created context ( for triggering its { @ link # on refresh callback } , and to call { @ link org springframework context configurable application context # refresh ( ) } before returning the context instance

protected web application context create web application context ( @ nullable application context parent ) { class < ? > context class = get context class ( ) ; if ( ! configurable web application context class is assignable from ( context class ) ) { throw new application context exception ( " fatal initialization error in servlet with name ' " + get servlet name ( ) + " ' : custom web application context class [ " + context class get name ( ) + " ] is not of type configurable web application context " ) ; } configurable web application context wac = ( configurable web application context ) bean utils instantiate class ( context class ) ; wac set environment ( get environment ( ) ) ; wac set parent ( parent ) ; string config location = get context config location ( ) ; if ( config location ! = null ) { wac set config location ( config location ) ; } configure and refresh web application context ( wac ) ; return wac ; }


returns the number of line data sets this object contains

public int get data set count ( ) { if ( m data sets = = null ) return 0 ; return m data sets size ( ) ; }


sets all operands with the given type to a masked or unmasked state note : this is done in a background task since it may be long - running

private void mask operands by type ( int op type , boolean mask ) { task b task = new task ( " masking operands " , true , true , true ) { @ override public void run ( task monitor monitor ) { monitor set maximum ( get row count ( ) * get column count ( ) ) ; for ( int i = 0 ; i < get row count ( ) ; i + + ) { for ( int j = 0 ; j < get column count ( ) ; j + + ) { if ( monitor is cancelled ( ) ) { return ; } monitor increment progress ( 1 ) ; instruction table data object obj = get cell data ( i , j ) ; mask operand by type ( op type , mask , obj ) ; } } } } ; new task launcher ( b task , this ) ; instruction table model model = ( instruction table model ) get model ( ) ; model fire table data changed ( ) ; }


execute a jdbc data access operation , implemented as callback action working on a jdbc connection this allows for implementing arbitrary data access operations , within spring ' s managed jdbc environment : that is , participating in spring - managed transactions and converting jdbc s q l exceptions into spring ' s data access exception hierarchy the callback action can return a result object , for example a domain object or a collection of domain objects


private static path build work path ( job context context , string uuid ) throws i o exception { if ( context instanceof task attempt context ) { return task attempt working path ( ( task attempt context ) context , uuid ) ; } else { return null ; } }


returns the index of { @ code chars } after the first occurrence of " has include " or - 1 if no such occurrence exists also requires that there be at least 5 characters after the " has include " , corresponding to a pair of parentheses and angle bracketsquotes and a filename this code runs on every line that starts with " # " , so it should be as fast as possible

private static int skip through has include ( byte [ ] chars , int pos , int end ) { int last pos = end - necessary has include length ; while ( pos < = last pos ) { int cur pos = 0 ; while ( cur pos < has include length & & ( chars [ pos + cur pos ] & 0xff ) = = has include char at ( cur pos ) ) { cur pos + + ; } if ( cur pos = = has include length ) { return pos + cur pos ; } / / we ' re looking for " has include " as a preprocessing token , which means that it cannot / / start in the middle of any characters we ' ve already processed , nor at the mismatching / / character pos + = cur pos + 1 ; } return - 1 ; }


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

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


this is similar to { @ link # do i o ( byte buffer , int ) } except that it does not perform any io it just waits for the channel to be ready for io as specified in ops

void wait for i o ( int ops ) throws i o exception { if ( selector select ( channel , ops , timeout ) = = 0 ) { throw new socket timeout exception ( timeout exception string ( channel , timeout , ops ) ) ; } }


transfers the specified source buffer ' s data to this buffer starting at the specified absolute { @ code index } until the source buffer ' s position reaches its limit this method does not modify { @ code reader index } or { @ code writer index } of this buffer

public abstract byte buf set bytes ( int index , byte buffer src ) ;


final boolean is with quota ( ) { return get directory with quota feature ( ) ! = null ; }


writes a { @ code short } as specified by { @ link data output stream # write short ( int ) } , except using little - endian byte order

public void write short ( int v ) throws i o exception { out write ( 0x f f & v ) ; out write ( 0x f f & ( v > > 8 ) ) ; }


ensures that the string has a leading and trailing quote

private string ensure quotes ( string in ) { pattern pattern = pattern compile ( " \ r \ n | \ r | \ n " ) ; matcher matcher = pattern matcher ( in ) ; if ( matcher find ( ) ) { / / if a string has a new line in it add triple quotes to make it a python multiline string return " ' ' ' " + in + " ' ' ' " ; } string str pattern = " ^ [ ' \ " ] * ? [ ' \ " ] $ " ; if ( in matches ( str pattern ) ) { return in ; } return " \ " " + in + " \ " " ; }


write annotation set item into current section

public int write annotation set ( annotation set annotation set ) { int off = data position ( ) ; write int ( annotation set annotation offsets length ) ; for ( int annotation offset : annotation set annotation offsets ) { write int ( annotation offset ) ; } return off ; }


protected object invoke listener method ( string method name , object [ ] arguments ) throws j m s exception { try { method invoker method invoker = new method invoker ( ) ; method invoker set target object ( get delegate ( ) ) ; method invoker set target method ( method name ) ; method invoker set arguments ( arguments ) ; method invoker prepare ( ) ; return method invoker invoke ( ) ; } catch ( invocation target exception ex ) { throwable target ex = ex get target exception ( ) ; if ( target ex instanceof j m s exception ) { throw ( j m s exception ) target ex ; } else { throw new listener execution failed exception ( " listener method ' " + method name + " ' threw exception " , target ex ) ; } } catch ( throwable ex ) { throw new listener execution failed exception ( " failed to invoke target method ' " + method name + " ' with arguments " + object utils null safe to string ( arguments ) , ex ) ; } }


configures and returns a new { @ link edge driver service } using the default configuration in this configuration , the service will use the m s edge driver executable identified by the { @ link # edge driver exe property } system property each service created by this method will be configured to use a free port on the current system

public static edge driver service create default service ( ) { return new edge driver service builder ( ) build ( ) ; }


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

public builder set foo ( java lang string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; foo = value ; on changed ( ) ; return this ; }


protected int get normal layout res id ( ) { return r layout grid item ; }


grant or deny authorization to an operation on a node as a function of :

public void check a c l ( server cnxn cnxn , list < acl > acl , int perm , list < id > ids , string path , list < acl > set acls ) throws keeper exception no auth exception { if ( skip a c l ) { return ; } log debug ( " permission requested : { } " , perm ) ; log debug ( " a c ls for node : { } " , acl ) ; log debug ( " client credentials : { } " , ids ) ; if ( acl = = null | | acl size ( ) = = 0 ) { return ; } for ( id auth id : ids ) { if ( auth id get scheme ( ) equals ( " super " ) ) { return ; } } for ( acl a : acl ) { id id = a get id ( ) ; if ( ( a get perms ( ) & perm ) ! = 0 ) { if ( id get scheme ( ) equals ( " world " ) & & id get id ( ) equals ( " anyone " ) ) { return ; } server authentication provider ap = provider registry get server provider ( id get scheme ( ) ) ; if ( ap ! = null ) { for ( id auth id : ids ) { if ( auth id get scheme ( ) equals ( id get scheme ( ) ) & & ap matches ( new server authentication provider server objs ( this , cnxn ) , new server authentication provider match values ( path , auth id get id ( ) , id get id ( ) , perm , set acls ) ) ) { return ; } } } } } throw new keeper exception no auth exception ( ) ; }


parse the given value into a month { @ code bits cron field } , the fifth entry of a cron expression

public static bits cron field parse month ( string value ) { return bits cron field parse field ( value , type month ) ; }


public static void assert cache empty ( cache cache ) { assert that ( cache get cache space ( ) ) is equal to ( 0 ) ; assert that ( cache get keys ( ) ) is empty ( ) ; }


process the given jsr - 303 constraint violations , adding corresponding errors to the provided spring { @ link errors } object

protected void process constraint violations ( set < constraint violation < object > > violations , errors errors ) { for ( constraint violation < object > violation : violations ) { string field = determine field ( violation ) ; field error field error = errors get field error ( field ) ; if ( field error = = null | | ! field error is binding failure ( ) ) { try { constraint descriptor < ? > cd = violation get constraint descriptor ( ) ; string error code = determine error code ( cd ) ; object [ ] error args = get arguments for constraint ( errors get object name ( ) , field , cd ) ; if ( errors instanceof binding result ) { / / can do custom field error registration with invalid value from constraint violation , / / as necessary for hibernate validator compatibility ( non - indexed set path in field ) binding result binding result = ( binding result ) errors ; string nested field = binding result get nested path ( ) + field ; if ( nested field is empty ( ) ) { string [ ] error codes = binding result resolve message codes ( error code ) ; object error error = new violation object error ( errors get object name ( ) , error codes , error args , violation , this ) ; binding result add error ( error ) ; } else { object rejected value = get rejected value ( field , violation , binding result ) ; string [ ] error codes = binding result resolve message codes ( error code , field ) ; field error error = new violation field error ( errors get object name ( ) , nested field , rejected value , error codes , error args , violation , this ) ; binding result add error ( error ) ; } } else { / / got no binding result - can only do standard reject value call / / with automatic extraction of the current field value errors reject value ( field , error code , error args , violation get message ( ) ) ; } } catch ( not readable property exception ex ) { throw new illegal state exception ( " jsr - 303 validated property ' " + field + " ' does not have a corresponding accessor for spring data binding - " + " check your data binder ' s configuration ( bean property versus direct field access ) " , ex ) ; } } } }


it should be illegal to dereference a normal bean as a factory

public void rejects factory get on normal bean ( ) { assert that exception of type ( bean is not a factory exception class ) is thrown by ( ( ) - > get bean factory ( ) get bean ( " & rod " ) ) ; }


finishes processing altogether and gets the result

public local list finish ( ) { about to process ( integer max value , 0 ) ; int result sz = result size ( ) ; int final sz = result sz - null result count ; if ( final sz = = 0 ) { return empty ; } / * * collect an array of only the non - null entries , and then * sort it to get a consistent order for everything : local * ends and starts for a given address could come in any * order , but we want ends before starts as well as * registers in order ( within ends or starts ) * / entry [ ] result arr = new entry [ final sz ] ; if ( result sz = = final sz ) { result to array ( result arr ) ; } else { int at = 0 ; for ( entry e : result ) { if ( e ! = null ) { result arr [ at + + ] = e ; } } } arrays sort ( result arr ) ; local list result list = new local list ( final sz ) ; for ( int i = 0 ; i < final sz ; i + + ) { result list set ( i , result arr [ i ] ) ; } result list set immutable ( ) ; return result list ; }


a 2 wants a 1 , a 3 wants a 1 and a 2 , a 1 wants a 2 the path is [ a 2 , a 1 , a 2 , a 3 ] , so a 2 occurs twice first occurrence of a 2 does not see a 1 , but the second does = > error

public void duplicate aspect 3 ( ) throws exception { aspect a 1 = create aspect ( " a 1 " , " a 2 " ) ; aspect a 2 = create aspect ( " a 2 " , " a 1 " ) ; aspect a 3 = create aspect ( " a 3 " , " a 1 " , " a 2 " ) ; aspect cycle on path exception e = assert throws ( aspect cycle on path exception class , ( ) - > aspect collection create ( immutable list of ( a 2 , a 1 , a 2 , a 3 ) ) ) ; assert that ( e get aspect ( ) ) is equal to ( a 2 get descriptor ( ) ) ; assert that ( e get previous aspect ( ) ) is equal to ( a 1 get descriptor ( ) ) ; }


represent an invalid use case if the result of the operation is non null , then we put the value with a different key this forces the method to be executed every time

public long get and put ( long id ) { return this counter get and increment ( ) ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


finishes writing the contents of the zip output stream without closing the underlying stream use this method when applying multiple filters in succession to the same output stream

public void finish ( ) throws i o exception { check not finished ( ) ; if ( entry ! = null ) { finish entry ( ) ; } write central directory ( ) ; finished = true ; }


wraps the given runnable such that for the duration of { @ link runnable # run } the thread that is running with have the given name

static runnable thread renaming ( final runnable task , final supplier < string > name supplier ) { check not null ( name supplier ) ; check not null ( task ) ; return new runnable ( ) { @ override public void run ( ) { thread current thread = thread current thread ( ) ; string old name = current thread get name ( ) ; boolean restore name = try set name ( name supplier get ( ) , current thread ) ; try { task run ( ) ; } finally { if ( restore name ) { boolean unused = try set name ( old name , current thread ) ; } } } } ; }


specify locales to initialize eagerly , rather than lazily when actually accessed allows for pre - initialization of common locales , eagerly checking the view configuration for those locales

public void set locales to initialize ( locale locales to initialize ) { this locales to initialize = locales to initialize ; }


public int get begin column ( ) { return bufcolumn [ token begin ] ; }


public tristate is empty directory ( ) { return is empty directory ; }


static public int random sign ( ) { return 1 | ( random next int ( ) > > 31 ) ; }


create streaming calculation of the given metrics name this methods is synchronized due to heavy implementation including creating dynamic class don ' t use this in concurrency runtime

public synchronized < t > boolean create ( string metrics name , string function name , scope type type ) throws illegal argument exception { final class < ? extends meter function > meter function = function register get ( function name ) ; if ( meter function = = null ) { throw new illegal argument exception ( " function " + function name + " can ' t be found " ) ; } type acceptance = null ; for ( final type generic interface : meter function get generic interfaces ( ) ) { if ( generic interface instanceof parameterized type ) { parameterized type parameterized type = ( parameterized type ) generic interface ; if ( parameterized type get raw type ( ) get type name ( ) equals ( acceptable value class get name ( ) ) ) { type [ ] arguments = parameterized type get actual type arguments ( ) ; acceptance = arguments [ 0 ] ; break ; } } } try { return create ( metrics name , function name , type , class for name ( objects require non null ( acceptance ) get type name ( ) ) ) ; } catch ( class not found exception e ) { throw new illegal argument exception ( e ) ; } }


return the result of processing all the bytes


sets up the queue the default implementation just declares the queue the user may override this method to have a custom setup for the queue ( i e binding the queue to an exchange or defining custom queue parameters )

protected void setup queue ( ) throws i o exception { util declare queue defaults ( channel , queue name ) ; }


convert an exception to an { @ code exit exception } this process may just be a simple pass through , otherwise a new exception is created with an exit code , the text of the supplied exception , and the supplied exception as an inner cause if is already the right type , pass it through if it implements { @ link exit code provider # get exit code ( ) } , the exit code is extracted and used in the new exception otherwise , the exit code { @ link launcher exit codes # exit exception thrown } is used

protected static exit util exit exception convert to exit exception ( throwable thrown ) { exit util exit exception exit exception ; / / get the exception message string message = thrown to string ( ) ; int exit code ; if ( thrown instanceof exit code provider ) { / / the exception provides a status code - extract it exit code = ( ( exit code provider ) thrown ) get exit code ( ) ; message = thrown get message ( ) ; if ( message = = null ) { / / some exceptions do not have a message ; fall back / / to the string value message = thrown to string ( ) ; } } else { / / no exception code : use the default exit code = exit exception thrown ; } / / construct the new exception with the original message and / / an exit code exit exception = new service launch exception ( exit code , thrown , message ) ; return exit exception ; }


sets the function calling convention for example , " cdecl "

public void set calling convention ( string calling convention ) { this calling convention = calling convention ; }


relinquish locks held during computation for a short while and reacquire them this will give other threads a chance to acquire the contended locks and run

public boolean yield ( ) { / / are we set up to do this ? if ( limit per run < = 0 | | dir = = null | | fsn = = null ) { return false ; } / / have we reached the limit ? long current count = counts get file count ( ) + counts get symlink count ( ) + counts get directory count ( ) + counts get snapshotable directory count ( ) ; if ( current count < = next count limit ) { return false ; } / / update the next limit next count limit = current count + limit per run ; boolean had dir read lock = dir has read lock ( ) ; boolean had dir write lock = dir has write lock ( ) ; boolean had fsn read lock = fsn has read lock ( ) ; boolean had fsn write lock = fsn has write lock ( ) ; / / sanity check if ( ! had dir read lock | | ! had fsn read lock | | had dir write lock | | had fsn write lock | | dir get read hold count ( ) ! = 1 | | fsn get read hold count ( ) ! = 1 ) { / / cannot relinquish return false ; } / / unlock dir read unlock ( ) ; fsn read unlock ( " content summary " ) ; try { thread sleep ( sleep milli sec , sleep nano sec ) ; } catch ( interrupted exception ie ) { } finally { / / reacquire fsn read lock ( ) ; dir read lock ( ) ; } yield count + + ; return true ; }


searches for a resource file matching the given regex in the given directory this method is primarily intended to be used for the initialization of static { @ link path } fields for resource file ( i e jar , config file ) that reside in the modules { @ code target } directory

public static path get resource ( final string resource name regex ) { / / if the property is not set then we are most likely running in the ide , where the working / / directory is the / / module of the test that is currently running , which is exactly what we want path module directory = module directory get ( paths get ( " " ) to absolute path ( ) ) ; try ( stream < path > dependency resources = files walk ( module directory ) ) { final list < path > matching resources = dependency resources filter ( jar - > pattern compile ( resource name regex ) matcher ( jar to absolute path ( ) to string ( ) ) find ( ) ) collect ( collectors to list ( ) ) ; switch ( matching resources size ( ) ) { case 0 : throw new runtime exception ( new file not found exception ( string format ( " no resource file could be found that matches the pattern % s " + " this could mean that the test module must be rebuilt via maven " , resource name regex ) ) ) ; case 1 : return matching resources get ( 0 ) ; default : throw new runtime exception ( new i o exception ( string format ( " multiple resource files were found matching the pattern % s matches = % s " , resource name regex , matching resources ) ) ) ; } } catch ( final i o exception ioe ) { throw new runtime exception ( " could not search for resource resource files " , ioe ) ; } }


quote the server name so that users specifying the host http header can ' t inject attacks

public string get server name ( ) { return html quoting quote html chars ( raw request get server name ( ) ) ; }


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


set the url path helper to configure on the { @ code simple url handler mapping } used to map handshake requests

public void set url path helper ( @ nullable url path helper url path helper ) { this url path helper = url path helper ; }


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


test replica placement policy in case last node is invalid we create 6 nodes but the last node is in fault topology ( with rack info ) , so cannot be added to cluster we should test proper exception is thrown in adding node but shouldn ' t affect the cluster

public void test choose random excluded node ( ) { string scope = " ~ " + node base get path ( data nodes [ 0 ] ) ; map < node , integer > frequency = pick nodes at random ( 100 , scope ) ; for ( node key : data nodes ) { / / all nodes except the first should be more than zero assert true ( frequency get ( key ) > 0 | | key = = data nodes [ 0 ] ) ; } }


returns the domain object that the change refers to

public program get program ( ) { return program ref get ( ) ; }


clears the previously open domain object which has been closed

synchronized boolean clear domain object ( string pathname ) { domain object adapter doa = open domain objects get ( pathname ) ; if ( doa ! = null ) { open domain objects remove ( pathname ) ; return true ; } return false ; }


gets a view by its name note : personal user ' s views aren ' t supported now

public view get view ( final string name ) { view group group = jenkins get ( ) ; view view = null ; final string tokenizer tok = new string tokenizer ( name , " / " ) ; while ( tok has more tokens ( ) ) { string view name = tok next token ( ) ; view = group get view ( view name ) ; if ( view = = null ) { group check permission ( view read ) ; throw new illegal argument exception ( string format ( " no view named % s inside view % s " , view name , group get display name ( ) ) ) ; } view check permission ( view read ) ; if ( view instanceof view group ) { group = ( view group ) view ; } else if ( tok has more tokens ( ) ) { throw new illegal state exception ( view get view name ( ) + " view can not contain views " ) ; } } return view ; }


bind a { @ code null } value to a parameter identified by its { @ code index }

generic execute spec bind null ( int index , class < ? > type ) ;


blocks until the task is complete or the timeout expires throws a { @ link timeout exception } if the timer expires , otherwise behaves like { @ link # get ( ) }

v get ( long nanos ) throws timeout exception , cancellation exception , execution exception , interrupted exception { / / attempt to acquire the shared lock with a timeout if ( ! try acquire shared nanos ( - 1 , nanos ) ) { throw new timeout exception ( " timeout waiting for task " ) ; } return get value ( ) ; }


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


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


private feature check feature ( point location ) { for ( feature feature : features ) { if ( feature get location ( ) get latitude ( ) = = location get latitude ( ) & & feature get location ( ) get longitude ( ) = = location get longitude ( ) ) { return feature ; } } / / no feature was found , return an unnamed feature return feature new builder ( ) set name ( " " ) set location ( location ) build ( ) ; }


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


public int get register count ( ) { return 3 ; }


creates the collection of values for a single key collections with weak , soft , or phantom references are not supported each call to { @ code create collection } should create a new instance the returned collection class determines whether duplicate key - value pairs are allowed

abstract collection < v > create collection ( ) ;


set value of context register between begad and endad

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


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

public static void write unsigned leb 1 2 8 ( byte output out , int value ) { int remaining = value > > > 7 ; while ( remaining ! = 0 ) { out write byte ( ( byte ) ( ( value & 0x 7f ) | 0x 8 0 ) ) ; value = remaining ; remaining > > > = 7 ; } out write byte ( ( byte ) ( value & 0x 7f ) ) ; }


return whether the associated code unit has an end of line comment

public boolean has e o l ( ) { return ( display comment arrays [ my eols ] ! = null ) & & ( ( ( string [ ] ) display comment arrays [ my eols ] ) length > 0 ) ; }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 0 : / / success return success ; default : return null ; } }


returns the message type forwarded to { @ link target # handle message ( int , object ) }

public int get type ( ) { return type ; }


register the one ofany of descendants of the model class

public static void register descendants ( class < ? > model class , map < string , generic type > descendants ) { model descendants put ( model class , descendants ) ; }


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


return the property value associated with the given key , converted to the given target type ( never { @ code null } )

< t > t get required property ( string key , class < t > target type ) throws illegal state exception ;


adds the broadcast connection identified by the given { @ code name } to this node

public void add broadcast connection ( string name , dag connection broadcast connection ) { this broadcast connection names add ( name ) ; this broadcast connections add ( broadcast connection ) ; }


returns the custom metadata that was attached to this snapshot at creation time

public map < string , object > user metadata ( ) { return user metadata ; }


positive test to verify file delete access check

public void test file delete access check positive ( ) throws throwable { path parent dir = new path ( " / " ) ; path test path = new path ( parent dir , " test dat " ) ; authorizer add auth rule for owner ( " / " , write , true ) ; fs update wasb authorizer ( authorizer ) ; try { fs create ( test path ) ; contract test utils assert path exists ( fs , " test path was not created " , test path ) ; } finally { fs delete ( test path , false ) ; contract test utils assert path does not exist ( fs , " test path exists after deletion ! " , test path ) ; } }


returns a { @ link media source event listener event dispatcher } which dispatches all events to the registered listeners with the specified media period id

protected final media source event listener event dispatcher create event dispatcher ( @ nullable media period id media period id ) { return event dispatcher with parameters ( / * window index = * / 0 , media period id , / * media time offset ms = * / 0 ) ; }


specify a typed root object to resolve against default is none , expecting an object argument at evaluation time

public builder with typed root object ( object root object , type descriptor type descriptor ) { this root object = new typed value ( root object , type descriptor ) ; return this ; }


tests delegation token a p is in file context for hdfs ; and renew and cancel a p is in hdfs

public void test fc delegation token ( ) throws unsupported file system exception , i o exception , interrupted exception { file context fc hdfs = file context get file context ( cluster get file system ( ) get uri ( ) ) ; final abstract file system afs = fc hdfs get default file system ( ) ; final list < token < ? > > token list = afs get delegation tokens ( user group information get current user ( ) get user name ( ) ) ; ( ( hdfs ) afs ) renew delegation token ( ( token < delegation token identifier > ) token list get ( 0 ) ) ; ( ( hdfs ) afs ) cancel delegation token ( ( token < ? extends abstract delegation token identifier > ) token list get ( 0 ) ) ; }


public void header ( string header , java sql date value ) { response add date header ( header , value get time ( ) ) ; }


returns true if we successfully loaded native libraries if this returns false , then native operations such as locking memory did not work

public static boolean is natives available ( ) { return natives jna available ; }


check whether the given { @ code char sequence } contains any whitespace characters

public static boolean contains whitespace ( @ nullable char sequence str ) { if ( ! has length ( str ) ) { return false ; } int str len = str length ( ) ; for ( int i = 0 ; i < str len ; i + + ) { if ( character is whitespace ( str char at ( i ) ) ) { return true ; } } return false ; }


disassemble an instruction , presumably the result of assembly

protected pseudo instruction disassemble ( long addr , byte [ ] ins , byte [ ] ctx ) throws insufficient bytes exception , unknown instruction exception , address overflow exception , memory access exception { address at = lang get default space ( ) get address ( addr ) ; context set context register ( ctx ) ; mem buffer buf = new byte mem buffer impl ( at , ins , lang is big endian ( ) ) ; instruction prototype ip = lang parse ( buf , context , false ) ; return new pseudo instruction ( at , ip , buf , context ) ; }


get the effective bit - size based upon the specified base type size a bit size larger than the base type size will truncated to the base type size

public static int get effective bit size ( int declared bit size , int base type byte size ) { return math min ( 8 * base type byte size , declared bit size ) ; }


add the supplied { @ code action state } if { @ code fire first event } is { @ code true } the first one will fire its event

public void add action state ( action state < t > action state ) { action states add ( action state ) ; if ( action states size ( ) = = 1 & & fire first event ) { set current action state ( action state ) ; } }


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


public static list < string > get source paths ( context context ) throws package manager name not found exception , i o exception { application info application info = context get package manager ( ) get application info ( context get package name ( ) , 0 ) ; file source apk = new file ( application info source dir ) ; list < string > source paths = new array list < > ( ) ; source paths add ( application info source dir ) ; / / add the default apk path / / the prefix of extracted file , ie : test classes string extracted file prefix = source apk get name ( ) + extracted name ext ; / / ， classesx ， / / ， ， if ( ! is v m multidex capable ( ) ) { / / the total dex numbers int total dex number = get multi dex preferences ( context ) get int ( key dex number , 1 ) ; file dex dir = new file ( application info data dir , secondary folder name ) ; for ( int secondary number = 2 ; secondary number < = total dex number ; secondary number + + ) { / / for each dex file , ie : test classes 2 zip , test classes 3 zip string file name = extracted file prefix + secondary number + extracted suffix ; file extracted file = new file ( dex dir , file name ) ; if ( extracted file is file ( ) ) { source paths add ( extracted file get absolute path ( ) ) ; / / we ignore the verify zip part } else { throw new i o exception ( " missing extracted secondary dex file ' " + extracted file get path ( ) + " ' " ) ; } } } if ( a router debuggable ( ) ) { / / search instant run support only debuggable source paths add all ( try load instant run dex file ( application info ) ) ; } return source paths ; }


writes this dependency set object for a specified output file under the root dir , and with a given suffix

public void write ( path out file , string suffix ) throws i o exception { path dotd file = out file get relative ( file system utils replace extension ( out file as fragment ( ) , suffix ) ) ; try ( print stream out = new print stream ( dotd file get output stream ( ) ) ) { out print ( out file relative to ( root ) + " : " ) ; for ( path d : dependencies ) { out print ( " \ \ \ n " + d get path string ( ) ) ; / / should already be root relative } out println ( ) ; } }


initializes the extractor with an { @ link extractor output } called at most once

void init ( extractor output extractor output ) ;


returns an iterator that walks all the layout items in this model , starting at the specified index

public default layout model iterator iterator ( big integer start index ) { return new layout model iterator ( this , start index ) ; }


public void float item test ( ) { / / todo : test float item }


initialize custom signers and register them with the aws sdk

public void init custom signers ( ) { string [ ] custom signers = owner conf get trimmed strings ( custom signers ) ; if ( custom signers = = null | | custom signers length = = 0 ) { / / no custom signers specified , nothing to do log debug ( " no custom signers specified " ) ; return ; } for ( string custom signer : custom signers ) { string [ ] parts = custom signer split ( " : " ) ; if ( ! ( parts length = = 1 | | parts length = = 2 | | parts length = = 3 ) ) { string message = " invalid format ( expected name , name : signer class , " + " name : signer class : signer initializer class ) " + " for custom signer : [ " + custom signer + " ] " ; log error ( message ) ; throw new illegal argument exception ( message ) ; } if ( parts length = = 1 ) { / / nothing to do trying to use a pre - defined signer } else { / / register any custom signer maybe register signer ( parts [ 0 ] , parts [ 1 ] , owner conf ) ; / / if an initializer is specified , take care of instantiating it and / / setting it up if ( parts length = = 3 ) { class < ? extends aws signer initializer > clazz = null ; try { clazz = ( class < ? extends aws signer initializer > ) owner conf get class by name ( parts [ 2 ] ) ; } catch ( class not found exception e ) { throw new runtime exception ( string format ( " signer initializer class " + " [ % s ] not found for signer [ % s ] " , parts [ 2 ] , parts [ 0 ] ) , e ) ; } log debug ( " creating signer initializer : [ { } ] for signer : [ { } ] " , parts [ 2 ] , parts [ 0 ] ) ; aws signer initializer signer initializer = reflection utils new instance ( clazz , null ) ; initializers add ( signer initializer ) ; signer initializer register store ( bucket name , owner conf , delegation token provider , owner ugi ) ; } } } }


applies the given window function to each window the window function is called for each evaluation of the window for each key individually the output of the window function is interpreted as a regular non - windowed stream arriving data is incrementally aggregated using the given reducer

public < r > single output stream operator < r > reduce ( reduce function < t > reduce function , process all window function < t , r , w > function ) { type information < r > result type = get process all window function return type ( function , input get type ( ) ) ; return reduce ( reduce function , function , result type ) ; }


return the command line argument for this option

public string get arg ( ) { return command line argument ; }


returns the sets of proto files that were added using proto library dependencies

private nested set < artifact > get proto deps sources ( ) { nested set builder < artifact > artifacts = nested set builder stable order ( ) ; iterable < proto info > providers = rule context get prerequisites ( " deps " , proto info provider ) ; for ( proto info provider : providers ) { artifacts add transitive ( provider get transitive proto sources ( ) ) ; } return artifacts build ( ) ; }


public int get slot idx ( ) { return ints checked cast ( ( slot address - base address ) / bytes per slot ) ; }


add a set of deleted indexes to the list of tombstones in the cluster state

public builder add tombstones ( final collection < index > indices ) { for ( index index : indices ) { add tombstone ( index ) ; } return this ; }


make sure the tracker returned from the stub factory follows the basic lifecycle

public void test stub duration lifecycle ( ) throws throwable { duration tracker tracker = stub duration tracker factory track duration ( " k " , 1 ) ; tracker failed ( ) ; tracker close ( ) ; tracker close ( ) ; }


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


recycle a list of poolables that this pool is capable of generating the t instances passed must not already exist inside this or any other object pool instance

public synchronized void recycle ( list < t > objects ) { while ( objects size ( ) + this objects pointer + 1 > this desired capacity ) { this resize pool ( ) ; } final int objects list size = objects size ( ) ; / / not relying on recycle ( t object ) because this is more performant for ( int i = 0 ; i < objects list size ; i + + ) { t object = objects get ( i ) ; if ( object current owner id ! = poolable no owner ) { if ( object current owner id = = this pool id ) { throw new illegal argument exception ( " the object passed is already stored in this pool ! " ) ; } else { throw new illegal argument exception ( " the object to recycle already belongs to pool id " + object current owner id + " object cannot belong to two different pool instances simultaneously ! " ) ; } } object current owner id = this pool id ; this objects [ this objects pointer + 1 + i ] = object ; } this objects pointer + = objects list size ; }


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


test that a structure array can ' t be added to the same structure

public void test cyclic dependency problem 2 ( ) { array array = create array ( union , 3 ) ; try { union add ( array ) ; assert fail ( " shouldn ' t be able to add a union array to the same union " ) ; } catch ( illegal argument exception e ) { / / should get an exception from adding the union to itself } try { union insert ( 0 , array ) ; assert fail ( " shouldn ' t be able to insert a union array into the same union " ) ; } catch ( illegal argument exception e ) { / / should get an exception from inserting the union to itself } }


prepare the base allocation response use last s c response and last heartbeat time stamp to assemble entries about cluster - wide info , e g available resource , num cluster nodes

protected allocate response generate base allocation response ( ) { allocate response base response = record factory new record instance ( allocate response class ) ; base response set available resources ( resource new instance ( 0 , 0 ) ) ; base response set num cluster nodes ( 0 ) ; set < sub cluster id > expired s c = get timed out s cs ( false ) ; for ( entry < sub cluster id , allocate response > entry : last s c response entry set ( ) ) { if ( expired s c contains ( entry get key ( ) ) ) { / / skip expired sub - clusters continue ; } allocate response response = entry get value ( ) ; if ( response get available resources ( ) ! = null ) { base response set available resources ( resources add ( base response get available resources ( ) , response get available resources ( ) ) ) ; } base response set num cluster nodes ( base response get num cluster nodes ( ) + response get num cluster nodes ( ) ) ; } return base response ; }


set field ' s long value all fixed - length field objects must implement this method

public void set long value ( long value ) { throw new illegal field access exception ( ) ; }


this recreates the new working directory of the recovered rocks d b instance and linkscopies the contents from a local state

private void restore instance directory from path ( path source , string instance rocks d b path ) throws i o exception { final path instance rocks d b directory = paths get ( instance rocks d b path ) ; final path [ ] files = file utils list directory ( source ) ; for ( path file : files ) { final string file name = file get file name ( ) to string ( ) ; final path target file = instance rocks d b directory resolve ( file name ) ; if ( file name ends with ( sst file suffix ) ) { / / hardlink ' ing the immutable sst - files files create link ( target file , file ) ; } else { / / true copy for all other files files copy ( file , target file , standard copy option replace existing ) ; } } }


derive a default bean name from the given bean definition the default implementation delegates to { @ link # build default bean name ( bean definition ) }

protected string build default bean name ( bean definition definition , bean definition registry registry ) { return build default bean name ( definition ) ; }


public int total size ( ) { return total size ; }


sets the log file extension if unset , the value of " extension " from the jvm logging configuration for { @ link simple log handler } will be used ; and if that ' s unset , the process id will be used

public builder set extension ( string extension ) { this extension = extension ; return this ; }


public long get total input size ( ) { return this file size ; }


encapsulate the obtained log information into a map

private map < string , string > to message map ( string logger name , string level , object args ) { map < string , string > message map = new hash map < > ( ) ; message map put ( " log kind " , logger name ) ; message map put ( " event " , level ) ; int param start = 2 ; / / like ` warn ( string format , object arg ) ` if ( args [ 0 ] instanceof string ) { param start = 1 ; message map put ( " message " , args [ 0 ] to string ( ) ) ; } else { message map put ( " message " , args [ 1 ] to string ( ) ) ; } / / build log for ( int i = param start ; i < args length ; i + + ) { string key = " param " + ( i - param start + 1 ) ; message map put ( key , args [ i ] to string ( ) ) ; } return message map ; }


creates a mock drawee controller with some methods stubbed

public static drawee controller mock controller ( ) { drawee controller controller = mock ( abstract drawee controller class ) ; stub get and set hierarchy ( controller ) ; stub get and set content description ( controller ) ; return controller ; }


public string to human ( ) { return integer to string ( get int bits ( ) ) ; }


return the configured handlers , or possibly { @ code null } if not initialized yet via { @ link # after properties set ( ) }

public handler method return value handler composite get return value handlers ( ) { return this return value handlers ; }


returns a quoted version of the given string , if necessary

private string quoted string ( string string ) { return string length ( ) = = 0 | | string index of ( ' ' ) > = 0 | | string index of ( ' @ ' ) > = 0 | | string index of ( ' { ' ) > = 0 | | string index of ( ' } ' ) > = 0 | | string index of ( ' ( ' ) > = 0 | | string index of ( ' ) ' ) > = 0 | | string index of ( ' : ' ) > = 0 | | string index of ( ' ; ' ) > = 0 | | string index of ( ' , ' ) > = 0 ? ( " ' " + string + " ' " ) : ( string ) ; }


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


{ @ inherit doc } this implementation is empty

public void configure async support ( async support configurer configurer ) { }


manually run this to write binary snapshot data

public void write savepoint ( ) throws exception { final stream execution environment env = stream execution environment get execution environment ( ) ; switch ( flink generate savepoint backend type ) { case state backend loader rocksdb state backend name : env set state backend ( new rocks d b state backend ( new memory state backend ( ) ) ) ; break ; case state backend loader memory state backend name : env set state backend ( new memory state backend ( ) ) ; break ; default : throw new unsupported operation exception ( ) ; } env enable checkpointing ( 500 ) ; env set parallelism ( 4 ) ; env set max parallelism ( 4 ) ; env add source ( new legacy checkpointed source ( num source elements ) ) set max parallelism ( 1 ) uid ( " legacy checkpointed source " ) flat map ( new legacy checkpointed flat map ( ) ) start new chain ( ) uid ( " legacy checkpointed flat map " ) key by ( 0 ) flat map ( new legacy checkpointed flat map with keyed state ( ) ) start new chain ( ) uid ( " legacy checkpointed flat map with keyed state " ) key by ( 0 ) flat map ( new keyed state setting flat map ( ) ) start new chain ( ) uid ( " keyed state setting flat map " ) key by ( 0 ) transform ( " custom operator " , new type hint < tuple 2 < long , long > > ( ) { } get type info ( ) , new checkpointed udf operator ( new legacy checkpointed flat map with keyed state ( ) ) ) uid ( " legacy checkpointed operator " ) key by ( 0 ) transform ( " timely stateful operator " , new type hint < tuple 2 < long , long > > ( ) { } get type info ( ) , new timely stateful operator ( ) ) uid ( " timely stateful operator " ) add sink ( new accumulator counting sink < tuple 2 < long , long > > ( ) ) ; execute and savepoint ( env , " src / test / resources / " + get savepoint path ( flink generate savepoint version , flink generate savepoint backend type ) , new tuple 2 < > ( accumulator counting sink num elements accumulator , num source elements ) ) ; }


returns whether the subtitle button is shown

public boolean get show subtitle button ( ) { return control view layout manager get show button ( subtitle button ) ; }


test proper handling where an object is not equal to one the user has said should be equal

public void test invalid not equals equal object ( ) { equals tester add equality group ( reference , not equal object 1 ) ; try { equals tester test equals ( ) ; } catch ( assertion failed error e ) { assert error message ( e , reference + " [ group 1 , item 1 ] " ) ; assert error message ( e , not equal object 1 + " [ group 1 , item 2 ] " ) ; return ; } fail ( " should get not equal to equal object error " ) ; }


get subscribe information from client side

public groupkey listenser status get all sub client config by ip ( @ request param ( " ip " ) string ip , @ request param ( value = " all " , required = false ) boolean all , @ request param ( value = " tenant " , required = false ) string tenant , @ request param ( value = " sample time " , required = false , default value = " 1 " ) int sample time , model map model map ) throws exception { sample result collect sample result = config sub service get collect sample result by ip ( ip , sample time ) ; groupkey listenser status gls = new groupkey listenser status ( ) ; gls set collect status ( 200 ) ; map < string , string > config md 5 status = new hash map < string , string > ( 100 ) ; if ( collect sample result get lisenters groupkey status ( ) ! = null ) { map < string , string > status = collect sample result get lisenters groupkey status ( ) ; for ( map entry < string , string > config : status entry set ( ) ) { if ( ! string utils is blank ( tenant ) ) { if ( config get key ( ) contains ( tenant ) ) { config md 5 status put ( config get key ( ) , config get value ( ) ) ; } } else { / / get common config default value , if want to get all config , you need to add " all " if ( all ) { config md 5 status put ( config get key ( ) , config get value ( ) ) ; } else { string [ ] config keys = group key 2 parse key ( config get key ( ) ) ; if ( string utils is blank ( config keys [ 2 ] ) ) { config md 5 status put ( config get key ( ) , config get value ( ) ) ; } } } } gls set lisenters groupkey status ( config md 5 status ) ; } return gls ; }


public void test map array merger ( ) { map < object , object > map one = new hash map < object , object > ( ) { { put ( " 11 " , 222 ) ; put ( " 223 " , 11 ) ; } } ; map < object , object > map two = new hash map < object , object > ( ) { { put ( " 3333 " , 3232 ) ; put ( " 444 " , 2323 ) ; } } ; map < object , object > result = merger factory get merger ( map class ) merge ( map one , map two , null ) ; assertions assert equals ( 4 , result size ( ) ) ; map < string , integer > merged result = new hash map < string , integer > ( ) { { put ( " 11 " , 222 ) ; put ( " 223 " , 11 ) ; put ( " 3333 " , 3232 ) ; put ( " 444 " , 2323 ) ; } } ; assertions assert equals ( merged result , result ) ; result = merger factory get merger ( map class ) merge ( null ) ; assertions assert equals ( 0 , result size ( ) ) ; result = merger factory get merger ( map class ) merge ( null , null ) ; assertions assert equals ( 0 , result size ( ) ) ; }


no magic bytes , so check for an empty directory in the first header

public final static boolean is y a f f s 2 image ( program program ) { byte [ ] bytes = new byte [ y a f f s 2 constants magic size ] ; try { address address = program get min address ( ) ; program get memory ( ) get bytes ( address , bytes ) ; } catch ( exception e ) { } / / check for initial byte equal to 0x 0 3 , ' directory ' / / and check that the first byte of the file name is null / / this is the yaffs 2 root level dir header return ( ( bytes [ 0 ] = = 0x 0 3 ) & & ( bytes [ 10 ] = = 0x 0 0 ) ) ; }


compare content of file operations using a double byte array

public static void validate file content ( byte [ ] concat , byte [ ] [ ] bytes ) { int idx = 0 ; boolean mismatch = false ; for ( byte [ ] bb : bytes ) { for ( byte b : bb ) { if ( b ! = concat [ idx + + ] ) { mismatch = true ; break ; } } if ( mismatch ) { break ; } } assert false ( " file content of file is not as expected at offset " + idx , mismatch ) ; }


public void select all cells ( ) { check widget ( ) ; select all cells internal ( 0 ) ; }


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


public synchronized r m admin request interceptor get root interceptor ( ) { return root interceptor ; }


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


protected void assert in state ( service service , service state expected ) { assert not null ( service ) ; service state actual = service get service state ( ) ; failif ( actual ! = expected , " service % s in state % s expected state : % s " , service get name ( ) , actual , expected ) ; }


set degrade rules for provided resource former rules of the resource will be replaced

public static boolean set rules for resource ( string resource name , set < degrade rule > rules ) { assert util not empty ( resource name , " resource name cannot be empty " ) ; try { map < string , set < degrade rule > > new rule map = new hash map < > ( rule map ) ; if ( rules = = null ) { new rule map remove ( resource name ) ; } else { set < degrade rule > new set = new hash set < > ( ) ; for ( degrade rule rule : rules ) { if ( is valid rule ( rule ) & & resource name equals ( rule get resource ( ) ) ) { new set add ( rule ) ; } } new rule map put ( resource name , new set ) ; } list < degrade rule > all rules = new array list < > ( ) ; for ( set < degrade rule > set : new rule map values ( ) ) { all rules add all ( set ) ; } return current property update value ( all rules ) ; } catch ( throwable e ) { record log error ( " [ degrade rule manager ] unexpected error when setting circuit breaking " + " rules for resource : " + resource name , e ) ; return false ; } }


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

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


root object mapper root ( ) { return root ; }


reinitialize configuration before every test since dn stores the parsed startup option in the configuration

public void init configuration ( ) { conf = new hdfs configuration ( ) ; }


get the starting position of the block in the file

public long get start pos ( ) { return r blk state get block region ( ) get offset ( ) ; }


get a meaningful name for a token type useful during code generation literals without associated names are converted to the string equivalent of their integer values used to generate x = = id and x = = 34 type comparisons etc essentially we are looking for the most obvious way to refer to a token type in the generated code

public string get token type as target label ( grammar g , int ttype ) { string name = g get token name ( ttype ) ; / / if name is not valid , return the token type instead if ( grammar invalid token name equals ( name ) ) { return string value of ( ttype ) ; } return name ; }


create a configuration , possibly patching in s 3 guard options

protected configuration create configuration ( ) { configuration conf = super create configuration ( ) ; / / patch in s 3 guard options maybe enable s 3 guard ( conf ) ; return conf ; }


public double get ( int i , int j ) { return data [ j * m + i ] ; }


public void set data node u u i d ( string node i d ) { this data node u u i d = node i d ; }


sets the interval of the date histogram using fixed units ( ` 1ms ` , ` 1s ` , ` 1 0m ` , ` 4h ` , etc ) these are not calendar aware and are simply multiples of fixed , si units this is mutually exclusive with { @ link date histogram values source builder # calendar interval ( date histogram interval ) }

public date histogram values source builder fixed interval ( date histogram interval interval ) { date histogram interval fixed interval ( interval ) ; return this ; }


shutdown callback : stop the service and set an atomic boolean if it stopped within the shutdown time

public void run ( ) { if ( service ! = null ) { service stop ( ) ; service was shutdown set ( service wait for service to stop ( shutdown time millis ) ) ; } else { service was shutdown set ( true ) ; } }


use this when you don ' t want to participate in global resources and you want to customize the creation of the managed { @ code loop resources } by default , { @ code loop resources create ( " reactor - http " ) } is used note that this option is ignored if { @ code user global resources = false } or { @ link # set loop resources ( loop resources ) } is set

public void set loop resources supplier ( supplier < loop resources > supplier ) { this loop resources supplier = supplier ; }


performs syntactical check on the remote fs for agents

public form validation do check remote f s ( @ query parameter string value ) throws i o exception , servlet exception { if ( util fix empty and trim ( value ) = = null ) return form validation error ( messages slave remote director mandatory ( ) ) ; if ( value starts with ( " \ \ \ \ " ) | | value starts with ( " / net / " ) ) return form validation warning ( messages slave network mounted file system warning ( ) ) ; if ( util is relative path ( value ) ) { return form validation warning ( messages slave remote relative path warning ( ) ) ; } return form validation ok ( ) ; }


resolves a uri reported by { @ link data source # get uri ( ) } for event reporting and caching purposes implementations do not need to overwrite this method unless they want to change the reported uri this method is not allowed to block

default uri resolve reported uri ( uri uri ) { return uri ; }


invoke the method after resolving its argument values in the context of the given message argument values are commonly resolved through { @ link handler method argument resolver handler method argument resolvers } the { @ code provided args } parameter however may supply argument values to be used directly , i e without argument resolution delegates to { @ link # get method argument values } and calls { @ link # do invoke } with the resolved arguments

public object invoke ( message < ? > message , object provided args ) throws exception { object [ ] args = get method argument values ( message , provided args ) ; if ( logger is trace enabled ( ) ) { logger trace ( " arguments : " + arrays to string ( args ) ) ; } return do invoke ( args ) ; }


load the spi instance with highest priority note : each call return same instances

public static < t > t load highest priority instance ( class < t > clazz ) { try { string key = clazz get name ( ) ; / / not thread - safe , as it ' s expected to be resolved in a thread - safe context service loader < t > service loader = service loader map get ( key ) ; if ( service loader = = null ) { service loader = service loader util get service loader ( clazz ) ; service loader map put ( key , service loader ) ; } spi order wrapper < t > w = null ; for ( t spi : service loader ) { int order = spi order resolver resolve order ( spi ) ; record log info ( " [ spi loader ] found { } spi : { } with order { } " , clazz get simple name ( ) , spi get class ( ) get canonical name ( ) , order ) ; if ( w = = null | | order < w order ) { w = new spi order wrapper < > ( order , spi ) ; } } return w = = null ? null : w spi ; } catch ( throwable t ) { record log error ( " [ spi loader ] error : load highest priority instance failed " , t ) ; t print stack trace ( ) ; return null ; } }


allow context to be changed so that standard validators can validate subtrees reject calls prepend the given path to the field names for example , an address validator could validate the subobject " address " of a customer object

void set nested path ( string nested path ) ;


{ @ inherit doc } the default implementation does nothing

@ override public void enter cast template ( sql base parser cast template context ctx ) { }


return true if this cat object is equal to o

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


sets the divider location between the left margin areas and the main display

public void set divider location ( int divider location ) { split pane divider location = divider location ; if ( split pane ! = null ) { split pane set divider location ( divider location ) ; } }


returns true if field success is set ( has been assigned a value ) and false otherwise

public boolean is set success ( ) { return isset bit vector get ( success isset id ) ; }


public mock http servlet request builder session attrs ( map < string , object > session attributes ) { assert not empty ( session attributes , " ' session attributes ' must not be empty " ) ; session attributes for each ( this : : session attr ) ; return this ; }


returns the number of milliseconds since time given by start nano time , which must have been previously returned from a call to { @ link system nano time ( ) }

long millis elapsed since ( long start nano time ) { return nanoseconds to millis ( system nano time ( ) - start nano time ) ; }


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


advances next cursor to the index of the first element after { @ code c } that is not in { @ code skip me } and returns { @ code size ( ) } if there is no such element

private void next not in skip me ( int c ) { if ( next cursor < c ) { if ( skip me ! = null ) { while ( c < size ( ) & & found and removed exact reference ( skip me , element data ( c ) ) ) { c + + ; } } next cursor = c ; } }


tests region failover does not restart vertexes which are already in initial created state ( v 1 ) - - | - - > ( v 2 ) ^ | ( blocking ) component 1 : 1 ; component 2 : 2

public void test region failover does not restart created executions ( ) { testing scheduling topology topology = new testing scheduling topology ( ) ; testing scheduling execution vertex v 1 = topology new execution vertex ( execution state created ) ; testing scheduling execution vertex v 2 = topology new execution vertex ( execution state created ) ; topology connect ( v 1 , v 2 , result partition type blocking ) ; failover strategy strategy = new restart pipelined region failover strategy ( topology ) ; verify that failed execution ( strategy , v 2 ) restarts ( ) ; testing scheduling result partition v 1out = v 2 get consumed results ( ) iterator ( ) next ( ) ; verify that failed execution ( strategy , v 2 ) partition connection cause ( v 1out ) restarts ( ) ; }


read a script from the provided { @ code line number reader } , using the supplied comment prefix and statement separator , and build a { @ code string } containing the lines lines beginning with the comment prefix are excluded from the results ; however , line comments anywhere else & mdash ; for example , within a statement & mdash ; will be included in the results

public static string read script ( line number reader line number reader , @ nullable string line comment prefix , @ nullable string separator , @ nullable string block comment end delimiter ) throws i o exception { string [ ] line comment prefixes = ( line comment prefix ! = null ) ? new string [ ] { line comment prefix } : null ; return read script ( line number reader , line comment prefixes , separator , block comment end delimiter ) ; }


to test enum parameters to test enum parameters

public void test enum parameters ( list < string > enum header string array , string enum header string , list < string > enum query string array , string enum query string , integer enum query integer , double enum query double , list < string > enum form string array , string enum form string , handler < async result < void > > result handler ) { delegate test enum parameters ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string , result handler ) ; }


given a collection of string representation of hosts , return a list of corresponding ip addresses in the textual representation

public static list < string > normalize host names ( collection < string > names ) { list < string > host names = new array list < string > ( names size ( ) ) ; for ( string name : names ) { host names add ( normalize host name ( name ) ) ; } return host names ; }


public void execute ( command line cmd ) throws exception { log info ( " executing \ " query plan \ " command " ) ; preconditions check state ( cmd has option ( disk balancer c l i query ) ) ; verify command options ( disk balancer c l i query , cmd ) ; string node name = cmd get option value ( disk balancer c l i query ) ; preconditions check not null ( node name ) ; node name = node name trim ( ) ; string node address = node name ; / / if the string is not name : port format use the default port if ( ! node name matches ( " [ ^ \ \ : ] + : [ 0 - 9 ] { 2 , 5 } " ) ) { int default i p c = net utils create socket addr ( get conf ( ) get trimmed ( d f s config keys dfs datanode ipc address key , d f s config keys dfs datanode ipc address default ) ) get port ( ) ; node address = node name + " : " + default i p c ; log debug ( " using default data node port : { } " , node address ) ; } client datanode protocol data node = get data node proxy ( node address ) ; try { disk balancer work status work status = data node query disk balancer plan ( ) ; system out printf ( " plan file : % s % n plan id : % s % n result : % s % n " , work status get plan file ( ) , work status get plan i d ( ) , work status get result ( ) to string ( ) ) ; if ( cmd has option ( disk balancer c l i verbose ) ) { system out printf ( " % s " , work status current state string ( ) ) ; } } catch ( disk balancer exception ex ) { log error ( " query plan failed ex : { } " , ex ) ; throw ex ; } }


locates the node that contains the given symbol < b > note : < b > this can degenerate into a brute - force search algorithm , but works in all normal cases using a binary search

public g tree node find symbol tree node ( symbol node key , boolean load children , task monitor monitor ) { / / if we don ' t have to load children and we are not loaded get out if ( ! load children & & ! is loaded ( ) ) { return null ; } list < g tree node > children = get children ( ) ; int index = collections binary search ( children , key , get children comparator ( ) ) ; if ( index > = 0 ) { g tree node node = children get ( index ) ; symbol tree node symbol node = ( symbol tree node ) node ; symbol search symbol = key get symbol ( ) ; if ( symbol node get symbol ( ) = = search symbol ) { return node ; } / / at this point we know that the given child is not itself a symbol node , but it / / may contain a child that contains the symbol node ( some symbol nodes will / / themselves contain more symbol nodes ) / / ask that child to search leave this method regardless , as if this child does / / not have it , then none of the others will node = symbol node find symbol tree node ( key , load children , monitor ) ; return node ; } / / brute - force lookup in each child this will not typically be called for ( g tree node child node : children ) { if ( monitor is cancelled ( ) ) { return null ; } if ( ! ( child node instanceof symbol tree node ) ) { continue ; / / in progress node } symbol tree node symbol node = ( symbol tree node ) child node ; g tree node found node = symbol node find symbol tree node ( key , load children , monitor ) ; if ( found node ! = null ) { return found node ; } } return null ; }


protected void on click back view ( int position ) { if ( swipe list view listener ! = null & & position ! = list view invalid position ) { swipe list view listener on click back view ( position ) ; } }


get the stack editor provider that is currently editing the stack frame of the named function

stack editor provider get provider ( program program , string function name ) { iterator < function > iter = editor map key set ( ) iterator ( ) ; while ( iter has next ( ) ) { function function = iter next ( ) ; if ( program = = function get program ( ) & & function get name ( ) equals ( function name ) ) { return editor map get ( function ) ; } } return null ; }


marks the group reduce operation as combinable combinable operations may pre - reduce the data before the actual group reduce operations combinable user - defined functions must implement the interface { @ link group combine function }

public void set combinable ( boolean combinable ) { / / sanity check if ( combinable & & ! group combine function class is assignable from ( this user function get user code class ( ) ) ) { throw new illegal argument exception ( " cannot set a udf as combinable if it does not implement the interface " + group combine function class get name ( ) ) ; } else { this combinable = combinable ; } }


returns the set of build , and optionally starlark files that define the given set of targets each such file is itself represented as a target in the result

thread safe mutable set < t > get build files ( query expression caller , thread safe mutable set < t > nodes , boolean build files , boolean loads , query expression context < t > context ) throws query exception , interrupted exception ;


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


route to resources using the provided lookup function if the lookup function provides a { @ link resource } for the given request , it will be it will be exposed using a { @ link handler function } that handles get , head , and options requests

public static router function < server response > resources ( function < server request , mono < resource > > lookup function ) { return new resources router function ( lookup function ) ; }


test equals tester after populating equal objects this checks proper handling of equality and verifies hash code for valid objects

public void test test equals equals objects ( ) { equals tester add equality group ( reference , equal object 1 , equal object 2 ) ; equals tester test equals ( ) ; }


post fakeouternumber test serialization of outer number types

default response entity < big decimal > fake outer number serialize ( @ api param ( value = " input number as post body " ) @ valid @ request body ( required = false ) big decimal body ) { return new response entity < > ( http status not implemented ) ; }


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


private boolean include document ( int doc ) throws i o exception { / / loop over fields for ( int i = 0 ; i < field vals length ; + + i ) { final numeric double values double values = values [ i ] ; if ( double values advance exact ( doc ) ) { final double value = double values double value ( ) ; if ( value = = double negative infinity ) { / / todo : fix matrix stats to treat neg inf as any other value return false ; } field vals [ i ] = value ; } else { return false ; } } return true ; }


return a translated exception if this is appropriate , otherwise return the given exception as - is

public static runtime exception translate if necessary ( runtime exception raw exception , persistence exception translator pet ) { assert not null ( pet , " persistence exception translator must not be null " ) ; data access exception dae = pet translate exception if possible ( raw exception ) ; return ( dae ! = null ? dae : raw exception ) ; }


returns the index settings for this index

public index settings get index settings ( ) { return index settings ; }


returns { @ link package settings } for creating packages called once during server startup some time after { @ link # server init } note that only one helper per bazel blaze runtime is allowed

public package settings get package settings ( ) { return null ; }


called when moving to a new page this allows the matcher to keep only the last match per stage and adjust insertion positions

void trim ( ordinal ordinal ) { / / for descending sequences , remove all in - flight sequences / / since the windows moves head and thus there is no chance / / of new results coming in if ( ordinal = = null ) { key to sequences clear ( ) ; } else { / / keep only the tail key to sequences trim to tail ( ordinal ) ; } }


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


returns an array containing all of the elements in this queue in proper sequence ( from first to last element ) ; the runtime type of the returned array is that of the specified array if the queue fits in the specified array , it is returned therein otherwise , a new array is allocated with the runtime type of the specified array and the size of this queue if this queue fits in the specified array with room to spare ( i e , the array has more elements than this queue ) , the element in the array immediately following the end of the queue is set to < tt > null < tt > like the { @ link # to array ( ) } method , this method acts as bridge between array - based and collection - based a p is further , this method allows precise control over the runtime type of the output array , and may , under certain circumstances , be used to save allocation costs suppose < tt > x < tt > is a queue known to contain only strings the following code can be used to dump the queue into a newly allocated array of < tt > string < tt > : { @ code string [ ] y = x to array ( new string [ 0 ] ) ; } note that < tt > to array ( new object [ 0 ] ) < tt > is identical in function to < tt > to array ( ) < tt >

public < t > t [ ] to array ( t [ ] a ) { int size = size ( ) ; if ( a length < size ) a = ( t [ ] ) java lang reflect array new instance ( a get class ( ) get component type ( ) , size ) ; if ( head < tail ) { system arraycopy ( elements , head , a , 0 , size ( ) ) ; } else if ( head > tail ) { int head portion len = elements length - head ; system arraycopy ( elements , head , a , 0 , head portion len ) ; system arraycopy ( elements , 0 , a , head portion len , tail ) ; } if ( a length > size ) a [ size ] = null ; return a ; }


public span utils append line ( ) { apply ( m type char sequence ) ; m text = line separator ; return this ; }


sets the color for the highlighted sector ( null for using entry color )

public void set highlight color ( @ nullable integer color ) { this m highlight color = color ; }


waits until the thread of this watcher has no threads to watch and terminates itself because a new watcher thread will be started again on { @ link # watch ( thread , runnable ) } , this operation is only useful when you want to ensure that the watcher thread is terminated after your application is shut down and there ' s no chance of calling { @ link # watch ( thread , runnable ) } afterwards

public static boolean await inactivity ( long timeout , time unit unit ) throws interrupted exception { object util check not null ( unit , " unit " ) ; thread watcher thread = thread death watcher watcher thread ; if ( watcher thread ! = null ) { watcher thread join ( unit to millis ( timeout ) ) ; return ! watcher thread is alive ( ) ; } else { return true ; } }


creates a new void property map with the given name

public void property map create void property map ( string property name ) throws duplicate name exception { lock acquire ( ) ; try { if ( property map cache contains key ( property name ) ) { throw new duplicate name exception ( ) ; } void property map pm = null ; try { pm = new void property map d b ( db handle , d b constants create , program , change mgr , addr map , property name , task monitor adapter dummy monitor ) ; properties d b adapter put record ( property name , void property type , null ) ; property map cache put ( property name , pm ) ; } catch ( version exception e ) { throw new assert exception ( ) ; } catch ( cancelled exception e ) { } catch ( i o exception e ) { program db error ( e ) ; } return pm ; } finally { lock release ( ) ; } }


returns a joiner which automatically places { @ code separator } between consecutive elements

public static joiner on ( char separator ) { return new joiner ( string value of ( separator ) ) ; }


initializes the shared file system settings the given configuration is passed to each file system factory to initialize the respective file systems because the configuration of file systems may be different subsequent to the call of this method , this method clears the file system instance cache this method also reads the default file system uri from the configuration key { @ link core options # default filesystem scheme } all calls to { @ link file system # get ( uri ) } where the uri has no scheme will be interpreted as relative to that uri as an example , assume the default file system uri is set to { @ code ' hdfs : localhost : 9000 ' } a file path of { @ code ' user u s e r n a m ein txt ' } is interpreted as { @ code ' hdfs : localhost : 9 0 0 0user u s e r n a m ein txt ' }

public static void initialize ( configuration config , plugin manager plugin manager ) throws illegal configuration exception { lock lock ( ) ; try { / / make sure file systems are re - instantiated after re - configuration cache clear ( ) ; fs factories clear ( ) ; collection < supplier < iterator < file system factory > > > factory suppliers = new array list < > ( 2 ) ; factory suppliers add ( ( ) - > service loader load ( file system factory class ) iterator ( ) ) ; if ( plugin manager ! = null ) { factory suppliers add ( ( ) - > iterators transform ( plugin manager load ( file system factory class ) , plugin file system factory : : of ) ) ; } final list < file system factory > file system factories = load file system factories ( factory suppliers ) ; / / configure all file system factories for ( file system factory factory : file system factories ) { factory configure ( config ) ; string scheme = factory get scheme ( ) ; file system factory fsf = connection limiting factory decorate if limited ( factory , scheme , config ) ; fs factories put ( scheme , fsf ) ; } / / configure the default ( fallback ) factory fallback factory configure ( config ) ; / / also read the default file system scheme final string stringified uri = config get string ( core options default filesystem scheme , null ) ; if ( stringified uri = = null ) { default scheme = null ; } else { try { default scheme = new uri ( stringified uri ) ; } catch ( u r i syntax exception e ) { throw new illegal configuration exception ( " the default file system scheme ( ' " + core options default filesystem scheme + " ' ) is invalid : " + stringified uri , e ) ; } } allowed fallback filesystems clear ( ) ; final iterable < string > allowed fallback filesystems = splitter on ( ' ; ' ) omit empty strings ( ) trim results ( ) split ( config get string ( core options allowed fallback filesystems ) ) ; allowed fallback filesystems for each ( allowed fallback filesystems : : add ) ; } finally { lock unlock ( ) ; } } / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / obtaining file system instances / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


return the available size of external storage

public static long get external available size ( ) { return utils bridge get fs available size ( get s d card path by environment ( ) ) ; }


return the { @ link aggregation profiler }

public aggregation profiler get aggregation profiler ( ) { return agg profiler ; }


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


gets available size of the current block

int available size ( ) { if ( block length = = 0 ) { return block length limit + 2 ; } return block length limit - block length + 1 ; }


public builder setnum readers ( int num readers ) { this num readers = num readers ; return this ; }


{ @ link # cursor style bar } , { @ link # cursor style block } or { @ link # cursor style underline }

public int get cursor style ( ) { return m cursor style ; }


create a readable and parseable audit log string for a failed event

public static void log failure ( string user , string operation , string perm , string target , string description , application id app id , container id container id , resource resource ) { if ( log is warn enabled ( ) ) { log warn ( create failure log ( user , operation , perm , target , description , app id , null , container id , resource ) ) ; } }


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


if true , the plugin is going to be activated next time jenkins runs

public boolean is enabled ( ) { return ! disable file exists ( ) ; }


set the preceding offset ( based on time or row - count intervals ) for over window

public over window partitioned ordered preceding preceding ( expression preceding ) { return new over window partitioned ordered preceding ( partition by , order by , preceding ) ; }


returns how many total clusters the search was executed successfully on

public int get successful ( ) { return successful ; }


releases all threads in the { @ link # waiters } list , and clears the list

private void release waiters ( ) { waiter head ; do { head = waiters ; } while ( ! atomic helper cas waiters ( this , head , waiter tombstone ) ) ; for ( waiter current waiter = head ; current waiter ! = null ; current waiter = current waiter next ) { current waiter unpark ( ) ; } }


allow to specify a { @ link channel option } which is used for the { @ link http 2 stream channel } instances once they got created use a value of { @ code null } to remove a previous set { @ link channel option }

public < t > http 2 stream channel bootstrap option ( channel option < t > option , t value ) { object util check not null ( option , " option " ) ; synchronized ( options ) { if ( value = = null ) { options remove ( option ) ; } else { options put ( option , value ) ; } } return this ; }


returns true if any of the filters contain this fingerprint at the specified bucket this is an expert - level api since it is dealing with buckets and fingerprints , not raw values being hashed

private boolean might contain fingerprint ( int bucket , int fingerprint ) { int alternate index = cuckoo filter alternate index ( bucket , fingerprint , num buckets ) ; for ( cuckoo filter filter : filters ) { if ( filter might contain fingerprint ( bucket , fingerprint , alternate index ) ) { return true ; } } return false ; }


public static < t > t new record ( class < t > clazz ) { return get serializer ( null ) new record instance ( clazz ) ; }


returns a distinct set of a { @ link data set } if the input is a { @ link org apache flink api common typeutils composite type } ( tuple or pojo type ) , distinct is performed on all fields and each field must be a key type


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


public multi match query builder type ( multi match query builder type type ) { if ( type = = null ) { throw new illegal argument exception ( " [ " + name + " ] requires type to be non - null " ) ; } this type = type ; return this ; }


find the highest index position of a safe index commit whose max sequence number is not greater than the global checkpoint index commits with different translog uuid will be filtered out as they don ' t belong to this engine

private static int index of kept commits ( list < ? extends index commit > commits , long global checkpoint ) throws i o exception { final string expected translog u u i d = commits get ( commits size ( ) - 1 ) get user data ( ) get ( translog translog uuid key ) ; / / commits are sorted by age ( the 0th one is the oldest commit ) for ( int i = commits size ( ) - 1 ; i > = 0 ; i - - ) { final map < string , string > commit user data = commits get ( i ) get user data ( ) ; / / ignore index commits with different translog uuid if ( expected translog u u i d equals ( commit user data get ( translog translog uuid key ) ) = = false ) { return i + 1 ; } final long max seq no from commit = long parse long ( commit user data get ( sequence numbers max seq no ) ) ; if ( max seq no from commit < = global checkpoint ) { return i ; } } / / if an index was created before 6 2 or recovered from remote , we might not have a safe commit / / in this case , we return the oldest index commit instead return 0 ; }


public void enum integer test ( ) { / / todo : test enum integer }


given a constant value accessed as an operand by a particular instruction , calculate a ( level 0 ) hash for ( any ) corresponding constant varnode

public static long [ ] calc constant hash ( instruction instr , long value ) { long [ ] tmp = new long [ 2 ] ; int count = 0 ; for ( pcode op op : instr get pcode ( true ) ) { varnode [ ] inputs = op get inputs ( ) ; for ( int i = 0 ; i < inputs length ; i + + ) { if ( inputs [ i ] is constant ( ) & & match with possible extension ( inputs [ i ] get offset ( ) , inputs [ i ] get size ( ) , value ) ) { if ( count > = tmp length ) { long [ ] newtmp = new long [ count + 10 ] ; for ( int j = 0 ; j < tmp length ; + + j ) { newtmp [ j ] = tmp [ j ] ; } tmp = newtmp ; } dynamic hash dynamic hash = new dynamic hash ( op , i ) ; tmp [ count ] = dynamic hash get hash ( ) ; if ( tmp [ count ] ! = 0 ) { count + = 1 ; } } } } long [ ] res = new long [ count ] ; for ( int i = 0 ; i < count ; + + i ) { res [ i ] = tmp [ i ] ; } return res ; }


stop the given span , if and only if this one is the top element of { @ link # active span stack } because the tracing core must make sure the span must match in a stack module , like any program did

public boolean stop span ( abstract span span ) { abstract span last span = peek ( ) ; if ( last span = = span ) { if ( last span instanceof abstract tracing span ) { abstract tracing span to finish span = ( abstract tracing span ) last span ; if ( to finish span finish ( segment ) ) { pop ( ) ; } } else { pop ( ) ; } } else { throw new illegal state exception ( " stopping the unexpected span = " + span ) ; } finish ( ) ; return active span stack is empty ( ) ; }


returns all the registered { @ link authorization strategy } descriptors

public static @ non null descriptor extension list < authorization strategy , descriptor < authorization strategy > > all ( ) { return jenkins get ( ) get descriptor list ( authorization strategy class ) ; }


public void outer enum test ( ) { / / todo : test outer enum }


public parameterized factory < t > add class ( class < ? extends t > cls ) { this classes add ( cls ) ; return this ; }


gets the matching code unit from the other listing for the specified code unit from one of the two listings whose differences this class determines

public code unit get matching code unit ( code unit code unit , boolean is listing 1 ) { if ( correlation = = null ) { return null ; } address min address = code unit get min address ( ) ; program source program = correlation get first program ( ) ; program destination program = correlation get second program ( ) ; if ( is listing 1 ) { address destination = correlation get address in second ( min address ) ; if ( destination ! = null ) { return destination program get listing ( ) get code unit at ( destination ) ; } } else { address source = correlation get address in first ( min address ) ; if ( source ! = null ) { return source program get listing ( ) get code unit at ( source ) ; } } / / code unit not from our programs return null ; }


response entity < void > update pet ( @ api param ( value = " pet object that needs to be added to the store " , required = true ) @ valid @ request body pet body ) ;


test that a structure can ' t contain another structure that contains it

public void test cyclic dependency problem 4 ( ) { structure another struct = create structure ( " another struct " , 0 ) ; another struct add ( struct ) ; try { struct add ( another struct ) ; assert fail ( " shouldn ' t be able to add another structure , which contains this structure , to this structure " ) ; } catch ( illegal argument exception e ) { / / should get an exception from adding the struct to itself } try { struct insert ( 0 , another struct ) ; assert fail ( " shouldn ' t be able to insert another structure , which contains this structure , to this structure " ) ; } catch ( illegal argument exception e ) { / / should get an exception from inserting the struct to itself } try { struct replace ( 0 , another struct , another struct get length ( ) ) ; assert fail ( " shouldn ' t be able to replace a structure component with another structure which contains this structure " ) ; } catch ( illegal argument exception e ) { / / should get an exception from replacing the struct to itself } }


for shards select id from ` shards ` table - purpose : 1 check the count as pre - check to avoid conflict 2 get statistics 3 use id to perform update update ` shards ` table check delta verify delete count update index table check delta verify delete count

private void update shards and index ( long table id , map < uuid , delta uuid pair > to update shard , handle handle ) throws s q l exception { if ( to update shard is empty ( ) ) { return ; } string args = joiner on ( " , " ) join ( n copies ( to update shard size ( ) , " ? " ) ) ; immutable map builder < long , uuid > shard map builder = immutable map builder ( ) ; string select shards = format ( " " + " select shard id , shard uuid \ n " + " from shards \ n " + " where shard uuid in ( % s ) " , args ) ; try ( prepared statement statement = handle get connection ( ) prepare statement ( select shards ) ) { bind uuids ( statement , to update shard key set ( ) ) ; try ( result set rs = statement execute query ( ) ) { while ( rs next ( ) ) { shard map builder put ( rs get long ( " shard id " ) , uuid from bytes ( rs get bytes ( " shard uuid " ) ) ) ; } } } map < long , uuid > shard id to uuid = shard map builder build ( ) ; if ( to update shard size ( ) ! = shard id to uuid size ( ) ) { throw transaction conflict ( ) ; } int updated count = 0 ; try ( shards and index updater shards and index updater = new shards and index updater ( handle get connection ( ) , table id ) ) { for ( list < long > batch : partition ( shard id to uuid key set ( ) , batch size ( handle get connection ( ) ) ) ) { for ( long shard id : batch ) { shards and index updater update ( shard id , to update shard get ( shard id to uuid get ( shard id ) ) get old delta uuid ( ) , to update shard get ( shard id to uuid get ( shard id ) ) get new delta uuid ( ) ) ; } updated count + = shards and index updater execute ( ) ; } } if ( updated count ! = shard id to uuid size ( ) ) { log error ( " updated count is not equal to shard id to uuid size " ) ; throw transaction conflict ( ) ; } }


return attribute provider or null if ugi is to bypass attribute provider

private i node attribute provider get user filtered attribute provider ( user group information ugi ) { if ( attribute provider = = null | | ( ugi ! = null & & is user bypassing ext attr provider ( ugi get user name ( ) ) ) ) { return null ; } return attribute provider ; }


public void test key set ( ) { json object a = new json object ( ) ; a add ( " foo " , new json array ( ) ) ; a add ( " bar " , new json object ( ) ) ; assert equals ( 2 , a size ( ) ) ; assert equals ( 2 , a key set ( ) size ( ) ) ; assert true ( a key set ( ) contains ( " foo " ) ) ; assert true ( a key set ( ) contains ( " bar " ) ) ; }


actually do the work the security context will be that in effect when the web request was made { @ link stapler # get current request } will also be similar to that in effect when the web request was made ; at least , { @ link ancestor } s and basic request properties ( uri , locale , and so on ) will be available

protected abstract void compute ( ) throws exception ;


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

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


constructs a saml specific exception with a consistent message regarding saml signature validation failures

private elasticsearch security exception saml signature exception ( list < credential > credentials , string signature , exception cause ) { logger warn ( " the xml signature of this saml message cannot be validated please verify that the saml realm uses the correct saml " + " metadata file / url for this identity provider " ) ; final string msg = " saml signature [ { } ] could not be validated against [ { } ] " ; return saml exception ( msg , cause , signature , describe credentials ( credentials ) ) ; }


quietly closes all messages in message producer

static void close quietly ( message producer producer ) { input stream message ; while ( ( message = producer next ( ) ) ! = null ) { close quietly ( message ) ; } }


specifies the types for the csv fields this method parses the csv data to a 8 - tuple which has fields of the specified types this method is overloaded for each possible length of the tuples to support type safe creation of data sets through csv parsing

public < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 > data source < tuple 8 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 > > types ( class < t0 > type 0 , class < t1 > type 1 , class < t2 > type 2 , class < t3 > type 3 , class < t4 > type 4 , class < t5 > type 5 , class < t6 > type 6 , class < t7 > type 7 ) { tuple type info < tuple 8 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 > > types = tuple type info get basic and basic value tuple type info ( type 0 , type 1 , type 2 , type 3 , type 4 , type 5 , type 6 , type 7 ) ; csv input format < tuple 8 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 > > input format = new tuple csv input format < tuple 8 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 > > ( path , types , this included mask ) ; configure input format ( input format ) ; return new data source < tuple 8 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 > > ( execution context , input format , types , utils get call location name ( ) ) ; }


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

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


returns the { @ code float } value of a header with the specified name if there is more than one value for the specified name , the first value in insertion order is returned

float get float ( k name , float default value ) ;


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


get the class name of the class which associated with self class

public string get associated class name ( ) { return associated class name ; }


the set of attribute declarations < code > repeated aapt pb styleable entry entry = 1 ; < code >

public builder remove entry ( int index ) { copy on write ( ) ; instance remove entry ( index ) ; return this ; }


private static byte assign partition ( int bucket , byte num partitions ) { return ( byte ) ( bucket % num partitions ) ; }