public void test intercept future not an exception 2 ( ) throws throwable { completable future < string > future = new completable future < > ( ) ; future complete exceptionally ( new error ( " oops " ) ) ; verify cause ( error class , intercept future ( execution exception class , " " , future ) ) ; }


update the job ' s data counts stats and figures note : this call is synchronous and pauses the calling thread

public void persist data counts ( string job id , data counts counts ) { counts set log time ( instant now ( ) ) ; try { results persister service index with retry ( job id , anomaly detectors index results write alias ( job id ) , counts , to x content empty params , write request refresh policy none , data counts document id ( job id ) , true , ( ) - > true , retry message - > logger debug ( " [ { } ] job data counts { } " , job id , retry message ) ) ; } catch ( i o exception ioe ) { logger error ( ( ) - > new parameterized message ( " [ { } ] failed writing data counts stats " , job id ) , ioe ) ; } catch ( exception ex ) { logger error ( ( ) - > new parameterized message ( " [ { } ] failed persisting data counts stats " , job id ) , ex ) ; auditor error ( job id , " failed persisting data counts stats : " + ex get message ( ) ) ; } }


explicitly set the properties file location and basename for this script ( used if a resource file representing the ghidra script is not available - - i e , if running ghidra script from a class file or instantiating the actual ghidra script object directly )

public void set properties file location ( string dir location , string basename ) throws i o exception { file test if dir = new file ( dir location ) ; properties file params = new ghidra script properties ( ) ; / / check if valid directory , then try to load properties file if ( test if dir is directory ( ) ) { properties file params load ghidra script properties ( new resource file ( dir location ) , basename ) ; } }


public string get body as string ( ) { if ( body as string = = null & & body ! = null ) { / / content - type null means that text was returned if ( body content type = = null | | body content type canonical ( ) = = x content type json | | body content type canonical ( ) = = x content type yaml ) { body as string = new string ( body , standard charsets utf 8 ) ; } else { / / if the body is in a binary format and gets requested as a string ( e g to log a test failure ) , we convert it to json try ( x content builder json builder = x content factory json builder ( ) ) { try ( x content parser parser = body content type x content ( ) create parser ( named x content registry empty , logging deprecation handler instance , body ) ) { json builder copy current structure ( parser ) ; } body as string = strings to string ( json builder ) ; } catch ( i o exception e ) { throw new unchecked i o exception ( " unable to convert response body to a string format " , e ) ; } } } return body as string ; }


public abstract void execute ( map < string , list < string > > parameters , print writer output ) throws exception ;


enables this plugin next time jenkins runs

public void enable ( ) throws i o exception { if ( ! disable file exists ( ) ) { logger log ( level finest , " plugin { 0 } has been already enabled skipping the enable ( ) operation " , get short name ( ) ) ; return ; } if ( ! disable file delete ( ) ) throw new i o exception ( " failed to delete " + disable file ) ; }


test that our local ip address is not null

public void test local host has an address ( ) throws exception { assert not null ( get local i p addr ( ) ) ; }


< code > optional org apache dubbo common serialize protobuf model p b request type c dubbo p b request type = 3 ; < code >

public builder clear c dubbo p b request type ( ) { if ( c dubbo p b request type builder = = null ) { c dubbo p b request type = null ; on changed ( ) ; } else { c dubbo p b request type builder clear ( ) ; } bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 2 ) ; return this ; }


< code > replace function parameters < code > replaces the parameters of the function in program 1 with the parameters of the function in program 2 at the specified entry point address it also replaces the return typestorage as well as custom storage use

public void replace function parameters ( address origin entry point , task monitor monitor ) { address result entry point = origin to result translator get address ( origin entry point ) ; function result function = result program get function manager ( ) get function at ( result entry point ) ; function origin function = origin program get function manager ( ) get function at ( origin entry point ) ; replace function parameters ( result function , origin function ) ; }


public cancellable forcemerge async ( force merge request force merge request , request options options , action listener < force merge response > listener ) { return rest high level client perform request async and parse entity ( force merge request , indices request converters : : force merge , options , force merge response : : from x content , listener , empty set ( ) ) ; }


flags common to arm - linux - androideabi

private c toolchain builder create base armeabi toolchain ( ) { string toolchain name = " arm - linux - androideabi - 4 9 " ; string target platform = " arm - linux - androideabi " ; c toolchain builder toolchain = c toolchain new builder ( ) set target system name ( target platform ) set compiler ( " gcc - 4 9 " ) add all tool path ( ndk paths create toolpaths ( toolchain name , target platform ) ) add all cxx builtin include directory ( ndk paths create gcc toolchain builtin include directories ( toolchain name , target platform , " 4 9 x " ) ) set builtin sysroot ( ndk paths create builtin sysroot ( " arm " ) ) / / compiler flags add compiler flag ( " - fstack - protector - strong " ) add compiler flag ( " - fpic " ) add compiler flag ( " - ffunction - sections " ) add compiler flag ( " - funwind - tables " ) add compiler flag ( " - no - canonical - prefixes " ) add compiler flag ( " - fno - canonical - system - headers " ) / / linker flags add linker flag ( " - no - canonical - prefixes " ) ; toolchain add compilation mode flags ( compilation mode flags new builder ( ) set mode ( compilation mode opt ) add compiler flag ( " - mthumb " ) add compiler flag ( " - os " ) add compiler flag ( " - g " ) add compiler flag ( " - dndebug " ) ) ; toolchain add compilation mode flags ( compilation mode flags new builder ( ) set mode ( compilation mode dbg ) add compiler flag ( " - g " ) add compiler flag ( " - mthumb " ) add compiler flag ( " - o0 " ) add compiler flag ( " - undebug " ) ) ; return toolchain ; }


used by auth sys return the auxiliary gids of the nfs user credential

public int [ ] get aux gids ( ) { throw new unsupported operation exception ( ) ; }


determine the class to use for naming a variable containing the given value will return the class of the given value , except when encountering a jdk proxy , in which case it will determine the ' primary ' interface implemented by that proxy

private static class < ? > get class for value ( object value ) { class < ? > value class = value get class ( ) ; if ( proxy is proxy class ( value class ) ) { class < ? > [ ] ifcs = value class get interfaces ( ) ; for ( class < ? > ifc : ifcs ) { if ( ! class utils is java language interface ( ifc ) ) { return ifc ; } } } else if ( value class get name ( ) last index of ( ' $ ' ) ! = - 1 & & value class get declaring class ( ) = = null ) { / / ' $ ' in the class name but no inner class - / / assuming it ' s a special subclass ( e g by open j p a ) value class = value class get superclass ( ) ; } return value class ; }


sets the result to the given array index and then runs { @ link # count down ( ) }

void on result ( r result ) { result consumer consume result ( result , this : : count down ) ; }


register a listener that will be called when this model is unbound from a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public test field prop child view model on unbind ( on model unbound listener < test field prop child view model , test field prop child view > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


checks the gui to determine if this composite is internally aligned

public boolean is internally aligned in gui ( ) { return internal alignment check box is selected ( ) ; }


this is the callback method for domain object changed events

public void domain object changed ( domain object changed event ev ) { if ( tool ! = null & & provider is visible ( ) ) { update ( ev ) ; } }


allow arbitrary errors to be recorded here for later throwing

public void inject exception and message ( throwable throwable , string message ) { exceptions thrown add ( pair of ( message , throwable ) ) ; }


checks that the two values are equal , and that their hashcodes are equal

private void assert equals ( object a , object b ) { if ( ! a equals ( b ) ) throw new gdx runtime exception ( a get class ( ) get simple name ( ) + " equals ( ) failed : \ n " + a + " \ n ! = \ n " + b ) ; if ( ! b equals ( a ) ) throw new gdx runtime exception ( a get class ( ) get simple name ( ) + " equals ( ) failed ( not symmetric ) : \ n " + b + " \ n ! = \ n " + a ) ; if ( a hash code ( ) ! = b hash code ( ) ) throw new gdx runtime exception ( a get class ( ) get simple name ( ) + " hash code ( ) failed : \ n " + a + " \ n ! = \ n " + b ) ; }


public boolean is corrupt ( ) { return corrupt ; }


returns the statistics on the { @ code x } values alone

public stats x stats ( ) { return x stats ; }


run multiple threads doing simultaneous operations on the namenode while a large directory is being deleted

private void run threads ( ) throws throwable { final test thread threads [ ] = new test thread [ 2 ] ; / / thread for creating files threads [ 0 ] = new test thread ( ) { @ override protected void execute ( ) throws throwable { while ( live ) { try { int blockcount = get block count ( ) ; if ( blockcount < total blocks & & blockcount > 0 ) { string file = " / tmp " + create ops ; create file ( file , 1 ) ; mc get file system ( ) delete ( new path ( file ) , true ) ; create ops + + ; } } catch ( i o exception ex ) { log info ( " create file exception " , ex ) ; break ; } } } } ; / / thread that periodically acquires the f s namesystem lock threads [ 1 ] = new test thread ( ) { @ override protected void execute ( ) throws throwable { while ( live ) { try { int blockcount = get block count ( ) ; if ( blockcount < total blocks & & blockcount > 0 ) { mc get namesystem ( ) write lock ( ) ; try { lock ops + + ; } finally { mc get namesystem ( ) write unlock ( ) ; } thread sleep ( 1 ) ; } } catch ( interrupted exception ex ) { log info ( " lock operation exception " , ex ) ; break ; } } } } ; threads [ 0 ] start ( ) ; threads [ 1 ] start ( ) ; final long start = time now ( ) ; mc get file system ( ) delete ( new path ( " / root " ) , true ) ; / / recursive delete final long end = time now ( ) ; threads [ 0 ] end thread ( ) ; threads [ 1 ] end thread ( ) ; log info ( " deletion took " + ( end - start ) + " msecs " ) ; log info ( " create operations " + create ops ) ; log info ( " lock operations " + lock ops ) ; assert assert true ( lock ops + create ops > 0 ) ; threads [ 0 ] rethrow ( ) ; threads [ 1 ] rethrow ( ) ; }


the number of symbols field is stored in big - endian format

private int read number of symbols ( binary reader reader ) throws i o exception { if ( reader is little endian ( ) ) { data converter dc = big endian data converter instance ; byte [ ] bytes = reader read next byte array ( 4 ) ; return dc get int ( bytes ) ; } return reader read next int ( ) ; }


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


get the write permission for the specified segment

public boolean is segment writable ( elf program header segment ) { return ( segment get flags ( ) & elf program header constants pf w ) ! = 0 ; }


public void test nested documents ( ) throws s q l exception { try ( connection c = es jdbc ( ) ; statement s = c create statement ( ) ) { s set fetch size ( 5 ) ; try ( result set rs = s execute query ( " select test field , nested * from test order by test field asc " ) ) { assert true ( " empty result set ! " , rs next ( ) ) ; for ( int i = 0 ; i < 20 ; i + + ) { assert equals ( 15 , rs get fetch size ( ) ) ; assert nested documents ( rs , i ) ; } assert false ( rs next ( ) ) ; } } }


test access for file and intermediate directory after creating file with intermediate directory

public void test access for file and intermediate directory created ( ) throws throwable { path parent dir = new path ( " / test access directory " ) ; path intermediate dir = new path ( parent dir , " intermediate dir " ) ; path test path = new path ( intermediate dir , " test dat " ) ; authorizer add auth rule for owner ( " / " , write , true ) ; authorizer add auth rule for owner ( parent dir to string ( ) , write , true ) ; / / recursive owner rule is to determine the permission on intermediate dirs authorizer add auth rule for owner ( parent dir to string ( ) + " / * " , write , true ) ; authorizer add auth rule for owner ( parent dir to string ( ) + " / * " , read , true ) ; fs update wasb authorizer ( authorizer ) ; try { fs mkdirs ( parent dir ) ; fs create ( test path ) ; assert path exists ( fs , " test path was not created " , test path ) ; fs access ( parent dir , fs action write ) ; fs access ( parent dir , fs action write execute ) ; fs access ( intermediate dir , fs action all ) ; fs access ( intermediate dir , fs action read write ) ; fs access ( test path , fs action all ) ; fs access ( test path , fs action read write ) ; } finally { recursive delete ( test path ) ; } }


implementation variation to use , or all if unset

optional < implementation > implementation ( ) { return optional of nullable ( enums get if present ( implementation class , system get property ( " implementation " , " " ) ) or null ( ) ) ; }


true if the vector represents a pair of valid , non - infinite floating point numbers

public final boolean is valid ( ) { return ! float is na n ( x ) & & ! float is infinite ( x ) & & ! float is na n ( y ) & & ! float is infinite ( y ) ; }


creates a transposed view of a given table that flips its row and column keys in other words , calling { @ code get ( column key , row key ) } on the generated table always returns the same value as calling { @ code get ( row key , column key ) } on the original table updating the original table changes the contents of the transposed table and vice versa the returned table supports update operations as long as the input table supports the analogous operation with swapped rows and columns for example , in a { @ link hash based table } instance , { @ code row key set ( ) iterator ( ) } supports { @ code remove ( ) } but { @ code column key set ( ) iterator ( ) } doesn ' t with a transposed { @ link hash based table } , it ' s the other way around

public static < r , c , v > table < c , r , v > transpose ( table < r , c , v > table ) { return ( table instanceof transpose table ) ? ( ( transpose table < r , c , v > ) table ) original : new transpose table < c , r , v > ( table ) ; }


returns { @ code true } if allow demote primary mangled symbols is " on "

public boolean allow demote primary mangled symbols ( ) { return allow demote primary mangled symbols ; }


find account via rest api and return user - info map

protected map < string , object > find account via rest api ( final map < string , object > headers ) { http response response = null ; try { response = http utils execute ( properties get url ( ) , properties get method ( ) , properties get basic auth username ( ) , properties get basic auth password ( ) , new hash map < > ( 0 ) , headers ) ; if ( response ! = null & & response get entity ( ) ! = null & & response get status line ( ) get status code ( ) = = http status sc ok ) { val result = i o utils to string ( response get entity ( ) get content ( ) , standard charsets utf 8 ) ; return mapper read value ( json value read hjson ( result ) to string ( ) , map class ) ; } } catch ( final exception e ) { logging utils error ( logger , e ) ; } finally { http utils close ( response ) ; } return new hash map < > ( 0 ) ; }


whether the selected handler for the current request chose to handle the request asynchronously a return value of " true " indicates concurrent handling is under way and the response will remain open a return value of " false " means concurrent handling was either not started or possibly that it has completed and the request was dispatched for further processing of the concurrent result

public boolean is concurrent handling started ( ) { return ( this async web request ! = null & & this async web request is async started ( ) ) ; }


returns the number of fields used in the match

private int find locations ( int field index ) { listing field field = ( listing field ) current layout get field ( field index ) ; field factory ff = field get field factory ( ) ; string field name = ff get field name ( ) ; if ( ! do search field ( field name ) ) { return 0 ; } int field count = 1 ; / / we always match on one field , unless it is the mnemonic / operand combo / / if field is the mnemonic , and instructions or data are / / being searched , get the next field as well boolean is mnemonic = field name equals ( mnemonic field factory field name ) ; boolean is instructions or data = options search all fields ( ) | | options search both data mnemonics and operands ( ) | | options search both instruction mnemonic and operands ( ) ; if ( is mnemonic & & is instructions or data ) { if ( current field index < = current layout get num fields ( ) - 2 ) { listing field op field = ( listing field ) current layout get field ( field index + 1 ) ; find mnemonic operand locations ( field , op field ) ; field count = 2 ; / / if we match here , then signal that we matched across two fields } else { find locations ( field ) ; } } else { find locations ( field ) ; } if ( location list size ( ) > 0 ) { / / we found a match ! return field count ; } return 0 ; }


method for retrieving the inner processor from a wrapped processor


public string get application release name ( ) { string app release name = get property ( application properties release name property ) ; if ( app release name = = null | | app release name trim ( ) is empty ( ) ) { return " " ; } return app release name ; }


compute the path where the output of a task attempt is stored until that task is committed this path is marked as a base path for relocations , so subdirectory information is preserved

public static path get magic task attempt path ( task attempt context context , string job u u i d , path dest ) { return new path ( get base magic task attempt path ( context , job u u i d , dest ) , base ) ; }


public static boolean is portrait ( ) { return utils get app ( ) get resources ( ) get configuration ( ) orientation = = configuration orientation portrait ; }


variant of { @ link # get lookup path for request ( http servlet request ) } that automates checking for a previously computed lookup path saved as a request attribute the attribute is only used for lookup purposes

public string get lookup path for request ( http servlet request request , @ nullable string name ) { string result = null ; if ( name ! = null ) { result = ( string ) request get attribute ( name ) ; } return ( result ! = null ? result : get lookup path for request ( request ) ) ; }


clears out the list of verification errors

public void clear verification errors ( ) { stb clear verification errors ( ) ; }


starts async disk service for a new volume

synchronized void add volume ( fs volume impl volume ) { if ( executors = = null ) { throw new runtime exception ( " async disk service is already shutdown " ) ; } if ( volume = = null ) { throw new runtime exception ( " attempt to add a null volume " ) ; } thread pool executor executor = executors get ( volume get storage i d ( ) ) ; if ( executor ! = null ) { throw new runtime exception ( " volume " + volume + " is already existed " ) ; } add executor for volume ( volume ) ; }


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

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


reports an attribute error if a target in { @ code deps } passes the legacy " py " provider but this is disallowed by the configuration

private void validate legacy provider not used if disabled ( ) { if ( ! rule context get fragment ( python configuration class ) disallow legacy py provider ( ) ) { return ; } for ( transitive info collection dep : rule context get prerequisites ( " deps " ) ) { if ( py provider utils has legacy provider ( dep ) ) { rule context attribute error ( " deps " , string format ( " in dep ' % s ' : the legacy ' py ' provider is disallowed migrate to the py info " + " provider instead you can temporarily disable this failure with " + " - - incompatible disallow legacy py provider = false " , dep get label ( ) ) ) ; } } }


create a temporary log 4j configuration for the test

public static file create temporary log 4 j properties ( ) throws i o exception { file log 4j props = file create temp file ( file utils get random filename ( " " ) , " - log 4j properties " ) ; log 4j props delete on exit ( ) ; common test utils print log 4j debug config ( log 4j props ) ; return log 4j props ; }


runs the bare test sequence , capturing a screenshot if a test fails @ exception throwable if any exception is thrown

public void run bare ( ) throws throwable { if ( ! is capture screen shot on failure ( ) ) { super run bare ( ) ; return ; } set up ( ) ; try { run test ( ) ; } catch ( throwable t ) { if ( selenium ! = null ) { string filename = get name ( ) + " png " ; try { selenium capture screenshot ( filename ) ; system err println ( " saved screenshot " + filename ) ; } catch ( exception e ) { system err println ( " couldn ' t save screenshot " + filename + " : " + e get message ( ) ) ; e print stack trace ( ) ; } throw t ; } } finally { tear down ( ) ; } }


returns an equivalence that uses { @ code = = } to compare values and { @ link system # identity hash code ( object ) } to compute the hash code { @ link equivalence # equivalent } returns { @ code true } if { @ code a = = b } , including in the case that a and b are both null

public static equivalence < object > identity ( ) { return identity instance ; }


test that the zkfc won ' t run if fencing is not configured for the local service

public void test fencing must be configured ( ) throws exception { dummy h a service svc = mockito spy ( cluster get service ( 0 ) ) ; mockito do throw ( new bad fencing configuration exception ( " no fencing " ) ) when ( svc ) check fencing configured ( ) ; / / format the base dir , should succeed assert equals ( 0 , run f c ( svc , " - format z k " ) ) ; / / try to run the actual fc , should fail without a fencer assert equals ( z k failover controller err code no fencer , run f c ( svc ) ) ; }


get user by user name < b > 200 < b > - successful operation < b > 400 < b > - invalid username supplied < b > 404 < b > - user not found

public response entity < user > get user by name with http info ( string username ) throws rest client exception { object post body = null ; / / verify the required parameter ' username ' is set if ( username = = null ) { throw new http client error exception ( http status bad request , " missing the required parameter ' username ' when calling get user by name " ) ; } / / create path and map variables final map < string , object > uri variables = new hash map < string , object > ( ) ; uri variables put ( " username " , username ) ; string path = api client expand path ( " / user / { username } " , uri variables ) ; final multi value map < string , string > query params = new linked multi value map < string , string > ( ) ; final http headers header params = new http headers ( ) ; final multi value map < string , string > cookie params = new linked multi value map < string , string > ( ) ; final multi value map < string , object > form params = new linked multi value map < string , object > ( ) ; final string [ ] local var accepts = { " application / xml " , " application / json " } ; final list < media type > local var accept = api client select header accept ( local var accepts ) ; final string [ ] content types = { } ; final media type content type = api client select header content type ( content types ) ; string [ ] auth names = new string [ ] { } ; parameterized type reference < user > return type = new parameterized type reference < user > ( ) { } ; return api client invoke a p i ( path , http method get , query params , post body , header params , cookie params , form params , local var accept , content type , auth names , return type ) ; }


returns the state handle from the { @ link # secondary output stream } also reports suppressed exceptions from earlier interactions with that stream

public stream state handle close and get secondary handle ( ) throws i o exception { if ( secondary stream exception = = null ) { flush internal buffer ( ) ; return secondary output stream close and get handle ( ) ; } else { throw new i o exception ( " secondary stream previously failed exceptionally " , secondary stream exception ) ; } }


returns the list of feedback { @ code transformations }

public list < transformation < t > > get feedback edges ( ) { return feedback edges ; }


sets { @ link format # encoder delay } the default value is 0

public builder set encoder delay ( int encoder delay ) { this encoder delay = encoder delay ; return this ; }


returns the given attribute if it ' s a computed default , null otherwise

public < t > attribute computed default get computed default ( string attribute name , type < t > type ) { object value = rule get attr ( attribute name , type ) ; if ( value instanceof attribute computed default ) { return ( attribute computed default ) value ; } else { return null ; } }


{ @ inherit doc } the default implementation does nothing

@ override public void enter sys tables ( sql base parser sys tables context ctx ) { }


filter on annotated methods see { @ link org springframework web method mvc annotation predicates }

public final builder < t > annot ( predicate < method > filters ) { this filters add all ( arrays as list ( filters ) ) ; return this ; }


private void get status response from index ( async execution id search id , get async status request request , long now in millis , action listener < async status response > listener ) { store get status response ( search id , async status response : : get status from async search response with expiration time , new action listener < > ( ) { @ override public void on response ( async status response async status response ) { send final response ( request , async status response , now in millis , listener ) ; } @ override public void on failure ( exception e ) { listener on failure ( e ) ; } } ) ; }


parse a dynamic name and return its address or null if unable to parse

public static address parse dynamic name ( address factory factory , string name ) { / / assume dynamic names will naver start with an underscore if ( name starts with ( underscore ) ) { return null ; } string [ ] pieces = name split ( underscore ) ; if ( pieces length < 2 ) { / / if we have less than two pieces , then this is not a dynamic name return null ; } string address offset string = pieces [ pieces length - 1 ] ; address space space = find address space ( factory , pieces ) ; if ( space = = null ) { space = factory get default address space ( ) ; } / / only consider address values which meet the meet the minimum padding behavior if ( address offset string length ( ) < min label address digits ) { return null ; } / * * * if we are dealing with segmented addresses , then the address is really composed of the * last two pieces * / if ( space instanceof segmented address space ) { address offset string = pieces [ pieces length - 2 ] + ' : ' + address offset string ; } try { return space get address ( address offset string ) ; } catch ( address format exception e ) { / / return null instead } return null ; }


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

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


test document failures ( failures after seq no generation ) are added as noop operation to the translog for primary and replica shards

public void test document failure replication ( ) throws exception { final i o exception index exception = new i o exception ( " simulated indexing failure " ) ; final engine factory engine factory = config - > internal engine tests create internal engine ( ( dir , iwc ) - > new index writer ( dir , iwc ) { @ override public long add document ( iterable < ? extends indexable field > doc ) throws i o exception { boolean is tombstone = false ; for ( indexable field field : doc ) { if ( seq no field mapper tombstone name equals ( field name ( ) ) ) { is tombstone = true ; } } if ( is tombstone ) { return super add document ( doc ) ; / / allow to add noop } else { throw index exception ; } } } , null , null , config ) ; try ( replication group shards = new replication group ( build index metadata ( 0 ) ) { @ override protected engine factory get engine factory ( shard routing routing ) { return engine factory ; } } ) { / / start with the primary only so two first failures are replicated to replicas via recovery from the translog of the primary shards start primary ( ) ; long primary term = shards get primary ( ) get pending primary term ( ) ; list < translog operation > expected translog ops = new array list < > ( ) ; bulk item response index resp = shards index ( new index request ( index get name ( ) ) id ( " 1 " ) source ( " { } " , x content type json ) ) ; assert that ( index resp is failed ( ) , equal to ( true ) ) ; assert that ( index resp get failure ( ) get cause ( ) , equal to ( index exception ) ) ; expected translog ops add ( new translog no op ( 0 , primary term , index exception to string ( ) ) ) ; try ( translog snapshot snapshot = get translog ( shards get primary ( ) ) new snapshot ( ) ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } shards assert all equal ( 0 ) ; int n replica = random int between ( 1 , 3 ) ; for ( int i = 0 ; i < n replica ; i + + ) { shards add replica ( ) ; } shards start replicas ( n replica ) ; for ( index shard shard : shards ) { try ( translog snapshot snapshot = get translog ( shard ) new snapshot ( ) ) { / / we flush at the end of peer recovery if ( shard routing entry ( ) primary ( ) | | shard index settings ( ) is soft delete enabled ( ) = = false ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } else { assert that ( snapshot total operations ( ) , equal to ( 0 ) ) ; } } try ( translog snapshot snapshot = shard new changes snapshot ( " test " , 0 , long max value , false ) ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } } / / the failure replicated directly from the replication channel index resp = shards index ( new index request ( index get name ( ) ) id ( " any " ) source ( " { } " , x content type json ) ) ; assert that ( index resp get failure ( ) get cause ( ) , equal to ( index exception ) ) ; translog no op noop 2 = new translog no op ( 1 , primary term , index exception to string ( ) ) ; expected translog ops add ( noop 2 ) ; for ( index shard shard : shards ) { try ( translog snapshot snapshot = get translog ( shard ) new snapshot ( ) ) { if ( shard routing entry ( ) primary ( ) | | shard index settings ( ) is soft delete enabled ( ) = = false ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } else { assert that ( snapshot , snapshot matchers contains operations in any order ( collections singleton list ( noop 2 ) ) ) ; } } try ( translog snapshot snapshot = shard new changes snapshot ( " test " , 0 , long max value , false ) ) { assert that ( snapshot , snapshot matchers contains operations in any order ( expected translog ops ) ) ; } } shards assert all equal ( 0 ) ; } }


returns true if this sub block uses the given file bytes as its byte source

protected boolean uses ( file bytes file bytes ) { return false ; }


used as a hook to delay writing a packet to disk


returns the current active session factory for injecting to d a os

public session factory get session factory ( ) { return dao test get session factory ( ) ; }


expose underlying attributes for auditing purposes

public map < string , set < string > > get required attributes ( ) { return required attributes ; }


resolve the given arguments object into an arguments array

protected object [ ] resolve arguments ( @ nullable object arguments ) throws jsp exception { if ( arguments instanceof string ) { return string utils delimited list to string array ( ( string ) arguments , this argument separator ) ; } else if ( arguments instanceof object [ ] ) { return ( object [ ] ) arguments ; } else if ( arguments instanceof collection ) { return ( ( collection < ? > ) arguments ) to array ( ) ; } else if ( arguments ! = null ) { / / assume a single argument object return new object [ ] { arguments } ; } else { return null ; } }


tell all datanodes to use a new , non - persistent bandwidth value for dfs datanode balance bandwidth per sec a system administrator can tune the balancer bandwidth parameter ( dfs datanode balance bandwidth per sec ) dynamically by calling " dfsadmin - set balanacer bandwidth newbandwidth " , at which point the following ' bandwidth ' variable gets updated with the new value for each node once the heartbeat command is issued to update the value on the specified datanode , this value will be set back to 0

public void set balancer bandwidth ( long bandwidth ) throws i o exception { synchronized ( this ) { for ( datanode descriptor node info : datanode map values ( ) ) { node info set balancer bandwidth ( bandwidth ) ; } } }


public test client model oper req spec ( consumer < request spec builder > req spec customizer ) { req spec customizer accept ( req spec ) ; return this ; }


this method will return a read - only { @ link set }

public set < k > key set ( ) { return view key set ( ) ; }


namespaces defined on this element < code > repeated aapt pb xml namespace namespace declaration = 1 ; < code >

private void set namespace declaration ( int index , com android aapt resources xml namespace builder builder for value ) { ensure namespace declaration is mutable ( ) ; namespace declaration set ( index , builder for value build ( ) ) ; }


assert the response status code is { @ code http status internal server error } ( 500 )

public result matcher is internal server error ( ) { return matcher ( http status internal server error ) ; }


reads a sequence of bytes from this channel into the given buffer

public int read ( byte buffer dst ) throws i o exception { return socket channel read ( dst ) ; }


specifies the time attribute on which rows are grouped for streaming tables you can specify grouping by a event - time or processing - time attribute for batch tables you can specify grouping on a timestamp or long attribute

public slide with size and slide on time on ( string time field ) { return on ( expression parser parse expression ( time field ) ) ; }


if set , only perform this delete request if the document was last modification was assigned this primary term if the document last modification was assigned a different term a { @ link org elasticsearch index engine version conflict engine exception } will be thrown

public long if primary term ( ) { return if primary term ; }


creates a allocated persistent task for communicating with task manager

protected allocated persistent task create task ( long id , string type , string action , task id parent task id , persistent task < params > task in progress , map < string , string > headers ) { return new allocated persistent task ( id , type , action , get description ( task in progress ) , parent task id , headers ) ; }


appends the desired hyperlink to the existing event message

public void format ( log event event , string builder to append to ) { string caller information = get caller information ( ) ; to append to append ( caller information ) ; }


returns a factory that always provides a single sample with { @ code time = sample time us } and then end - of - stream

static track data factory single sample with time us ( long sample time us ) { return ( unused format , unused media period id ) - > immutable list of ( one byte sample ( sample time us ) , end of stream item ) ; }


blocks until the task has started , or has been canceled without having been started

public final void block until started ( ) { started block uninterruptible ( ) ; }


generate a text string containing the implementation type of this cache and its statistics the string returned by this method contains all information required for compliance with the contract for { @ link # log statistics ( ) }

public string to string ( ) { return new to string creator ( this ) append ( " size " , size ( ) ) append ( " max size " , get max size ( ) ) append ( " parent context count " , get parent context count ( ) ) append ( " hit count " , get hit count ( ) ) append ( " miss count " , get miss count ( ) ) to string ( ) ; }


extract the rejected value behind the given constraint violation , for exposure through the spring errors representation

protected object get rejected value ( string field , constraint violation < object > violation , binding result binding result ) { object invalid value = violation get invalid value ( ) ; if ( ! field is empty ( ) & & ! field contains ( " [ ] " ) & & ( invalid value = = violation get leaf bean ( ) | | field contains ( " [ " ) | | field contains ( " " ) ) ) { / / possibly a bean constraint with property path : retrieve the actual property value / / however , explicitly avoid this for " address [ ] " style paths that we can ' t handle invalid value = binding result get raw field value ( field ) ; } return invalid value ; }


does some work and returns current state


utility function used to convert a given uri to a decoded string representation sent to the backing store u r is coming as input to this class will be encoded by the uri class , and we want the underlying storage to store keys in their original utf - 8 form

private static string convert uri to decoded string ( uri uri ) { try { return codec decode ( uri to string ( ) ) ; } catch ( decoder exception e ) { throw new assertion error ( " failed to decode uri : " + uri to string ( ) ) ; } }


utility method for tests converts an array of strings into a set of labels

public static set < label > as label set ( iterable < string > strings ) throws label syntax exception { set < label > result = sets new tree set ( ) ; for ( string s : strings ) { result add ( label parse absolute ( s , immutable map of ( ) ) ) ; } return result ; }


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


same as { @ link # get implicit output artifact ( implicit outputs function ) } but includes the option to use a content - based path for this artifact ( see { @ link build configuration # use content based output paths ( ) } )

public artifact get implicit output artifact ( implicit outputs function function , boolean content based path ) throws interrupted exception { iterable < string > result ; try { result = function get implicit outputs ( get analysis environment ( ) get event handler ( ) , raw attribute mapper of ( rule ) ) ; } catch ( eval exception e ) { / / it ' s ok as long as we don ' t use this method from starlark throw new illegal state exception ( e ) ; } return get implicit output artifact ( iterables get only element ( result ) , content based path ) ; }


public long get readahead ( ) { return readahead ; }


returns the most concrete public methods from { @ code type }

private static method [ ] get most concrete methods ( class < ? > type ) { method [ ] methods = type get methods ( ) ; for ( int i = 0 ; i < methods length ; i + + ) { try { methods [ i ] = type get method ( methods [ i ] get name ( ) , methods [ i ] get parameter types ( ) ) ; } catch ( exception e ) { throw if unchecked ( e ) ; throw new runtime exception ( e ) ; } } return methods ; }


we used to serialize a change into a single byte [ ] now , we don ' t anymore , but we still need to be able to read it ( so that we can load the state store from previously - written changelog records )

public static change < byte [ ] > decompose legacy formatted array into change arrays ( final byte [ ] data ) { if ( data = = null ) { return null ; } final byte buffer buffer = byte buffer wrap ( data ) ; final byte [ ] old bytes = get nullable size prefixed array ( buffer ) ; final byte [ ] new bytes = get nullable size prefixed array ( buffer ) ; return new change < > ( new bytes , old bytes ) ; }


public void add rpc queue time ( long q time ) { rpc queue time add ( q time ) ; if ( rpc quantile enable ) { for ( mutable quantiles q : rpc queue time quantiles ) { q add ( q time ) ; } } }


return the blur bitmap fast zoom out , blur , zoom in

public static bitmap fast blur ( final bitmap src , @ float range ( from = 0 , to = 1 , from inclusive = false ) final float scale , @ float range ( from = 0 , to = 25 , from inclusive = false ) final float radius , final boolean recycle ) { return fast blur ( src , scale , radius , recycle , false ) ; }


detect all persistence exception translators in the given bean factory

protected persistence exception translator detect persistence exception translators ( listable bean factory bf ) { / / find all translators , being careful not to activate factory beans chained persistence exception translator cpet = new chained persistence exception translator ( ) ; bf get bean provider ( persistence exception translator class , false ) ordered stream ( ) for each ( cpet : : add delegate ) ; return cpet ; }


test the given rmi registry , calling some operation on it to check whether it is still active default implementation calls { @ code registry list ( ) }

protected void test registry ( registry registry ) throws remote exception { registry list ( ) ; }


stops the clock does nothing if the clock is already stopped

public void stop ( ) { if ( started ) { reset position ( get position us ( ) ) ; started = false ; } }


public void set destination volume ( disk balancer volume destination volume ) { this destination volume = destination volume ; }


this function exists to be compatible with { @ link org elasticsearch common xcontent context parser # parse ( x content parser , object ) }

public static role mapper expression parse object ( x content parser parser , string id ) throws i o exception { return new expression parser ( ) parse ( id , parser ) ; }


calculates the size of the packet starting from { @ code start segment index }

private int calculate packet size ( int start segment index ) { segment count = 0 ; int size = 0 ; while ( start segment index + segment count < page header page segment count ) { int segment length = page header laces [ start segment index + segment count + + ] ; size + = segment length ; if ( segment length ! = 255 ) { / / packets end at first lace < 255 break ; } } return size ; }


report whether the last column read had a value of sql { @ code null } note that you must first call one of the getter methods and then call the { @ code was null ( ) } method

boolean was null ( ) throws invalid result set access exception ;


computes a hull the same as { @ link # compute polygon ( float [ ] , int , int , boolean ) } but returns indices of the specified points

public int array compute indices ( float [ ] points , int offset , int count , boolean sorted , boolean y down ) { if ( count > 32767 ) throw new illegal argument exception ( " count must be < = " + 32767 ) ; int end = offset + count ; if ( ! sorted ) { if ( sorted points = = null | | sorted points length < count ) sorted points = new float [ count ] ; system arraycopy ( points , offset , sorted points , 0 , count ) ; points = sorted points ; offset = 0 ; sort with indices ( points , count , y down ) ; } int array indices = this indices ; indices clear ( ) ; float array hull = this hull ; hull clear ( ) ; / / lower hull for ( int i = offset , index = i / 2 ; i < end ; i + = 2 , index + + ) { float x = points [ i ] ; float y = points [ i + 1 ] ; while ( hull size > = 4 & & ccw ( x , y ) < = 0 ) { hull size - = 2 ; indices size - - ; } hull add ( x ) ; hull add ( y ) ; indices add ( index ) ; } / / upper hull for ( int i = end - 4 , index = i / 2 , t = hull size + 2 ; i > = offset ; i - = 2 , index - - ) { float x = points [ i ] ; float y = points [ i + 1 ] ; while ( hull size > = t & & ccw ( x , y ) < = 0 ) { hull size - = 2 ; indices size - - ; } hull add ( x ) ; hull add ( y ) ; indices add ( index ) ; } / / convert sorted to unsorted indices if ( ! sorted ) { short [ ] original indices array = original indices items ; int [ ] indices array = indices items ; for ( int i = 0 , n = indices size ; i < n ; i + + ) indices array [ i ] = original indices array [ indices array [ i ] ] ; } return indices ; }


returns true if this is the event dispatch thread note that this method returns true in headless mode because any thread in headless mode can dispatch its own events in swing environments , the swing thread is usually used to dispatch events

public static boolean is swing thread ( ) { if ( is in headless mode ( ) ) { return true ; } / / note : just calling this method may trigger the awt thread to get created return swing utilities is event dispatch thread ( ) ; }


read the version tag which starts the xml file

private void read version ( ) throws i o exception { try { expect tag ( " version " , false ) ; } catch ( i o exception e ) { / / handle the case where < version > does not exist / / note : fsimage xml files which are missing < version > are also missing / / many other fields that oiv needs to accurately reconstruct the / / fsimage throw new i o exception ( " no < version > section found at the top of " + " the fsimage xml this xml file is too old to be processed " + " by oiv " , e ) ; } node version = new node ( ) ; load node children ( version , " version fields " ) ; integer on disk version = version remove child int ( " on disk version " ) ; if ( on disk version = = null ) { throw new i o exception ( " the < version > section doesn ' t contain " + " the on disk version " ) ; } integer layout version = version remove child int ( " layout version " ) ; if ( layout version = = null ) { throw new i o exception ( " the < version > section doesn ' t contain " + " the layout version " ) ; } if ( layout version int value ( ) ! = name node layout version current layout version ) { throw new i o exception ( " layout version mismatch this oiv tool " + " handles layout version " + name node layout version current layout version + " , but the " + " xml file has < layout version > " + layout version + " please " + " either re - generate the xml file with the proper layout version , " + " or manually edit the xml file to be usable with this version " + " of the oiv tool " ) ; } file summary bld set ondisk version ( on disk version ) ; file summary bld set layout version ( layout version ) ; if ( log is debug enabled ( ) ) { log debug ( " loaded < version > with on disk version = " + on disk version + " , layout version = " + layout version + " " ) ; } }


returns the bin dir for artifacts built for a given apple architecture ( as set by a configuration transition ) and configuration distinguisher but the global default for { @ code - - cpu } and the platform default for minimum os

protected string configuration bin ( string arch , configuration distinguisher configuration distinguisher ) { return configuration bin ( arch , configuration distinguisher , null , compilation mode fastbuild ) ; }


parses a string into an authentication token

public static authentication token parse ( string token str ) throws authentication exception { return new authentication token ( auth token parse ( token str ) ) ; }


the time series average total number of executors for this { @ link # get label ( ) }

public float get total latest ( ) { return get online executors latest ( ) ; }


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


check if the configuration contains the specified key

default boolean contains key ( string key ) { return get property ( key ) ! = null ; }


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

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


pause the execution of the watcher executor , and empty the state pausing means , that no new watch executions will be done unless this pausing is explicitly unset this is important when watcher is stopped , so that scheduled watches do not accidentally get executed this should not be used when we need to reload watcher based on some cluster state changes , then just calling { @ link # clear executions and queue ( runnable ) } is the way to go

public int pause ( runnable stopped listener ) { assert stopped listener ! = null ; paused set ( true ) ; return clear executions and queue ( stopped listener ) ; }


how old ( in milliseconds ) files must be before being aged - off during cache maintenance

public long get max file age m s ( ) { return max file age ms ; }


set the failure channel after a send failure , an { @ link error message } will be sent to this channel with a payload of a { @ link messaging exception } with the failed message and cause

public void set send failure channel ( message channel send failure channel ) { this send failure channel = send failure channel ; }


returns term frequency - the number of times this term occurs in the current document

public int get term freq ( ) { return term freq ; }


public string get name ( ) { return name ; }


decode the body to the given target type for an error response ( status code of 4xx or 5xx ) , the { @ code mono } emits a { @ link web client exception } use { @ link # on status ( predicate , function ) } to customize error response handling

< t > mono < t > body to mono ( class < t > element class ) ;


a convenient way to produce a new record if you only need to change the headers copies the attributes of this record with the headers replaced also makes a copy of the provided headers see { @ link processor context # forward ( record ) } for considerations around mutability of keys , values , and headers

public record < k , v > with headers ( final headers headers ) { return new record < > ( key , value , timestamp , headers ) ; }


register the status of application changed listener

public static void register app status changed listener ( @ non null final utils on app status changed listener listener ) { utils bridge add on app status changed listener ( listener ) ; }


tells whether it is microsoft intermediate language

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


tries to read value of certain column from result set

object get attribute value ( d b d attribute binding attribute ) ;


set the list of response headers other than " simple " headers , i e { @ code cache - control } , { @ code content - language } , { @ code content - type } , { @ code expires } , { @ code last - modified } , or { @ code pragma } , that an actual response might have and can be exposed the special value { @ code " " } allows all headers to be exposed for non - credentialed requests by default this is not set

public cors registration exposed headers ( string headers ) { this config set exposed headers ( arrays as list ( headers ) ) ; return this ; }


private static int compare version strings ( string version left , string version right ) { if ( version left = = null | | version right = = null ) { return 0 ; } string [ ] version strings left = util split ( version left , " \ \ " ) ; string [ ] version strings right = util split ( version right , " \ \ " ) ; int min length = min ( version strings left length , version strings right length ) ; for ( int i = 0 ; i < min length ; i + + ) { if ( ! version strings left [ i ] equals ( version strings right [ i ] ) ) { try { int version int left = integer parse int ( version strings left [ i ] ) ; int version int right = integer parse int ( version strings right [ i ] ) ; return version int left - version int right ; } catch ( number format exception e ) { return 0 ; } } } return 0 ; }


returns the target kind for all input files

public static string target kind ( ) { return " source file " ; }


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


helper method to grow the character buffer as needed , this only happens once in a while so it ' s ok if it ' s in a method call if the index passed in is 0 then no copying will be done

private static char [ ] grow buffer ( char [ ] dest , int index , int size ) { if ( size < 0 ) { / / overflow - should be out of memory error but gwt / j 2cl don ' t support it throw new assertion error ( " cannot increase internal buffer any further " ) ; } char [ ] copy = new char [ size ] ; if ( index > 0 ) { system arraycopy ( dest , 0 , copy , 0 , index ) ; } return copy ; }


tests a single load balance policy ' s listener receive per - request orca reports upon call trailer arrives

public void single policy typical workflow ( ) { / / use a mocked noop stream tracer factory as the original stream tracer factory client stream tracer factory fake delegate factory = mock ( client stream tracer factory class ) ; client stream tracer fake tracer = mock ( client stream tracer class ) ; do nothing ( ) when ( fake tracer ) inbound trailers ( any ( metadata class ) ) ; when ( fake delegate factory new client stream tracer ( any ( client stream tracer stream info class ) , any ( metadata class ) ) ) then return ( fake tracer ) ; / / the orca reporting tracer factory will augment the stream info passed to its / / new client stream tracer method the augmented stream info ' s call options will contain / / a orca report broker , in which has the registered listener client stream tracer factory factory = orca per request util get instance ( ) new orca client stream tracer factory ( fake delegate factory , orca listener 1 ) ; client stream tracer tracer = factory new client stream tracer ( stream info , new metadata ( ) ) ; argument captor < client stream tracer stream info > stream info captor = argument captor for class ( null ) ; verify ( fake delegate factory ) new client stream tracer ( stream info captor capture ( ) , any ( metadata class ) ) ; client stream tracer stream info captured info = stream info captor get value ( ) ; assert that ( captured info ) is not equal to ( stream info ) ; / / when the trailer does not contain orca report , listener callback will not be invoked metadata trailer = new metadata ( ) ; tracer inbound trailers ( trailer ) ; verify no more interactions ( orca listener 1 ) ; / / when the trailer contains an orca report , listener callback will be invoked trailer put ( orca reporting tracer factory orca endpoint load metrics key , orca load report get default instance ( ) ) ; tracer inbound trailers ( trailer ) ; argument captor < orca load report > report captor = argument captor for class ( null ) ; verify ( orca listener 1 ) on load report ( report captor capture ( ) ) ; assert that ( report captor get value ( ) ) is equal to ( orca load report get default instance ( ) ) ; }


returns the schema of the consumed table

default table schema get table schema ( ) { final string [ ] field names = get field names ( ) ; final type information [ ] legacy field types = get field types ( ) ; if ( field names = = null | | legacy field types = = null ) { throw new table exception ( " table sink does not implement a table schema " ) ; } return new table schema ( field names , legacy field types ) ; }


returns whether this initialization data applies to the specified scheme

public boolean matches ( uuid scheme uuid ) { return c uuid nil equals ( uuid ) | | scheme uuid equals ( uuid ) ; }


control structure abstraction for safely extracting a prereq from the launcher attribute or { @ code - - java launcher } flag returns { @ code null } if either { @ code create executable } or { @ code use launcher } are disabled

private static string filter launcher for target ( rule context rule context ) { / / create executable = 0 disables the launcher if ( rule context get rule ( ) is attr defined ( " create executable " , type boolean ) & & ! rule context attributes ( ) get ( " create executable " , type boolean ) ) { return null ; } / / use launcher = false disables the launcher if ( rule context get rule ( ) is attr defined ( " use launcher " , type boolean ) & & ! rule context attributes ( ) get ( " use launcher " , type boolean ) ) { return null ; } / / build rule " launcher " attribute if ( rule context get rule ( ) is attr defined ( " launcher " , build type label ) & & rule context attributes ( ) get ( " launcher " , build type label ) ! = null ) { return " launcher " ; } / / blaze flag - - java launcher java configuration java config = rule context get fragment ( java configuration class ) ; if ( rule context get rule ( ) is attr defined ( " : java launcher " , build type label ) & & java config get java launcher label ( ) ! = null ) { return " : java launcher " ; } return null ; }


bytes representing a list of lists of catch types and associated handler addresses each try item has a byte - wise offset into this structure this element is only present if tries size is non - zero

public encoded catch handler list get handler list ( ) { return handlers ; }


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


gets the index of the address range containing the indicated address , if it is contained in the list ; otherwise , < tt > ( - ( insertion point ) - 1 ) < tt >

private int get address range index ( address address ) { int low = 0 ; int high = diffs length - 1 ; while ( low < = high ) { int mid = ( low + high ) > > 1 ; address range range = ranges [ mid ] ; if ( range contains ( address ) ) { return mid ; } else if ( address compare to ( range get min address ( ) ) < 0 ) { high = mid - 1 ; } else { low = mid + 1 ; } } return - ( low + 1 ) ; / / not found }


helper method for { @ link # check constraints } : performs refined environment constraint checking refined environment expectations : no environment group should be emptied out due to refining this reflects the idea that some of the static declared environments get pruned out by the build configuration , but all environments shouldn ' t be pruned out violations of this expectation trigger rule analysis errors

private void check refined constraints ( rule context rule context , set < environment labels > groups with environments removed , set < environment with group > refined environments so far , environment collection builder refined environments , map < label , removed environment culprit > removed environment culprits ) { set < environment labels > refined groups = new linked hash set < > ( ) ; for ( environment with group env with group : refined environments so far ) { refined environments put ( env with group group ( ) , env with group environment ( ) ) ; refined groups add ( env with group group ( ) ) ; } set < environment labels > newly empty groups = groups with environments removed is empty ( ) ? immutable set of ( ) : sets difference ( groups with environments removed , refined groups ) ; if ( ! newly empty groups is empty ( ) ) { rule error ( rule context , get over refinement error ( rule context get label ( ) , newly empty groups , removed environment culprits ) ) ; } }


return the packages to search for jaxb2 annotations

public string [ ] get packages to scan ( ) { return this packages to scan ; }


gets a free item if possible from the freelist returns null if the free list is empty updates the bucket in use count

public v get ( ) { v value = pop ( ) ; if ( value ! = null ) { m in use length + + ; } return value ; }


from a given configuration get all entries representing requested resources : entries that match the { prefix } { resource name } = { value } [ { units } ] pattern

public static list < resource information > get requested resources from config ( configuration configuration , string prefix ) { list < resource information > result = new array list < > ( ) ; map < string , string > custom resources map = configuration get val by regex ( " ^ " + pattern quote ( prefix ) + yarn io optional + " [ ^ ] + $ " ) ; for ( entry < string , string > resource : custom resources map entry set ( ) ) { string resource name = resource get key ( ) substring ( prefix length ( ) ) ; matcher matcher = resource request value pattern matcher ( resource get value ( ) ) ; if ( ! matcher matches ( ) ) { string error msg = " invalid resource request specified for property " + resource get key ( ) + " : \ " " + resource get value ( ) + " \ " , expected format is : value [ ] [ units ] " ; log error ( error msg ) ; throw new illegal argument exception ( error msg ) ; } long value = long parse long ( matcher group ( 1 ) ) ; string unit = matcher group ( 2 ) ; if ( unit is empty ( ) ) { unit = resource utils get default unit ( resource name ) ; } resource information resource information = new resource information ( ) ; resource information set name ( resource name ) ; resource information set value ( value ) ; resource information set units ( unit ) ; result add ( resource information ) ; } return result ; }


public static litho view mount component ( component context context , litho view litho view , component component ) { return mount component ( context , litho view , component , 100 , 100 ) ; }


submits all the callable tasks to the executor and waits for the results

static void submit tasks and wait for results ( executor service executor , callable [ ] tasks ) throws exception { final list < future > results = lists new array list with capacity ( tasks length ) ; for ( callable task : tasks ) { / / noinspection unchecked results add ( executor submit ( task ) ) ; } for ( future result : results ) { result get ( ) ; } }


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

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


get the proxy object which should be used until the next failover event occurs


returns the pattern that resulted in the stored { @ link sky key } or { @ link target parsing exception }


determine the order for this factory ' s aspect instance , either an instance - specific order expressed through implementing the { @ link org springframework core ordered } interface , or a fallback order

public int get order ( ) { if ( this aspect instance instanceof ordered ) { return ( ( ordered ) this aspect instance ) get order ( ) ; } return get order for aspect class ( this aspect instance get class ( ) ) ; }


set whether to return buckets as a hash or as an array , and return the builder so that calls can be chained

public date histogram aggregation builder keyed ( boolean keyed ) { this keyed = keyed ; return this ; }


public set < string > get photo urls ( ) { return photo urls ; }


for a given attribute , returns all declared provider provided by targets of that attribute each declared provider is keyed by the { @ link build configuration } under which the provider was created

public < c extends info > immutable list multimap < build configuration , c > get prerequisites by configuration ( string attribute name , builtin provider < c > provider ) { check attribute is dependency ( attribute name ) ; list < configured target and data > ctat collection = get prerequisite configured targets ( attribute name ) ; immutable list multimap builder < build configuration , c > result = immutable list multimap builder ( ) ; for ( configured target and data prerequisite : ctat collection ) { c prerequisite provider = prerequisite get configured target ( ) get ( provider ) ; if ( prerequisite provider ! = null ) { result put ( prerequisite get configuration ( ) , prerequisite provider ) ; } } return result build ( ) ; }


a { @ link channel } is inactive now , which means it is closed this will result in having the { @ link channel inbound handler # channel inactive ( channel handler context ) } method called of the next { @ link channel inbound handler } contained in the { @ link channel pipeline } of the { @ link channel }

channel inbound invoker fire channel inactive ( ) ;


return true if the field includes the { @ code public } modifier

public boolean is public ( ) { return field is public ( ) ; }


this isn ' t ideal behavior this is more to show how something works in the future , it ' d be nice to support inner unknown fields

public void combine with unknown fields inner messages unknowns ignored ( ) throws invalid protocol buffer exception { test inner message with new string test = test inner message with new string new builder ( ) set inner ( test inner message with new string inner new builder ( ) set a ( " a 1 " ) set b ( " b 1 " ) build ( ) ) build ( ) ; test inner message local representation = test inner message new builder ( ) set inner ( test inner message inner new builder ( ) set a ( " a 2 " ) build ( ) ) build ( ) ; test inner message combined = proto util combine with unknown fields ( local representation , test to byte array ( ) ) ; test inner message with new string reparsed test = test inner message with new string parse from ( combined to byte array ( ) ) ; assert assert equals ( " a 2 " , reparsed test get inner ( ) get a ( ) ) ; assert assert equals ( " " , reparsed test get inner ( ) get b ( ) ) ; }


gets type literal for the parameterized type represented by applying { @ code type arguments } to { @ code raw type }

public static type token < ? > get parameterized ( type raw type , type type arguments ) { return new type token < object > ( $ gson $ types new parameterized type with owner ( null , raw type , type arguments ) ) ; }


set the offset on this builder , and return the builder so that calls can be chained

public histogram aggregation builder offset ( double offset ) { this offset = offset ; return this ; }


returns the { @ link tunneling support } from the combined { @ link capabilities }

static int get tunneling support ( @ capabilities int support flags ) { return support flags & tunneling support mask ; }


maps the specified class to the specified value does not associate this value with any of the class ' s supertypes

< t extends b > t put instance ( class < t > type , @ nullable t value ) ;


indicates whether this domain name is composed of exactly one subdomain component followed by a { @ linkplain # is public suffix ( ) public suffix } for example , returns { @ code true } for { @ code google com } { @ code foo co uk } , and { @ code myblog blogspot com } , but not for { @ code www google com } , { @ code co uk } , or { @ code blogspot com } this method can be used to determine whether a domain is probably the highest level for which cookies may be set , though even that depends on individual browsers ' implementations of cookie controls see < a href = " http : www ietf orgrfcrfc 2 1 0 9 txt " > rfc 2109 for details

public boolean is top private domain ( ) { return public suffix index = = 1 ; }


sets the local strategy comparator for this channel

public void set local strategy comparator ( type comparator factory < ? > local strategy comparator ) { this local strategy comparator = local strategy comparator ; }


decommissioning using a post - configured exclude hosts file

public void test add new exclude path to configuration ( ) throws exception { configuration conf = new configuration ( ) ; rm = new mock r m ( conf ) ; rm start ( ) ; mock n m nm 1 = rm register node ( " host 1 : 1234 " , 5120 ) ; mock n m nm 2 = rm register node ( " host 2 : 5678 " , 10240 ) ; cluster metrics metrics = cluster metrics get metrics ( ) ; assert ( metrics ! = null ) ; int initial metric count = metrics get num decommisioned n ms ( ) ; node heartbeat response node heartbeat = nm 1 node heartbeat ( true ) ; assert assert equals ( node action normal , node heartbeat get node action ( ) ) ; node heartbeat = nm 2 node heartbeat ( true ) ; assert assert equals ( node action normal , node heartbeat get node action ( ) ) ; write to hosts file ( " host 2 " ) ; conf set ( yarn configuration rm nodes exclude file path , host file get absolute path ( ) ) ; rm get nodes list manager ( ) refresh nodes ( conf ) ; check decommissioned n m count ( rm , + + initial metric count ) ; node heartbeat = nm 1 node heartbeat ( true ) ; assert assert equals ( " node should not have been decommissioned " , node action normal , node heartbeat get node action ( ) ) ; node heartbeat = nm 2 node heartbeat ( true ) ; assert assert equals ( " node should have been decommissioned but is in state " + node heartbeat get node action ( ) , node action shutdown , node heartbeat get node action ( ) ) ; }


get all of the paths that currently exist in the working directories

iterable < path > get all local paths to read ( string path str , configuration conf ) throws i o exception { context ctx = conf changed ( conf ) ; if ( path str starts with ( " / " ) ) { path str = path str substring ( 1 ) ; } return new path iterator ( ctx local f s , path str , ctx local dirs ) ; }


public int get resource data length ( ) { return resource data length ; }


draws a rectangle in the xy plane using { @ link shape type # line } or { @ link shape type # filled } the x and y specify the lower left corner

public void rect ( float x , float y , float width , float height , color col 1 , color col 2 , color col 3 , color col 4 ) { check ( shape type line , shape type filled , 8 ) ; if ( shape type = = shape type line ) { renderer color ( col 1 r , col 1 g , col 1 b , col 1 a ) ; renderer vertex ( x , y , 0 ) ; renderer color ( col 2 r , col 2 g , col 2 b , col 2 a ) ; renderer vertex ( x + width , y , 0 ) ; renderer color ( col 2 r , col 2 g , col 2 b , col 2 a ) ; renderer vertex ( x + width , y , 0 ) ; renderer color ( col 3 r , col 3 g , col 3 b , col 3 a ) ; renderer vertex ( x + width , y + height , 0 ) ; renderer color ( col 3 r , col 3 g , col 3 b , col 3 a ) ; renderer vertex ( x + width , y + height , 0 ) ; renderer color ( col 4 r , col 4 g , col 4 b , col 4 a ) ; renderer vertex ( x , y + height , 0 ) ; renderer color ( col 4 r , col 4 g , col 4 b , col 4 a ) ; renderer vertex ( x , y + height , 0 ) ; renderer color ( col 1 r , col 1 g , col 1 b , col 1 a ) ; renderer vertex ( x , y , 0 ) ; } else { renderer color ( col 1 r , col 1 g , col 1 b , col 1 a ) ; renderer vertex ( x , y , 0 ) ; renderer color ( col 2 r , col 2 g , col 2 b , col 2 a ) ; renderer vertex ( x + width , y , 0 ) ; renderer color ( col 3 r , col 3 g , col 3 b , col 3 a ) ; renderer vertex ( x + width , y + height , 0 ) ; renderer color ( col 3 r , col 3 g , col 3 b , col 3 a ) ; renderer vertex ( x + width , y + height , 0 ) ; renderer color ( col 4 r , col 4 g , col 4 b , col 4 a ) ; renderer vertex ( x , y + height , 0 ) ; renderer color ( col 1 r , col 1 g , col 1 b , col 1 a ) ; renderer vertex ( x , y , 0 ) ; } }


get the connector names of the connectors currently running on this cluster

public collection < string > connectors ( ) { object mapper mapper = new object mapper ( ) ; string url = endpoint for resource ( " connectors " ) ; response response = request get ( url ) ; if ( response get status ( ) < response status bad request get status code ( ) ) { try { return mapper reader for ( collection class ) read value ( response to string ( response ) ) ; } catch ( i o exception e ) { log error ( " could not parse connector list from response : { } " , response to string ( response ) , e ) ; throw new connect exception ( " could not not parse connector list " , e ) ; } } throw new connect rest exception ( response get status ( ) , " could not read connector list error response : " + response to string ( response ) ) ; }


creates a number of random headers with the given namevalue lengths

static list < hpack header > create headers ( int num headers , int name length , int value length , boolean limit to ascii ) { list < hpack header > hpack headers = new array list < hpack header > ( num headers ) ; for ( int i = 0 ; i < num headers ; + + i ) { / / force always ascii for header names byte [ ] name = random bytes ( new byte [ name length ] , true ) ; byte [ ] value = random bytes ( new byte [ value length ] , limit to ascii ) ; hpack headers add ( new hpack header ( name , value ) ) ; } return hpack headers ; }


returns a string containing the supplied { @ code float } values , converted to strings as specified by { @ link float # to string ( float ) } , and separated by { @ code separator } for example , { @ code join ( " - " , 1 0f , 2 0f , 3 0f ) } returns the string { @ code " 1 0 - 2 0 - 3 0 " } note that { @ link float # to string ( float ) } formats { @ code float } differently in gwt in the previous example , it returns the string { @ code " 1 - 2 - 3 " }

public static string join ( string separator , float array ) { check not null ( separator ) ; if ( array length = = 0 ) { return " " ; } / / for pre - sizing a builder , just get the right order of magnitude string builder builder = new string builder ( array length * 12 ) ; builder append ( array [ 0 ] ) ; for ( int i = 1 ; i < array length ; i + + ) { builder append ( separator ) append ( array [ i ] ) ; } return builder to string ( ) ; }


adds a translational component to the matrix in the 3rd column the other columns are untouched

public matrix 3 trn ( float x , float y ) { val [ m02 ] + = x ; val [ m12 ] + = y ; return this ; }


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

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


factory for an empty { @ code merged test property sources } instance

static merged test property sources empty ( ) { return empty ; }


add tags defined in hadoop tags system , hadoop tags custom

public void add tags ( properties prop ) { / / get all system tags try { if ( prop contains key ( common configuration keys hadoop tags system ) ) { string system tags = prop get property ( common configuration keys hadoop tags system ) ; tags add all ( arrays as list ( system tags split ( " , " ) ) ) ; } / / get all custom tags if ( prop contains key ( common configuration keys hadoop tags custom ) ) { string custom tags = prop get property ( common configuration keys hadoop tags custom ) ; tags add all ( arrays as list ( custom tags split ( " , " ) ) ) ; } if ( prop contains key ( common configuration keys hadoop system tags ) ) { string system tags = prop get property ( common configuration keys hadoop system tags ) ; tags add all ( arrays as list ( system tags split ( " , " ) ) ) ; } / / get all custom tags if ( prop contains key ( common configuration keys hadoop custom tags ) ) { string custom tags = prop get property ( common configuration keys hadoop custom tags ) ; tags add all ( arrays as list ( custom tags split ( " , " ) ) ) ; } } catch ( exception ex ) { log trace ( " error adding tags in configuration " , ex ) ; } }


add a given name to the cache or track use count exist if the name already exists , then the internal value is returned

k put ( final k name ) { k internal = cache get ( name ) ; if ( internal ! = null ) { lookups + + ; return internal ; } / / track the usage count only during initialization if ( ! initialized ) { use count use count = transient map get ( name ) ; if ( use count ! = null ) { use count increment ( ) ; if ( use count get ( ) > = use threshold ) { promote ( name ) ; } return use count value ; } use count = new use count ( name ) ; transient map put ( name , use count ) ; } return null ; }


sets the cursor to the given program location

public void set cursor position ( program location loc ) { set cursor position ( loc , event trigger api call ) ; }


inserts a char value into the mapping of this bundle , replacing any existing value for the given key

public postcard with char ( @ nullable string key , char value ) { m bundle put char ( key , value ) ; return this ; }


register one or more component classes to be processed note that { @ link # refresh ( ) } must be called in order for the context to fully process the new classes

public void register ( class < ? > component classes ) { assert not empty ( component classes , " at least one component class must be specified " ) ; startup step register component class = this get application startup ( ) start ( " spring context component - classes register " ) tag ( " classes " , ( ) - > arrays to string ( component classes ) ) ; this reader register ( component classes ) ; register component class end ( ) ; }


determines if the given property passes this filter

boolean select ( object object , d b p property descriptor property ) ;


simple client - to - server streaming rpc

public io grpc stub stream observer < io grpc testing protobuf simple request > client streaming rpc ( io grpc stub stream observer < io grpc testing protobuf simple response > response observer ) { return io grpc stub server calls async unimplemented streaming call ( get client streaming rpc method ( ) , response observer ) ; }


request to connect to the given { @ link socket address } while bind to the local address and notify the { @ link channel future } once the operation completes , either because the operation was successful or because of an error the given { @ link channel promise } will be notified and also returned this will result in having the { @ link channel outbound handler # connect ( channel handler context , socket address , socket address , channel promise ) } method called of the next { @ link channel outbound handler } contained in the { @ link channel pipeline } of the { @ link channel }

channel future connect ( socket address remote address , socket address local address , channel promise promise ) ;


public summation get element ( ) { return sigma ; }


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


returns a { @ link config or error } for the failure to parse the config

public static config or error from error ( status status ) { return new config or error ( status ) ; }


public client response apply ( client request jersey request ) { try { final http uri request apache request = build apache request ( jersey request ) ; final closeable http response apache response = client execute ( apache request ) ; final status line status line = apache response get status line ( ) ; final string reason phrase = strings null to empty ( status line get reason phrase ( ) ) ; final response status type status = statuses from ( status line get status code ( ) , reason phrase ) ; final client response jersey response = new client response ( status , jersey request ) ; for ( header header : apache response get all headers ( ) ) { jersey response get headers ( ) compute if absent ( header get name ( ) , k - > new array list < > ( ) ) add ( header get value ( ) ) ; } final http entity http entity = apache response get entity ( ) ; jersey response set entity stream ( http entity ! = null ? http entity get content ( ) : new byte array input stream ( new byte [ 0 ] ) ) ; return jersey response ; } catch ( exception e ) { throw new processing exception ( e ) ; } }


construct the full set of requirements for a tester method

static tester requirements build tester requirements ( method tester method ) throws conflicting requirements exception { tester requirements cloned class requirements = new tester requirements ( get tester requirements ( tester method get declaring class ( ) ) ) ; tester requirements declared requirements = build declared tester requirements ( tester method ) ; return incorporate requirements ( cloned class requirements , declared requirements , tester method ) ; }


first data source failed , second succeeded , no intermediate results

public void test lifecycle f1 s2 c ( ) { data source < object > data source = get and subscribe ( ) ; data subscriber < object > subscriber 1 = verify get and subscribe ( m data source supplier 1 , m src 1 ) ; set state ( m src 1 , not closed , finished , without result , null , failed , mock ( throwable class ) ) ; subscriber 1 on failure ( m src 1 ) ; m in order verify ( m src 1 ) close ( ) ; data subscriber < object > subscriber 2 = verify get and subscribe ( m data source supplier 2 , m src 2 ) ; verify state ( data source , null , not closed , not finished , without result , null , not failed , null ) ; object val = mock ( object class ) ; set state ( m src 2 , not closed , finished , with result , val , not failed , null ) ; subscriber 2 on new result ( m src 2 ) ; verify subscriber ( data source , m src 2 , on new result ) ; verify state ( data source , m src 2 , not closed , finished , with result , val , not failed , null ) ; test close ( data source , m src 2 ) ; verify state ( data source , null , closed , finished , without result , null , not failed , null ) ; }


public void test conversion to long ( ) { data type to = long ; { converter conversion = converter for ( double , to ) ; assert null ( conversion convert ( null ) ) ; assert equals ( 10l , conversion convert ( 10 0 ) ) ; assert equals ( 10l , conversion convert ( 10 1 ) ) ; assert equals ( 11l , conversion convert ( 10 6 ) ) ; exception e = expect throws ( ql illegal argument exception class , ( ) - > conversion convert ( double max value ) ) ; assert equals ( " [ " + double max value + " ] out of [ long ] range " , e get message ( ) ) ; } { converter conversion = converter for ( integer , to ) ; assert null ( conversion convert ( null ) ) ; assert equals ( 10l , conversion convert ( 10 ) ) ; assert equals ( - 134l , conversion convert ( - 134 ) ) ; } { converter conversion = converter for ( boolean , to ) ; assert null ( conversion convert ( null ) ) ; assert equals ( 1l , conversion convert ( true ) ) ; assert equals ( 0l , conversion convert ( false ) ) ; } { converter conversion = converter for ( date , to ) ; assert null ( conversion convert ( null ) ) ; assert equals ( 123379200000l , conversion convert ( as date only ( 123456789101l ) ) ) ; assert equals ( - 123465600000l , conversion convert ( as date only ( - 123456789101l ) ) ) ; } { converter conversion = converter for ( time , to ) ; assert null ( conversion convert ( null ) ) ; assert equals ( 123456l , conversion convert ( as time only ( 123456l ) ) ) ; assert equals ( 77589101l , conversion convert ( as time only ( 123456789101l ) ) ) ; assert equals ( 86276544l , conversion convert ( as time only ( - 123456l ) ) ) ; assert equals ( 8810899l , conversion convert ( as time only ( - 123456789101l ) ) ) ; } { converter conversion = converter for ( datetime , to ) ; assert null ( conversion convert ( null ) ) ; assert equals ( 123456789101l , conversion convert ( as date time ( 123456789101l ) ) ) ; assert equals ( - 123456789101l , conversion convert ( as date time ( - 123456789101l ) ) ) ; } { converter conversion = converter for ( keyword , to ) ; assert null ( conversion convert ( null ) ) ; assert equals ( 1l , conversion convert ( " 1 " ) ) ; assert equals ( 0l , conversion convert ( " - 0 " ) ) ; exception e = expect throws ( ql illegal argument exception class , ( ) - > conversion convert ( " 0xff " ) ) ; assert equals ( " cannot cast [ 0xff ] to [ long ] " , e get message ( ) ) ; } }


returns true if any files with a yml extension exist the test resources rest - api - spectest directory ( from source or output dir )

private boolean project has yaml rest tests ( ) { file test source resource dir = get test source resource dir ( ) ; file test output resource dir = get test output resource dir ( ) ; / / check output for cases where tests are copied programmatically if ( test source resource dir = = null & & test output resource dir = = null ) { return false ; } try { if ( test source resource dir ! = null & & new file ( test source resource dir , " rest - api - spec / test " ) exists ( ) ) { return files walk ( test source resource dir to path ( ) resolve ( " rest - api - spec / test " ) ) any match ( p - > p get file name ( ) to string ( ) ends with ( " yml " ) ) ; } if ( test output resource dir ! = null & & new file ( test output resource dir , " rest - api - spec / test " ) exists ( ) ) { return files walk ( test output resource dir to path ( ) resolve ( " rest - api - spec / test " ) ) any match ( p - > p get file name ( ) to string ( ) ends with ( " yml " ) ) ; } } catch ( i o exception e ) { throw new illegal state exception ( string format ( " error determining if this project [ % s ] has rest tests " , get project ( ) ) , e ) ; } return false ; }


returns a freshly created entry , typed at the { @ code e } type , for the given { @ code segment }

e new entry ( s segment , k key , int hash , @ nullable decl e next ) ;


returns the unique id of this { @ code transformation }


build the sql statement , using string format rules

protected static string sql ( final string template , final object args ) { return args length > 0 ? string format ( template , args ) : template ; }


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 an instance of this class if jaas configuration property @ link sasl configs # sasl jaas config } is specified , the configuration object is created by parsing the property value otherwise , the default configuration is returned the context name is always ` kafka client `

public static jaas context load client context ( map < string , ? > configs ) { password dynamic jaas config = ( password ) configs get ( sasl configs sasl jaas config ) ; return load ( jaas context type client , null , global context name client , dynamic jaas config ) ; }


returns the default value of this attribute in the context of the specified rule for attributes with a computed default , i e { @ code has computed default ( ) } , { @ code rule } must be non - null since the result may depend on the values of its other attributes the result may be null ( although this is not a value in the build language ) during population of the rule ' s attribute dictionary , all non - computed defaults must be set before all computed ones

public object get default value ( rule rule ) { if ( ! get condition ( ) apply ( rule = = null ? null : nonconfigurable attribute mapper of ( rule ) ) ) { return null ; } else if ( default value instanceof late bound default < ? , ? > ) { return ( ( late bound default < ? , ? > ) default value ) get default ( ) ; } else { return default value ; } }


returns the internal name of the given class the internal name of a class is its fully qualified name , as returned by class get name ( ) , where ' ' are replaced by ' '

public static string get internal name ( final class < ? > clazz ) { return clazz get name ( ) replace ( ' ' , ' / ' ) ; }


provide a comparator to sort request mapping infos matched to a request

protected comparator < request mapping info > get mapping comparator ( final server web exchange exchange ) { return ( info 1 , info 2 ) - > info 1 compare to ( info 2 , exchange ) ; }


returns the number of tasks tracked globally

static int get num tasks ( ) { return http channels values ( ) stream ( ) map to int ( close listener : : get num tasks ) sum ( ) ; }


creates list of users with given input array < b > 0 < b > - successful operation

public void create users with array input ( list < user > body ) throws i o exception { create users with array input for http response ( body ) ; }


executed once for every successful shard level request

protected void on shard result ( result result , search shard iterator shard it ) { assert result get shard index ( ) ! = - 1 : " shard index is not set " ; assert result get search shard target ( ) ! = null : " search shard target must not be null " ; has shard response set ( true ) ; if ( logger is trace enabled ( ) ) { logger trace ( " got first - phase result from { } " , result ! = null ? result get search shard target ( ) : null ) ; } results consume result ( result , ( ) - > on shard result consumed ( result , shard it ) ) ; }


protected void report ( ) { log info ( get report ( ) ) ; }


see { @ link socket # to string ( ) } calling this method does not trigger mode detection

public string to string ( ) { return " unified socket [ mode = " + mode to string ( ) + " socket = " + get socket allow unknown mode ( ) to string ( ) + " ] " ; }


returns a { @ link track output } that emsg messages could be written to

public player track emsg handler new player track emsg handler ( ) { return new player track emsg handler ( allocator ) ; }


writes a data stream to the standard output stream ( stderr ) for each element of the data stream the result of { @ link object # to string ( ) } is written note : this will print to stderr on the machine where the code is executed , i e the flink worker

public data stream sink < t > print to err ( string sink identifier ) { print sink function < t > print function = new print sink function < > ( sink identifier , true ) ; return add sink ( print function ) name ( " print to std err " ) ; }


set the alpha value ( transparency ) that is used for drawing the highlight indicator bar min = 0 ( fully transparent ) , max = 255 ( fully opaque )

public void set high light alpha ( int alpha ) { m high light alpha = alpha ; }


attempts to determine the set of references which refer to the specified variable in utilizing the first use offset scoping model , negative offsets ( relative to the functions entry ) are shifted beyond the maximum positive offset within the function while this does not account for the actual instruction flow , it is hopefully accurate enough for most situations

public reference [ ] get references to ( variable var ) { lock acquire ( ) ; try { function function = var get function ( ) ; if ( ! ( function instanceof function d b ) | | function get program ( ) ! = program | | ! ( ( function d b ) function ) check is valid ( ) ) { return no refs ; } symbol d b var symbol = ( symbol d b ) var get symbol ( ) ; if ( var symbol ! = null & & ! var symbol check is valid ( ) ) { return no refs ; } function cacher set function ( function ) ; variable storage storage = var get variable storage ( ) ; scope scope = find variable scope ( function , var symbol , var ) ; list < reference > matching references = get scoped variable references ( storage , function , scope ) ; if ( matching references is empty ( ) ) { return no refs ; } reference [ ] refs = new reference [ matching references size ( ) ] ; matching references to array ( refs ) ; return refs ; } finally { lock release ( ) ; } }


update query and header parameters based on authentication settings

public void update params for auth ( string [ ] auth names , list < pair > query params , map < string , string > header params , map < string , string > cookie params ) { for ( string auth name : auth names ) { authentication auth = authentications get ( auth name ) ; if ( auth = = null ) { throw new runtime exception ( " authentication undefined : " + auth name ) ; } auth apply to params ( query params , header params , cookie params ) ; } }


public void clear ( ) { fifo queue clear ( ) ; head record = null ; partition time = unknown ; }


add a new encryption zone does not assume that the f s directory lock is held

void unprotected add encryption zone ( long inode id , cipher suite suite , crypto protocol version version , string key name ) { final encryption zone int ez = new encryption zone int ( inode id , suite , version , key name ) ; if ( encryption zones = = null ) { encryption zones = new tree map < > ( ) ; } encryption zones put ( inode id , ez ) ; }


a sensible , albeit inefficient , definition of { @ link # contains key } in terms of the { @ code iterator } method of { @ link # entry set } if you override { @ link # entry set } , you may wish to override { @ link # contains key } to forward to this implementation

protected boolean standard contains key ( @ nullable object key ) { return maps contains key impl ( this , key ) ; }


computes the specified { @ code digest } and { @ code signature } for the provided { @ code json } object and checks whether they match { @ code digest entry } and { @ code signature entry } in the provided { @ code signature json } object

private form validation check specific signature ( j s o n object json , j s o n object signature json , message digest digest , string digest entry , signature signature , string signature entry , string digest name ) throws i o exception { / / this is for computing a digest to check sanity digest output stream dos = new digest output stream ( null output stream null output stream , digest ) ; signature output stream sos = new signature output stream ( signature ) ; string provided digest = signature json opt string ( digest entry , null ) ; if ( provided digest = = null ) { return form validation warning ( " no ' " + digest entry + " ' found " ) ; } string provided signature = signature json opt string ( signature entry , null ) ; if ( provided signature = = null ) { return form validation warning ( " no ' " + signature entry + " ' found " ) ; } / / until jenkins - 11110 fix , uc used to serve invalid digest ( and therefore unverifiable signature ) / / that only covers the earlier portion of the file this was caused by the lack of close ( ) call / / in the canonical writing , which apparently leave some bytes somewhere that ' s not flushed to / / the digest output stream this affects jenkins [ 1 424 , 1 , 431 ] / / jenkins 1 432 shipped with the " fix " ( 1eb 0c 6 4abb 3 7 9 4edce 2 9cbb 1de 5 0c 9 3fa 0 3a 8 2 2 9 ) that made it / / compute the correct digest , but it breaks all the existing uc json metadata out there we then / / quickly discovered ourselves in the catch - 22 situation if we generate uc with the correct signature , / / it ' ll cut off [ 1 424 , 1 431 ] from the uc but if we don ' t , we ' ll cut off [ 1 432 , * ) / / / / in 1 433 , we revisited 1eb 0c 6 4abb 3 7 9 4edce 2 9cbb 1de 5 0c 9 3fa 0 3a 8 2 2 9 so that the original " digest " / " signature " / / pair continues to be generated in a buggy form , while " correct digest " / " correct signature " are generated / / correctly / / / / jenkins should ignore " digest " / " signature " pair accepting it creates a vulnerability that allows / / the attacker to inject a fragment at the end of the json json write canonical ( new output stream writer ( new tee output stream ( dos , sos ) , standard charsets utf 8 ) ) close ( ) ; / / did the digest match ? this is not a part of the signature validation , but if we have a bug in the c 1 4n / / ( which is more likely than someone tampering with update center ) , we can tell if ( ! digest matches ( digest digest ( ) , provided digest ) ) { string msg = digest name + " digest mismatch : expected = " + provided digest + " in ' " + name + " ' " ; if ( logger is loggable ( level severe ) ) { logger severe ( msg ) ; logger severe ( json to string ( 2 ) ) ; } return form validation error ( msg ) ; } if ( ! verify signature ( signature , provided signature ) ) { return form validation error ( digest name + " based signature in the update center doesn ' t match with the certificate in ' " + name + " ' " ) ; } return form validation ok ( ) ; }