returns true if the given files exist , are not directories , and contain the same bytes

public static boolean equal ( file file 1 , file file 2 ) throws i o exception { check not null ( file 1 ) ; check not null ( file 2 ) ; if ( file 1 = = file 2 | | file 1 equals ( file 2 ) ) { return true ; } / * * some operating systems may return zero as the length for files denoting system - dependent * entities such as devices or pipes , in which case we must fall back on comparing the bytes * directly * / long len 1 = file 1 length ( ) ; long len 2 = file 2 length ( ) ; if ( len 1 ! = 0 & & len 2 ! = 0 & & len 1 ! = len 2 ) { return false ; } return as byte source ( file 1 ) content equals ( as byte source ( file 2 ) ) ; }


an object with no declared properties and no undeclared properties , hence it & # 39 ; s an empty map

public object get empty map ( ) { return empty map ; }


this implementation checks the timestamp of the underlying file , if available

public long last modified ( ) throws i o exception { long last modified = get file for last modified check ( ) last modified ( ) ; if ( last modified = = 0l ) { throw new file not found exception ( get description ( ) + " cannot be resolved in the file system for resolving its last - modified timestamp " ) ; } return last modified ; }


tries to find a good value for the number of buckets will ensure that the number of buckets is a multiple of num partitions

private static int get initial table size ( int num buffers , int buffer size , int num partitions , int record len bytes ) { final long total size = ( ( long ) buffer size ) * num buffers ; final long num records storable = total size / ( record len bytes + record overhead bytes ) ; final long bucket bytes = num records storable * record overhead bytes ; long num buckets = bucket bytes / ( 2 * hash bucket size ) + 1 ; num buckets + = num partitions - num buckets % num partitions ; return num buckets > integer max value ? integer max value : ( int ) num buckets ; }


public node < k , v > first ( ) { node < k , v > node = this ; node < k , v > child = node left ; while ( child ! = null ) { node = child ; child = node left ; } return node ; }


creates a mock objc proto library rule in the current main workspace

public static void setup objc proto library ( scratch scratch ) throws exception { / / append file instead of creating one in case it already exists string tools repo = test constants tools repository ; scratch file ( " objc proto library / build " , " " ) ; scratch file ( " objc proto library / objc proto library bzl " , " def impl ( ctx ) : " , " return [ apple common new objc provider ( ) ] " , " " , " objc proto library = rule ( " , " impl , " , " attrs = { " , " ' deps ' : attr label list ( ) , " , " ' portable proto filters ' : attr label list ( allow files = true ) , " , " ' lib protobuf ' : attr label ( default = ' " + tools repo + " / / objcproto : protobuf lib ' ) , " , " } " , " ) " ) ; }


delete user { username } : delete user this can only be done by the logged in user

public response entity < void > delete user ( @ api param ( value = " the name that needs to be deleted " , required = true ) @ path variable ( " username " ) string username ) { return new response entity < > ( http status not implemented ) ; }


called from { @ link node # create launcher ( task listener ) } to decorate the launchers this method should perform node - specific decoration for job - specific decoration , { @ link build wrapper # decorate launcher ( abstract build , launcher , build listener ) } might fit your needs better if the implementation wants to do something differently if the launcher is for a build , call { @ link executor # current executor ( ) } if it returns non - null you can figure out the current build in progress from there note that { @ link launcher } s are also created for doing things other than builds , so { @ link executor # current executor ( ) } may return null also , for job - specific decoration , see { @ link build wrapper # decorate launcher ( abstract build , launcher , build listener ) } as well

public abstract launcher decorate ( @ non null launcher launcher , @ non null node node ) ;


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

public builder set c dubbo p b request type ( google p b p b request type builder builder for value ) { if ( c dubbo p b request type builder = = null ) { c dubbo p b request type = builder for value build ( ) ; on changed ( ) ; } else { c dubbo p b request type builder set message ( builder for value build ( ) ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; return this ; }


returns whether or not any layers in this composition has masks

@ suppress warnings ( " unused " ) public boolean has masks ( ) { return lottie drawable has masks ( ) ; }


gets a path filter which would match job history file names

public static path filter get history file filter ( ) { return job history file filter ; }


public static suite get size ( class < ? > clazz ) { return get annotation element or default ( clazz , " size " ) ; }


compiles the given pattern into a { @ link n f a factory } the nfa factory can be used to create multiple n f as

public static < t > n f a factory < t > compile factory ( final pattern < t , ? > pattern , boolean timeout handling ) { if ( pattern = = null ) { / / return a factory for empty n f as return new n f a factory impl < > ( 0 , collections < state < t > > empty list ( ) , timeout handling ) ; } else { final n f a factory compiler < t > nfa factory compiler = new n f a factory compiler < > ( pattern ) ; nfa factory compiler compile factory ( ) ; return new n f a factory impl < > ( nfa factory compiler get window time ( ) , nfa factory compiler get states ( ) , timeout handling ) ; } }


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


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

datagram channel config set send buffer size ( int send buffer size ) ;


get the pattern for jar contents to unpack on the tasktracker

public pattern get jar unpack pattern ( ) { return get pattern ( job context jar unpack pattern , unpack jar pattern default ) ; }


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


return whether statements will return updatable result sets

public boolean is updatable results ( ) { return this updatable results ; }


public void test assignment char deserialization ( ) { string json = " \ " abc = \ " " ; string value = gson from json ( json , string class ) ; assert equals ( " abc = " , value ) ; json = " ' abc \ u 0 0 3d ' " ; value = gson from json ( json , string class ) ; assert equals ( " abc = " , value ) ; }


this creates a directory with a child and then deletes it the parent dir must be found and declared as empty when deleting markers , that forces the recreation of a new marker

public void test delete single file in dir ( ) throws throwable { describe ( " delete a file " ) ; s 3 a file system fs = get file system ( ) ; / / creates the marker path dir = dir ( method path ( ) ) ; / / file creation may have deleted that marker , but it may / / still be there path simple file = file ( new path ( dir , " simple txt " ) ) ; boolean raw and keeping = is raw ( ) & & is deleting ( ) ; boolean raw and deleting = is raw ( ) & & is deleting ( ) ; verify metrics ( ( ) - > { fs delete ( simple file , false ) ; return " after fs delete ( simple file ) " + get metric summary ( ) ; } , probe ( raw and keeping , object metadata requests , filestatus file probe h ) , / / if deleting markers , look for the parent too probe ( raw and deleting , object metadata requests , filestatus file probe h + filestatus dir probe h ) , with when raw ( object list request , filestatus file probe l + filestatus dir probe l ) , with ( directories deleted , 0 ) , with ( files deleted , 1 ) , / / a single delete call is made to delete the object with ( object delete request , delete object request ) , / / keeping : create no parent dirs or delete parents with when keeping ( directories created , 0 ) , with when keeping ( object bulk delete request , 0 ) , / / deleting : create a parent and delete any of its parents with when deleting ( directories created , 1 ) , / / a bulk delete for all parents is issued / / the number of objects in it depends on the depth of the tree ; / / don ' t worry about that with when deleting ( object bulk delete request , delete marker request ) ) ; / / there is an empty dir for a parent s 3 a file status status = verify raw inner get file status ( dir , true , status probe enum all , get file status on dir ) ; assert empty dir status ( status , tristate true ) ; }


returns the string representation of the { @ link # sum }

public string to string ( ) { return long to string ( sum ( ) ) ; }


delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors

public void delete order test ( ) { string order id = null ; / / api delete order ( order id ) ; / / todo : test validations }


close the mailbox in this state , all pending and future put operations and all pending and future take operations will throw { @ link mailbox closed exception } returns all mails that were still enqueued


after one of the b p service actors registers successfully with the nn , it calls this function to verify that the nn it connected to is consistent with other n ns serving the block - pool

void registration succeeded ( b p service actor bp service actor , datanode registration reg ) throws i o exception { write lock ( ) ; try { if ( bp registration ! = null ) { check n s equality ( bp registration get storage info ( ) get namespace i d ( ) , reg get storage info ( ) get namespace i d ( ) , " namespace id " ) ; check n s equality ( bp registration get storage info ( ) get cluster i d ( ) , reg get storage info ( ) get cluster i d ( ) , " cluster id " ) ; } bp registration = reg ; data node fault injector get ( ) delay when offer service hold lock ( ) ; dn bp registration succeeded ( bp registration , get block pool id ( ) ) ; / / add the initial block token secret keys to the dn ' s secret manager if ( dn is block token enabled ) { dn block pool token secret manager add keys ( get block pool id ( ) , reg get exported keys ( ) ) ; } } finally { write unlock ( ) ; } }


verify if storage space quota is violated once quota is set relevant method { @ link directory with quota feature # verify storagespace quota }

public void verify storagespace quota ( ) throws d s quota exceeded exception { long space quota = get space quota ( ) ; long space consumed = get space consumed ( ) ; if ( quota is violated ( space quota , space consumed ) ) { throw new d s quota exceeded exception ( space quota , space consumed ) ; } }


returns the equate defined at the operand index of the instruction with the given value

public final equate get equate ( instruction instruction , int operand index , long value ) { return current program get equate table ( ) get equate ( instruction get min address ( ) , operand index , value ) ; }


forget what happened so far and start measuring once again

void init instrumentation ( final string tag , perf listener perf listener ) ;


return the concrete implementation of the builder instance

public abstract b get this builder ( ) ;


returns true if the set has one or more items

public boolean not empty ( ) { return size > 0 ; }


protected boolean requires delayed commit output in file system ( ) { return true ; }


replaces the external result function with the origin function < br > note : this method will replace the function , but does not create the parent namespace or put the function in the parent namespace this must be done separately

public function replace external function ( function to function , function from function , task monitor monitor ) throws cancelled exception , unsupported operation exception { if ( ! to function is external ( ) ) { throw new illegal argument exception ( " the function being replaced is not an external " ) ; } if ( ! from function is external ( ) ) { throw new illegal argument exception ( " the function being used as the source of information for a replace is not an external " ) ; } stack frame origin frame = from function get stack frame ( ) ; / / do not replace the function name here , since the symbols need to get sorted out first / / after the symbols are merged you will need to replace the function symbol in case the / / merge of symbols was not chosen if ( to function has custom variable storage ( ) ! = from function has custom variable storage ( ) ) { to function set custom variable storage ( from function has custom variable storage ( ) ) ; } try { to function set calling convention ( from function get calling convention name ( ) ) ; } catch ( invalid input exception e ) { error msg append ( " address = " + to function get entry point ( ) + " : " + e get message ( ) + " \ n " ) ; } stack frame new to frame = to function get stack frame ( ) ; try { if ( to function has custom variable storage ( ) ) { variable return var = from function get return ( ) ; to function set return ( from function get return type ( ) , return var get variable storage ( ) , return var get source ( ) ) ; } else { to function set return type ( from function get return type ( ) , source type analysis ) ; } / / if ( new to frame get parameter offset ( ) ! = origin frame get parameter offset ( ) ) { / / new to frame set parameter offset ( origin frame get parameter offset ( ) ) ; / / } } catch ( invalid input exception e ) { msg error ( this , " unexpected exception : " + e get message ( ) , e ) ; error msg append ( " invalid input exception replacing external function : " + e get message ( ) + " \ n " ) ; } if ( new to frame get local size ( ) ! = origin frame get local size ( ) ) { new to frame set local size ( origin frame get local size ( ) ) ; } to function set stack purge size ( from function get stack purge size ( ) ) ; to function set var args ( from function has var args ( ) ) ; to function set inline ( from function is inline ( ) ) ; to function set no return ( from function has no return ( ) ) ; to function set signature source ( from function get signature source ( ) ) ; replace variables ( to function , from function , monitor ) ; / / restore variable refs ( new result function , restore refs ) ; return to function ; }


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


called when the downstream format sent to the renderers changed

default void on downstream format changed ( event time event time , media load data media load data ) { }


finds layout spec class in the given file

public static optional < psi class > get first layout spec ( psi file psi file ) { return get first class ( psi file , litho plugin utils : : is layout spec ) ; }


public static void put cas login form viewable ( final request context context , final boolean viewable ) { context get flow scope ( ) put ( " cas login form viewable " , viewable ) ; }


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


gets the number of pointers in the current gesture

public int get pointer count ( ) { return m detector get pointer count ( ) ; }


bind the jvm jas setting to the specified jaas file < b > important : < b > once a file has been loaded the jvm doesn ' t pick up changes

public static void bind j v mto j a a s file ( file jaas file ) { string path = jaas file get absolute path ( ) ; if ( log is debug enabled ( ) ) { log debug ( " binding { } to { } " , environment jaas conf key , path ) ; } system set property ( environment jaas conf key , path ) ; }


changes the { @ link path pattern parser } on the given { @ linkplain router function router function } this method can be used to change the { @ code path pattern parser } properties from the defaults , for instance to change { @ linkplain path pattern parser # set case sensitive ( boolean ) case sensitivity }

public static < t extends server response > router function < t > change parser ( router function < t > router function , path pattern parser parser ) { assert not null ( router function , " router function must not be null " ) ; assert not null ( parser , " parser must not be null " ) ; change path pattern parser visitor visitor = new change path pattern parser visitor ( parser ) ; router function accept ( visitor ) ; return router function ; }


override this to perform actions before the call { @ code actual on subscribe ( this ) } happens

protected boolean before downstream ( ) { return true ; }


implements equals for a map of string arrays the map of string arrays is used in some x pack protocol classes but does ' t work with equal

public static boolean equals ( map < string , string [ ] > a , map < string , string [ ] > b ) { if ( a = = null ) { return b = = null ; } if ( b = = null ) { return false ; } if ( a size ( ) ! = b size ( ) ) { return false ; } for ( map entry < string , string [ ] > entry : a entry set ( ) ) { string [ ] val = entry get value ( ) ; string key = entry get key ( ) ; if ( val = = null ) { if ( b get ( key ) ! = null | | b contains key ( key ) = = false ) { return false ; } } else { if ( arrays equals ( val , b get ( key ) ) = = false ) { return false ; } } } return true ; }


presto ' charges ' the quanta run time to the task and the level it belongs to in an effort to maintain the target thread utilization ratios between levels and to maintain fairness within a level consider an example split where a read hung for several minutes this is either a bug or a failing dependency in either case we do not want to charge the task too much , and we especially do not want to charge the level too much - i e cause other queries in this level to starve

public priority update priority ( priority old priority , long quanta nanos , long scheduled nanos ) { int old level = old priority get level ( ) ; int new level = compute level ( scheduled nanos ) ; long level contribution = math min ( quanta nanos , level contribution cap ) ; if ( old level = = new level ) { add level time ( old level , level contribution ) ; return new priority ( old level , old priority get level priority ( ) + quanta nanos ) ; } long remaining level contribution = level contribution ; long remaining task time = quanta nanos ; / / a task normally slowly accrues scheduled time in a level and then moves to the next , but / / if the split had a particularly long quanta , accrue time to each level as if it had run / / in that level up to the level limit for ( int current level = old level ; current level < new level ; current level + + ) { long time accrued to level = math min ( seconds to nanos ( level threshold seconds [ current level + 1 ] - level threshold seconds [ current level ] ) , remaining level contribution ) ; add level time ( current level , time accrued to level ) ; remaining level contribution - = time accrued to level ; remaining task time - = time accrued to level ; } add level time ( new level , remaining level contribution ) ; long new level min priority = get level min priority ( new level , scheduled nanos ) ; return new priority ( new level , new level min priority + remaining task time ) ; }


set the source path to satisfy storage policy

public void satisfy storage policy ( final path path ) throws i o exception { final path abs f = fix relative part ( path ) ; new f s link resolver < void > ( ) { @ override public void next ( final abstract file system fs , final path p ) throws i o exception { fs satisfy storage policy ( path ) ; return null ; } } resolve ( this , abs f ) ; }


template method that subclasses may override to construct the object returned by this factory invoked lazily the first time { @ link # get object ( ) } is invoked in case of a shared singleton ; else , on each { @ link # get object ( ) } call the default implementation returns the merged { @ code map } instance

protected map < string , object > create map ( ) { map < string , object > result = new linked hash map < > ( ) ; process ( ( properties , map ) - > merge ( result , map ) ) ; return result ; } @ suppress warnings ( { " rawtypes " , " unchecked " }


creates a target pkg : bin with the given version attr and that depends on a target pkg : lib having the given sources version attr

private void declare bin depending on lib with versions ( string bin version , string lib srcs version ) throws exception { scratch file ( " pkg / build " , " py library ( name = ' lib ' , " , " srcs = [ ] , " , " srcs version = ' " + lib srcs version + " ' ) " , " py binary ( name = ' bin ' , " , " srcs = [ ' bin py ' ] , " , " deps = [ ' : lib ' ] , " , " python version = ' " + bin version + " ' ) " ) ; }


converts a timestamp in microseconds to a 90 k hz clock timestamp does not perform any wraparound to get a 90 k hz timestamp suitable for use with mpeg - ts , use { @ link # us to wrapped pts ( long ) }

public static long us to non wrapped pts ( long us ) { return ( us * 90000 ) / c micros per second ; }


public void insert row ( ) throws s q l exception { }


public static string hex decode ( final string data ) { if ( string utils is not blank ( data ) ) { return hex decode ( data to char array ( ) ) ; } return null ; }


writes properties and their attributes ( final and resource ) to the given { @ link writer } when property name is not empty , and the property exists in the configuration , the format of the output would be , { " property " : { " key " : " key 1 " , " value " : " value 1 " , " is final " : " key 1 is final " , " resource " : " key 1 resource " } } when property name is null or empty , it behaves same as { @ link # dump configuration ( configuration , writer ) } , the output would be , { " properties " : [ { key : " key 1 " , value : " value 1 " , is final : " key 1 is final " , resource : " key 1 resource " } , { key : " key 2 " , value : " value 2 " , is final : " ke 2 is final " , resource : " key 2 resource " } ] } when property name is not empty , and the property is not found in the configuration , this method will throw an { @ link illegal argument exception }

public static void dump configuration ( configuration config , string property name , writer out ) throws i o exception { if ( strings is null or empty ( property name ) ) { dump configuration ( config , out ) ; } else if ( strings is null or empty ( config get ( property name ) ) ) { throw new illegal argument exception ( " property " + property name + " not found " ) ; } else { json factory dump factory = new json factory ( ) ; json generator dump generator = dump factory create generator ( out ) ; dump generator write start object ( ) ; dump generator write field name ( " property " ) ; append j s o n property ( dump generator , config , property name , new config redactor ( config ) ) ; dump generator write end object ( ) ; dump generator flush ( ) ; } }


integration testing with a " mock " server targeting the given web handler

static mock server spec < ? > bind to web handler ( web handler web handler ) { return new default mock server spec ( web handler ) ; }


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


test that , when a block is re - opened for append , the related datanode messages are correctly queued by the sbn because they have future states and genstamps

public void test queueing with append ( ) throws exception { int num queued = 0 ; int num d n = cluster get data nodes ( ) size ( ) ; / / case 1 : create file and call hflush after write f s data output stream out = fs create ( test file path ) ; try { append test util write ( out , 0 , 10 ) ; out hflush ( ) ; / / opening the file will report rbw replicas , but will be / / queued on the standby node / / however , the delivery of rbw messages is delayed by hdfs - 7217 fix / / apply cluster trigger block reports ( ) to trigger the reporting sooner / / cluster trigger block reports ( ) ; num queued + = num d n ; / / rbw messages / / the cluster trigger block reports ( ) call above does a full / / block report that incurs 3 extra rbw messages num queued + = num d n ; / / rbw messages } finally { i o utils close stream ( out ) ; num queued + = num d n ; / / block received messages } cluster trigger block reports ( ) ; num queued + = num d n ; assert equals ( num queued , cluster get name node ( 1 ) get namesystem ( ) get pending data node message count ( ) ) ; / / case 2 : append to file and call hflush after write try { out = fs append ( test file path ) ; append test util write ( out , 10 , 10 ) ; out hflush ( ) ; cluster trigger block reports ( ) ; num queued + = num d n * 2 ; / / rbw messages , see comments in case 1 } finally { i o utils close stream ( out ) ; cluster trigger heartbeats ( ) ; num queued + = num d n ; / / block received } assert equals ( num queued , cluster get name node ( 1 ) get namesystem ( ) get pending data node message count ( ) ) ; / / case 3 : similar to case 2 , except no hflush is called try { out = fs append ( test file path ) ; append test util write ( out , 20 , 10 ) ; } finally { / / the write operation in the try block is buffered , thus no rbw message / / is reported yet until the close stream call here when close stream is / / called , before hdfs - 7217 fix , there would be three rbw messages / / ( block receiving ) , plus three finalized messages ( block received ) / / delivered to nn however , because of hdfs - 7217 fix , the reporting of / / rbw messages is postponed in this case , they are even overwritten / / by the block received messages of the same block when they are waiting / / to be delivered all this happens within the close stream ( ) call / / what ' s delivered to nn is the three block received messages see / / b p service actor # add pending replication block info / / i o utils close stream ( out ) ; num queued + = num d n ; / / block received } cluster trigger block reports ( ) ; num queued + = num d n ; log info ( " expect " + num queued + " and got : " + cluster get name node ( 1 ) get namesystem ( ) get pending data node message count ( ) ) ; assert equals ( num queued , cluster get name node ( 1 ) get namesystem ( ) get pending data node message count ( ) ) ; cluster transition to standby ( 0 ) ; cluster transition to active ( 1 ) ; / / verify that no replicas are marked corrupt , and that the / / file is readable from the failed - over standby block manager test util update state ( nn 1 get namesystem ( ) get block manager ( ) ) ; block manager test util update state ( nn 2 get namesystem ( ) get block manager ( ) ) ; assert equals ( 0 , nn 1 get namesystem ( ) get corrupt replica blocks ( ) ) ; assert equals ( 0 , nn 2 get namesystem ( ) get corrupt replica blocks ( ) ) ; append test util check ( fs , test file path , 30 ) ; }


returns the generation threshold size as sequence numbers can cause multiple generations to be preserved for rollback purposes , we want to keep the size of individual generations from growing too large to avoid excessive disk space consumption therefore , the translog is automatically rolled to a new generation when the current generation exceeds this generation threshold size

public byte size value get generation threshold size ( ) { return generation threshold size ; }


turn speculative execution on or off for this job for reduce tasks

public void set reduce speculative execution ( boolean speculative execution ) { set boolean ( job context reduce speculative , speculative execution ) ; }


called when the { @ link item touch helper } first registers an item as being moved or swiped implementations should update the item view to indicate it ' s active state


set the minimum value if a maximum value has been set then the minimum value must not be greater than the maximum value

public long parameter set minimum value ( long minimum value ) { if ( has maximum value ) { util check parameter ( minimum value < = maximum value , " minimum value ( " + minimum value + " ) must be less than or equal to maximum ( " + maximum value + " ) " ) ; } this has minimum value = true ; this minimum value = minimum value ; return this ; }


public void on error ( throwable t ) { alts handshaker stub this exception message compare and set ( null , " received a terminating error : " + t to string ( ) ) ; / / trigger the release of any blocked send optional < handshaker resp > result = optional absent ( ) ; alts handshaker stub this response queue offer ( result ) ; }


access to response body assertions with specific namespaces using an x path expression to inspect a specific subset of the body the x path expression can be a parameterized string using formatting specifiers as defined in { @ link string # format }

xpath assertions xpath ( string expression , @ nullable map < string , string > namespaces , object args ) ;


public integer get attribute integer ( ) { return attribute integer ; }


gets the maximum number of bytes available for a new data type that will replace the current data type at the indicated index if there isn ' t a component with the indicated index , the max length will be determined by the lock mode note : this method doesn ' t care whether there is a selection or not

public int get max replace length ( int current index ) { return integer max value ; }


decode with inputs and erased indexes , generates outputs more see above

public void decode ( byte [ ] [ ] inputs , int [ ] erased indexes , byte [ ] [ ] outputs ) throws i o exception { byte array decoding state decoding state = new byte array decoding state ( this , inputs , erased indexes , outputs ) ; if ( decoding state decode length = = 0 ) { return ; } do decode ( decoding state ) ; }


public long get server version ( ) { return server version ; }


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


set the active listener on the flow - controller


public pet get pet by id ( @ path param ( " pet id " ) long pet id ) ;


indicate if the touch position is at the adview

protected boolean is on ad view ( int pos ) { final int zero for admob selection = ( pos + 1 ) % adfrequency ; return zero for admob selection = = 0 ; }


returns a notification to be displayed when this service running in the foreground download services that do not wish to run in the foreground should be created by setting the { @ code foreground notification id } constructor argument to { @ link # foreground notification id none } this method is not called for such services , meaning it can be implemented to throw { @ link unsupported operation exception }

protected abstract notification get foreground notification ( list < download > downloads ) ;


gets unix groups and netgroups for the user it gets all unix groups as returned by id - gn but it only returns netgroups that are used in a c ls ( there is no way to get all netgroups for a given user , see documentation for getent netgroup )

public list < string > get groups ( string user ) throws i o exception { / / parent gets unix groups list < string > groups = new linked list < string > ( super get groups ( user ) ) ; netgroup cache get netgroups ( user , groups ) ; return groups ; }


applies this function to the given argument


tests that the task configuration is respected and overwritten by the execution config

public void test task config ( ) throws exception { long interval = 28218123 ; long timeout = interval + 19292 ; final configuration config = new configuration ( ) ; config set long ( task manager options task cancellation interval , interval ) ; config set long ( task manager options task cancellation timeout , timeout ) ; final execution config execution config = new execution config ( ) ; execution config set task cancellation interval ( interval + 1337 ) ; execution config set task cancellation timeout ( timeout - 1337 ) ; final task task = create task builder ( ) set invokable ( invokable blocking in invoke class ) set task manager config ( config ) set execution config ( execution config ) build ( ) ; assert equals ( interval , task get task cancellation interval ( ) ) ; assert equals ( timeout , task get task cancellation timeout ( ) ) ; task start task thread ( ) ; await latch await ( ) ; assert equals ( execution config get task cancellation interval ( ) , task get task cancellation interval ( ) ) ; assert equals ( execution config get task cancellation timeout ( ) , task get task cancellation timeout ( ) ) ; task get executing thread ( ) interrupt ( ) ; task get executing thread ( ) join ( ) ; }


determine if the graphical elements of the editor have been constructed

protected final boolean has editor components ( ) { return inline editor component ! = null | | detail editor component ! = null ; }


reads all stories in the folders provided , asserts if no story found

protected static list < object > create stories ( string [ ] interop tests ) throws exception { if ( interop tests length = = 0 ) { return collections singleton list ( missing ) ; } list < object > result = new array list < > ( ) ; for ( string interop test name : interop tests ) { list < story > stories = hpack json util read stories ( interop test name ) ; for ( story story : stories ) { result add ( story ) ; } } return result ; }


creates a new { @ code listenable future } whose value is a list containing the values of all its successful input futures the list of results is in the same order as the input list , and if any of the provided futures fails or is canceled , its corresponding position will contain { @ code null } ( which is indistinguishable from the future having a successful value of { @ code null } ) the list of results is in the same order as the input list this differs from { @ link # all as list ( listenable future [ ] ) } in that it ' s tolerant of failed futures for any of the items , representing them as { @ code null } in the result list canceling this future will attempt to cancel all the component futures

public static < v > listenable future < list < v > > successful as list ( listenable future < ? extends v > futures ) { return new list future < v > ( immutable list copy of ( futures ) , false ) ; }


copy - pasted from postgre s q l implementation todo : vertica is originally based on pg maybe we should refactor this stuff somehow

protected void add object modify actions ( d b r progress monitor monitor , d b c execution context execution context , list < d b e persist action > action list , object change command command , map < string , object > options ) { final generic table column column = command get object ( ) ; string prefix = " alter table " + d b utils get object full name ( column get table ( ) , d b p evaluation context ddl ) + " alter column " + d b utils get quoted identifier ( column ) + " " ; string type clause = column get full type name ( ) ; if ( command get property ( d b constants prop id type name ) ! = null | | command get property ( " max length " ) ! = null | | command get property ( " precision " ) ! = null | | command get property ( " scale " ) ! = null ) { action list add ( new s q l database persist action ( " set column type " , prefix + " set data type " + type clause ) ) ; } if ( command get property ( d b constants prop id required ) ! = null ) { action list add ( new s q l database persist action ( " set column nullability " , prefix + ( column is required ( ) ? " set " : " drop " ) + " not null " ) ) ; } if ( command get property ( d b constants prop id default value ) ! = null ) { if ( common utils is empty ( column get default value ( ) ) ) { action list add ( new s q l database persist action ( " drop column default " , prefix + " drop default " ) ) ; } else { action list add ( new s q l database persist action ( " set column default " , prefix + " set default " + column get default value ( ) ) ) ; } } super add object modify actions ( monitor , execution context , action list , command , options ) ; }


private void send trace data by m q ( set < string > key set , final string data , string data topic , string region id ) { string trace topic = trace topic name ; if ( access channel cloud = = access channel ) { trace topic = trace constants trace topic prefix + region id ; } final message message = new message ( trace topic , data get bytes ( ) ) ; / / keyset of message trace includes msg id of or original message message set keys ( key set ) ; try { set < string > trace broker set = try get message queue broker set ( trace producer get default m q producer impl ( ) , trace topic ) ; send callback callback = new send callback ( ) { @ override public void on success ( send result send result ) { } @ override public void on exception ( throwable e ) { log info ( " send trace data , the trace data is " + data ) ; } } ; if ( trace broker set is empty ( ) ) { / / no cross set trace producer send ( message , callback , 5000 ) ; } else { trace producer send ( message , new message queue selector ( ) { @ override public message queue select ( list < message queue > mqs , message msg , object arg ) { set < string > broker set = ( set < string > ) arg ; list < message queue > filter mqs = new array list < message queue > ( ) ; for ( message queue queue : mqs ) { if ( broker set contains ( queue get broker name ( ) ) ) { filter mqs add ( queue ) ; } } int index = send which queue get and increment ( ) ; int pos = math abs ( index ) % filter mqs size ( ) ; if ( pos < 0 ) { pos = 0 ; } return filter mqs get ( pos ) ; } } , trace broker set , callback ) ; } } catch ( exception e ) { log info ( " send trace data , the trace data is " + data ) ; } }


add a { @ code pattern eval row object } and update the stats appropriately

public void add row object ( pattern eval row object row object ) { row objects add ( row object ) ; switch ( row object get match type ( ) ) { case true positive : inc true positives ( ) ; break ; case possible start code : inc num possible start code ( ) ; break ; case fp wrong flow : inc num f p within block ( ) ; break ; case fp misaligned : inc num f p misaligned ( ) ; break ; case fp data : inc num f p data ( ) ; break ; case possible start undefined : inc num undefined ( ) ; break ; case context conflict : inc num context conflicts ( ) ; break ; case pre pattern hit : inc num pre pattern hit ( ) ; default : break ; } }


test that an invalid webapp triggers an exception

public void test missing server resource ( ) throws throwable { try { http server 2 server = create server ( " no such webapp " ) ; / / should not have got here / / close the server string server description = server to string ( ) ; stop ( server ) ; fail ( " expected an exception , got " + server description ) ; } catch ( file not found exception expected ) { log debug ( " expected exception " + expected , expected ) ; } }


define the format for datetime with the given { @ link date format } note : setting this property makes the exposed { @ link object mapper } non - thread - safe , according to jackson ' s thread safety rules

public void set date format ( date format date format ) { this builder date format ( date format ) ; }


set the { @ link stack trace element } for the given { @ link throwable } , using the { @ link class } and method name

public static < t extends throwable > t unknown stack trace ( t cause , class < ? > clazz , string method ) { cause set stack trace ( new stack trace element [ ] { new stack trace element ( clazz get name ( ) , method , null , - 1 ) } ) ; return cause ; }


model tests for additional properties any type

public void test additional properties any type ( ) { / / todo : test additional properties any type }


public static date begin of year ( @ not null final date date ) { return date utils truncate ( date , calendar year ) ; }


trace provided { @ link throwable } to the given resource entry

public static void trace entry ( throwable e , entry entry ) { if ( ! should trace ( e ) ) { return ; } trace entry internal ( e , entry ) ; }


shortcut for { @ link serialization feature # indent output } option

public void set indent output ( boolean indent output ) { this builder indent output ( indent output ) ; }


export all x 509 certificates contained within keystore to the specified out file

public static void export keystore ( key store keystore , file out file , char [ ] password ) throws i o exception , key store exception , no such algorithm exception , certificate exception { file output stream out = new file output stream ( out file ) ; try { keystore store ( out , password ) ; out flush ( ) ; out get f d ( ) sync ( ) ; } catch ( sync failed exception e ) { / / ignore } finally { out close ( ) ; } }


returns true if this build should strip j 2 objc dead code

private boolean strip j 2 objc dead code ( j 2 objc entry class provider j 2 objc entry class provider ) { j 2 objc configuration j 2objc configuration = build configuration get fragment ( j 2 objc configuration class ) ; / / only perform j 2 obj c dead code stripping if flag - - j 2objc dead code removal is specified and / / users have specified entry classes return j 2objc configuration remove dead code ( ) & & ! j 2 objc entry class provider get entry classes ( ) is empty ( ) ; }


forwards item moved callback to all listeners within this list

public void item moved ( string parent path , string name , string new parent path , string new name ) { if ( enable asynchronous dispatching ) { add ( new item moved event ( parent path , name , new parent path , new name ) ) ; } else { for ( file system listener l : listener list ) { l item moved ( parent path , name , new parent path , new name ) ; } } }


void set aux effect info ( aux effect info aux effect info ) ;


tests to verify the behaviours of three different processes if the number of available buffers is less than required buffers recycle the floating buffer recycle the exclusive buffer decrease the sender ' s backlog

public void test available buffers less than required buffers ( ) throws exception { / / setup final network buffer pool network buffer pool = new network buffer pool ( 16 , 32 ) ; final int num floating buffers = 14 ; final single input gate input gate = create single input gate ( 1 , network buffer pool ) ; final remote input channel input channel = create remote input channel ( input gate ) ; input gate set input channels ( input channel ) ; throwable thrown = null ; try { final buffer pool buffer pool = spy ( network buffer pool create buffer pool ( num floating buffers , num floating buffers ) ) ; input gate set buffer pool ( buffer pool ) ; input gate setup channels ( ) ; input channel request subpartition ( 0 ) ; / / prepare the exclusive and floating buffers to verify recycle logic later final buffer exclusive buffer = input channel request buffer ( ) ; assert not null ( exclusive buffer ) ; final int num recycle floating buffers = 2 ; final array deque < buffer > floating buffer queue = new array deque < > ( num recycle floating buffers ) ; for ( int i = 0 ; i < num recycle floating buffers ; i + + ) { buffer floating buffer = buffer pool request buffer ( ) ; assert not null ( floating buffer ) ; floating buffer queue add ( floating buffer ) ; } verify ( buffer pool , times ( num recycle floating buffers ) ) request buffer ( ) ; / / receive the producer ' s backlog more than the number of available floating buffers input channel on sender backlog ( 14 ) ; / / the channel requests ( backlog + num exclusive buffers ) floating buffers from local / / pool / / it does not get enough floating buffers and register as buffer listener verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 13 buffers available in the channel " , 13 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 16 buffers required in the channel " , 16 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / increase the backlog input channel on sender backlog ( 16 ) ; / / the channel is already in the status of waiting for buffers and will not request any / / more verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 13 buffers available in the channel " , 13 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 18 buffers required in the channel " , 18 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / recycle one exclusive buffer exclusive buffer recycle buffer ( ) ; / / the exclusive buffer is returned to the channel directly verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 14 buffers available in the channel " , 14 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 18 buffers required in the channel " , 18 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / recycle one floating buffer floating buffer queue poll ( ) recycle buffer ( ) ; / / assign the floating buffer to the listener and the channel is still waiting for more / / floating buffers verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 15 buffers available in the channel " , 15 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 18 buffers required in the channel " , 18 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / decrease the backlog input channel on sender backlog ( 13 ) ; / / only the number of required buffers is changed by ( backlog + num exclusive buffers ) verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 15 buffers available in the channel " , 15 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 15 buffers required in the channel " , 15 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; / / recycle one more floating buffer floating buffer queue poll ( ) recycle buffer ( ) ; / / return the floating buffer to the buffer pool and the channel is not waiting for more / / floating buffers verify ( buffer pool , times ( 15 ) ) request buffer ( ) ; verify ( buffer pool , times ( 1 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 15 buffers available in the channel " , 15 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 15 buffers required in the channel " , 15 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 1 buffers available in local pool " , 1 , buffer pool get number of available memory segments ( ) ) ; assert false ( input channel is waiting for floating buffers ( ) ) ; / / increase the backlog again input channel on sender backlog ( 15 ) ; / / the floating buffer is requested from the buffer pool and the channel is registered / / as listener again verify ( buffer pool , times ( 17 ) ) request buffer ( ) ; verify ( buffer pool , times ( 2 ) ) add buffer listener ( input channel get buffer manager ( ) ) ; assert equals ( " there should be 16 buffers available in the channel " , 16 , input channel get number of available buffers ( ) ) ; assert equals ( " there should be 17 buffers required in the channel " , 17 , input channel get number of required buffers ( ) ) ; assert equals ( " there should be 0 buffers available in local pool " , 0 , buffer pool get number of available memory segments ( ) ) ; assert true ( input channel is waiting for floating buffers ( ) ) ; } catch ( throwable t ) { thrown = t ; } finally { cleanup ( network buffer pool , null , null , thrown , input channel ) ; } }


{ @ link audio track # get playback head position ( ) } returns a value intended to be interpreted as an unsigned 32 bit integer , which also wraps around periodically this method returns the playback head position as a long that will only wrap around if the value exceeds { @ link long # max value } ( which in practice will never happen )

private long get playback head position ( ) { audio track audio track = assertions check not null ( this audio track ) ; if ( stop timestamp us ! = c time unset ) { / / simulate the playback head position up to the total number of frames submitted long elapsed time since stop us = ( system clock elapsed realtime ( ) * 1000 ) - stop timestamp us ; long frames since stop = ( elapsed time since stop us * output sample rate ) / c micros per second ; return min ( end playback head position , stop playback head position + frames since stop ) ; } int state = audio track get play state ( ) ; if ( state = = playstate stopped ) { / / the audio track hasn ' t been started return 0 ; } long raw playback head position = 0x f f f f f f f f l & audio track get playback head position ( ) ; if ( needs passthrough workarounds ) { / / work around an issue with passthrough / direct audio tracks on platform api versions 21 / 22 / / where the playback head position jumps back to zero on paused passthrough / direct audio / / tracks see [ internal : b / 19187573 ] if ( state = = playstate paused & & raw playback head position = = 0 ) { passthrough workaround pause offset = last raw playback head position ; } raw playback head position + = passthrough workaround pause offset ; } if ( util sdk int < = 29 ) { if ( raw playback head position = = 0 & & last raw playback head position > 0 & & state = = playstate playing ) { / / if connecting a bluetooth audio device fails , the audio track may be left in a state / / where its java api is in the playing state , but the native track is stopped when this / / happens the playback head position gets stuck at zero in this case , return the old / / playback head position and force the track to be reset after / / { @ link # force reset workaround timeout ms } has elapsed if ( force reset workaround time ms = = c time unset ) { force reset workaround time ms = system clock elapsed realtime ( ) ; } return last raw playback head position ; } else { force reset workaround time ms = c time unset ; } } if ( last raw playback head position > raw playback head position ) { / / the value must have wrapped around raw playback head wrap count + + ; } last raw playback head position = raw playback head position ; return raw playback head position + ( raw playback head wrap count < < 32 ) ; }


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


looks in the given list for keep specifications that match the given template returns a comma - separated string of class names from matching keep specifications , and removes the matching keep specifications as a side effect

private string find matching keep specifications ( keep class specification keep class specification template , list keep specifications ) { if ( keep specifications = = null ) { return null ; } string buffer buffer = null ; for ( int index = 0 ; index < keep specifications size ( ) ; index + + ) { keep class specification listed keep class specification = ( keep class specification ) keep specifications get ( index ) ; string class name = listed keep class specification class name ; keep class specification template class name = class name ; if ( keep class specification template equals ( listed keep class specification ) ) { if ( buffer = = null ) { buffer = new string buffer ( ) ; } else { buffer append ( ' , ' ) ; } buffer append ( class name = = null ? " * " : class util external class name ( class name ) ) ; / / remove the matching option as a side effect keep specifications remove ( index - - ) ; } } return buffer = = null ? null : buffer to string ( ) ; }


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

public void rect ( float x , float y , float origin x , float origin y , float width , float height , float scale x , float scale y , float degrees ) { rect ( x , y , origin x , origin y , width , height , scale x , scale y , degrees , color , color , color , color ) ; }


observable < model api response > upload file ( @ retrofit 2 http path ( " pet id " ) long pet id , @ retrofit 2 http part ( " additional metadata " ) string additional metadata , @ retrofit 2 http part multipart body part file ) ;


unbind the rmi service from jndi on bean factory shutdown

public void destroy ( ) throws naming exception , remote exception { if ( logger is debug enabled ( ) ) { logger debug ( " unbinding rmi service from jndi location [ " + this jndi name + " ] " ) ; } this jndi template unbind ( this jndi name ) ; invoke portable remote object ( unexport object ) ; }


public void set ordinal position ( int ordinal position ) { this ordinal position = ordinal position ; }


if this operation was successfully merged with other operation into a single tx , this will give the count of merged operations if the operation was not merged , it will be 0

public int get merged operations count ( ) { return merged operations count ; }


public calendar query builder sort ( boolean sort ) { this sort = sort ; return this ; }


test case for https : issues apache orgjirabrowse z o o k e e p e r - 2299

public void test client address ( ) throws exception { quorum peer quorum peer = new quorum peer ( ) ; local peer bean remote peer bean = new local peer bean ( quorum peer ) ; / * * * case 1 : when cnxn factory is null * / string result = remote peer bean get client address ( ) ; assert not null ( result ) ; assert equals ( 0 , result length ( ) ) ; / * * * case 2 : when only client port is configured * / server cnxn factory cnxn factory = server cnxn factory create factory ( ) ; int client port = port assignment unique ( ) ; inet socket address address = new inet socket address ( client port ) ; cnxn factory configure ( address , 5 , - 1 , false ) ; quorum peer set cnxn factory ( cnxn factory ) ; result = remote peer bean get client address ( ) ; string ipv 4 = " 0 0 0 0 : " + client port ; string ipv 6 = " [ 0 : 0 : 0 : 0 : 0 : 0 : 0 : 0 ] : " + client port ; assert true ( result equals ( ipv 4 ) | | result equals ( ipv 6 ) ) ; / / cleanup cnxn factory shutdown ( ) ;


if a value of 0 is set then this attribute will revert to its default value optional : default value is r string string resource value

public text prop default view model nullable text with default ( @ string res int string res ) { on mutation ( ) ; nullable text with default string attribute data set value ( string res ) ; return this ; }


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


casts and returns the imports field ( or its default value )

public static nested set < string > get imports ( struct impl info ) throws eval exception { object x = get value ( info , imports ) ; if ( x = = null ) { throw starlark errorf ( " ' % s ' provider ' s ' % s ' field is missing , want depset " , provider name , imports ) ; } return depset cast ( x , string class , imports ) ; }


sets the default network timeout value to wait for the database operation to complete see { @ link connection # set network timeout ( java util concurrent executor , int ) }

public void set default network timeout ( integer milliseconds ) { data source set default network timeout ( milliseconds ) ; force close all ( ) ; }


notifies the provider that the component is being hidden this happens when the provider is being closed

public void component hidden ( ) { / / subclasses implement as needed }


returns the logical or of this integer value and the given specific integer value

public integer value or ( specific integer value other ) { return or ( ( integer value ) other ) ; }


returns the value associated with the given key as a float

public float get float ( string key , float default value ) { return get raw value ( key ) map ( configuration utils : : convert to float ) or else ( default value ) ; }


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


this method releases all resources of the record writer output it stops the output flushing thread ( if there is one ) and releases all buffers currently held by the output serializers this method should never fail

public void release outputs ( ) { for ( record writer output < ? > stream output : stream outputs ) { stream output close ( ) ; } }


gets the value of the " jvm flags " attribute combining it with the default options and expanding any make variables and $ ( location ) tags

public static list < string > get jvm flags ( rule context rule context ) { list < string > jvm flags = new array list < > ( ) ; jvm flags add all ( rule context get fragment ( java configuration class ) get default jvm flags ( ) ) ; jvm flags add all ( rule context get expander ( ) with data locations ( ) list ( " jvm flags " ) ) ; return jvm flags ; }


register bean definitions contained in a resource bundle , using all property keys ( i e not filtering by prefix )

public int register bean definitions ( resource bundle rb ) throws bean definition store exception { return register bean definitions ( rb , null ) ; }


update an existing pet < b > 200 < b > - successful operation < b > 400 < b > - invalid id supplied < b > 404 < b > - pet not found < b > 405 < b > - validation exception

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


returns the { @ link nested sort builder }

public nested sort builder get nested sort ( ) { return this nested sort ; }


sets the timeout , in milliseconds , after which the executed command will be terminated

builder set timeout ( long timeout ) { preconditions check argument ( timeout > 0 , " timeout must be a positive number " ) ; this timeout = timeout ; return this ; }


returns true only if the this tuple domain contains all possible tuples that would be allowable by the other tuple domain

public boolean contains ( tuple domain < t > other ) { return other is none ( ) | | column wise union ( this , other ) equals ( this ) ; }


private insn list convert insns ( array list < ssa insn > ssa insns ) { int insn count = ssa insns size ( ) ; insn list result = new insn list ( insn count ) ; for ( int i = 0 ; i < insn count ; i + + ) { result set ( i , ssa insns get ( i ) to rop insn ( ) ) ; } result set immutable ( ) ; return result ; }


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


use { @ link remote } as the serialized form

/ * package * / object write replace ( ) throws object stream exception { return new remote ( this , get channel for serialization ( ) ) ; } / / public static void main ( string [ ] args ) { / / / / dump everything / / logger set level ( level all ) ; / / console handler h = new console handler ( ) ; / / h set level ( level all ) ; / / logger add handler ( h ) ; / / / / solaris killer = ( solaris ) get ( ) ; / / solaris solaris system s = killer create system ( ) ; / / solaris solaris process p = s get ( integer parse int ( args [ 0 ] ) ) ; / / system out println ( p get env vars ( ) ) ; / / / / if ( args length = = 2 ) / / p kill ( ) ; / / }


returns an instance which creates synchronous observables that { @ linkplain observable # subscribe on ( scheduler ) subscribe on } { @ code scheduler } by default

public static rx java call adapter factory create with scheduler ( scheduler scheduler ) { if ( scheduler = = null ) throw new null pointer exception ( " scheduler = = null " ) ; return new rx java call adapter factory ( scheduler , false ) ; }


invokes a remote method against the specified namespace re - throws exceptions generated by the remote rpc call as either remote exception or i o exception

public < t > t invoke single ( final string ns id , remote method method , class < t > clazz ) throws i o exception { @ suppress warnings ( " unchecked " ) t ret = ( t ) invoke single ( ns id , method ) ; return ret ; }


public string get class name ( clazz clazz ) { return clazz get string ( u 2class info index ) ; }


get the shard store information for the node , if it exists

public shard store info get shard store info ( ) { return shard store info ; }


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


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


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


creates a document store reader for a { @ link document store vendor }

public static < document extends timeline document > document store reader < document > create document store reader ( configuration conf ) throws yarn exception { final document store vendor store type = get store vendor ( conf ) ; switch ( store type ) { case cosmos db : document store utils validate cosmos d b conf ( conf ) ; return new cosmos d b document store reader < > ( conf ) ; default : throw new document store not supported exception ( " unable to create document store reader for type : " + store type ) ; } }


validate and set cluster id from { @ link properties }

protected void set cluster id ( properties props , int layout version , storage directory sd ) throws inconsistent f s state exception { / / set cluster id in version that supports federation if ( layout version supports ( get service layout feature map ( ) , feature federation , layout version ) ) { string cid = get property ( props , sd , " cluster i d " ) ; if ( ! ( cluster i d equals ( " " ) | | cid equals ( " " ) | | cluster i d equals ( cid ) ) ) { throw new inconsistent f s state exception ( sd get root ( ) , " cluster id is incompatible with others " ) ; } cluster i d = cid ; } }


the test demonstrates that the generics - based api for { @ link collection factory # create approximate collection ( object , int ) } is not type - safe specifically , the parameterized type { @ code e } is not bound to the type of elements contained in the { @ code collection } argument passed to { @ code create approximate collection ( ) } thus casting the value returned by { @ link enum set # copy of ( enum set ) } to { @ code ( collection < e > ) } cannot guarantee that the returned collection actually contains elements of type { @ code e }

void create approximate collection is not type safe for enum set ( ) { collection < integer > ints = create approximate collection ( enum set of ( color blue ) , 3 ) ; / / use a try - catch block to ensure that the exception is thrown as a result of the / / next line and not as a result of the previous line / / note that ints is of type collection < integer > , but the collection returned / / by create approximate collection ( ) is of type collection < color > thus , 42 / / cannot be cast to a color assert that exception of type ( class cast exception class ) is thrown by ( ( ) - > ints add ( 42 ) ) ; }


public string get v f table name ( mem buffer buf ) { data type instance dti = null ; wrapped mem buffer name buf = null ; try { name buf = new wrapped mem buffer ( buf , get name offset ( buf get memory ( ) get program ( ) ) ) ; dti = data type instance get data type instance ( new terminated string data type ( ) , name buf ) ; } catch ( address out of bounds exception e ) { / / ignore } if ( dti = = null | | dti get length ( ) > 1024 ) { msg warn ( this , " couldn ' t get vf table name @ " + buf get address ( ) + " " ) ; return null ; } string s = dti get data type ( ) get value ( name buf , settings impl no settings , dti get length ( ) ) to string ( ) ; return s ; }


public login user oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


test that makes the balancer to disperse r p cs to the name node in order to avoid nn ' s rpc queue saturation this not marked as @ test because it is run from { @ link test balancer r p c delay }

void test balancer r p c delay ( int get blocks max qps ) throws exception { final configuration conf = new hdfs configuration ( ) ; init conf ( conf ) ; conf set int ( d f s config keys dfs balancer dispatcherthreads key , 30 ) ; conf set int ( d f s config keys dfs namenode getblocks max qps key , get blocks max qps ) ; int num d ns = 20 ; long [ ] capacities = new long [ num d ns ] ; string [ ] racks = new string [ num d ns ] ; for ( int i = 0 ; i < num d ns ; i + + ) { capacities [ i ] = capacity ; racks [ i ] = ( i < num d ns / 2 ? rack0 : rack1 ) ; } do test ( conf , capacities , racks , capacity , rack2 , / / use only 1 node and set the starting capacity to 50 % to allow the / / balancing to complete in only one iteration this is necessary / / because the start get blocks time and end get blocks time measures across / / all get block calls , so if two iterations are performed , the duration / / also includes the time it took to perform the block move ops in the / / first iteration new port number based nodes ( 1 , 0 , 0 ) , false , false , true , 0 5 ) ; assert true ( " number of get blocks should be not less than " + get blocks max qps , num get blocks calls get ( ) > = get blocks max qps ) ; long duration ms = 1 + end get blocks time get ( ) - start get blocks time get ( ) ; int duration sec = ( int ) math ceil ( duration ms / 1000 0 ) ; log info ( " balancer executed { } get blocks in { } msec ( round up to { } sec ) " , num get blocks calls get ( ) , duration ms , duration sec ) ; long get block calls per second = num get blocks calls get ( ) / duration sec ; assert true ( " expected balancer get blocks calls per second < = " + get blocks max qps , get block calls per second < = get blocks max qps ) ; }


test that we don ' t scan too many blocks per second

public void test scan rate limit ( ) throws exception { configuration conf = new configuration ( ) ; / / limit scan bytes per second dramatically conf set long ( dfs block scanner volume bytes per second , 4096l ) ; / / scan continuously conf set long ( internal dfs datanode scan period ms , 1l ) ; conf set ( internal volume scanner scan result handler , test scan result handler class get name ( ) ) ; final test context ctx = new test context ( conf , 1 ) ; final int num expected blocks = 5 ; ctx create files ( 0 , num expected blocks , 4096 ) ; final test scan result handler info info = test scan result handler get info ( ctx volumes get ( 0 ) ) ; long start ms = time monotonic now ( ) ; synchronized ( info ) { info should run = true ; info notify ( ) ; } generic test utils wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { synchronized ( info ) { return info blocks scanned > 0 ; } } } , 1 , 30000 ) ; thread sleep ( 2000 ) ; synchronized ( info ) { long end ms = time monotonic now ( ) ; / / should scan no more than one block a second long seconds = ( ( end ms + 999 - start ms ) / 1000 ) ; long max blocks scanned = seconds * 1 ; assert true ( " the number of blocks scanned is too large scanned " + info blocks scanned + " blocks ; only expected to scan at most " + max blocks scanned + " in " + seconds + " seconds " , info blocks scanned < = max blocks scanned ) ; } ctx close ( ) ; }


assert that , if sd to lock is locked , the cluster is not allowed to start up

private static void assert cluster start fails when dir locked ( configuration conf , storage directory sd to lock ) throws i o exception { / / lock the edits dir , then start the nn , and make sure it fails to start sd to lock lock ( ) ; mini d f s cluster cluster = null ; try { cluster = new mini d f s cluster builder ( conf ) format ( false ) manage name dfs dirs ( false ) num data nodes ( 0 ) build ( ) ; assert false ( " cluster should fail to start after locking " + sd to lock , sd to lock is lock supported ( ) ) ; } catch ( i o exception ioe ) { generic test utils assert exception contains ( " already locked " , ioe ) ; } finally { cleanup ( cluster ) ; cluster = null ; sd to lock unlock ( ) ; } }


internal query to resolve the " to many target entity list " to - many relationship of to many entity

public list < to many target entity > query to many entity to many target entity list ( long to many id ) { synchronized ( this ) { if ( to many entity to many target entity list query = = null ) { query builder < to many target entity > query builder = query builder ( ) ; query builder where ( properties to many id eq ( null ) ) ; query builder order raw ( " t ' id ' asc " ) ; to many entity to many target entity list query = query builder build ( ) ; } } query < to many target entity > query = to many entity to many target entity list query for current thread ( ) ; query set parameter ( 0 , to many id ) ; return query list ( ) ; }


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


attaches < code > recycler view header < code > to < code > recycler view < code > this method will perform necessary actions to properly align the header within < code > recycler view < code > be sure that < code > set layout manager ( ) < code > has been called for < code > recycler view < code > before calling this method also , if you were planning to use < code > set on scroll listener ( ) < code > method for your < code > recycler view < code > , be sure to do it before calling this method

public void attach to ( recycler view recycler ) { attach to ( recycler , false ) ; }


returns a rule class provider with standard test setup plus the above rulesconfigs

static configured rule class provider get rule class provider ( ) { configured rule class provider builder builder = new configured rule class provider builder ( ) ; test rule class provider add standard rules ( builder ) ; builder add rule definition ( rule with test fragment ) ; builder add configuration fragment ( test fragment class ) ; builder add configuration options ( test options class ) ; return builder build ( ) ; }


each entry in the exception table array describes one exception handler in the code array the order of the handlers in the exception table array is significant

public exception handler java [ ] get exception table ( ) { return exception table ; }


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

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


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


public api client set temp folder path ( string temp folder path ) { this temp folder path = temp folder path ; return this ; }


convenience method to load and process an antlr grammar useful when creating interpreters if you need to access to the lexer grammar created while processing a combined grammar , use get implicit lexer ( ) on returned grammar

public grammar load grammar ( string file name ) { grammar root a s t grammar root a s t = parse grammar ( file name ) ; final grammar g = create grammar ( grammar root a s t ) ; g file name = file name ; process ( g , false ) ; return g ; }


indicates whether the specified header follows the pseudo - header format ( begins with ' : ' character )

public static boolean has pseudo header format ( char sequence header name ) { if ( header name instanceof ascii string ) { final ascii string ascii header name = ( ascii string ) header name ; return ascii header name length ( ) > 0 & & ascii header name byte at ( 0 ) = = pseudo header prefix byte ; } else { return header name length ( ) > 0 & & header name char at ( 0 ) = = pseudo header prefix ; } }


authenticates against a url and returns a { @ link authenticated u r l token } to be used by subsequent requests

public void authenticate ( url url , authenticated u r l token token ) throws i o exception , authentication exception ;


request session credentials for the default time ( 9 0 0s )

public static marshalled credentials request session credentials ( final configuration conf , final string bucket ) throws i o exception { return request session credentials ( conf , bucket , test session token duration seconds ) ; }


returns the { @ link inet 6 address } representation of a { @ link char sequence } ip address the { @ code ipv 4 mapped } parameter specifies how i pv 4 addresses should be treated " i pv 4 mapped " format as defined in < a href = " https : tools ietf orghtmlrfc 4 2 9 1 # section - 2 5 5 " > rfc 4291 section 2 is supported

public static inet 6 address get by name ( char sequence ip , boolean ipv 4 mapped ) { byte [ ] bytes = get i pv 6 by name ( ip , ipv 4 mapped ) ; if ( bytes = = null ) { return null ; } try { return inet 6 address get by address ( null , bytes , - 1 ) ; } catch ( unknown host exception e ) { throw new runtime exception ( e ) ; / / should never happen } }


postmultiplies the current transformation with a scale matrix represented by the given scale vector

public void scale ( vector 3 scale ) { scale ( scale x , scale y , scale z ) ; }


determine if this model is for a 64 bit program

protected final boolean is 6 4 bit ( ) { return is 6 4 bit ; }


a " bulk " version of the solve vandermonde system , using byte buffer

public void solve vandermonde system ( int [ ] x , byte buffer [ ] y , int len ) { byte buffer p ; int idx 1 , idx 2 ; for ( int i = 0 ; i < len - 1 ; i + + ) { for ( int j = len - 1 ; j > i ; j - - ) { p = y [ j ] ; for ( idx 1 = p position ( ) , idx 2 = y [ j - 1 ] position ( ) ; idx 1 < p limit ( ) ; idx 1 + + , idx 2 + + ) { p put ( idx 1 , ( byte ) ( p get ( idx 1 ) ^ mul table [ x [ i ] ] [ y [ j - 1 ] get ( idx 2 ) & 0x 0 0 0 0 0 0 f f ] ) ) ; } } } for ( int i = len - 1 ; i > = 0 ; i - - ) { for ( int j = i + 1 ; j < len ; j + + ) { p = y [ j ] ; for ( idx 1 = p position ( ) ; idx 1 < p limit ( ) ; idx 1 + + ) { p put ( idx 1 , ( byte ) ( div table [ p get ( idx 1 ) & 0x 0 0 0 0 0 0 f f ] [ x [ j ] ^ x [ j - i - 1 ] ] ) ) ; } } for ( int j = i ; j < len - 1 ; j + + ) { p = y [ j ] ; for ( idx 1 = p position ( ) , idx 2 = y [ j + 1 ] position ( ) ; idx 1 < p limit ( ) ; idx 1 + + , idx 2 + + ) { p put ( idx 1 , ( byte ) ( p get ( idx 1 ) ^ y [ j + 1 ] get ( idx 2 ) ) ) ; } } } }


returns the { @ link smtp command } for the given command name

public static smtp command value of ( char sequence command name ) { object util check not null ( command name , " command name " ) ; smtp command command = commands get ( command name to string ( ) ) ; return command ! = null ? command : new smtp command ( ascii string of ( command name ) ) ; }


add the given { @ link header } to this collection


sets the default network timeout value to wait for the database operation to complete see { @ link connection # set network timeout ( java util concurrent executor , int ) }

public void set default network timeout ( integer default network timeout ) { this default network timeout = default network timeout ; }


updates the view with changed fields majority of the properties here are independent so they are has to be reset to null as soon as view is updated with the value the only exception from this rule is the group of the properties for the animation for now this is animation name and cache strategy these two properties are should be set simultaneously if the dirty flag is set

public void commit changes ( ) { lottie animation view view = view weak reference get ( ) ; if ( view = = null ) { return ; } if ( animation json ! = null ) { view set animation from json ( animation json , integer to string ( animation json hash code ( ) ) ) ; animation json = null ; } if ( animation name dirty ) { view set animation ( animation name ) ; animation name dirty = false ; } if ( progress ! = null ) { view set progress ( progress ) ; progress = null ; } if ( loop ! = null ) { view set repeat count ( loop ? lottie drawable infinite : 0 ) ; loop = null ; } if ( speed ! = null ) { view set speed ( speed ) ; speed = null ; } if ( scale type ! = null ) { view set scale type ( scale type ) ; scale type = null ; } if ( render mode ! = null ) { view set render mode ( render mode ) ; render mode = null ; } if ( image assets folder ! = null ) { view set image assets folder ( image assets folder ) ; image assets folder = null ; } if ( enable merge paths ! = null ) { view enable merge paths for kit kat and above ( enable merge paths ) ; enable merge paths = null ; } if ( color filters ! = null & & color filters size ( ) > 0 ) { for ( int i = 0 ; i < color filters size ( ) ; i + + ) { readable map current = color filters get map ( i ) ; string color = current get string ( " color " ) ; string path = current get string ( " keypath " ) ; simple color filter color filter = new simple color filter ( color parse color ( color ) ) ; string path with globstar = path + " * * " ; string [ ] keys = path with globstar split ( pattern quote ( " " ) ) ; key path key path = new key path ( keys ) ; lottie value callback < color filter > callback = new lottie value callback < > ( color filter ) ; view add value callback ( key path , lottie property color filter , callback ) ; } } }


compute the latest partition metadata to cache given ordering by leader epochs ( if both available and reliable )

private optional < metadata response partition metadata > update latest metadata ( metadata response partition metadata partition metadata , boolean has reliable leader epoch ) { topic partition tp = partition metadata topic partition ; if ( has reliable leader epoch & & partition metadata leader epoch is present ( ) ) { int new epoch = partition metadata leader epoch get ( ) ; / / if the received leader epoch is at least the same as the previous one , update the metadata integer current epoch = last seen leader epochs get ( tp ) ; if ( current epoch = = null | | new epoch > = current epoch ) { log debug ( " updating last seen epoch for partition { } from { } to epoch { } from new metadata " , tp , current epoch , new epoch ) ; last seen leader epochs put ( tp , new epoch ) ; return optional of ( partition metadata ) ; } else { / / otherwise ignore the new metadata and use the previously cached info log debug ( " got metadata for an older epoch { } ( current is { } ) for partition { } , not updating " , new epoch , current epoch , tp ) ; return cache partition metadata ( tp ) ; } } else { / / handle old cluster formats as well as error responses where leader and epoch are missing last seen leader epochs remove ( tp ) ; return optional of ( partition metadata without leader epoch ( ) ) ; } }


this method checks if { @ code serializer } supports { @ code null } value

public static < t > boolean check if null supported ( @ nonnull type serializer < t > serializer ) { int length = serializer get length ( ) > 0 ? serializer get length ( ) : 1 ; data output serializer dos = new data output serializer ( length ) ; try { serializer serialize ( null , dos ) ; } catch ( i o exception | runtime exception e ) { return false ; } check argument ( serializer get length ( ) < 0 | | serializer get length ( ) = = dos get copy of buffer ( ) length , " the serialized form of the null value should have the same length " + " as any other if the length is fixed in the serializer " ) ; data input deserializer dis = new data input deserializer ( dos get shared buffer ( ) ) ; try { check argument ( serializer deserialize ( dis ) = = null ) ; } catch ( i o exception e ) { throw new runtime exception ( string format ( " unexpected failure to deserialize just serialized null value with % s " , serializer get class ( ) get name ( ) ) , e ) ; } check argument ( serializer copy ( null ) = = null , " serializer % s has to be able properly copy null value if it can serialize it " , serializer get class ( ) get name ( ) ) ; return true ; }


matches { @ code is incompatible } { @ link type serializer schema compatibility }

public static < t > matcher < type serializer schema compatibility < t > > is incompatible ( ) { return property matcher ( type serializer schema compatibility : : is incompatible , " type serializer schema that is incompatible " ) ; }


all registered { @ link s c m decision handler } s

public static extension list < s c m decision handler > all ( ) { return extension list lookup ( s c m decision handler class ) ; }


shortcut to { @ link key pair # get public ( ) }

public pub get public key ( ) { instance identity provider < pub , priv > provider = get ( this ) ; try { return provider = = null ? null : provider get public key ( ) ; } catch ( runtime exception e ) { logger log ( level warning , " instance identity provider " + provider + " propagated a runtime exception " , e ) ; return null ; } catch ( error e ) { logger log ( level info , " encountered an error while consulting instance identity provider " + provider , e ) ; throw e ; } catch ( throwable e ) { logger log ( level severe , " instance identity provider " + provider + " propagated an uncaught exception " , e ) ; return null ; } }


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


public pet get pet by id ( long pet id ) throws api exception { object local var post body = null ; / / verify the required parameter ' pet id ' is set if ( pet id = = null ) { throw new api exception ( 400 , " missing the required parameter ' pet id ' when calling get pet by id " ) ; } / / create path and map variables string local var path = " / pet / { pet id } " replace all ( " \ \ { format \ \ } " , " json " ) replace all ( " \ \ { " + " pet id " + " \ \ } " , api invoker escape string ( pet id to string ( ) ) ) ; / / query params list < pair > local var query params = new array list < pair > ( ) ; / / header params map < string , string > local var header params = new hash map < string , string > ( ) ; / / form params map < string , string > local var form params = new hash map < string , string > ( ) ; string [ ] local var content types = { } ; string local var content type = local var content types length > 0 ? local var content types [ 0 ] : " application / json " ; if ( local var content type starts with ( " multipart / form - data " ) ) { / / file uploading multipart entity builder local var builder = multipart entity builder create ( ) ; local var post body = local var builder build ( ) ; } else { / / normal form params } try { string local var response = api invoker invoke a p i ( base path , local var path , " get " , local var query params , local var post body , local var header params , local var form params , local var content type ) ; if ( local var response ! = null ) { return ( pet ) api invoker deserialize ( local var response , " " , pet class ) ; } else { return null ; } } catch ( api exception ex ) { throw ex ; } }


returns a subset of { @ link trigger descriptor } s that applies to the given item

public static list < trigger descriptor > for ( item i ) { list < trigger descriptor > r = new array list < > ( ) ; for ( trigger descriptor t : all ( ) ) { if ( ! t is applicable ( i ) ) continue ; if ( i instanceof top level item ) { / / ugly top level item descriptor tld = ( ( top level item ) i ) get descriptor ( ) ; / / tld shouldn ' t be really null in contract , but we often write test describables that / / doesn ' t have a descriptor if ( tld ! = null & & ! tld is applicable ( t ) ) continue ; } r add ( t ) ; } return r ; }


make a { @ linkplain date field mapper date field type } for a { @ code date }

protected keyword field mapper keyword field type keyword field ( string name ) { return new keyword field mapper keyword field type ( name ) ; }


returns the next pseudorandom , uniformly distributed long value from the math random ( ) sequence < b > n b all values are > = 0 < b >

public static long next long ( ) { return next long ( jvm random ) ; }


set the throttling factor on requests and number of calls to throttle

protected void set throttling ( float p , int limit ) { if ( inconsistent client ! = null ) { inconsistent client set throttle probability ( p ) ; } set failure limit ( limit ) ; }


produce a block with the given values in the last field

private static block create block ( type type , list < ? > values ) { block builder block builder = type create block builder ( null , values size ( ) ) ; for ( object value : values ) { class < ? > java type = type get java type ( ) ; if ( value = = null ) { block builder append null ( ) ; } else if ( java type = = boolean class ) { type write boolean ( block builder , ( boolean ) value ) ; } else if ( java type = = long class ) { type write long ( block builder , ( long ) value ) ; } else if ( java type = = double class ) { type write double ( block builder , ( double ) value ) ; } else if ( java type = = slice class ) { slice slice = ( slice ) value ; type write slice ( block builder , slice , 0 , slice length ( ) ) ; } else { throw new unsupported operation exception ( " not yet implemented : " + java type ) ; } } return block builder build ( ) ; }


public http 2 flags end of stream ( boolean end of stream ) { return set flag ( end of stream , end stream ) ; }


set the order for this result handler relative to others by default set to { @ link ordered # lowest precedence } , however see javadoc of sub - classes which may change this default

public void set order ( int order ) { this order = order ; }


adds a new constraint set to this column based table filter

public < t > void add constraint set ( logic operation logical op , int column index , list < column constraint < t > > constraints ) { constraint sets add ( new column constraint set < > ( model , column index , constraints , logical op ) ) ; or list = null ; / / the current or list is now invalid , this will cause it to be rebuilt when needed }


parse x attrs from json result of getxattrs call , return x attrs map

private map < string , byte [ ] > get x attrs ( string status json ) throws exception { map < string , byte [ ] > x attrs = maps new hash map ( ) ; j s o n parser parser = new j s o n parser ( ) ; j s o n object json object = ( j s o n object ) parser parse ( status json ) ; j s o n array json x attrs = ( j s o n array ) json object get ( " x attrs " ) ; if ( json x attrs ! = null ) { for ( object a : json x attrs ) { string name = ( string ) ( ( j s o n object ) a ) get ( " name " ) ; string value = ( string ) ( ( j s o n object ) a ) get ( " value " ) ; x attrs put ( name , decode x attr value ( value ) ) ; } } return x attrs ; }


create boxes for the given computer in its page

public static list < computer panel box > all ( computer computer ) { list < computer panel box > boxs = new array list < > ( ) ; for ( computer panel box box : extension list lookup ( computer panel box class ) ) { box set computer ( computer ) ; boxs add ( box ) ; } return boxs ; }


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


sets row key information in the table schema

public void set row key ( string row key name , class < ? > clazz ) { this hbase schema set row key ( row key name , clazz ) ; }


compute the difference between two snapshots ( or a snapshot and the current directory ) of the directory the diff calculation can be scoped to either the snapshot root or any descendant directory under the snapshot root

snapshot diff info compute diff ( final i node directory snapshot root dir , final i node directory snapshot diff scope dir , final string from , final string to ) throws snapshot exception { preconditions check argument ( snapshot diff scope dir is descendant of snapshot root ( snapshot root dir ) ) ; snapshot from snapshot = get snapshot by name ( snapshot root dir , from ) ; snapshot to snapshot = get snapshot by name ( snapshot root dir , to ) ; / / if the start point is equal to the end point , return null if ( from ! = null & & from equals ( to ) ) { return null ; } snapshot diff info diffs = new snapshot diff info ( snapshot root dir , snapshot diff scope dir , from snapshot , to snapshot ) ; / / the snapshot diff scope dir is passed in as the snapshot dir / / so that the file paths in the diff report are relative to the / / snapshot scope dir compute diff recursively ( snapshot diff scope dir , snapshot diff scope dir , new array list < > ( ) , diffs ) ; return diffs ; }


returns the next pseudorandom , uniformly distributed boolean value from the math random ( ) sequence

public boolean next boolean ( ) { return shared random next boolean ( ) ; }


tests that package defaults restriction produces an valid dependency that would otherwise be invalid

public void restriction package defaults ( ) throws exception { new environment group maker ( " buildenv / foo " ) set environments ( " a " , " b " ) set defaults ( " a " , " b " ) make ( ) ; scratch file ( " hello / build " , " package ( default restricted to = [ ' / / buildenv / foo : b ' ] ) " , get dependency rule ( constrained to ( " / / buildenv / foo : b " ) ) , get depending rule ( ) ) ; assert that ( get configured target ( " / / hello : main " ) ) is not null ( ) ; assert no events ( ) ; }


key set to array returns contains all keys

public void test key set to array ( ) { concurrent map map = map 5 ( ) ; set s = map key set ( ) ; object [ ] ar = s to array ( ) ; assert true ( s contains all ( arrays as list ( ar ) ) ) ; assert equals ( 5 , ar length ) ; ar [ 0 ] = m 1 0 ; assert false ( s contains all ( arrays as list ( ar ) ) ) ; }


creates credentials to be configured by x d s , falling back to other credentials if no tls configuration is provided by x d s

public static server credentials create ( server credentials fallback ) { internal protocol negotiator server factory fallback negotiator = internal netty server credentials to negotiator ( check not null ( fallback , " fallback " ) ) ; return internal netty server credentials create ( sds protocol negotiators server protocol negotiator factory ( fallback negotiator ) ) ; }


returns a list of arrays containing { @ link simulation config } objects to exercise different extractor paths this is intended to be used from tests using { @ code parameterized robolectric test runner } or { @ code org junit runners parameterized }

public static list < object [ ] > configs ( ) { return arrays as list ( new object [ ] { new simulation config ( true , false , false , false ) } , new object [ ] { new simulation config ( true , false , false , true ) } , new object [ ] { new simulation config ( true , false , true , false ) } , new object [ ] { new simulation config ( true , false , true , true ) } , new object [ ] { new simulation config ( true , true , false , false ) } , new object [ ] { new simulation config ( true , true , false , true ) } , new object [ ] { new simulation config ( true , true , true , false ) } , new object [ ] { new simulation config ( true , true , true , true ) } , new object [ ] { new simulation config ( false , false , false , false ) } ) ; }


the host and port where transport http connections are accepted

public string get transport address ( ) { return transport address ; }


public void test unrecoverable error check ( ) { / / normal error assert false ( execution failure handler is unrecoverable error ( new exception ( ) ) ) ; / / direct unrecoverable error assert true ( execution failure handler is unrecoverable error ( new suppress restarts exception ( new exception ( ) ) ) ) ; / / nested unrecoverable error assert true ( execution failure handler is unrecoverable error ( new exception ( new suppress restarts exception ( new exception ( ) ) ) ) ) ; }


register the specified handler for the given url path

protected void register handler ( string url path , object handler ) throws beans exception , illegal state exception { assert not null ( url path , " url path must not be null " ) ; assert not null ( handler , " handler object must not be null " ) ; object resolved handler = handler ; / / parse path pattern url path = prepend leading slash ( url path ) ; path pattern pattern = get path pattern parser ( ) parse ( url path ) ; if ( this handler map contains key ( pattern ) ) { object existing handler = this handler map get ( pattern ) ; if ( existing handler ! = null & & existing handler ! = resolved handler ) { throw new illegal state exception ( " cannot map " + get handler description ( handler ) + " to [ " + url path + " ] : " + " there is already " + get handler description ( existing handler ) + " mapped " ) ; } } / / eagerly resolve handler if referencing singleton via name if ( ! this lazy init handlers & & handler instanceof string ) { string handler name = ( string ) handler ; if ( obtain application context ( ) is singleton ( handler name ) ) { resolved handler = obtain application context ( ) get bean ( handler name ) ; } } / / register resolved handler this handler map put ( pattern , resolved handler ) ; if ( logger is trace enabled ( ) ) { logger trace ( " mapped [ " + url path + " ] onto " + get handler description ( handler ) ) ; } }


add a { @ link channel promise } to this { @ link channel flush promise notifier } which will be notified after the given { @ code pending data size } was reached

public channel flush promise notifier add ( channel promise promise , long pending data size ) { object util check not null ( promise , " promise " ) ; check positive or zero ( pending data size , " pending data size " ) ; long checkpoint = write counter + pending data size ; if ( promise instanceof flush checkpoint ) { flush checkpoint cp = ( flush checkpoint ) promise ; cp flush checkpoint ( checkpoint ) ; flush checkpoints add ( cp ) ; } else { flush checkpoints add ( new default flush checkpoint ( checkpoint , promise ) ) ; } return this ; }


public static map < string , subscriber status > list subs by group ( string group key ) { map < string , subscriber status > subs = new hash map < string , subscriber status > ( 100 ) ; for ( client record client rec : client records values ( ) ) { string client md 5 = client rec get group key 2md 5 map ( ) get ( group key ) ; long last polling ts = client rec get group key 2polling ts map ( ) get ( group key ) ; if ( null ! = client md 5 & & null ! = last polling ts ) { boolean is update = config cache service is uptodate ( group key , client md 5 ) ; subs put ( client rec get ip ( ) , new subscriber status ( group key , is update , client md 5 , last polling ts ) ) ; } } return subs ; }


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


adds a translational component to the matrix in the 4th column the other columns are untouched

public matrix 4 trn ( float x , float y , float z ) { val [ m03 ] + = x ; val [ m13 ] + = y ; val [ m23 ] + = z ; return this ; }


public long get cache disk size ( ) { return m cache disk utils get cache size ( ) ; }