converts a string into 128 - bit aes key

public static secret key to aes 1 2 8 key ( @ non null string s ) { try { / / turn secret key into 256 bit hash message digest digest = message digest get instance ( " sha - 256 " ) ; digest reset ( ) ; digest update ( s get bytes ( standard charsets utf 8 ) ) ; / / due to the stupid us export restriction jdk only ships 1 2 8bit version return new secret key spec ( digest digest ( ) , 0 , 128 / 8 , " aes " ) ; } catch ( no such algorithm exception e ) { throw new error ( e ) ; } }


the method is used to find out if the stop watch is started

public boolean is running ( ) { return is started ; }


tests { @ link task slot table impl # get active task slot allocation ids ( ) }

public void test retrieving all active slots ( ) throws exception { try ( final task slot table impl < ? > task slot table = create task slot table and start ( 3 ) ) { final job i d job id 1 = new job i d ( ) ; final allocation i d allocation id 1 = new allocation i d ( ) ; task slot table allocate slot ( 0 , job id 1 , allocation id 1 , slot timeout ) ; final allocation i d allocation id 2 = new allocation i d ( ) ; task slot table allocate slot ( 1 , job id 1 , allocation id 2 , slot timeout ) ; final allocation i d allocation id 3 = new allocation i d ( ) ; final job i d job id 2 = new job i d ( ) ; task slot table allocate slot ( 2 , job id 2 , allocation id 3 , slot timeout ) ; task slot table mark slot active ( allocation id 1 ) ; task slot table mark slot active ( allocation id 3 ) ; assert that ( task slot table get active task slot allocation ids ( ) , is ( sets new hash set ( allocation id 1 , allocation id 3 ) ) ) ; } }


filters the given stack trace to remove entries known to be present in the test thread that offer little forensic value

public static stack trace element [ ] filter trace ( stack trace element [ ] trace ) { / / @ formatter : off stack trace element [ ] filtered = reflection utilities filter stack trace ( trace , junit org package , junit framework package , mockit junit package , java awt event package , java lang package , sun package , ghidra swing runner ) ; / / @ formatter : on return filtered ; }


resets variables maintaining the sum to zero this method may be a useful alternative to creating a new adder , but is only effective if there are no concurrent updates because this method is intrinsically racy , it should only be used when it is known that no threads are concurrently updating

public void reset ( ) { internal reset ( 0l ) ; }


public time value get bucket span ( ) { return bucket span ; }


returns the index of the last appearance of the value { @ code target } in { @ code array }

public static int last index of ( boolean [ ] array , boolean target ) { return last index of ( array , target , 0 , array length ) ; }


deactivates the message endpoint , preparing it for shutdown


void write ( xml writer writer , address set view set , task monitor monitor ) throws cancelled exception { monitor set message ( " writing equates " ) ; writer start element ( " equates " ) ; writer start element ( " equate group " ) ; iterator < equate > iter = equate table get equates ( ) ; while ( iter has next ( ) ) { if ( monitor is cancelled ( ) ) { throw new cancelled exception ( ) ; } equate equate = iter next ( ) ; write equate ( writer , equate , set ) ; } writer end element ( " equate group " ) ; writer end element ( " equates " ) ; }


corrupt an edit log file after the start segment transaction

private void corrupt after start segment ( file f ) throws i o exception { random access file raf = new random access file ( f , " rw " ) ; raf seek ( 0x 2 0 ) ; / / skip version and first tranaction and a bit of next transaction for ( int i = 0 ; i < 1000 ; i + + ) { raf write int ( 0xdeadbeef ) ; } raf close ( ) ; }


test that server default values can be retrieved on the client side

public void test server defaults ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; conf set long ( dfs block size key , dfs block size default ) ; conf set int ( dfs bytes per checksum key , dfs bytes per checksum default ) ; conf set int ( dfs client write packet size key , dfs client write packet size default ) ; conf set int ( dfs replication key , dfs replication default + 1 ) ; conf set int ( io file buffer size key , io file buffer size default ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( d f s config keys dfs replication default + 1 ) build ( ) ; cluster wait active ( ) ; file system fs = cluster get file system ( ) ; try { fs server defaults server defaults = fs get server defaults ( new path ( " / " ) ) ; assert equals ( dfs block size default , server defaults get block size ( ) ) ; assert equals ( dfs bytes per checksum default , server defaults get bytes per checksum ( ) ) ; assert equals ( dfs client write packet size default , server defaults get write packet size ( ) ) ; assert equals ( dfs replication default + 1 , server defaults get replication ( ) ) ; assert equals ( io file buffer size default , server defaults get file buffer size ( ) ) ; assert equals ( 7 , server defaults get default storage policy id ( ) ) ; } finally { fs close ( ) ; cluster shutdown ( ) ; } }


get the target of the link if a merge link then it returned as " , " separated uri list

path get target link ( ) { string builder result = new string builder ( target dir link list [ 0 ] to string ( ) ) ; / / if merge link , use " , " as separator between the merged u r is for ( int i = 1 ; i < target dir link list length ; + + i ) { result append ( ' , ' ) append ( target dir link list [ i ] to string ( ) ) ; } return new path ( result to string ( ) ) ; }


links an { @ link event } to a specific { @ link handler }

public < e extends event > void register handler ( class < e > event type , handler < e > handler ) { handlers put ( event type , handler ) ; }


returns the { @ link byte buf allocator } which created this buffer

public abstract byte buf allocator alloc ( ) ;


public int get exit code ( ) { return code ; }


called by log 4j 2 to initialize this converter

public static custom map fields converter new instance ( final configuration config , final string [ ] options ) { return new custom map fields converter ( ) ; }


public void set parent ( node parent ) { this parent = parent ; }


pops the given number of stack entries at or after the given offset the instructions are marked as necessary

private void insert pop instructions ( int offset , boolean replace , boolean before , instruction old instruction , int pop count ) { / / collect the pop opcodes int pop opcodes = pop count % 2 = = 1 ? instruction constants op pop : 0 ; for ( int counter = 1 ; counter < pop count ; counter + = 2 ) { pop opcodes = ( pop opcodes < < 8 ) | instruction constants op pop2 ; } / / replace or insert them insert instructions ( offset , replace , before , old instruction , pop opcodes ) ; }


returns the the mask used for masking off the upper bits of a value use to get the mod - page - size of the value ( page sizes must be power of two for this to work )

protected int get page size mod mask ( ) { return page size mod mask ; }


boolean subscribe ( message handler handler ) ;


public static bitmap to round ( final bitmap src , @ int range ( from = 0 ) int border size , @ color int int border color ) { return to round ( src , border size , border color , false ) ; }


examine the path metadata , declare whether it should be queued for recursive scanning

private boolean is directory ( path metadata md ) { return ! md get file status ( ) is file ( ) ; }


public static void init session manager ( ) throws exception { session holder init ( null ) ; remoting server = new default coordinator test mock server message sender ( ) ; core = new default core ( remoting server ) ; }


set arbitrary properties for the kafka source and kafka consumer the valid keys can be found in { @ link consumer config } and { @ link kafka source options } note that the following keys will be overridden by the builder when the kafka source is created < code > key deserializer < code > is always set to { @ link byte array deserializer } < code > value deserializer < code > is always set to { @ link byte array deserializer } < code > auto offset reset strategy < code > is overridden by { @ link offsets initializer # get auto offset reset strategy ( ) } for the starting offsets , which is by default { @ link offsets initializer # earliest ( ) } < code > partition discovery interval ms < code > is overridden to - 1 when { @ link # set bounded ( offsets initializer ) } has been invoked < code > client id < code > is overridden to the " client id prefix - random long " , or " group id - random long " if the client id prefix is not set

public kafka source builder < out > set properties ( properties props ) { this props put all ( props ) ; return this ; }


the optinal style from which this style inherits attributes < code > optional aapt pb reference parent = 1 ; < code >

public builder set parent ( com android aapt resources reference builder builder for value ) { copy on write ( ) ; instance set parent ( builder for value ) ; return this ; }


public list < list < big decimal > > get array array number ( ) { return array array number ; }


get collection of blocks which map onto this block

collection < memory block d b > get mapped blocks ( ) { return mapped blocks ; }


generate a big integer value by invoking buf get bytes at the specified offset

public big integer get big integer ( mem buffer buf , int offset , int size , boolean signed ) throws memory access exception ;


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

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


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


returns the last ( tail ) item in the queue ( without removing it )

public t last ( ) { if ( size = = 0 ) { / / underflow throw new no such element exception ( " queue is empty " ) ; } final t [ ] values = this values ; int tail = this tail ; tail - - ; if ( tail = = - 1 ) { tail = values length - 1 ; } return values [ tail ] ; }


todo nacos does not support atomic update of the value mapped to a key

public sorted set < string > get config keys ( string group ) { / / todo use nacos client api to replace http open api sorted set < string > keys = new tree set < > ( ) ; try { list < string > params values = as list ( " search " , " accurate " , " data id " , " " , " group " , resolve group ( group ) , " page no " , " 1 " , " page size " , string value of ( integer max value ) ) ; string encoding = get property ( encode , " utf - 8 " ) ; http simple client http result result = http agent http get ( get config keys path , empty list ( ) , params values , encoding , 5 * 1000 ) ; stream < string > keys stream = to keys stream ( result content ) ; keys stream for each ( keys : : add ) ; } catch ( i o exception e ) { if ( logger is error enabled ( ) ) { logger error ( e get message ( ) , e ) ; } } return keys ; }


return whether the setter method of the given bean property is defined in any of the given interfaces

public static boolean is setter defined in interface ( property descriptor pd , set < class < ? > > interfaces ) { method setter = pd get write method ( ) ; if ( setter ! = null ) { class < ? > target class = setter get declaring class ( ) ; for ( class < ? > ifc : interfaces ) { if ( ifc is assignable from ( target class ) & & class utils has method ( ifc , setter ) ) { return true ; } } } return false ; }


atomically subtract the given number ( positive , not validated ) from the target field unless it contains { @ link long # max value }

public static long produced ( @ non null atomic long requested , long n ) { for ( ; ; ) { long current = requested get ( ) ; if ( current = = long max value ) { return long max value ; } long update = current - n ; if ( update < 0l ) { rx java plugins on error ( new illegal state exception ( " more produced than requested : " + update ) ) ; update = 0l ; } if ( requested compare and set ( current , update ) ) { return update ; } } }


set the given property , if it is currently unset

public void set boolean if unset ( string name , boolean value ) { set if unset ( name , boolean to string ( value ) ) ; }


guard against the default value changing by accident

@ test public void default prefix ( ) { assert that ( new platform ( ) get prefix ( ) ) is equal to ( " ok http " ) ; }


set whether local properties override properties from files default is " false " : properties from files override local defaults can be switched to " true " to let local properties override defaults from files

public void set local override ( boolean local override ) { this local override = local override ; }


sets the { @ link standard socket options # so reuseaddr } option

server socket channel config set reuse address ( boolean reuse address ) ;


gets the functions offset , which is an address offset from the start of the cache mapping

public int get functions offset ( ) { return functions offset ; }


gets the token , which together with the scheme , will be sent as the value of the authorization header

public string get bearer token ( ) { return bearer token ; }


try to remove the given reference and then return the reference count if the given inode is not a reference , return - 1 ;

public static int try remove reference ( i node inode ) { if ( ! inode is reference ( ) ) { return - 1 ; } return remove reference ( inode as reference ( ) ) ; }


configure the thread pool backing this message channel using a custom thread pool task executor

public task executor registration task executor ( @ nullable thread pool task executor task executor ) { if ( this registration = = null ) { this registration = ( task executor ! = null ? new task executor registration ( task executor ) : new task executor registration ( ) ) ; } return this registration ; }


configure the { @ link scheduler } to use by default , initialized with a { @ link scheduled executor scheduler }

public void set scheduler ( @ nullable scheduler scheduler ) { this scheduler = scheduler ; }


add the given { @ link header } to this collection


create a new { @ code mock mvc html unit driver builder } based on the supplied { @ link mock mvc } instance

public static mock mvc html unit driver builder mock mvc setup ( mock mvc mock mvc ) { assert not null ( mock mvc , " mock mvc must not be null " ) ; return new mock mvc html unit driver builder ( mock mvc ) ; }


method to perform depth - first search and write the parameters of every queue in json format

private static void dump configuration ( json generator dump generator , set < queue > root queues ) throws json generation exception , i o exception { for ( queue queue : root queues ) { dump generator write start object ( ) ; dump generator write string field ( " name " , queue get name ( ) ) ; dump generator write string field ( " state " , queue get state ( ) to string ( ) ) ; access control list submit job list = null ; access control list administer jobs list = null ; if ( queue get acls ( ) ! = null ) { submit job list = queue get acls ( ) get ( to full property name ( queue get name ( ) , queue a c l submit job get acl name ( ) ) ) ; administer jobs list = queue get acls ( ) get ( to full property name ( queue get name ( ) , queue a c l administer jobs get acl name ( ) ) ) ; } string acls submit job value = " " ; if ( submit job list ! = null ) { acls submit job value = submit job list get acl string ( ) ; } dump generator write string field ( " acl submit job " , acls submit job value ) ; string acls administer value = " " ; if ( administer jobs list ! = null ) { acls administer value = administer jobs list get acl string ( ) ; } dump generator write string field ( " acl administer jobs " , acls administer value ) ; dump generator write field name ( " properties " ) ; dump generator write start array ( ) ; if ( queue get properties ( ) ! = null ) { for ( map entry < object , object > property : queue get properties ( ) entry set ( ) ) { dump generator write start object ( ) ; dump generator write string field ( " key " , ( string ) property get key ( ) ) ; dump generator write string field ( " value " , ( string ) property get value ( ) ) ; dump generator write end object ( ) ; } } dump generator write end array ( ) ; set < queue > child queues = queue get children ( ) ; dump generator write field name ( " children " ) ; dump generator write start array ( ) ; if ( child queues ! = null & & child queues size ( ) > 0 ) { dump configuration ( dump generator , child queues ) ; } dump generator write end array ( ) ; dump generator write end object ( ) ; } }


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


tracks the given new non runnable app so that it can be made runnable when it would not violate max running app limits

public void track non runnable app ( f s app attempt app ) { string user = app get user ( ) ; users non runnable apps put ( user , app ) ; }


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

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


public boolean add ( e elem ) { if ( elem = = null ) { return false ; } if ( elem is in list ( this ) ) { return false ; } element prev = root get prev ( intrusive collection this ) ; prev set next ( intrusive collection this , elem ) ; root set prev ( intrusive collection this , elem ) ; elem insert internal ( intrusive collection this , prev , root ) ; size + + ; return true ; }


test code generation for nullable objects value must be a map of strings to values or the & # 39 ; null & # 39 ; value

public object get object with no declared props nullable ( ) { return object with no declared props nullable or else ( null ) ; }


enter a parse tree produced by the { @ code null literal } labeled alternative in { @ link sql base parser # constant }

void enter null literal ( sql base parser null literal context ctx ) ;


default string create token ( final string username ) { return null ; }


start a transaction on the given program with the given description

public static program transaction open ( program program , string description ) { int tid = program start transaction ( description ) ; return new program transaction ( program , tid ) ; }


all of the named writeables needed to deserialize the instances of { @ linkplain bucket extractor } s

public static list < named writeable registry entry > get named writeables ( ) { list < named writeable registry entry > entries = new array list < > ( ) ; entries add ( new entry ( bucket extractor class , computing extractor name , computing extractor : : new ) ) ; entries add ( new entry ( bucket extractor class , constant extractor name , constant extractor : : new ) ) ; return entries ; }


waits for the value returned by the supplier to be non - null if the timeout period expires , then null will be returned most of the < code > wait xyz ( ) < code > methods throw an { @ link assertion failed error } if the timeout period expires this method allows you to setup a longer wait period by repeatedly calling this method < p > most clients should use { @ link # wait for value ( supplier ) }

public static < t > t wait for value without failing ( supplier < t > supplier ) { return wait for value ( supplier , null , false / * fail on timeout * / ) ; }


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


public boolean is sleeping allowed ( ) { return jni is sleeping allowed ( addr ) ; }


set the span of transverse proportion of font

public span utils set font x proportion ( final float proportion ) { this x proportion = proportion ; return this ; }


public static < t > boolean contains ( collection < t > coll , t target ) { if ( is empty ( coll ) ) { return false ; } return coll contains ( target ) ; }


enter a parse tree produced by { @ link sql base parser # grouping expressions }

void enter grouping expressions ( sql base parser grouping expressions context ctx ) ;


public void service start ( ) throws i o exception { start storage ( ) ; }


creates a symbolic link see { @ link path # create symbolic link ( path ) } for specification note : for { @ link file system } s where { @ link # supports symbolic links natively ( path ) } returns false , this method will throw an { @ link unsupported operation exception }

protected abstract void create symbolic link ( path link path , path fragment target fragment ) throws i o exception ;


public static float [ ] reallocate buffer ( float [ ] old buffer , int old capacity , int new capacity ) { assert ( new capacity > old capacity ) ; float [ ] new buffer = new float [ new capacity ] ; if ( old buffer ! = null ) { system arraycopy ( old buffer , 0 , new buffer , 0 , old capacity ) ; } return new buffer ; }


transforms this local resource descriptor to a { @ link local resource }

public local resource to local resource ( ) { return utils register local resource ( path , size , modification time , visibility , resource type ) ; }


the substitute method for a private instance method in an interface

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


modifies the configuration to contain the lifeline rpc address setting

void set rpc lifeline server address ( configuration conf , inet socket address lifeline r p c address ) { log info ( " setting lifeline rpc address { } " , lifeline r p c address ) ; conf set ( dfs namenode lifeline rpc address key , net utils get host port string ( lifeline r p c address ) ) ; }


returns the length ( in code units ) of the short hash

public byte get short hash code unit length ( ) { return short hash code unit length ; }


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

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


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


during a parse is sometimes useful to listen in on the rule entry and exit events as well as token matches this is for quick and dirty debugging

public void set trace ( boolean trace ) { if ( ! trace ) { remove parse listener ( tracer ) ; tracer = null ; } else { if ( tracer ! = null ) remove parse listener ( tracer ) ; else tracer = new trace listener ( ) ; add parse listener ( tracer ) ; } }


created 10 000 nodes randomly adds different number outgoing and incoming edges for every node

public void test valid state of graph after concurrent access with varierty of nodes ( ) throws interrupted exception { digraph < integer > digraph = new digraph < > ( ) ; final int number of nodes = 50 000 ; final atomic integer id generator = new atomic integer ( ) ; runnable worker both 3 = new create node worker ( digraph , 3 , 3 , id generator ) ; runnable worker both 1 0 = new create node worker ( digraph , 10 , 10 , id generator ) ; runnable worker both 1 0 0 = new create node worker ( digraph , 100 , 100 , id generator ) ; runnable worker outgoing 2 0 = new create node worker ( digraph , 20 , 0 , id generator ) ; runnable worker incoming 2 0 = new create node worker ( digraph , 0 , 20 , id generator ) ; run workers ( number of nodes / 5 , / / have already 5 workers worker both 3 , worker both 1 0 , worker both 1 0 0 , worker incoming 2 0 , worker outgoing 2 0 ) ; assert that ( digraph get node count ( ) ) is equal to ( number of nodes ) ; assert graph is in consistent state ( digraph ) ; }


for each { @ code required matchers } check there is an element present in { @ code ids } that matches once a match is made the matcher is removed from { @ code required matchers }

public void filter matched ids ( collection < string > ids ) { for ( string id : ids ) { iterator < id matcher > itr = required matches iterator ( ) ; if ( itr has next ( ) = = false ) { break ; } while ( itr has next ( ) ) { if ( itr next ( ) matches ( id ) ) { itr remove ( ) ; } } } }


updates the queue tracker with a reported timeline change

public void on timeline changed ( player player ) { current player media period = find current player media period in queue ( player , media period queue , playing media period , period ) ; update media period timelines ( / * preferred timeline = * / player get current timeline ( ) ) ; }


adds a field to run the multi match against with a specific boost

public multi match query builder field ( string field , float boost ) { if ( strings is empty ( field ) ) { throw new illegal argument exception ( " supplied field is null or empty " ) ; } check negative boost ( boost ) ; this fields boosts put ( field , boost ) ; return this ; }


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


public file cache entry add stream to cache ( input stream is , task monitor monitor ) throws i o exception , cancelled exception { file cache entry fce = file cache add stream ( is , monitor ) ; return fce ; }


non - blocking api resource manager services call this to remove an application from the state store this does not block the dispatcher threads there is no notification of completion for this operation

public void remove application ( r m app app ) { application state data app state = application state data new instance ( app get submit time ( ) , app get start time ( ) , app get application submission context ( ) , app get user ( ) , app get caller context ( ) ) ; for ( r m app attempt app attempt : app get app attempts ( ) values ( ) ) { app state attempts put ( app attempt get app attempt id ( ) , null ) ; } get r m state store event handler ( ) handle ( new r m state store remove app event ( app state ) ) ; }


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


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

void exit value expression default ( eql base parser value expression default context ctx ) ;


returns a hash code for { @ code value } ; equal to the result of invoking { @ code ( ( boolean ) value ) hash code ( ) } < b > java 8 users : < b > use { @ link boolean # hash code ( boolean ) } instead

public static int hash code ( boolean value ) { return value ? 1231 : 1237 ; }


returns an { @ link input stream } to read from { @ code stderr } of the child process when this method returns null , { @ link proc } will internally pump the output from the child process to your { @ link output stream } of choosing

public abstract input stream get stderr ( ) ;


writes this to { @ code directory } with the provided { @ code charset } using the standard directory structure

public void write to ( path directory , charset charset ) throws i o exception { write to path ( directory , charset ) ; }


public static < e > linked blocking deque < e > new blocking unlimit deque ( ) { return new linked blocking deque < e > ( ) ; }


returns { @ code true } if the specified { @ link byte buf } starting at { @ code index } with { @ code length } is valid ascii text , otherwise return { @ code false }

private static boolean is ascii ( byte buf buf , int index , int length ) { return buf for each byte ( index , length , find non ascii ) = = - 1 ; }


put the value of field into content values if current action is saving check the value of field is default value or not if current action is updating if it ' s not default value , put it into content values otherwise ignore it

private void put fields value depends on save or update ( lite pal support base obj , field field , content values values ) throws security exception , illegal argument exception , illegal access exception , invocation target exception { if ( is updating ( ) ) { if ( ! is field with default value ( base obj , field ) ) { put content values for update ( base obj , field , values ) ; } } else if ( is saving ( ) ) { put content values for save ( base obj , field , values ) ; } }


fetch retry policy from configuration and create the retry policy with specified retry time and retry interval

protected static retry policy create retry policy ( configuration conf , long retry time , long retry interval , boolean is h a enabled ) { long rm connect wait m s = retry time ; long rm connection retry interval m s = retry interval ; boolean wait for ever = ( rm connect wait m s = = - 1 ) ; if ( ! wait for ever ) { if ( rm connect wait m s < 0 ) { throw new yarn runtime exception ( " invalid configuration " + yarn configuration resourcemanager connect max wait ms + " can be - 1 , but can not be other negative numbers " ) ; } / / try connect once if ( rm connect wait m s < rm connection retry interval m s ) { log warn ( yarn configuration resourcemanager connect max wait ms + " is smaller than " + yarn configuration resourcemanager connect retry interval ms + " only try connect once " ) ; rm connect wait m s = 0 ; } } / / handle ha case first if ( is h a enabled ) { final long failover sleep base ms = conf get long ( yarn configuration client failover sleeptime base ms , rm connection retry interval m s ) ; final long failover sleep max ms = conf get long ( yarn configuration client failover sleeptime max ms , rm connection retry interval m s ) ; int max failover attempts = conf get int ( yarn configuration client failover max attempts , - 1 ) ; if ( max failover attempts = = - 1 ) { if ( wait for ever ) { max failover attempts = integer max value ; } else { max failover attempts = ( int ) ( rm connect wait m s / failover sleep base ms ) ; } } return retry policies failover on network exception ( retry policies try once then fail , max failover attempts , failover sleep base ms , failover sleep max ms ) ; } if ( rm connection retry interval m s < 0 ) { throw new yarn runtime exception ( " invalid configuration " + yarn configuration resourcemanager connect retry interval ms + " should not be negative " ) ; } retry policy retry policy = null ; if ( wait for ever ) { retry policy = retry policies retry forever with fixed sleep ( rm connection retry interval m s , time unit milliseconds ) ; } else { retry policy = retry policies retry up to maximum time with fixed sleep ( rm connect wait m s , rm connection retry interval m s , time unit milliseconds ) ; } map < class < ? extends exception > , retry policy > exception to policy map = new hash map < class < ? extends exception > , retry policy > ( ) ; exception to policy map put ( e o f exception class , retry policy ) ; exception to policy map put ( connect exception class , retry policy ) ; exception to policy map put ( no route to host exception class , retry policy ) ; exception to policy map put ( unknown host exception class , retry policy ) ; exception to policy map put ( connect timeout exception class , retry policy ) ; exception to policy map put ( retriable exception class , retry policy ) ; exception to policy map put ( socket exception class , retry policy ) ; exception to policy map put ( socket timeout exception class , retry policy ) ; exception to policy map put ( standby exception class , retry policy ) ; / / yarn - 4288 : local i o exception is also possible exception to policy map put ( i o exception class , retry policy ) ; / / not retry on remote io exception return retry policies retry other than remote exception ( retry policies try once then fail , exception to policy map ) ; }


public string [ ] get automatic comment ( ) { return ( string [ ] ) display comment arrays [ my automatic ] ; }


computes the quantile value of the given dataset

public double compute ( collection < ? extends number > dataset ) { return compute in place ( doubles to array ( dataset ) ) ; }


creates a new bit mapped memory block ( a bit mapped block is a block where each byte value is either 1 or 0 and the value is taken from a bit in a byte at some other address in memory )

public static memory block create bit mapped block ( program program , string name , address start , address base , int length , string comment , string source , boolean r , boolean w , boolean x , boolean overlay , message log log ) { memory memory = program get memory ( ) ; try { memory block block = memory create bit mapped block ( name , start , base , length , overlay ) ; set block attributes ( block , comment , source , r , w , x ) ; adjust fragment ( program , start , name ) ; return block ; } catch ( lock exception e ) { log append msg ( " failed to create ' " + name + " ' bit mapped memory block : exclusive lock / checkout required " ) ; } catch ( exception e ) { log append msg ( " failed to create ' " + name + " ' mapped memory block : " + e get message ( ) ) ; } return null ; }


specify a limited set of in parameters to be used

public void set limited in parameter names ( set < string > limited in parameter names ) { this limited in parameter names = limited in parameter names ; }


register the given callback as to be executed after request completion

protected final void register request destruction callback ( string name , runnable callback ) { assert not null ( name , " name must not be null " ) ; assert not null ( callback , " callback must not be null " ) ; synchronized ( this request destruction callbacks ) { this request destruction callbacks put ( name , callback ) ; } }


returns the escaped form of a given literal string , starting at the given index this method is called by the { @ link # escape ( string ) } method when it discovers that escaping is required it is protected to allow subclasses to override the fastpath escaping function to inline their escaping test see { @ link char escaper builder } for an example usage

protected final string escape slow ( string s , int index ) { int slen = s length ( ) ; / / get a destination buffer and setup some loop variables char [ ] dest = platform char buffer from thread local ( ) ; int dest size = dest length ; int dest index = 0 ; int last escape = 0 ; / / loop through the rest of the string , replacing when needed into the / / destination buffer , which gets grown as needed as well for ( ; index < slen ; index + + ) { / / get a replacement for the current character char [ ] r = escape ( s char at ( index ) ) ; / / if no replacement is needed , just continue if ( r = = null ) { continue ; } int rlen = r length ; int chars skipped = index - last escape ; / / this is the size needed to add the replacement , not the full size / / needed by the string we only regrow when we absolutely must , and / / when we do grow , grow enough to avoid excessive growing grow int size needed = dest index + chars skipped + rlen ; if ( dest size < size needed ) { dest size = size needed + dest pad multiplier * ( slen - index ) ; dest = grow buffer ( dest , dest index , dest size ) ; } / / if we have skipped any characters , we need to copy them now if ( chars skipped > 0 ) { s get chars ( last escape , index , dest , dest index ) ; dest index + = chars skipped ; } / / copy the replacement string into the dest buffer as needed if ( rlen > 0 ) { system arraycopy ( r , 0 , dest , dest index , rlen ) ; dest index + = rlen ; } last escape = index + 1 ; } / / copy leftover characters if there are any int chars left = slen - last escape ; if ( chars left > 0 ) { int size needed = dest index + chars left ; if ( dest size < size needed ) { / / regrow and copy , expensive ! no padding as this is the final copy dest = grow buffer ( dest , dest index , size needed ) ; } s get chars ( last escape , slen , dest , dest index ) ; dest index = size needed ; } return new string ( dest , 0 , dest index ) ; }


public okhttp 3 call test body with query params async ( string query , user body , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = test body with query params validate before call ( query , body , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


set the template used for method entry log messages this template can contain any of the following placeholders : { @ code $ [ target class name ] } { @ code $ [ target class short name ] } { @ code $ [ argument types ] } { @ code $ [ arguments ] }

public void set enter message ( string enter message ) throws illegal argument exception { assert has text ( enter message , " enter message must not be empty " ) ; check for invalid placeholders ( enter message ) ; assert does not contain ( enter message , placeholder return value , " enter message cannot contain placeholder " + placeholder return value ) ; assert does not contain ( enter message , placeholder exception , " enter message cannot contain placeholder " + placeholder exception ) ; assert does not contain ( enter message , placeholder invocation time , " enter message cannot contain placeholder " + placeholder invocation time ) ; this enter message = enter message ; }


settle the captured view at the given ( left , top ) position the appropriate velocity from prior motion will be taken into account if this method returns true , the caller should invoke { @ link # continue settling ( boolean ) } on each subsequent frame to continue the motion until it returns false if this method returns false there is no further work to do to complete the movement

public boolean settle captured view at ( int final left , int final top ) { if ( ! m release in progress ) { throw new illegal state exception ( " cannot settle captured view at outside of a call to " + " callback # on view released " ) ; } return force settle captured view at ( final left , final top , ( int ) velocity tracker compat get x velocity ( m velocity tracker , m active pointer id ) , ( int ) velocity tracker compat get y velocity ( m velocity tracker , m active pointer id ) ) ; }


returns the number of elements that have been written to the buffer


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


test verifies that the server shouldn ' t be affected but runtime errors on stop ( )

public void test faulty metrics provider on stop ( ) throws exception { client base setup test env ( ) ; final int client port = port assignment unique ( ) ; metrics provider with error in stop stop called set ( false ) ; final string configs = " metrics provider class name = " + metrics provider with error in stop class get name ( ) + " \ n " ; main thread main = new main thread ( client port , true , configs ) ; main start ( ) ; assert true ( client base wait for server up ( " 127 0 0 1 : " + client port , connection timeout ) , " waiting for server being up " ) ; client connected = new count down latch ( 1 ) ; zoo keeper zk = new zoo keeper ( " 127 0 0 1 : " + client port , client base connection timeout , this ) ; assert true ( client connected await ( connection timeout , time unit milliseconds ) , " failed to establish zkclient connection ! " ) ; zk create ( " / foo " , " foobar " get bytes ( ) , ids open acl unsafe , create mode persistent ) ; assert equals ( new string ( zk get data ( " / foo " , null , null ) ) , " foobar " ) ; zk close ( ) ; main shutdown ( ) ; main join ( ) ; main delete dirs ( ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port , client base connection timeout ) , " waiting for server down " ) ; assert true ( metrics provider with error in stop stop called get ( ) ) ; }


tests a scenario when channel is closed while the handshake is in progress validates that the handshake future is notified in such cases

public void test handshake future is notified on channel close ( ) throws exception { embedded channel client channel = create client channel ( null ) ; embedded channel server channel = create server channel ( null ) ; try { / / start handshake from client to server but don ' t complete the handshake for the purpose of this test transfer all data with merge ( client channel , server channel ) ; final web socket client protocol handler client ws handler = client channel pipeline ( ) get ( web socket client protocol handler class ) ; final web socket client protocol handshake handler client ws handshake handler = client channel pipeline ( ) get ( web socket client protocol handshake handler class ) ; final channel handler context ctx = client channel pipeline ( ) context ( web socket client protocol handler class ) ; / / close the channel while the handshake is in progress the channel could be closed before the handshake is / / complete due to a number of varied reasons to reproduce the test scenario for this test case , / / we would manually close the channel client ws handler close ( ctx , ctx new promise ( ) ) ; / / at this stage handshake is incomplete but the handshake future should be completed exceptionally since / / channel is closed assert true ( client ws handshake handler get handshake future ( ) is done ( ) ) ; } finally { server channel finish and release all ( ) ; client channel finish and release all ( ) ; } }


protected principal build resolved principal ( final string id , final map < string , list < object > > attributes , final credential credential , final optional < principal > current principal , final optional < authentication handler > handler ) { return context get principal factory ( ) create principal ( id , attributes ) ; }


get the http status when using the default block page you can set the status code with the { @ code - dcsp sentinel web servlet block status } property when the property is empty or invalid , sentinel will use 429 ( too many requests ) as the default status code

public static int get block page http status ( ) { string value = sentinel config get config ( block page http status conf key ) ; if ( string util is empty ( value ) ) { return http status too many requests ; } try { int s = integer parse int ( value ) ; if ( s < = 0 ) { throw new illegal argument exception ( " invalid status code : " + s ) ; } return s ; } catch ( exception e ) { record log warn ( " [ web servlet config ] invalid block http status ( " + value + " ) , using default 429 " ) ; set block page http status ( http status too many requests ) ; } return http status too many requests ; }


converts an integer in the range of an unsigned 16 - bit integer to a big - endian byte pair

static byte [ ] to uint 1 6 ( int num ) { if ( num < 0 | | num > 65535 ) { throw new illegal state exception ( " number [ " + num + " ] must be a value between 0 and 65535 " ) ; } return new byte [ ] { ( byte ) ( num > > 8 ) , ( byte ) num } ; }


like { @ link # seek to ( int ) } but uses index of the frame instead of time if < code > frame index < code > exceeds number of frames , seek stops at the end , no exception is thrown

public void seek to frame ( @ int range ( from = 0 , to = integer max value ) final int frame index ) { if ( frame index < 0 ) { throw new index out of bounds exception ( " frame index is not positive " ) ; } m executor execute ( new safe runnable ( this ) { @ override public void do work ( ) { m native info handle seek to frame ( frame index , m buffer ) ; m invalidation handler send empty message at time ( msg type invalidation , 0 ) ; } } ) ; }


returns current or last client area if grid controls are stacked then only the top is visible and has real client area so we cache it - all stack has the same client area

private rectangle get current or last client area ( ) { rectangle client area = get client area ( ) ; if ( client area width = = 0 ) { if ( last client area = = null ) { return client area ; } return last client area ; } last client area = client area ; return client area ; }


public static string pjoin ( object args ) { return path joiner join ( args ) ; }


the successful number of shards the search was executed on

public int get successful shards ( ) { return shard stats successful shards ; }


transitions from the alpha at the time this action starts to an alpha of 1

static public alpha action fade in ( float duration ) { return alpha ( 1 , duration , null ) ; }


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

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


adds the contents of a directory to the jar file all files below this directory will be added to the jar file using the name relative to the directory as the name for the jar entry

public void add directory ( path directory ) { if ( ! files exists ( directory ) ) { throw new illegal argument exception ( " directory does not exist : " + directory ) ; } try { files walk file tree ( directory , new simple file visitor < path > ( ) { @ override public file visit result pre visit directory ( path path , basic file attributes attrs ) throws i o exception { if ( ! path equals ( directory ) ) { / / for consistency with legacy behaviour , include entries for directories except for / / the root add entry ( path , / * is directory = * / true ) ; } return file visit result continue ; } @ override public file visit result visit file ( path path , basic file attributes attrs ) throws i o exception { add entry ( path , / * is directory = * / false ) ; return file visit result continue ; } void add entry ( path path , boolean is directory ) { string builder sb = new string builder ( ) ; boolean first = true ; for ( path entry : directory relativize ( path ) ) { if ( ! first ) { / / use ` / ` as the directory separator for jar paths , even on windows sb append ( ' / ' ) ; } sb append ( entry get file name ( ) ) ; first = false ; } if ( is directory ) { sb append ( ' / ' ) ; } jar entries put ( sb to string ( ) , path ) ; } } ) ; } catch ( i o exception e ) { throw new unchecked i o exception ( e ) ; } }


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


test is key - field - based partitioned works with empty key

public void test empty key ( ) throws exception { int num reducers = 10 ; key field based partitioner < text , text > kfbp = new key field based partitioner < text , text > ( ) ; configuration conf = new configuration ( ) ; conf set int ( " num key fields for partition " , 10 ) ; kfbp set conf ( conf ) ; assert equals ( " empty key should map to 0th partition " , 0 , kfbp get partition ( new text ( ) , new text ( ) , num reducers ) ) ; / / check if the hashcode is correct when no keyspec is specified kfbp = new key field based partitioner < text , text > ( ) ; conf = new configuration ( ) ; kfbp set conf ( conf ) ; string input = " abc \ tdef \ txyz " ; int hash code = input hash code ( ) ; int expected partition = kfbp get partition ( hash code , num reducers ) ; assert equals ( " partitioner doesnt work as expected " , expected partition , kfbp get partition ( new text ( input ) , new text ( ) , num reducers ) ) ; / / check if the hashcode is correct with specified keyspec kfbp = new key field based partitioner < text , text > ( ) ; conf = new configuration ( ) ; conf set ( key field based partitioner partitioner options , " - k 2 , 2 " ) ; kfbp set conf ( conf ) ; string expected output = " def " ; byte [ ] e bytes = expected output get bytes ( ) ; hash code = kfbp hash code ( e bytes , 0 , e bytes length - 1 , 0 ) ; expected partition = kfbp get partition ( hash code , num reducers ) ; assert equals ( " partitioner doesnt work as expected " , expected partition , kfbp get partition ( new text ( input ) , new text ( ) , num reducers ) ) ; / / test with invalid end index in keyspecs kfbp = new key field based partitioner < text , text > ( ) ; conf = new configuration ( ) ; conf set ( key field based partitioner partitioner options , " - k 2 , 5 " ) ; kfbp set conf ( conf ) ; expected output = " def \ txyz " ; e bytes = expected output get bytes ( ) ; hash code = kfbp hash code ( e bytes , 0 , e bytes length - 1 , 0 ) ; expected partition = kfbp get partition ( hash code , num reducers ) ; assert equals ( " partitioner doesnt work as expected " , expected partition , kfbp get partition ( new text ( input ) , new text ( ) , num reducers ) ) ; / / test with 0 end index in keyspecs kfbp = new key field based partitioner < text , text > ( ) ; conf = new configuration ( ) ; conf set ( key field based partitioner partitioner options , " - k 2 " ) ; kfbp set conf ( conf ) ; expected output = " def \ txyz " ; e bytes = expected output get bytes ( ) ; hash code = kfbp hash code ( e bytes , 0 , e bytes length - 1 , 0 ) ; expected partition = kfbp get partition ( hash code , num reducers ) ; assert equals ( " partitioner doesnt work as expected " , expected partition , kfbp get partition ( new text ( input ) , new text ( ) , num reducers ) ) ; / / test with invalid keyspecs kfbp = new key field based partitioner < text , text > ( ) ; conf = new configuration ( ) ; conf set ( key field based partitioner partitioner options , " - k 1 0 " ) ; kfbp set conf ( conf ) ; assert equals ( " partitioner doesnt work as expected " , 0 , kfbp get partition ( new text ( input ) , new text ( ) , num reducers ) ) ; / / test with multiple keyspecs kfbp = new key field based partitioner < text , text > ( ) ; conf = new configuration ( ) ; conf set ( key field based partitioner partitioner options , " - k 2 , 2 - k 4 , 4 " ) ; kfbp set conf ( conf ) ; input = " abc \ tdef \ tpqr \ txyz " ; expected output = " def " ; e bytes = expected output get bytes ( ) ; hash code = kfbp hash code ( e bytes , 0 , e bytes length - 1 , 0 ) ; expected output = " xyz " ; e bytes = expected output get bytes ( ) ; hash code = kfbp hash code ( e bytes , 0 , e bytes length - 1 , hash code ) ; expected partition = kfbp get partition ( hash code , num reducers ) ; assert equals ( " partitioner doesnt work as expected " , expected partition , kfbp get partition ( new text ( input ) , new text ( ) , num reducers ) ) ; / / test with invalid start index in keyspecs kfbp = new key field based partitioner < text , text > ( ) ; conf = new configuration ( ) ; conf set ( key field based partitioner partitioner options , " - k 2 , 2 - k 3 0 , 21 - k 4 , 4 - k 5 " ) ; kfbp set conf ( conf ) ; expected output = " def " ; e bytes = expected output get bytes ( ) ; hash code = kfbp hash code ( e bytes , 0 , e bytes length - 1 , 0 ) ; expected output = " xyz " ; e bytes = expected output get bytes ( ) ; hash code = kfbp hash code ( e bytes , 0 , e bytes length - 1 , hash code ) ; expected partition = kfbp get partition ( hash code , num reducers ) ; assert equals ( " partitioner doesnt work as expected " , expected partition , kfbp get partition ( new text ( input ) , new text ( ) , num reducers ) ) ; }


clears any usage marks from the given visitor accepter

protected void mark as unused ( visitor accepter visitor accepter ) { visitor accepter set visitor info ( null ) ; }


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


bitmap factory calculates the density scale factor as a float this introduces some non - trivial error this method attempts to account for that error by adjusting the in target density so that the final scale factor is as close to our target as possible

private static int adjust target density for error ( double adjusted scale factor ) { int density multiplier = get density multiplier ( adjusted scale factor ) ; int target density = round ( density multiplier * adjusted scale factor ) ; float scale factor with error = target density / ( float ) density multiplier ; double difference = adjusted scale factor / scale factor with error ; return round ( difference * target density ) ; }


writes 0x 0 0 until the position is aligned to a multiple of 4

public void align to four bytes with zero fill ( ) { int aligned pos = size of round to times of four ( data position ( ) ) ; ensure buffer size ( ( aligned pos - data position ( ) ) * size of ubyte ) ; while ( ( data position ( ) & 3 ) ! = 0 ) { data put ( ( byte ) 0 ) ; } if ( this data position ( ) > this data bound ) { this data bound = this data position ( ) ; } }


codify the contents of the collector to be iterated over when this is called , all record readers registered for this key should have added resetable iterators

public void reset ( k key ) { this key = key ; first = true ; pos = iters length - 1 ; for ( int i = 0 ; i < iters length ; + + i ) { iters [ i ] reset ( ) ; } }


append message string to log buffer note : method has no affect unless constructed with verbose logging mode

public void append ( string str ) { if ( ! is verbose enabled ( ) ) { return ; } int index = str index of ( ' \ n ' ) ; while ( index > = 0 ) { check line start ( ) ; buffer append ( str substring ( 0 , index + 1 ) ) ; str = str substring ( index + 1 ) ; at line start = true ; index = str index of ( ' \ n ' ) ; } if ( str length ( ) ! = 0 ) { check line start ( ) ; buffer append ( str ) ; } }


appends { @ code values } , in order , to the end of the values the built { @ link immutable long array } will contain

public builder add all ( immutable long array values ) { ensure room for ( values length ( ) ) ; system arraycopy ( values array , values start , array , count , values length ( ) ) ; count + = values length ( ) ; return this ; }


fast method of finding the next power of 2 greater than or equal to the supplied value if the value is { @ code < = 0 } then 1 will be returned this method is not suitable for { @ link integer # min value } or numbers greater than 2 ^ 30

public static int find next positive power of two ( final int value ) { assert value > integer min value & & value < 0x 4 0 0 0 0 0 0 0 ; return 1 < < ( 32 - integer number of leading zeros ( value - 1 ) ) ; }


generates the proxy instance for a base object , each ipc call will clean its calling identity

public static < t > t gen proxy ( class < t > interface class , final object base ) { / / noinspection constant conditions if ( true ) { return ( t ) base ; } / / noinspection unchecked return ( t ) proxy new proxy instance ( interface class get class loader ( ) , new class [ ] { interface class } , new invocation handler ( ) { @ override public object invoke ( object proxy , method method , object [ ] args ) throws throwable { try { return method invoke ( base , args ) ; } catch ( throwable e ) { throw e get cause ( ) = = null ? e : e get cause ( ) ; } } } ) ; }


return an ordered version of the client environment restricted to those variables allowlisted by the command - line options to be inheritable by actions

public map < string , string > get allowlisted test env ( ) { return filter client env ( visible test env ) ; }


this gets the class hierarchy descriptor ( rtti 3 ) structure for the indicated program

public static data type get data type ( program program ) { / / create simple data types for rtti 1 & rtti 3 data type rtti 3 dt = get simple data type ( program ) ; data type rtti 1 dt = rtti 1 model get simple data type ( program ) ; / / now make each refer to the other set rtti 1 data type ( rtti 3 dt , program , rtti 1 dt ) ; rtti 1 model set rtti 3 data type ( rtti 1 dt , program , rtti 3 dt ) ; return m s data type utils get matching data type ( program , rtti 3 dt ) ; }


display any bep transports that are still open after the build most likely , because uploading build events takes longer than the build itself

private void maybe report bep transports ( position aware ansi terminal writer terminal writer ) throws i o exception { if ( ! build complete | | bep open transports is empty ( ) ) { return ; } long since seconds = milliseconds to seconds ( clock current time millis ( ) - bep transport closing start time millis ) ; if ( since seconds = = 0 ) { / / special case for when bazel was interrupted , in which case we don ' t want to have / / a bep upload message return ; } int count = bep open transports size ( ) ; / / can just use target width , because we always write to a new line int max width = target width ; string wait message = " waiting for build events upload : " ; string name = bep open transports iterator ( ) next ( ) name ( ) ; string line = wait message + name + " " + since seconds + " s " ; if ( count = = 1 & & line length ( ) < = max width ) { terminal writer newline ( ) append ( line ) ; } else if ( count = = 1 ) { wait message = " waiting for : " ; string wait secs = " " + since seconds + " s " ; int max name width = max width - wait message length ( ) - wait secs length ( ) ; terminal writer newline ( ) append ( wait message + shortened string ( name , max name width ) + wait secs ) ; } else { terminal writer newline ( ) append ( wait message + since seconds + " s " ) ; for ( build event transport transport : bep open transports ) { name = " " + transport name ( ) ; terminal writer newline ( ) append ( shortened string ( name , max width ) ) ; } } }


asserts that two master states are equal the master state avoids overriding { @ code equals ( ) } on purpose , because equality is not well defined in the raw contents

public static void assert master state equality ( master state a , master state b ) { assert equals ( a version ( ) , b version ( ) ) ; assert equals ( a name ( ) , b name ( ) ) ; assert array equals ( a bytes ( ) , b bytes ( ) ) ; }


test scenario where proto symbols are mixed between the low and top level binaries there is an implicit dependency hierarchy between the different apple binary types ( executable , loadable bundle , dylib ) which looks like this ( top level binary types can depend on lower level binary types ) : loadable bundle \ dylib ( s ) executable | dylibs the mechanism to remove duplicate dependencies between dylibs and executable binaries works the same way between executable and loadable bundle binaries ; the only difference is through which attribute the dependency is declared ( dylibs vs bundle loader ) this test scenario sets up dependencies for low level and top level binaries and checks that the correct files are linked for each of the binaries

private void check proto deduping deps partial ( binary type dep binary type ) throws exception { mock objc support setup objc proto library ( scratch ) ; scratch file ( " x / filter a pbascii " ) ; scratch file ( " x / filter b pbascii " ) ; scratch file ( " protos / build " , test constants load proto library , " load ( ' / / objc proto library : objc proto library bzl ' , ' objc proto library ' ) " , " proto library ( " , " name = ' protos 1 ' , " , " srcs = [ ' data a proto ' , ' data b proto ' ] , " , " ) " , " proto library ( " , " name = ' protos 2 ' , " , " srcs = [ ' data b proto ' , ' data c proto ' ] , " , " ) " , " proto library ( " , " name = ' protos 3 ' , " , " srcs = [ ' data a proto ' , ' data c proto ' , ' data d proto ' ] , " , " ) " , " objc proto library ( " , " name = ' objc protos a ' , " , " portable proto filters = [ ' filter a pbascii ' ] , " , " deps = [ ' : protos 1 ' ] , " , " ) " , " objc proto library ( " , " name = ' objc protos b ' , " , " portable proto filters = [ ' filter b pbascii ' ] , " , " deps = [ ' : protos 2 ' , ' : protos 3 ' ] , " , " ) " ) ; scratch file ( " libs / build " , " objc library ( " , " name = ' main lib ' , " , " srcs = [ ' a m ' ] , " , " deps = [ ' / / protos : objc protos a ' , ' / / protos : objc protos b ' ] " , " ) " , " objc library ( " , " name = ' apple low level lib ' , " , " srcs = [ ' b m ' ] , " , " deps = [ ' / / protos : objc protos a ' ] " , " ) " ) ; if ( dep binary type = = binary type dylib ) { scratch framework starlark stub ( " frameworkstub / framework stub bzl " ) ; scratch file ( " dep binary / build " , " load ( ' / / frameworkstub : framework stub bzl ' , ' framework stub rule ' ) " , " apple binary ( " , " name = ' apple low level binary ' , " , " deps = [ ' / / libs : apple low level lib ' ] , " , " platform type = ' ios ' , " , " binary type = ' dylib ' , " , " ) " , " framework stub rule ( " , " name = ' low level framework ' , " , " deps = [ ' : apple low level binary ' ] , " , " binary = ' : apple low level binary ' ) " ) ; get rule type ( ) scratch target ( scratch , " binary type " , " ' executable ' " , " deps " , " [ ' / / libs : main lib ' ] " , " dylibs " , " [ ' / / dep binary : low level framework ' ] " ) ; } else { assert that ( dep binary type = = binary type loadable bundle ) is true ( ) ; scratch file ( " dep binary / build " , " apple binary ( " , " name = ' apple low level binary ' , " , " deps = [ ' / / libs : apple low level lib ' ] , " , " platform type = ' ios ' , " , " binary type = ' executable ' , " , " ) " ) ; get rule type ( ) scratch target ( scratch , " binary type " , " ' loadable bundle ' " , " deps " , " [ ' / / libs : main lib ' ] " , " bundle loader " , " ' / / dep binary : apple low level binary ' " ) ; } / / the proto libraries objc lib depends on should be linked into the low level binary but not x artifact low level binary = iterables get only element ( link action ( " / / dep binary : apple low level binary " ) get outputs ( ) ) ; immutable list < artifact > low level object files = get all object files linked in bin ( low level binary ) ; assert that ( get first artifact ending with ( low level object files , " data a pbobjc o " ) ) is not null ( ) ; assert that ( get first artifact ending with ( low level object files , " data b pbobjc o " ) ) is not null ( ) ; assert that ( get first artifact ending with ( low level object files , " data c pbobjc o " ) ) is null ( ) ; assert that ( get first artifact ending with ( low level object files , " data d pbobjc o " ) ) is null ( ) ; artifact bin = iterables get only element ( link action ( " / / x : x " ) get outputs ( ) ) ; immutable list < artifact > bin object files = get all object files linked in bin ( bin ) ; assert that ( get first artifact ending with ( bin object files , " data a pbobjc o " ) ) is null ( ) ; assert that ( get first artifact ending with ( bin object files , " data b pbobjc o " ) ) is null ( ) ; assert that ( get first artifact ending with ( bin object files , " data c pbobjc o " ) ) is not null ( ) ; assert that ( get first artifact ending with ( bin object files , " data d pbobjc o " ) ) is not null ( ) ; }


returns true iff this file is a block device

public boolean is block device ( ) { return ( st mode & s ifmt ) = = s ifblk ; }


looks for the first boundary in the given buffer if found , changes state to { @ link headers state } , and passes on the remainder of the buffer

public void on next ( data buffer buf ) { int end idx = this first boundary match ( buf ) ; if ( end idx ! = - 1 ) { if ( logger is trace enabled ( ) ) { logger trace ( " first boundary found @ " + end idx + " in " + buf ) ; } data buffer headers buf = multipart utils slice from ( buf , end idx ) ; data buffer utils release ( buf ) ; change state ( this , new headers state ( ) , headers buf ) ; } else { data buffer utils release ( buf ) ; request buffer ( ) ; } }


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

completion stage < response < void > > update user ( @ retrofit 2 http path ( " username " ) string username , @ retrofit 2 http body user body ) ;


public job conf get job conf ( ) { return job ; }


public boolean is support dtd ( ) { return this support dtd ; }


set the { @ code object mapper } for this view if not set , a default { @ link object mapper # object mapper ( ) object mapper } is used setting a custom - configured { @ code object mapper } is one way to take further control of the json serialization process for example , an extended { @ link com fasterxml jackson databind ser serializer factory } can be configured that provides custom serializers for specific types the other option for refining the serialization process is to use jackson ' s provided annotations on the types to be serialized , in which case a custom - configured object mapper is unnecessary

public void set object mapper ( object mapper object mapper ) { assert not null ( object mapper , " object mapper must not be null " ) ; this object mapper = object mapper ; configure pretty print ( ) ; }


check if this type is assignable from the given type token

public boolean is assignable from ( type token < ? > token ) { return is assignable from ( token get type ( ) ) ; }


success authentication policy via a condition

public static authentication policy execution result success ( final boolean condition ) { return authentication policy execution result builder ( ) success ( condition ) build ( ) ; }


public string get small camel ( ) { return small camel ; }


create the keytabl for the given principal , includes raw principal and $ principallocalhost

public static file create keytab ( string principal , string filename ) throws exception { assert not empty ( " empty principal " , principal ) ; assert not empty ( " empty host " , filename ) ; assert not null ( " null kdc " , kdc ) ; file keytab = new file ( kdc work dir , filename ) ; kdc create principal ( keytab , principal , principal + " / localhost " , principal + " / 127 0 0 1 " ) ; return keytab ; }


public void enable scroll ( ) { view parent parent = get parent ( ) ; if ( parent ! = null ) parent request disallow intercept touch event ( false ) ; }


returns an immutable multiset containing the given elements , in order

public static < e > immutable multiset < e > of ( e e 1 , e e 2 ) { return copy from elements ( e 1 , e 2 ) ; }


get fakejson form data : test json serialization of form data

default response entity < void > test json form data ( @ api param ( value = " field 1 " , required = true ) @ valid @ request part ( value = " param " , required = true ) string param , @ api param ( value = " field 2 " , required = true ) @ valid @ request part ( value = " param 2 " , required = true ) string param 2 ) { return new response entity < > ( http status not implemented ) ; }


returns true if the specified index into the underlying byte provider is valid

public boolean is valid index ( long index ) throws i o exception { return provider is valid index ( index ) ; }


called after the build is loaded and the object is added to the build list because { @ link run action } s are persisted with { @ link run } , the implementation can keep a reference to { @ link run } in a field ( which is set via { @ link # on attached ( run ) } )


public static hls media chunk create instance ( hls extractor factory extractor factory , data source data source , format format , long start of playlist in period us , hls media playlist media playlist , int segment index in playlist , uri playlist url , @ nullable list < format > muxed caption formats , int track selection reason , @ nullable object track selection data , boolean is master timestamp source , timestamp adjuster provider timestamp adjuster provider , @ nullable hls media chunk previous chunk , @ nullable byte [ ] media segment key , @ nullable byte [ ] init segment key ) { / / media segment hls media playlist segment media segment = media playlist segments get ( segment index in playlist ) ; data spec data spec = new data spec ( uri util resolve to uri ( media playlist base uri , media segment url ) , media segment byte range offset , media segment byte range length ) ; boolean media segment encrypted = media segment key ! = null ; @ nullable byte [ ] media segment iv = media segment encrypted ? get encryption iv array ( assertions check not null ( media segment encryption i v ) ) : null ; data source media data source = build data source ( data source , media segment key , media segment iv ) ; / / init segment hls media playlist segment init segment = media segment initialization segment ; data spec init data spec = null ; boolean init segment encrypted = false ; @ nullable data source init data source = null ; if ( init segment ! = null ) { init segment encrypted = init segment key ! = null ; @ nullable byte [ ] init segment iv = init segment encrypted ? get encryption iv array ( assertions check not null ( init segment encryption i v ) ) : null ; uri init segment uri = uri util resolve to uri ( media playlist base uri , init segment url ) ; init data spec = new data spec ( init segment uri , init segment byte range offset , init segment byte range length ) ; init data source = build data source ( data source , init segment key , init segment iv ) ; } long segment start time in period us = start of playlist in period us + media segment relative start time us ; long segment end time in period us = segment start time in period us + media segment duration us ; int discontinuity sequence number = media playlist discontinuity sequence + media segment relative discontinuity sequence ; @ nullable hls media chunk extractor previous extractor = null ; id 3 decoder id 3 decoder ; parsable byte array scratch id 3 data ; boolean should splice in ; if ( previous chunk ! = null ) { boolean is following chunk = playlist url equals ( previous chunk playlist url ) & & previous chunk load completed ; id 3 decoder = previous chunk id 3 decoder ; scratch id 3 data = previous chunk scratch id 3 data ; boolean can continue without splice = is following chunk | | ( media playlist has independent segments & & segment start time in period us > = previous chunk end time us ) ; should splice in = ! can continue without splice ; previous extractor = is following chunk & & ! previous chunk extractor invalidated & & previous chunk discontinuity sequence number = = discontinuity sequence number ? previous chunk extractor : null ; } else { id 3 decoder = new id 3 decoder ( ) ; scratch id 3 data = new parsable byte array ( id 3 decoder id3 header length ) ; should splice in = false ; } return new hls media chunk ( extractor factory , media data source , data spec , format , media segment encrypted , init data source , init data spec , init segment encrypted , playlist url , muxed caption formats , track selection reason , track selection data , segment start time in period us , segment end time in period us , / * chunk media sequence = * / media playlist media sequence + segment index in playlist , discontinuity sequence number , media segment has gap tag , is master timestamp source , / * timestamp adjuster = * / timestamp adjuster provider get adjuster ( discontinuity sequence number ) , media segment drm init data , previous extractor , id 3 decoder , scratch id 3 data , should splice in ) ; }


creates a mock generic drawee hierarchy builder with stubbed build

public static generic drawee hierarchy builder mock builder of ( generic drawee hierarchy drawable hierarchies ) { generic drawee hierarchy builder builder = mock ( generic drawee hierarchy builder class , calls real methods ) ; final supplier < generic drawee hierarchy > gdh provider = supplier of ( drawable hierarchies ) ; do answer ( new answer ( ) { @ override public object answer ( invocation on mock invocation ) throws throwable { return gdh provider get ( ) ; } } ) when ( builder ) build ( ) ; return builder ; }


indicates whether the document ' s version will be included in the search hits

public boolean version ( ) { return version ; }


returns a measurement of the current resource usage of the current process

public static measurement measure current resource usage ( ) { return measure current resource usage ( " self " ) ; }


starts multiple nodes with the given settings and returns their names

public synchronized list < string > start nodes ( settings extra settings ) { final int new master count = math to int exact ( stream of ( extra settings ) filter ( discovery node : : is master node ) count ( ) ) ; final list < node and client > nodes = new array list < > ( ) ; final int prev master count = get master nodes count ( ) ; int auto bootstrap master node index = auto manage master nodes & & prev master count = = 0 & & new master count > 0 & & arrays stream ( extra settings ) all match ( s - > discovery node is master node ( s ) = = false | | zen2 discovery type equals ( discovery type setting get ( s ) ) ) ? random numbers random int between ( random , 0 , new master count - 1 ) : - 1 ; final int num of nodes = extra settings length ; final int first node id = next node id get and increment ( ) ; final list < settings > settings = new array list < > ( ) ; for ( int i = 0 ; i < num of nodes ; i + + ) { settings add ( get node settings ( first node id + i , random next long ( ) , extra settings [ i ] ) ) ; } next node id set ( first node id + num of nodes ) ; final list < string > initial master nodes = settings stream ( ) filter ( discovery node : : is master node ) map ( node node name setting : : get ) collect ( collectors to list ( ) ) ; final list < settings > updated settings = bootstrap master node with specified index ( settings ) ; for ( int i = 0 ; i < num of nodes ; i + + ) { final settings node settings = updated settings get ( i ) ; final builder builder = settings builder ( ) ; if ( discovery node is master node ( node settings ) ) { if ( auto bootstrap master node index = = 0 ) { builder put list ( initial master nodes setting get key ( ) , initial master nodes ) ; } auto bootstrap master node index - = 1 ; } final node and client node and client = build node ( first node id + i , builder put ( node settings ) build ( ) , false , ( ) - > rebuild unicast host files ( nodes ) ) ; nodes add ( node and client ) ; } start and publish nodes and clients ( nodes ) ; if ( auto manage master nodes ) { validate cluster formed ( ) ; } return nodes stream ( ) map ( node and client : : get name ) collect ( collectors to list ( ) ) ; }


public boolean execute ( ) throws s q l exception { connection mark commit state dirty ( ) ; return ( ( prepared statement ) delegate ) execute ( ) ; }


public api response < void > add pet with http info ( pet body ) throws api exception { okhttp 3 call local var call = add pet validate before call ( body , null ) ; return local var api client execute ( local var call ) ; }


check whether the service monitors the given job

public boolean contains job ( job i d job id ) { preconditions check state ( default job leader service state started = = state , " the service is currently not running " ) ; return job leader services contains key ( job id ) ; }


tests that a batch slot request does not react to { @ link slot pool # fail allocation ( allocation i d , exception ) } signals whose exception is not { @ link unfulfillable slot request exception }

public void test pending batch slot request does not fail if allocation fails ( ) throws exception { final testing resource manager gateway testing resource manager gateway = new testing resource manager gateway ( ) ; final completable future < allocation i d > allocation id future = new completable future < > ( ) ; testing resource manager gateway set request slot consumer ( slot request - > allocation id future complete ( slot request get allocation id ( ) ) ) ; final component main thread executor direct main thread executor = component main thread executor service adapter for main thread ( ) ; final time batch slot timeout = time milliseconds ( 1000l ) ; try ( final slot pool impl slot pool = create and set up slot pool ( direct main thread executor , testing resource manager gateway , batch slot timeout ) ) { final completable future < physical slot > slot future = slot pool utils request new allocated batch slot ( slot pool , direct main thread executor , resource profile ) ; slot pool utils fail allocation ( slot pool , direct main thread executor , allocation id future get ( ) , new flink exception ( " failed request " ) ) ; assert that ( slot future is done ( ) , is ( false ) ) ; } }


given 0 & lt ; x & lt ; y , return x ^ ( - 1 ) mod y

public static long mod inverse ( final long x , final long y ) { if ( x = = 1 ) return 1 ; long a = 1 ; long b = 0 ; long c = x ; long u = 0 ; long v = 1 ; long w = y ; for ( ; ; ) { { final long q = w / c ; w - = q * c ; u - = q * a ; if ( w = = 1 ) return u > 0 ? u : u + y ; v - = q * b ; } { final long q = c / w ; c - = q * w ; a - = q * u ; if ( c = = 1 ) return a > 0 ? a : a + y ; b - = q * v ; } } }


tests that during reroute when a node is detected as leaving the cluster , the right unassigned meta is set

public void test node leave ( ) { allocation service allocation = create allocation service ( ) ; metadata metadata = metadata builder ( ) put ( index metadata builder ( " test " ) settings ( settings ( version current ) ) number of shards ( 1 ) number of replicas ( 1 ) ) build ( ) ; cluster state cluster state = cluster state builder ( cluster name cluster name setting get default ( settings empty ) ) metadata ( metadata ) routing table ( routing table builder ( ) add as new ( metadata index ( " test " ) ) build ( ) ) build ( ) ; cluster state = cluster state builder ( cluster state ) nodes ( discovery nodes builder ( ) add ( new node ( " node 1 " ) ) add ( new node ( " node 2 " ) ) ) build ( ) ; cluster state = allocation reroute ( cluster state , " reroute " ) ; / / starting primaries cluster state = start initializing shards and reroute ( allocation , cluster state ) ; / / starting replicas cluster state = start initializing shards and reroute ( allocation , cluster state ) ; assert that ( cluster state get routing nodes ( ) unassigned ( ) size ( ) > 0 , equal to ( false ) ) ; / / remove node 2 and reroute cluster state = cluster state builder ( cluster state ) nodes ( discovery nodes builder ( cluster state nodes ( ) ) remove ( " node 2 " ) ) build ( ) ; cluster state = allocation disassociate dead nodes ( cluster state , true , " reroute " ) ; / / verify that node leave is the reason for meta assert that ( cluster state get routing nodes ( ) unassigned ( ) size ( ) > 0 , equal to ( true ) ) ; assert that ( cluster state get routing nodes ( ) shards with state ( unassigned ) size ( ) , equal to ( 1 ) ) ; assert that ( cluster state get routing nodes ( ) shards with state ( unassigned ) get ( 0 ) unassigned info ( ) , not null value ( ) ) ; assert that ( cluster state get routing nodes ( ) shards with state ( unassigned ) get ( 0 ) unassigned info ( ) get reason ( ) , equal to ( unassigned info reason node left ) ) ; assert that ( cluster state get routing nodes ( ) shards with state ( unassigned ) get ( 0 ) unassigned info ( ) get unassigned time in millis ( ) , greater than ( 0l ) ) ; }


default model and view build response model and view ( final j e e context context , final services manager services manager , final string client id , final string redirect url , final map < string , string > parameters ) { val registered service = o auth 2 0 utils get registered o auth service by client id ( services manager , client id ) ; val response type = o auth 2 0 utils get response mode type ( context ) ; if ( o auth 2 0 utils is response mode type form post ( registered service , response type ) ) { val model = new linked hash map < string , object > ( ) ; model put ( " original url " , redirect url ) ; model put ( " parameters " , parameters ) ; return new model and view ( cas webflow constants view id post response , model ) ; } return new model and view ( new redirect view ( redirect url ) , parameters ) ; }


public builder group by ( string name , single group source group ) { groups put ( name , group ) ; return this ; }


base 6 4 - decode the given string as string

public static string decode base 6 4 to string ( final string data ) { return new string ( decode base 6 4 ( data ) , standard charsets utf 8 ) ; }


returns the base 2 logarithm of a double value , rounded with the specified rounding mode to an { @ code int } regardless of the rounding mode , this is faster than { @ code ( int ) log 2 ( x ) }

public static int log 2 ( double x , rounding mode mode ) { check argument ( x > 0 0 & & is finite ( x ) , " x must be positive and finite " ) ; int exponent = get exponent ( x ) ; if ( ! is normal ( x ) ) { return log 2 ( x * implicit bit , mode ) - significand bits ; / / do the calculation on a normal value } / / x is positive , finite , and normal boolean increment ; switch ( mode ) { case unnecessary : check rounding unnecessary ( is power of two ( x ) ) ; / / fall through case floor : increment = false ; break ; case ceiling : increment = ! is power of two ( x ) ; break ; case down : increment = exponent < 0 & ! is power of two ( x ) ; break ; case up : increment = exponent > = 0 & ! is power of two ( x ) ; break ; case half down : case half even : case half up : double x scaled = scale normalize ( x ) ; / / sqrt ( 2 ) is irrational , and the spec is relative to the " exact numerical result , " / / so log 2 ( x ) is never exactly exponent + 0 5 increment = ( x scaled * x scaled ) > 2 0 ; break ; default : throw new assertion error ( ) ; } return increment ? exponent + 1 : exponent ; }


returns the value of this { @ code unsigned integer } as an { @ code int } this is an inverse operation to { @ link # from int bits } note that if this { @ code unsigned integer } holds a value { @ code > = 2 ^ 31 } , the returned value will be equal to { @ code this - 2 ^ 32 }

public int int value ( ) { return value ; }


public boolean get prefix ns boolean ( ) { return prefix ns boolean ; }


verify that the given list of streams contains exactly the range of transactions specified , inclusive

public static void verify edits ( list < edit log input stream > streams , int first txn id , int last txn id ) throws i o exception { iterator < edit log input stream > iter = streams iterator ( ) ; assert true ( iter has next ( ) ) ; edit log input stream stream = iter next ( ) ; for ( int expected = first txn id ; expected < = last txn id ; expected + + ) { f s edit log op op = stream read op ( ) ; while ( op = = null ) { assert true ( " expected to find txid " + expected + " , " + " but no more streams available to read from " , iter has next ( ) ) ; stream = iter next ( ) ; op = stream read op ( ) ; } assert equals ( f s edit log op codes op mkdir , op op code ) ; assert equals ( expected , op get transaction id ( ) ) ; } assert null ( stream read op ( ) ) ; assert false ( " expected no more txns after " + last txn id + " but more streams are available " , iter has next ( ) ) ; }


sets the aliases to be used on the target index

public resize request set aliases ( list < alias > aliases ) { this aliases clear ( ) ; this aliases add all ( aliases ) ; return this ; }


tests that code can be executed in the main thread without respecting the fencing token

public void test run async without fencing ( ) throws exception { final completable future < uuid > result future = new completable future < > ( ) ; final uuid new fencing token = uuid random u u i d ( ) ; test run async ( endpoint - > { endpoint run async without fencing ( ( ) - > result future complete ( endpoint get fencing token ( ) ) ) ; return result future ; } , new fencing token ) ; assert equals ( new fencing token , result future get ( timeout to milliseconds ( ) , time unit milliseconds ) ) ; }


creates list of users with given input array

public void create users with array input ( @ valid list < user > body ) ;


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

public void create user test ( ) throws api exception { user user = null ; api create user ( user ) ; / / todo : test validations }


return the underlying type converter of this binder ' s binding result

protected type converter get type converter ( ) { if ( get target ( ) ! = null ) { return get internal binding result ( ) get property accessor ( ) ; } else { return get simple type converter ( ) ; } }


called before initial collection and between successive collection runs a chance to initialize or re - initialize state


guaranteed to throw an exception and leave the { @ code range set } unmodified

public void remove all ( range set < c > other ) { throw new unsupported operation exception ( ) ; }


private int get outs size ( ) { return code get insns ( ) get outs size ( ) ; }


drains the recency queue , updating eviction metadata that the entries therein were read in the specified relative order this currently amounts to adding them to relevant eviction lists ( accounting for the fact that they could have been removed from the map since being added to the recency queue )

void drain recency queue ( ) { reference entry < k , v > e ; while ( ( e = recency queue poll ( ) ) ! = null ) { / / an entry may be in the recency queue despite it being removed from / / the map this can occur when the entry was concurrently read while a / / writer is removing it from the segment or after a clear has removed / / all of the segment ' s entries if ( access queue contains ( e ) ) { access queue add ( e ) ; } } }


tests that a collision on the manual hash throws an exception

public void test manual hash assignment collision throws exception ( ) throws exception { stream execution environment env = stream execution environment create local environment ( ) ; env set parallelism ( 4 ) ; env disable operator chaining ( ) ; env add source ( new no op source function ( ) ) uid ( " source " ) map ( new no op map function ( ) ) uid ( " source " ) / / collision add sink ( new discarding sink < > ( ) ) ; / / this call is necessary to generate the job graph env get stream graph ( ) get job graph ( ) ; }


get the first unused key value remember 0 is reserved for unknown and 1 for default

private byte get first available key ( ) throws i o exception { byte key = 2 ; for ( ; key < 256 ; key + + ) { d b record record = get calling convention record ( key ) ; if ( record = = null ) { return key ; } } if ( key > = 256 ) { throw new i o exception ( " no more keys available for calling conventions " ) ; } return key ; }


starts auto - analysis on the specified program and performs complete analysis of the entire program this is usually only necessary if full analysis was never performed this method will block until analysis completes

public void analyze ( program program ) { analyze all ( program ) ; }


called when the visibility andor docked state of the watched satellite changes

public void satellite visibility changed ( boolean docked , boolean visible ) ;


if one instance is empty , the other " wins " if both instances have conditions , compare them in the order in which they were provided

public int compare to ( composite request condition other , http servlet request request ) { if ( is empty ( ) & & other is empty ( ) ) { return 0 ; } else if ( is empty ( ) ) { return 1 ; } else if ( other is empty ( ) ) { return - 1 ; } else { assert number of conditions ( other ) ; for ( int i = 0 ; i < get length ( ) ; i + + ) { int result = this request conditions [ i ] compare to ( other request conditions [ i ] , request ) ; if ( result ! = 0 ) { return result ; } } return 0 ; } }


void add key listener ( on key listener listener ) ;


a basic test for rolling restart we are restarting the zoo keeper servers one by one , starting from the first server we always make sure that all the nodes joined to the quorum before moving forward

public void test rolling restart ( ) throws exception { for ( int server to restart = 1 ; server to restart < = 3 ; server to restart + + ) { log info ( " * * * * * restarting : " + server to restart ) ; qu shutdown ( server to restart ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + qu get peer ( server to restart ) client port , client base connection timeout ) , string format ( " timeout during waiting for server % d to go down " , server to restart ) ) ; qu restart ( server to restart ) ; final string error message = " not all the quorum members are connected after restarting server " + server to restart ; wait for ( error message , ( ) - > qu all peers are connected ( ) , 30 ) ; log info ( " * * * * * restart { } succeeded " , server to restart ) ; } }


create a directory at path specified by parent

private static i nodes in path unprotected mkdir ( f s directory fsd , long inode id , i nodes in path parent , byte [ ] name , permission status permission , list < acl entry > acl entries , long timestamp ) throws quota exceeded exception , acl exception , file already exists exception { assert fsd has write lock ( ) ; assert parent get last i node ( ) ! = null ; if ( ! parent get last i node ( ) is directory ( ) ) { throw new file already exists exception ( " parent path is not a directory : " + parent get path ( ) + " " + d f s util bytes 2 string ( name ) ) ; } final i node directory dir = new i node directory ( inode id , name , permission , timestamp ) ; i nodes in path iip = fsd add last i node ( parent , dir , permission get permission ( ) , true ) ; if ( iip ! = null & & acl entries ! = null ) { acl storage update i node acl ( dir , acl entries , snapshot current state id ) ; } return iip ; }


returns the highest supported api key of this message , inclusive


set the container id - to - exception map in which the exception indicates error from each container for failed requests

public abstract void set failed requests ( map < container id , serialized exception > failed requests ) ;


test that the number of acceptors and selectors can be configured by trying to configure more of them than would be allowed based on the maximum thread count

public void test acceptor selector configurability ( ) throws exception { configuration conf = new configuration ( ) ; conf set int ( http server 2 http max threads key , max threads ) ; conf set int ( http server 2 http acceptor count key , max threads - 2 ) ; conf set int ( http server 2 http selector count key , max threads - 2 ) ; http server 2 badserver = create test server ( conf ) ; try { badserver start ( ) ; / / should not succeed fail ( ) ; } catch ( i o exception ioe ) { assert true ( ioe get cause ( ) instanceof illegal state exception ) ; } }


set the group for this entity ( default = null )

public builder group ( string group ) { this group = group ; return this ; }


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


assign the value to a portion of this register value

public register value assign ( register sub register , register value value ) { check base register ( sub register ) ; register value other value = new register value ( sub register , value get unsigned value ignore mask ( ) , value get value mask ( ) ) ; return combine values ( other value ) ; }


see { @ link stream tracer # stream closed } this may be called multiple times , and only the first value will be taken called from abstract stream implementations

public void stream closed ( status status ) { if ( closed compare and set ( false , true ) ) { for ( stream tracer tracer : tracers ) { tracer stream closed ( status ) ; } } }


set the { @ code name } to { @ code value } this will remove all previous values associated with { @ code name }

t set boolean ( k name , boolean value ) ;


applies { @ link json path expectations helper # assert value is array ( string ) }

public web test client body content spec is array ( ) { this path helper assert value is array ( this content ) ; return this body spec ; }


handles the creation of the s s l service along with the necessary actions to enable reloading of s s l contexts when configuration files change on disk

private s s l service create s s l service ( environment environment , resource watcher service resource watcher service ) { final map < string , s s l configuration > ssl configurations = s s l service get s s l configurations ( environment settings ( ) ) ; final s s l configuration reloader reloader = new s s l configuration reloader ( environment , resource watcher service , ssl configurations values ( ) ) ; final s s l service ssl service = new s s l service ( environment , ssl configurations ) ; reloader set s s l service ( ssl service ) ; set ssl service ( ssl service ) ; return ssl service ; }


send a { @ link get request } to the tasks index looking for a persisted copy of the task completed task it ' ll only be found only if the task ' s result was stored called on the node that once had the task if that node is still part of the cluster or on the coordinating node if the node is no longer part of the cluster

void get finished task from index ( task this task , get task request request , action listener < get task response > listener ) { get request get = new get request ( task results service task index , request get task id ( ) to string ( ) ) ; get set parent task ( cluster service local node ( ) get id ( ) , this task get id ( ) ) ; client get ( get , action listener wrap ( r - > on get finished task from index ( r , listener ) , e - > { if ( exceptions helper unwrap ( e , index not found exception class ) ! = null ) { / / we haven ' t yet created the index for the task results so it can ' t be found listener on failure ( new resource not found exception ( " task [ { } ] isn ' t running and hasn ' t stored its results " , e , request get task id ( ) ) ) ; } else { listener on failure ( e ) ; } } ) ) ; }


public static int get measured height ( final view view ) { return measure view ( view ) [ 1 ] ; }


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


convert the where clause if it contains invalid column names which conflict with s q lite keywords

public static string convert where clause to column name ( string where clause ) { if ( ! text utils is empty ( where clause ) ) { try { string buffer converted where clause = new string buffer ( ) ; pattern p = pattern compile ( " ( \ \ w + " + reg operator + " | \ \ w + " + reg fuzzy + " | \ \ w + " + reg collection + " ) " ) ; matcher m = p matcher ( where clause ) ; while ( m find ( ) ) { string matches = m group ( ) ; string column = matches replace all ( " ( " + reg operator + " | " + reg fuzzy + " | " + reg collection + " ) " , " " ) ; string rest = matches replace ( column , " " ) ; column = convert to valid column name ( column ) ; m append replacement ( converted where clause , column + rest ) ; } m append tail ( converted where clause ) ; return converted where clause to string ( ) ; } catch ( exception e ) { e print stack trace ( ) ; } } return where clause ; }


compile a string pattern in to a pattern object

protected abstract pattern compile ( string s ) ;


sets the is upper case tabs of this m t config object

public void set upper case tabs ( final boolean is upper case tabs ) { upper case tabs = is upper case tabs ; }


the @ override annotation is intentionally removed for this method to align with the production codes ' assumption that this interface may not be available for the given hadoop version

public list < container > get containers from previous attempts ( ) { return get containers from previous attempts supplier get ( ) ; }


specifies if the { @ link layout result } {

boolean has render tree hosts ( r result ) ;


this is a regression test for antlrantlr 4 # 649 " unknown target causes null ptr exception " https : github comantlrantlr 4issues 6 4 9 stops before processing the lexer

@ test public void test invalid language in grammar with lexer command ( ) throws exception { string grammar = " grammar t ; \ n " + " options { language = foo ; } \ n " + " start : ' t ' eof ; \ n " + " something : ' something ' - > channel ( custom ) ; " ; string expected = " error ( " + error type cannot create target generator code + " ) : antlr cannot generate foo code as of version " + tool version + " \ n " ; string [ ] pair = new string [ ] { grammar , expected } ; super test errors ( pair , true ) ; }


informs if the invocation participates in verify - no - more - invocations or verification in order

boolean is ignored for verification ( ) ;


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