iterates over all the dwarf die records in the program and checks for some pre - known issues , throwing an exception if there is a problem that would prevent a successful run

public void check preconditions ( task monitor monitor ) throws d w a r f precondition exception , d w a r f exception , cancelled exception , i o exception { monitor set indeterminate ( false ) ; monitor set show progress value ( true ) ; monitor set maximum ( get compilation units ( ) size ( ) ) ; if ( get compilation units ( ) size ( ) > 0 & & get compilation units ( ) get ( 0 ) get compile unit ( ) has d w o ( ) ) { / / probably won ' t get anything from the file because its all in an external dwo msg warn ( this , " unsupported dwarf dwo ( external debug file ) detected - - unlikely any debug information will be found " ) ; } / / this loop : / / 1 ) preloads the d i es if that option is set / / 2 ) checks for cross - cu refs / / 3 ) sums up the total number of die records found and updates prog with total boolean pre load = import options is preload all d i es ( ) ; total d i e count = 0 ; total aggregate count = 0 ; clear d i e indexes ( ) ; for ( d w a r f compilation unit cu : get compilation units ( ) ) { monitor set message ( " dwarf checking preconditions - compilation unit # " + cu get comp unit number ( ) + " / " + get compilation units ( ) size ( ) ) ; monitor set progress ( cu get comp unit number ( ) ) ; cu read d i es ( current d i es , monitor ) ; if ( total d i e count > import options get import limit d i e count ( ) & & ! pre load ) { throw new d w a r f precondition exception ( string format ( program get name ( ) + " has more die records ( % d ) than limit of % d " , total d i e count , import options get import limit d i e count ( ) ) ) ; } if ( ! pre load ) { found cross c u refs | = check for cross c u refs ( current d i es ) ; total d i e count + = current d i es size ( ) ; total aggregate count + = count aggregates ( ) ; current d i es clear ( ) ; if ( found cross c u refs ) { throw new d w a r f precondition exception ( " found cross - compilation unit references between die records , but ' preload ' is not turned on " ) ; } } } if ( pre load ) { / / build die indexes once rebuild d i e indexes ( ) ; this total aggregate count = aggregates size ( ) ; this total d i e count = current d i es size ( ) ; } }


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


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


calls to get the storage component could be blocking this ensures requests that block callers ( such as http or g r p c ) do not add additional load during such events

public void accept ( list < span > spans , callback < void > callback , executor executor ) { if ( spans is empty ( ) ) { callback on success ( null ) ; return ; } metrics increment spans ( spans size ( ) ) ; list < span > sampled spans = sample ( spans ) ; if ( sampled spans is empty ( ) ) { callback on success ( null ) ; return ; } / / in order to ensure callers are not blocked , we swap callbacks when we get to the storage / / phase of this process here , we create a callback whose sole purpose is classifying later / / errors on this bundle of spans in the same log category this allows people to only turn on / / debug logging in one place try { executor execute ( new store spans ( sampled spans ) ) ; callback on success ( null ) ; } catch ( throwable unexpected ) { / / ensure if a future is supplied we always set value or error callback on error ( unexpected ) ; throw unexpected ; } }


this test triggers a failure in the listener - the expectation is that the service has already reached it ' s desired state , purely because the notifications take place afterwards

public void test listener failure ( ) { listener set failing state ( service state inited ) ; register ( ) ; breakable state change listener l 2 = new breakable state change listener ( ) ; register ( l 2 ) ; breakable service service = new breakable service ( ) ; service init ( new configuration ( ) ) ; / / expected notifications to fail / / still should record its invocation assert listener state ( listener , service state inited ) ; assert listener event count ( listener , 1 ) ; / / and second listener didn ' t get notified of anything assert listener event count ( l 2 , 0 ) ; / / service should still consider itself started assert service state inited ( service ) ; service start ( ) ; service stop ( ) ; }


creates an { @ link ads loader } for requesting ads using the specified settings

ads loader create ads loader ( context context , ima sdk settings ima sdk settings , ad display container ad display container ) ;


add to the hook and clean up when the program exits

public static void add ( string file ) { files add ( file ) ; }


sets whether firefox should accept ssl certificates which have expired , signed by an unknown authority or are generally untrusted this is set to true by default

public void set accept untrusted certificates ( boolean accept untrusted ssl ) { this accept untrusted certs = accept untrusted ssl ; }


public double get double ( ) { return double ; }


applies the given { @ code aggregate function } to each window the aggregate function aggregates all elements of a window into a single result element the stream of these result elements ( one per window ) is interpreted as a regular non - windowed stream

public < acc , r > single output stream operator < r > aggregate ( aggregate function < t , acc , r > function ) { check not null ( function , " function " ) ; if ( function instanceof rich function ) { throw new unsupported operation exception ( " this aggregation function cannot be a rich function " ) ; } type information < acc > accumulator type = type extractor get aggregate function accumulator type ( function , input get type ( ) , null , false ) ; type information < r > result type = type extractor get aggregate function return type ( function , input get type ( ) , null , false ) ; return aggregate ( function , accumulator type , result type ) ; }


gson invokes this call - back method during deserialization to create an instance of the specified type the fields of the returned instance are overwritten with the data present in the json since the prior contents of the object are destroyed and overwritten , do not return an instance that is useful elsewhere in particular , do not return a common instance , always use { @ code new } to create a new instance

public t create instance ( type type ) ;


public static boolean is empty ( object [ ] array ) { return ! is not empty ( array ) ; }


see { @ link media session compat callback # on prepare from search ( string , bundle ) }

void on prepare from search ( string query , boolean play when ready , @ nullable bundle extras ) ;


public array create array of ( string type name , object [ ] elements ) throws s q l exception { return null ; }


public static void check version ( string version ) throws incompatible version exception { long current = convert version ( current ) ; long client version = convert version ( version ) ; long divide version = convert version ( version 0 7 1 ) ; if ( ( current > divide version & & client version < divide version ) | | ( current < divide version & & client version > divide version ) ) { throw new incompatible version exception ( " incompatible client version : " + version ) ; } }


set a property on the underlying { @ link mock property source } for this environment

public void set property ( string key , string value ) { this property source set property ( key , value ) ; }


regression test for https : github combazelbuildbazelissues 1 0 5 7 2 make sure we do have the command line executed in the error message of action execution exception when - - verbose failures is enabled

public void test verbose failures ( ) { exec exception e = assert throws ( exec exception class , ( ) - > run ( create spawn ( get false command ( ) ) ) ) ; action execution exception action execution exception = e to action execution exception ( new null action ( ) ) ; assert with message ( " got : " + action execution exception get message ( ) ) that ( action execution exception get message ( ) contains ( " failed : error executing command " ) ) is true ( ) ; }


changes the tenant id for all jobs related to a given { @ link deployment entity }

void update job tenant id for deployment ( string deployment id , string new tenant id ) ;


public void test inline object 1 ( ) { / / todo : test inline object 1 }


used by tests that require a map , but don ' t care whether it ' s populated or not

protected map < k , v > make either map ( ) { try { return make populated map ( ) ; } catch ( unsupported operation exception e ) { return make empty map ( ) ; } }


first visit the given { @ link i node reference } and then the referred

default void visit reference recursively ( i node reference ref , int snapshot ) { visit reference ( ref , snapshot ) ; final i node referred = ref get referred i node ( ) ; pre visit referred ( referred ) ; referred accept ( this , snapshot ) ; post visit referred ( referred ) ; }


visits a continue statement checks : control flow

public void visit continue ( s continue user continue node , semantic scope semantic scope ) { if ( semantic scope get condition ( user continue node , in loop class ) = = false ) { throw user continue node create error ( new illegal argument exception ( " invalid continue statement : not inside loop " ) ) ; } if ( semantic scope get condition ( user continue node , last loop class ) ) { throw user continue node create error ( new illegal argument exception ( " extraneous continue statement " ) ) ; } semantic scope set condition ( user continue node , all escape class ) ; semantic scope set condition ( user continue node , any continue class ) ; }


return the parameters identifying the target request , or an empty map

public multi value map < string , string > get target request params ( ) { return this target request params ; }


returns a { @ linkplain delayable writeable } that stores its contents in serialized form

public abstract serialized < t > as serialized ( writeable reader < t > reader , named writeable registry registry ) ;


create a new { @ link scripted metric } aggregation with the given name

public static scripted metric aggregation builder scripted metric ( string name ) { return new scripted metric aggregation builder ( name ) ; }


public depset / * < symlink entry > * / get symlinks for starlark ( ) { return depset of ( symlink entry type , symlinks ) ; }


expands the object into the command line as a string


public void cmdb get instance list 7 ( ) throws exception { string service name = random domain name ( ) ; string service name 2 = random domain name ( ) ; system out println ( service name ) ; naming service create ( service name , constants default namespace id , constants default group ) ; instance register ( service name , constants default namespace id , constants default group , " 11 11 11 11 " , string value of ( test port 4 dom 1 ) , " c 1 " ) ; instance register ( service name , constants default namespace id , constants default group , " 22 22 22 22 " , string value of ( test port 4 dom 1 ) , " c 1 " ) ; instance register ( service name , constants default namespace id , constants default group , " 33 33 33 33 " , string value of ( test port 4 dom 1 ) , " c 2 " ) ; instance register ( service name , constants default namespace id , constants default group , " 44 44 44 44 " , string value of ( test port 4 dom 1 ) , " c 2 " ) ; instance register ( service name , constants default namespace id , constants default group , " 55 55 55 55 " , string value of ( test port 4 dom 1 ) , " c 1 " ) ; instance register ( service name , constants default namespace id , constants default group , " 66 66 66 66 " , string value of ( test port 4 dom 1 ) , " c 1 " ) ; naming service create ( service name 2 , constants default namespace id , constants default group ) ; instance register ( service name 2 , constants default namespace id , constants default group , " 77 77 77 77 " , string value of ( test port 4 dom 1 ) , " c 2 " ) ; instance register ( service name 2 , constants default namespace id , constants default group , " 88 88 88 88 " , string value of ( test port 4 dom 1 ) , " c 2 " ) ; time unit seconds sleep ( 10 ) ; object node json = jackson utils create empty json node ( ) ; json put ( " type " , " label " ) ; json put ( " expression " , " consumer label label 1 = provider label label 1 & consumer label label 2 = provider label label 2 " ) ; list < string > params = arrays as list ( " service name " , service name , " protect threshold " , " 0 " , " selector " , json to string ( ) ) ; response entity < string > http result = request ( " / nacos / v 1 / ns / service " , params new params ( ) append param ( " service name " , service name ) append param ( " protect threshold " , " 0 " ) append param ( " selector " , json to string ( ) ) done ( ) , string class , http method put ) ; assert assert equals ( http u r l connection http ok , http result get status code value ( ) ) ; http result = request ( " / nacos / v 1 / ns / instance / list " , params new params ( ) append param ( " service name " , service name ) append param ( " client i p " , " 11 11 11 11 " ) done ( ) , string class , http method get ) ; assert assert equals ( http u r l connection http ok , http result get status code value ( ) ) ; json node result = jackson utils to obj ( http result get body ( ) ) ; system out println ( " instance list = " + result ) ; assert assert equals ( 1 , json get ( " hosts " ) size ( ) ) ; http result = request ( " / nacos / v 1 / ns / service " , params new params ( ) append param ( " service name " , service name ) append param ( " protect threshold " , " 0 " ) append param ( " selector " , " " ) done ( ) , string class , http method put ) ; assert assert equals ( http u r l connection http ok , http result get status code value ( ) ) ; http result = request ( " / nacos / v 1 / ns / instance / list " , params new params ( ) append param ( " service name " , service name ) append param ( " client i p " , " 11 11 11 11 " ) done ( ) , string class , http method get ) ; assert assert equals ( http u r l connection http ok , http result get status code value ( ) ) ; result = jackson utils to obj ( http result get body ( ) ) ; system out println ( " instance list = " + result ) ; assert assert equals ( 6 , result get ( " hosts " ) size ( ) ) ; }


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

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


public int get height above ( ) { return height above ; }


read 8 byte fixed length integer from byte buffers

public long read int 8 ( ) { return byte buf read long l e ( ) ; }


gets the references that need to be checked for differences from those that are handed to it via the refs parameter

public static reference [ ] get diff refs ( reference [ ] refs ) { list < reference > ref list = new array list < > ( ) ; for ( reference reference : refs ) { if ( reference get reference type ( ) is fallthrough ( ) ) { continue ; / / discard fallthrough refs , which are handled by instruction } ref list add ( reference ) ; } return ref list to array ( new reference [ ref list size ( ) ] ) ; }


public int do end tag ( ) throws jsp exception { assert state ( this tag writer ! = null , " no tag writer set " ) ; this tag writer end tag ( ) ; return eval page ; }


this implementation checks for the resolution of a resource url

public boolean exists ( ) { return ( resolve u r l ( ) ! = null ) ; }


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

public immutable range set < c > union ( range set < c > other ) { return union of ( iterables concat ( as ranges ( ) , other as ranges ( ) ) ) ; }


collect two types of constructor methods : 1 methods that are annotated with @ starlark constructor 2 structfield methods that return an object which itself has a method with self call = true , and is annotated with @ starlark constructor ( for example , suppose foo has a structfield method ' bar ' if foo bar is itself callable , and is a constructor , then foo bar ( ) should be treated like a constructor method )

private static void collect constructor methods ( class < ? > module class , map < string , starlark builtin doc > modules ) { method self call constructor = get self call constructor method ( module class ) ; if ( self call constructor ! = null ) { collect constructor ( modules , self call constructor ) ; } for ( method method : starlark get method annotations ( module class ) key set ( ) ) { if ( method is annotation present ( starlark constructor class ) ) { collect constructor ( modules , method ) ; } class < ? > return class = method get return type ( ) ; method return class constructor = get self call constructor method ( return class ) ; if ( return class constructor ! = null ) { collect constructor ( modules , return class constructor ) ; } } }


the order is respected for the execution local rules will be executed before the global ones this method is called only once per step to create the { @ link env vars filter rule context } the default implementation returns an empty list ; this allows build steps to support global rules

default list < env vars filter local rule > build env vars filter rules ( ) { return collections empty list ( ) ; }


finds the last record by the cluster parameters you can use the below way to finish a complicated query : lite pal select ( & quot ; name & quot ; ) where ( & quot ; age & gt ; ? & quot ; , & quot ; 14 & quot ; ) order ( & quot ; age & quot ; ) limit ( 10 ) offset ( 2 ) find last ( person class ) ; note that the associated models won ' t be loaded by default considering the efficiency , but you can do that by using { @ link fluent query # find last ( class , boolean ) }

public < t > t find last ( class < t > model class ) { return find last ( model class , false ) ; }


sets the state to state checking adts header

private void set checking adts header state ( ) { state = state checking adts header ; bytes read = 0 ; }


if both flush delay and max max batch size are set ( bigger than 0 ) , flush whenever either condition is hit if only one or the other is set , flush only when the relevant condition is hit

private boolean should flush ( ) { long flush delay = zks get flush delay ( ) ; long max batch size = zks get max batch size ( ) ; if ( ( flush delay > 0 ) & & ( get remaining delay ( ) = = 0 ) ) { return true ; } return ( max batch size > 0 ) & & ( to flush size ( ) > = max batch size ) ; }


public synchronized resource get allocated resource ( ) { return this allocated resource ; }


set the username that the request applies to must not be { @ code null }

public void username ( string username ) { this username = username ; }


enumerate all files in the directory and recursive if enumerate nested files is true

private long add files in dir ( path path , list < file status > files , boolean log excluded files ) throws i o exception { final file system fs = path get file system ( ) ; long length = 0 ; for ( file status dir : fs list status ( path ) ) { if ( dir is dir ( ) ) { if ( accept file ( dir ) & & enumerate nested files ) { length + = add files in dir ( dir get path ( ) , files , log excluded files ) ; } else { if ( log excluded files & & log is debug enabled ( ) ) { log debug ( " directory " + dir get path ( ) to string ( ) + " did not pass the file - filter and is excluded " ) ; } } } else { if ( accept file ( dir ) ) { files add ( dir ) ; length + = dir get len ( ) ; test for unsplittable ( dir ) ; } else { if ( log excluded files & & log is debug enabled ( ) ) { log debug ( " directory " + dir get path ( ) to string ( ) + " did not pass the file - filter and is excluded " ) ; } } } } return length ; }


calculates the x - coordinate in the tile grid for the specified longitude given the number of tile columns for a pre - determined zoom - level

public static int get x tile ( double longitude , long tiles ) { / / normalize lon treats this as 180 , which is not friendly for tile mapping if ( longitude = = - 180 ) { return 0 ; } int x tile = ( int ) math floor ( ( normalize lon ( longitude ) + 180 ) / 360 * tiles ) ; / / edge values may generate invalid values , and need to be clipped / / for example , polar regions ( above / below lat 85 05112878 ) get normalized if ( x tile < 0 ) { return 0 ; } if ( x tile > = tiles ) { return ( int ) tiles - 1 ; } return x tile ; }


public void delete row ( ) throws s q l exception { connection mark commit state dirty ( ) ; delegate delete row ( ) ; }


test the property ' quadrilateral type '

public void quadrilateral type test ( ) { / / todo : test quadrilateral type }


public int get time date stamp ( ) { return time date stamp ; }


return the number of handler methods in this advice

public int get handler method count ( ) { return this exception handler map size ( ) ; }


called on the start of each build , giving extensions a chance to intercept the data that is written to the log even though this method is not marked ' abstract ' , this is the method that must be overridden by extensions

public output stream decorate logger ( run build , output stream logger ) throws i o exception , interrupted exception { / / this implementation is backward compatibility thunk in case subtypes only override the / / old signature ( abstract build , output stream ) if ( build instanceof abstract build ) { / / maybe the plugin implements the old signature return decorate logger ( ( abstract build ) build , logger ) ; } else { / / this console log filter can only decorate abstract build , so just pass through return logger ; } }


parse eh cache configuration from the given resource , for further use with custom { @ link cache manager } creation

public static configuration parse configuration ( resource config location ) throws cache exception { input stream is = null ; try { is = config location get input stream ( ) ; return configuration factory parse configuration ( is ) ; } catch ( i o exception ex ) { throw new cache exception ( " failed to parse eh cache configuration resource " , ex ) ; } finally { if ( is ! = null ) { try { is close ( ) ; } catch ( i o exception ex ) { / / ignore } } } }


returns the set of nodes that are reachable from { @ code node } node b is defined as reachable from node a if there exists a path ( a sequence of adjacent outgoing edges ) starting at node a and ending at node b note that a node is always reachable from itself via a zero - length path this is a " snapshot " based on the current topology of { @ code graph } , rather than a live view of the set of nodes reachable from { @ code node } in other words , the returned { @ link set } will not be updated after modifications to { @ code graph }

public static < n > set < n > reachable nodes ( graph < n > graph , n node ) { check argument ( graph nodes ( ) contains ( node ) , node not in graph , node ) ; return immutable set copy of ( traverser for graph ( graph ) breadth first ( node ) ) ; } / / graph mutation methods / / graph view methods


creates a converter for mapping between flink ' s internal data structures and objects specified by the given { @ link data type } that can be passed into a runtime implementation for example , { @ link row data } and its fields can be converted into a { @ link row } , or the internal representation for structured types can be converted back into the original ( possibly nested ) pojo

data structure converter create data structure converter ( data type consumed data type ) ;


excluded nodes are not verified and will be ignored by placement if they are not in the same nameservice as the file

public located block get additional datanode ( final string src , final long file id , final extended block blk , final datanode info [ ] existings , final string [ ] existing storage i ds , final datanode info [ ] excludes , final int num additional nodes , final string client name ) throws i o exception { return client proto get additional datanode ( src , file id , blk , existings , existing storage i ds , excludes , num additional nodes , client name ) ; }


execute the cci interaction encapsulated by this operation object this method will call cci ' s { @ code interaction execute } variant that returns an output record

public record execute ( record input record ) throws data access exception { interaction spec interaction spec = get interaction spec ( ) ; assert state ( interaction spec ! = null , " no interaction spec set " ) ; return get cci template ( ) execute ( interaction spec , input record ) ; }


gets the total instruction count for this instance this is the sum of the instruction counts of each block

public int get instruction count ( ) { int sz = size ( ) ; int result = 0 ; for ( int i = 0 ; i < sz ; i + + ) { basic block one = ( basic block ) get or null 0 ( i ) ; if ( one ! = null ) { result + = one get insns ( ) size ( ) ; } } return result ; }


enables this watchdog so that at { @ link # default watchdog timeout m s } milliseconds in the future the { @ link # timeout method } will be called

public void arm ( ) { set enabled ( true ) ; }


the final scale parameter is computed from the scale parameter given by the user and a value this value is the value that the decay function should compute if document distance and user defined scale equal the scale parameter for the function must be adjusted accordingly in this function

double process scale ( double scale , double decay ) ;


called to record the currentnext content for a transition key

private void record layout outputs group diff ( transition id transition id , output units affinity group < animatable item > current layout outputs group , output units affinity group < animatable item > next layout outputs group ) { animation state animation state = m animation states get ( transition id ) ; if ( animation state = = null ) { animation state = new animation state ( ) ; m animation states put ( transition id , animation state ) ; } if ( current layout outputs group = = null & & next layout outputs group = = null ) { throw new runtime exception ( " both current and next layout output groups were null ! " ) ; } if ( current layout outputs group = = null & & next layout outputs group ! = null ) { animation state change type = change type appeared ; } else if ( current layout outputs group ! = null & & next layout outputs group ! = null ) { animation state change type = change type changed ; } else { if ( ( animation state change type = = change type appeared | | animation state change type = = change type changed ) & & ! animation state has disappearing animation ) { animation state should finish undeclared animation = true ; } animation state change type = change type disappeared ; } animation state current layout outputs group = current layout outputs group ; animation state next layout outputs group = next layout outputs group ; record last mounted values ( animation state ) ; animation state seen in last transition = true ; if ( m debug tag ! = null ) { log d ( m debug tag , " saw transition id " + transition id + " which is " + change type to string ( animation state change type ) ) ; } }


parse an animation from rawres this is recommended over putting your animation in assets because it uses a hard reference to r the resource id will be used as a cache key so future usages won ' t parse the json again note : to correctly load dark mode ( - night ) resources , make sure you pass activity as a context ( instead of e g the application context ) the activity won ' t be leaked pass null as the cache key to skip caching

public static lottie result < lottie composition > from raw res sync ( context context , @ raw res int raw res , @ nullable string cache key ) { try { buffered source source = okio buffer ( source ( context get resources ( ) open raw resource ( raw res ) ) ) ; if ( is zip compressed ( source ) ) { return from zip stream sync ( new zip input stream ( source input stream ( ) ) , cache key ) ; } return from json input stream sync ( source input stream ( ) , cache key ) ; } catch ( resources not found exception e ) { return new lottie result < > ( e ) ; } }


processes android data ( assets , resources , and manifest ) for android local test targets

public static processed android data process local test data from ( android data context data context , data binding context data binding context , stamped android manifest manifest , map < string , string > manifest values , android resources resources , android assets assets , resource dependencies resource deps , asset dependencies asset deps , list < string > no compress extensions , resource filter factory resource filter factory ) throws interrupted exception { return builder for non incremental top level target ( data context , manifest , manifest values ) set manifest out ( data context create output artifact ( android rule classes android processed manifest ) ) set merged resources out ( data context create output artifact ( android rule classes android resources zip ) ) set crunch png ( false ) with resource dependencies ( resource deps ) with asset dependencies ( asset deps ) set uncompressed extensions ( no compress extensions ) set resource filter factory ( resource filter factory ) build ( data context , resources , assets , manifest , data binding context ) ; }


retrieve the started service by component name

public service get service ( component name component ) { return this m services get ( component ) ; }


returns type information for a table api sql timestamp or sql timestamp type

public static type information < java sql timestamp > sql timestamp ( ) { return org apache flink api common typeinfo types sql timestamp ; }


returns a file name by changing its extension

public static file change extension ( @ non null file dst , @ non null string ext ) { string p = dst get path ( ) ; int pos = p last index of ( ' ' ) ; if ( pos < 0 ) return new file ( p + ext ) ; else return new file ( p substring ( 0 , pos ) + ext ) ; }


sets the matrix to a rotation matrix representing the quaternion

public matrix 4 set ( quaternion quaternion ) { return set ( quaternion x , quaternion y , quaternion z , quaternion w ) ; }


tests a tuple writable with more than 64 values and the values set written spread far apart

public void test sparse wide writable ( ) throws exception { writable [ ] many writs = make random writables ( 131 ) ; tuple writable s tuple = new tuple writable ( many writs ) ; for ( int i = 0 ; i < many writs length ; i + + ) { if ( i % 65 = = 0 ) { s tuple set written ( i ) ; } } byte array output stream out = new byte array output stream ( ) ; s tuple write ( new data output stream ( out ) ) ; byte array input stream in = new byte array input stream ( out to byte array ( ) ) ; tuple writable d tuple = new tuple writable ( ) ; d tuple read fields ( new data input stream ( in ) ) ; assert true ( " failed to write / read tuple " , s tuple equals ( d tuple ) ) ; assert equals ( " all tuple data has not been read from the stream " , - 1 , in read ( ) ) ; }


any comments associated with the declaration < code > optional string comment = 2 ; < code >

public builder set comment bytes ( com google protobuf byte string value ) { copy on write ( ) ; instance set comment bytes ( value ) ; return this ; }


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


add a source jar in the transitive closure , that can be reached by a chain of java source jars provider instances

public builder add transitive source jar ( artifact transitive source jar ) { transitive source jars add ( preconditions check not null ( transitive source jar ) ) ; return this ; }


public void name thread ( ) { thread current thread ( ) set name ( " j unit " ) ; }


splits the provided text into an array , separator string specified the separator is not included in the returned string array adjacent separators are treated as separators for empty tokens a { @ code null } separator splits on whitespace " " split by whole separator preserve all tokens ( ) = [ ] " ab de fg " split by whole separator preserve all tokens ( null ) = [ " ab " , " de " , " fg " ] " ab de fg " split by whole separator preserve all tokens ( null ) = [ " ab " , " " , " " , " de " , " fg " ] " ab : cd : ef " split by whole separator preserve all tokens ( " : " ) = [ " ab " , " cd " , " ef " ] " ab - ! - cd - ! - ef " split by whole separator preserve all tokens ( " - ! - " ) = [ " ab " , " cd " , " ef " ] note : returned binary strings reuse memory segments from the input str

public static binary string data [ ] split by whole separator preserve all tokens ( binary string data str , binary string data separator ) { str ensure materialized ( ) ; final int size in bytes = str get size in bytes ( ) ; memory segment [ ] segments = str get segments ( ) ; int offset = str get offset ( ) ; if ( size in bytes = = 0 ) { return empty string array ; } if ( separator = = null | | empty utf8 equals ( separator ) ) { / / split on whitespace return split by whole separator preserve all tokens ( str , from string ( " " ) ) ; } separator ensure materialized ( ) ; int sep size = separator get size in bytes ( ) ; memory segment [ ] sep segs = separator get segments ( ) ; int sep offset = separator get offset ( ) ; final array list < binary string data > substrings = new array list < > ( ) ; int beg = 0 ; int end = 0 ; while ( end < size in bytes ) { end = segments util find ( segments , offset + beg , size in bytes - beg , sep segs , sep offset , sep size ) - offset ; if ( end > - 1 ) { if ( end > beg ) { / / the following is ok , because string substring ( beg , end ) excludes / / the character at the position ' end ' substrings add ( from address ( segments , offset + beg , end - beg ) ) ; / / set the starting point for the next search / / the following is equivalent to beg = end + ( separator length - 1 ) + 1 , / / which is the right calculation : beg = end + sep size ; } else { / / we found a consecutive occurrence of the separator substrings add ( empty utf8 ) ; beg = end + sep size ; } } else { / / string substring ( beg ) goes from ' beg ' to the end of the string substrings add ( from address ( segments , offset + beg , size in bytes - beg ) ) ; end = size in bytes ; } } return substrings to array ( new binary string data [ 0 ] ) ; }


short for { @ code add ( url as well as name , url as well as name ) }

public search index builder add ( string url as well as name ) { return add ( url as well as name , url as well as name ) ; }


public insn with added catch ( type type ) { throw new unsupported operation exception ( " unsupported " ) ; }


reads all of the lines from a url the lines do not include line - termination characters , but do include other leading and trailing whitespace this method returns a mutable { @ code list } for an { @ code immutable list } , use { @ code resources as char source ( url , charset ) read lines ( ) }

public static list < string > read lines ( url url , charset charset ) throws i o exception { / / don ' t use as char source ( url , charset ) read lines ( ) because that returns / / an immutable list , which would change the behavior of this method return read lines ( url , charset , new line processor < list < string > > ( ) { final list < string > result = lists new array list ( ) ; @ override public boolean process line ( string line ) { result add ( line ) ; return true ; } @ override public list < string > get result ( ) { return result ; } } ) ; }


returns { @ code true } if a header with the { @ code name } exists , { @ code false } otherwise


public final void process ( ) throws i o exception , servlet exception { if ( permission ! = null ) try { if ( subject = = null ) throw new access denied exception ( " no subject " ) ; subject check permission ( permission ) ; } catch ( access denied exception e ) { / / if the user has hudson - wide admin permission , all checks are allowed / / this is to protect hudson administrator from broken acl / security realm implementation / configuration if ( ! jenkins get ( ) has permission ( jenkins administer ) ) throw e ; } check ( ) ; }


get the slice starting at { @ code offset } in the value at { @ code internal position } with { @ code length } bytes

public slice get slice unchecked ( int internal position , int offset , int length ) { int num 1 2 8 integers = get num 1 2 8 integers ( length ) ; return slices wrapped long array ( values , ( internal position + offset ) * 2 , num 1 2 8 integers * 2 ) ; }


blocks indefinitely until the future response is obtained

server response block ( ) ; / / static creation methods


set the debug script to run when the map tasks fail the debug script can aid debugging of failed map tasks the script is given task ' s stdout , stderr , syslog , jobconf files as arguments the debug command , run on the node where the map failed , is : < blockquote > $ script $ stdout $ stderr $ syslog $ jobconf < blockquote > the script file is distributed through { @ link distributed cache } a p is the script needs to be symlinked here is an example on how to submit a script < blockquote > job set map debug script ( " myscript " ) ; distributed cache create symlink ( job ) ; distributed cache add cache file ( " debugscriptsmyscript # myscript " ) ; < blockquote >

public void set map debug script ( string m dbg script ) { set ( job context map debug script , m dbg script ) ; }


callback for { @ link bt dbvt # collide o c l } this method must check if the input node from the broadphase bounding volume tree is completely occluded by an occluder node previously rendered by { @ link # process ( bt dbvt node , float ) } the node may or may not be a leaf node , i e may or may not contain a single collision object if the node is not a leaf ( i e an internal node ) , and the node is occluded , the child nodes it contains will not be processed or checked for occlusion , since they are contained in this parent node bounding volume and must therefore also be occluded

public boolean descent ( bt dbvt node node ) { return ocl buffer query a a b b ( tmp v 1 set ( node get volume ( ) center ( ) ) , tmp v 2 set ( node get volume ( ) extents ( ) ) ) ; }


fill in the space portion of a fixed handle , based on this const

public void fillin space ( fixed handle hand , parser walker walker ) { switch ( type ) { case j curspace : hand space = walker get cur space ( ) ; return ; case handle : { fixed handle otherhand = walker get fixed handle ( handle index ) ; switch ( select ) { case v space : hand space = otherhand space ; return ; default : break ; } } case spaceid : hand space = value spaceid ; return ; default : break ; } throw new sleigh exception ( " const tpl is not a spaceid as expected " ) ; }


public long get total space ( ) { return this total space ; }


writes all the remaining shorts of the { @ code src } short buffer to this buffer ' s current position , and increases both buffers ' position by the number of shorts copied

public short buffer put ( short buffer src ) { if ( src = = this ) { throw new illegal argument exception ( ) ; } if ( src remaining ( ) > remaining ( ) ) { throw new buffer overflow exception ( ) ; } short [ ] contents = new short [ src remaining ( ) ] ; src get ( contents ) ; put ( contents ) ; return this ; }


set a name for which to retrieve or create a cache instance default is the bean name of this eh cache factory bean

public void set cache name ( string cache name ) { set name ( cache name ) ; }


test the property ' pattern with digits and delimiter '

public void pattern with digits and delimiter test ( ) { / / todo : test pattern with digits and delimiter }


further reduces the memory footprint by finding the same labels across multiple { @ link tree string } s

public void dedup ( ) { root dedup ( new hash map < string , char [ ] > ( ) ) ; }


public final boolean is private ( ) { return modifier is private ( get modifiers ( ) ) ; }


modify ( block { @ literal - - > } datanode ) map possibly generate replication tasks , if the removed block is still valid

public void remove stored block ( block info stored block , datanode descriptor node ) { block log debug ( " block * remove stored block : { } from { } " , stored block , node ) ; assert ( namesystem has write lock ( ) ) ; { if ( stored block = = null | | ! blocks map remove node ( stored block , node ) ) { block log debug ( " block * remove stored block : { } has already been " + " removed from node { } " , stored block , node ) ; return ; } cached block cblock = namesystem get cache manager ( ) get cached blocks ( ) get ( new cached block ( stored block get block id ( ) , ( short ) 0 , false ) ) ; if ( cblock ! = null ) { boolean removed = false ; removed | = node get pending cached ( ) remove ( cblock ) ; removed | = node get cached ( ) remove ( cblock ) ; removed | = node get pending uncached ( ) remove ( cblock ) ; if ( removed ) { block log debug ( " block * remove stored block : { } removed from caching " + " related lists on node { } " , stored block , node ) ; } } / / / / it ' s possible that the block was removed because of a datanode / / failure if the block is still valid , check if replication is / / necessary in that case , put block on a possibly - will - / / be - replicated list / / if ( ! stored block is deleted ( ) ) { bm safe mode decrement safe block count ( stored block ) ; update needed reconstructions ( stored block , - 1 , 0 ) ; } excess redundancy map remove ( node , stored block ) ; corrupt replicas remove from corrupt replicas map ( stored block , node ) ; } }


public void clean and reopen derby ( ) throws exception { do derby clean ( ) ; final string jdbc url = " jdbc : derby : " + paths get ( env util get nacos home ( ) , derby base dir ) to string ( ) + " ; create = true " ; initialize ( jdbc url ) ; }


returns the height of the column headers if this table has column groups , the returned value includes the height of group headers

public int get header height ( ) { return header height ; }


public static void dispatch error event ( component context c , error event e ) { component utils dispatch error event ( c , e ) ; }


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit decimal literal ( sql base parser decimal literal context ctx ) { return visit children ( ctx ) ; }


set the ' enabled ' appearance of the entire icon preserves the underlying enablement state of badges , though the entire icon looks disabled if < code > set enabled ( true ) < code > is called

public void set enabled ( boolean enabled ) { this enabled = enabled ; }


@ api note this method returns a cached index table that is ordered in a certain order

public optional < indexed table > get indexed table ( string table name , double scale factor , set < string > index column names ) { tpch scaled table table = new tpch scaled table ( table name , scale factor ) ; set < tpch scaled column > index columns = index column names stream ( ) map ( name - > new tpch scaled column ( table , name ) ) collect ( to immutable set ( ) ) ; return optional of nullable ( indexed tables get ( index columns ) ) ; }


returns token object via file system , null if bad argument

public token < ? > add delegation tokens ( configuration conf , credentials creds , string renewer , string url ) throws exception { if ( ! url starts with ( get service name ( ) to string ( ) ) ) { url = get service name ( ) to string ( ) + " : / / " + url ; } file system fs = file system get ( uri create ( url ) , conf ) ; token < ? > token = fs get delegation token ( renewer ) ; if ( token = = null ) { log error ( fetch failed ) ; throw new i o exception ( fetch failed ) ; } creds add token ( token get service ( ) , token ) ; return token ; }


public void add actor ( actor actor ) { root add actor ( actor ) ; }


returns a { @ link list } of active shards

public list < shard routing > active shards ( ) { return this active shards ; }


construct the preferred type of sequence file writer

public static writer create writer ( file system fs , configuration conf , path name , class key class , class val class , int buffer size , short replication , long block size , boolean create parent , compression type compression type , compression codec codec , metadata metadata ) throws i o exception { return create writer ( file context get file context ( fs get uri ( ) , conf ) , conf , name , key class , val class , compression type , codec , metadata , enum set of ( create flag create , create flag overwrite ) , create opts buffer size ( buffer size ) , create parent ? create opts create parent ( ) : create opts donot create parent ( ) , create opts rep fac ( replication ) , create opts block size ( block size ) ) ; }


creates a configured instance of { @ link calcite parser }

public calcite parser create calcite parser ( ) { return new calcite parser ( get sql parser config ( ) ) ; }


public void set comment ( string comment ) throws zip exception { zip data set comment ( comment ) ; }


adds a constant float info to the constant pool of this symbol table does nothing if the constant pool already contains a similar item

symbol add constant float ( final float value ) { return add constant integer or float ( symbol constant float tag , float float to raw int bits ( value ) ) ; }


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

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


create a meta block and obtain an output stream for adding data into the block there can only be one block appender stream active at any time regular blocks may not be created after the first meta blocks the caller must call block appender close ( ) to conclude the block creation

public block appender prepare meta block ( string name , string compression name ) throws i o exception , meta block already exists { return prepare meta block ( name , compression get compression algorithm by name ( compression name ) ) ; }


private void load icons ( ) { icon list model remove all elements ( ) ; list < tool icon u r l > urls = icon map get icons ( ) ; for ( tool icon u r l url : urls ) { icon list model add element ( url ) ; } }


response entity < void > add pet ( pet body ) ;


dumps the version signature and age this package - protected method is for debugging only

protected string dump version signature age ( ) { string builder builder = new string builder ( ) ; builder append ( " directory header - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " ) ; builder append ( " \ nversion number : " ) ; builder append ( version number ) ; builder append ( " \ nsignature : " ) ; builder append ( integer to hex string ( signature ) ) ; builder append ( " \ nage : " ) ; builder append ( pdb age ) ; return builder to string ( ) ; }


async http post json create a new resource by p o s ting the given object to the http request , http header content type default ' applicationjson ; charset = utf - 8 ' { @ code response type } can be an rest result or rest result data { @ code t } type { @ code callback } result callback execution , if you need response headers , you can convert the received rest result to http rest result

public < t > void post json ( string url , header header , string body , type response type , callback < t > callback ) { execute ( url , http method post , new request http entity ( header set content type ( media type application json ) , body ) , response type , callback ) ; }


public fake data append read action ( runnable action ) { segments add ( new segment ( action , get last segment ( ) ) ) ; return this ; }


disposes this worker and terminates its thread

public void dispose ( ) { concurrent q set monitor ( null , false ) ; concurrent q cancel all tasks ( true ) ; is disposed = true ; }


private static long parse unsigned long ( object value ) { if ( value instanceof number ) { if ( ( value instanceof long ) | | ( value instanceof integer ) | | ( value instanceof short ) | | ( value instanceof byte ) ) { long lv = ( ( number ) value ) long value ( ) ; if ( lv < 0 ) { throw new illegal argument exception ( " value [ " + lv + " ] is out of range for unsigned long " ) ; } return lv ; } else if ( value instanceof big integer ) { big integer big integer value = ( big integer ) value ; if ( big integer value compare to ( biginteger 2 64 minus one ) > 0 | | big integer value compare to ( big integer zero ) < 0 ) { throw new illegal argument exception ( " value [ " + big integer value + " ] is out of range for unsigned long " ) ; } return big integer value long value ( ) ; } / / throw exception for all other numeric types with decimal parts throw new illegal argument exception ( " for input string : [ " + value to string ( ) + " ] " ) ; } else { string string value = ( value instanceof bytes ref ) ? ( ( bytes ref ) value ) utf 8 to string ( ) : value to string ( ) ; try { return long parse unsigned long ( string value ) ; } catch ( number format exception e ) { throw new illegal argument exception ( " for input string : \ " " + string value + " \ " " ) ; } } }


tests safemode with view f s overload scheme , but with wrong target fs

public void test safe mode with wrong f s ( ) throws exception { final path hdfs target path = new path ( " hdfs : / / non existent " + hdfs user folder ) ; add mount links ( default f s u r i get host ( ) , new string [ ] { hdfs user folder } , new string [ ] { hdfs target path to uri ( ) to string ( ) } , conf ) ; final d f s admin dfs admin = new d f s admin ( conf ) ; redirect stream ( ) ; int ret = tool runner run ( dfs admin , new string [ ] { " - safemode " , " enter " } ) ; assert equals ( - 1 , ret ) ; assert err msg ( " safemode : java net unknown host exception : non existent " , 0 ) ; }


set the body of the request to a string if not set or set to { @ code null } then no body is sent with the request the { @ code content - type } will be sent as { @ code applicationjson } if you need a different content type then use { @ link # set entity ( http entity ) }

public void set json entity ( string entity ) { set entity ( entity = = null ? null : new n string entity ( entity , content type application json ) ) ; }


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


check whether we have already successfully obtained the key it also initializes the value input stream

void check key ( ) throws i o exception { if ( klen > = 0 ) return ; if ( at end ( ) ) { throw new e o f exception ( " no key - value to read " ) ; } klen = - 1 ; vlen = - 1 ; value checked = false ; klen = utils read v int ( blk reader ) ; blk reader read fully ( key buffer , 0 , klen ) ; value buffer input stream reset ( blk reader ) ; if ( value buffer input stream is last chunk ( ) ) { vlen = value buffer input stream get remain ( ) ; } }


protected void store user profile ( final web context web context , final common profile profile ) { val manager = new profile manager < common profile > ( web context ) ; manager save ( true , profile , false ) ; }


target patterns that select additional toolchains that will be considered during toolchain resolution

public immutable list < string > get extra toolchains ( ) { return extra toolchains ; }


gets the json instance to do json serialization and deserialization

public json get j s o n ( ) { return json ; }


returns the test case node with the given test description note that in theory this should never return { @ code null } , but if it did we would not want to throw a { @ code null pointer exception } because j unit 4 would catch the exception and remove our test listener !

private test case node get test case ( description description ) { / / the description shouldn ' t be null , but in the test runner code we avoid throwing exceptions return description = = null ? null : test case map get ( description ) ; }


adds the models to the end of the { @ link # models } list and notifies that the items were inserted

protected void add models ( epoxy model < ? > models to add ) { int initial size = models size ( ) ; int num models to add = models to add length ; ( ( model list ) models ) ensure capacity ( initial size + num models to add ) ; pause model list notifications ( ) ; collections add all ( models , models to add ) ; resume model list notifications ( ) ; notify item range inserted ( initial size , num models to add ) ; }


creates a page blob using the specified request options and operation context

void create ( final long length , blob request options options , operation context op context ) throws storage exception ;


return an instance , which may be shared or independent , of the specified bean

protected < t > t do get bean ( string name , @ nullable class < t > required type , @ nullable object [ ] args , boolean type check only ) throws beans exception { string bean name = transformed bean name ( name ) ; object bean instance ; / / eagerly check singleton cache for manually registered singletons object shared instance = get singleton ( bean name ) ; if ( shared instance ! = null & & args = = null ) { if ( logger is trace enabled ( ) ) { if ( is singleton currently in creation ( bean name ) ) { logger trace ( " returning eagerly cached instance of singleton bean ' " + bean name + " ' that is not fully initialized yet - a consequence of a circular reference " ) ; } else { logger trace ( " returning cached instance of singleton bean ' " + bean name + " ' " ) ; } } bean instance = get object for bean instance ( shared instance , name , bean name , null ) ; } else { / / fail if we ' re already creating this bean instance : / / we ' re assumably within a circular reference if ( is prototype currently in creation ( bean name ) ) { throw new bean currently in creation exception ( bean name ) ; } / / check if bean definition exists in this factory bean factory parent bean factory = get parent bean factory ( ) ; if ( parent bean factory ! = null & & ! contains bean definition ( bean name ) ) { / / not found - > check parent string name to lookup = original bean name ( name ) ; if ( parent bean factory instanceof abstract bean factory ) { return ( ( abstract bean factory ) parent bean factory ) do get bean ( name to lookup , required type , args , type check only ) ; } else if ( args ! = null ) { / / delegation to parent with explicit args return ( t ) parent bean factory get bean ( name to lookup , args ) ; } else if ( required type ! = null ) { / / no args - > delegate to standard get bean method return parent bean factory get bean ( name to lookup , required type ) ; } else { return ( t ) parent bean factory get bean ( name to lookup ) ; } } if ( ! type check only ) { mark bean as created ( bean name ) ; } startup step bean creation = this application startup start ( " spring beans instantiate " ) tag ( " bean name " , name ) ; try { if ( required type ! = null ) { bean creation tag ( " bean type " , required type : : to string ) ; } root bean definition mbd = get merged local bean definition ( bean name ) ; check merged bean definition ( mbd , bean name , args ) ; / / guarantee initialization of beans that the current bean depends on string [ ] depends on = mbd get depends on ( ) ; if ( depends on ! = null ) { for ( string dep : depends on ) { if ( is dependent ( bean name , dep ) ) { throw new bean creation exception ( mbd get resource description ( ) , bean name , " circular depends - on relationship between ' " + bean name + " ' and ' " + dep + " ' " ) ; } register dependent bean ( dep , bean name ) ; try { get bean ( dep ) ; } catch ( no such bean definition exception ex ) { throw new bean creation exception ( mbd get resource description ( ) , bean name , " ' " + bean name + " ' depends on missing bean ' " + dep + " ' " , ex ) ; } } } / / create bean instance if ( mbd is singleton ( ) ) { shared instance = get singleton ( bean name , ( ) - > { try { return create bean ( bean name , mbd , args ) ; } catch ( beans exception ex ) { / / explicitly remove instance from singleton cache : it might have been put there / / eagerly by the creation process , to allow for circular reference resolution / / also remove any beans that received a temporary reference to the bean destroy singleton ( bean name ) ; throw ex ; } } ) ; bean instance = get object for bean instance ( shared instance , name , bean name , mbd ) ; } else if ( mbd is prototype ( ) ) { / / it ' s a prototype - > create a new instance object prototype instance = null ; try { before prototype creation ( bean name ) ; prototype instance = create bean ( bean name , mbd , args ) ; } finally { after prototype creation ( bean name ) ; } bean instance = get object for bean instance ( prototype instance , name , bean name , mbd ) ; } else { string scope name = mbd get scope ( ) ; if ( ! string utils has length ( scope name ) ) { throw new illegal state exception ( " no scope name defined for bean ´ " + bean name + " ' " ) ; } scope scope = this scopes get ( scope name ) ; if ( scope = = null ) { throw new illegal state exception ( " no scope registered for scope name ' " + scope name + " ' " ) ; } try { object scoped instance = scope get ( bean name , ( ) - > { before prototype creation ( bean name ) ; try { return create bean ( bean name , mbd , args ) ; } finally { after prototype creation ( bean name ) ; } } ) ; bean instance = get object for bean instance ( scoped instance , name , bean name , mbd ) ; } catch ( illegal state exception ex ) { throw new scope not active exception ( bean name , scope name , ex ) ; } } } catch ( beans exception ex ) { bean creation tag ( " exception " , ex get class ( ) to string ( ) ) ; bean creation tag ( " message " , string value of ( ex get message ( ) ) ) ; cleanup after bean creation failure ( bean name ) ; throw ex ; } finally { bean creation end ( ) ; } } return adapt bean instance ( name , bean instance , required type ) ; }


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


finish a table creation with data after the data is written

default optional < connector output metadata > finish create table ( connector session session , connector output table handle table handle , collection < slice > fragments , collection < computed statistics > computed statistics ) { throw new presto exception ( generic internal error , " connector metadata begin create table ( ) is implemented without finish create table ( ) " ) ; }


shuts down all the registered commands to give them a chance to cleanup or close resources should be called by the owner of this command dispatcher in all termination cases

public void shutdown ( ) { close silently ( log output stream ) ; log output stream = null ; }


if this is the first call for this object , fills { @ code this memo } and returns a set from { @ link # walk } otherwise returns null , in which case some other thread must have completely populated memo ; the caller should use { @ link # replay } instead

private synchronized compact hash set < e > locked expand ( object [ ] children ) { / / precondition : this is a non - leaf node with non - leaf successors ( depth > 2 ) / / postcondition : memo is completely populated if ( memo ! = null ) { return null ; } compact hash set < e > members = compact hash set create with expected size ( 128 ) ; compact hash set < object > sets = compact hash set create with expected size ( 128 ) ; sets add ( children ) ; memo = new byte [ 3 + math min ( ceildiv ( children length , 8 ) , 8 ) ] ; / / ( + 3 for size : a guess ) int pos = walk ( sets , members , children , / * pos = * / 0 ) ; int bytes = ceildiv ( pos , 8 ) ; / / append ( nonzero ) size to memo , in reverse varint encoding : / / 7 bits at a time , least significant first / / only the first encoded byte ' s top bit is set / / / / we resize memo if it is too small or much too large / / there may be unused bytes between the replay memo ( at the start ) / / and the size ( at the end ) int size = members size ( ) ; preconditions check state ( 0 < size ) ; int nsize = varintlen ( size ) ; int ideal = bytes + nsize ; if ( ! ( memo length - 16 < ideal & & ideal < = memo length ) ) { memo = arrays copy of ( memo , ideal ) ; } for ( byte top = ( byte ) 0x 8 0 ; size > 0 ; top = 0 ) { memo [ bytes + + ] = ( byte ) ( ( byte ) ( size & 0x 7f ) | top ) ; size > > > = 7 ; } return members ; }


this add an empty set for { @ link lite pal support # associated models map for join table } might use for updating intermediate join table

private void declare associations ( lite pal support base obj , associations info association info ) { base obj add empty model for join table ( get associated table name ( association info ) ) ; }


returns true if the provided string passes through the filter , or false if it should be removed

public boolean passes filter ( string flag ) { if ( all passes ) { return true ; } else { return ! no copts pattern matcher ( flag ) matches ( ) ; } }


perform a global flat aggregate without group by flat aggregate takes a table aggregate function which returns multiple rows use a selection after the flat aggregate example : { @ code table aggregate function table agg func = new my table aggregate function ( ) ; table env register function ( " table agg func " , table agg func ) ; tab flat aggregate ( " table agg func ( a , b ) as ( x , y , z ) " ) select ( " x , y , z " ) }

flat aggregate table flat aggregate ( string table aggregate function ) ;


test that on an open circuit that a single attempt will be allowed after a window of time to see if issues are resolved

public void test single test on open circuit after time window ( ) { string key = " cmd - f " ; try { int sleep window = 200 ; hystrix command < boolean > cmd 1 = new failure command ( key , 60 ) ; hystrix circuit breaker cb = cmd 1 circuit breaker ; / / this should start as allowing requests assert true ( cb allow request ( ) ) ; assert false ( cb is open ( ) ) ; cmd 1 execute ( ) ; hystrix command < boolean > cmd 2 = new failure command ( key , 1 ) ; cmd 2 execute ( ) ; hystrix command < boolean > cmd 3 = new failure command ( key , 1 ) ; cmd 3 execute ( ) ; hystrix command < boolean > cmd 4 = new failure command ( key , 1 ) ; cmd 4 execute ( ) ; / / everything has failed in the test window so we should return false now thread sleep ( 100 ) ; assert false ( cb allow request ( ) ) ; assert true ( cb is open ( ) ) ; / / wait for sleep window to pass thread sleep ( sleep window + 50 ) ; / / we should now allow 1 request assert true ( cb attempt execution ( ) ) ; / / but the circuit should still be open assert true ( cb is open ( ) ) ; / / and further requests are still blocked assert false ( cb attempt execution ( ) ) ; } catch ( exception e ) { e print stack trace ( ) ; fail ( " error occurred : " + e get message ( ) ) ; } }


updates the user object by adding a property

public synchronized void add property ( @ non null user property p ) throws i o exception { user property old = get property ( p get class ( ) ) ; list < user property > ps = new array list < > ( properties ) ; if ( old ! = null ) ps remove ( old ) ; ps add ( p ) ; p set user ( this ) ; properties = ps ; save ( ) ; }


this test tries to simulate load while creating an index and indexing documents while the index is being created

public void test auto generate id no duplicates ( ) throws exception { int number of iterations = scaled random int between ( 10 , 50 ) ; for ( int i = 0 ; i < number of iterations ; i + + ) { exception first error = null ; create index ( " test " ) ; int num of docs = random int between ( 10 , 100 ) ; logger info ( " indexing [ { } ] docs " , num of docs ) ; list < index request builder > builders = new array list < > ( num of docs ) ; for ( int j = 0 ; j < num of docs ; j + + ) { builders add ( client ( ) prepare index ( " test " ) set source ( " field " , " value " + j ) ) ; } index random ( true , builders ) ; logger info ( " verifying indexed content " ) ; int num of checks = random int between ( 8 , 12 ) ; for ( int j = 0 ; j < num of checks ; j + + ) { try { logger debug ( " running search with all types " ) ; search response response = client ( ) prepare search ( " test " ) get ( ) ; if ( response get hits ( ) get total hits ( ) value ! = num of docs ) { final string message = " count is " + response get hits ( ) get total hits ( ) value + " but " + num of docs + " was expected " + elasticsearch assertions format shard status ( response ) ; logger error ( " { } search response : \ n { } " , message , response ) ; fail ( message ) ; } } catch ( exception e ) { logger error ( " search for all docs types failed " , e ) ; if ( first error = = null ) { first error = e ; } } try { logger debug ( " running search with a specific type " ) ; search response response = client ( ) prepare search ( " test " ) get ( ) ; if ( response get hits ( ) get total hits ( ) value ! = num of docs ) { final string message = " count is " + response get hits ( ) get total hits ( ) value + " but " + num of docs + " was expected " + elasticsearch assertions format shard status ( response ) ; logger error ( " { } search response : \ n { } " , message , response ) ; fail ( message ) ; } } catch ( exception e ) { logger error ( " search for all docs of a specific type failed " , e ) ; if ( first error = = null ) { first error = e ; } } } if ( first error ! = null ) { fail ( first error get message ( ) ) ; } internal cluster ( ) wipe indices ( " test " ) ; } }


public cancellable clone async ( org elasticsearch action admin indices shrink resize request resize request , request options options , action listener < org elasticsearch action admin indices shrink resize response > listener ) { return rest high level client perform request async and parse entity ( resize request , indices request converters : : clone , options , org elasticsearch action admin indices shrink resize response : : from x content , listener , empty set ( ) ) ; }


create a new directory in the passed filesystem this wrapper method exists so that it can be overriddenstubbed during testing

boolean mkdirs ( file system fs , path dir , fs permission permission ) throws i o exception { return file system mkdirs ( fs , dir , permission ) ; }


prepares plugins for some expected xml configuration if the configuration ( typically a job ’ s { @ code config xml } ) needs some plugins to be installed ( or updated ) , those jobs will be triggered plugins are dynamically loaded whenever possible requires { @ link jenkins # administer }

public list < future < update center update center job > > prevalidate config ( input stream config xml ) throws i o exception { jenkins get ( ) check permission ( jenkins administer ) ; list < future < update center update center job > > jobs = new array list < > ( ) ; update center uc = jenkins get ( ) get update center ( ) ; / / todo call uc update all sites ( ) when available ? perhaps not , since we should not block on network here for ( map entry < string , version number > requested plugin : parse requested plugins ( config xml ) entry set ( ) ) { plugin wrapper pw = get plugin ( requested plugin get key ( ) ) ; if ( pw = = null ) { / / install new update site plugin to install = uc get plugin ( requested plugin get key ( ) , requested plugin get value ( ) ) ; if ( to install = = null ) { logger log ( warning , " no such plugin { 0 } to install " , requested plugin get key ( ) ) ; continue ; } log plugin warnings ( requested plugin , to install ) ; jobs add ( to install deploy ( true ) ) ; } else if ( pw is older than ( requested plugin get value ( ) ) ) { / / upgrade update site plugin to install = uc get plugin ( requested plugin get key ( ) , requested plugin get value ( ) ) ; if ( to install = = null ) { logger log ( warning , " no such plugin { 0 } to upgrade " , requested plugin get key ( ) ) ; continue ; } if ( ! pw is older than ( new version number ( to install version ) ) ) { logger log ( warning , " { 0 } @ { 1 } is no newer than what we already have " , new object [ ] { to install name , to install version } ) ; continue ; } log plugin warnings ( requested plugin , to install ) ; if ( ! to install is compatible with installed version ( ) ) { logger log ( warning , " { 0 } @ { 1 } is incompatible with the installed @ { 2 } " , new object [ ] { to install name , to install version , pw get version ( ) } ) ; } jobs add ( to install deploy ( true ) ) ; / / dynamic load = true = > sure to throw restart required exception , but at least message is nicer } / / else already good } return jobs ; }


resource get maximum profile ( ) throws yarn exception ;


gets the instance cap as int , where the capless is represented as { @ link integer # max value }

public int get instance cap ( ) { return instance cap ; }


utility function to get node info by calling rm web service

public static j s o n object get node info from r m web service ( configuration conf , string node id ) throws client handler exception , uniform interface exception { try { return web app utils exec on active r m ( conf , yarn web service utils : : get node info from r m , node id ) ; } catch ( exception e ) { if ( e instanceof client handler exception ) { throw ( ( client handler exception ) e ) ; } else if ( e instanceof uniform interface exception ) { throw ( ( uniform interface exception ) e ) ; } else { throw new runtime exception ( e ) ; } } }


tests the basic functionality of the class

public void test basic functionality ( ) throws exception { rolling window average average = new rolling window average ( 100 ) ; assert equals ( 0 , average get current average ( ) ) ; / / nothing there yet average add point ( 5 ) ; assert equals ( 5 , average get current average ( ) ) ; / / one point in there thread sleep ( 50 ) ; average add point ( 15 ) ; assert equals ( 10 , average get current average ( ) ) ; / / two points in there thread sleep ( 60 ) ; assert equals ( 15 , average get current average ( ) ) ; / / one point retired thread sleep ( 50 ) ; assert equals ( 0 , average get current average ( ) ) ; / / both points retired }


private synchronized void inc scheduled size ( long size ) { scheduled size + = size ; }


get the storage statistics for this file system object these statistics are per - instance they are not shared with any other file system object this is a default method which is intended to be overridden by subclasses the default implementation returns an empty storage statistics object

public storage statistics get storage statistics ( ) { return new empty storage statistics ( get uri ( ) to string ( ) ) ; }


creates an instance of { @ link to string helper } this is helpful for implementing { @ link object # to string ( ) } specification by example : { @ code returns " class name { } " objects to string helper ( this ) to string ( ) ; returns " class name { x = 1 } " objects to string helper ( this ) add ( " x " , 1 ) to string ( ) ; returns " my object { x = 1 } " objects to string helper ( " my object " ) add ( " x " , 1 ) to string ( ) ; returns " class name { x = 1 , y = foo } " objects to string helper ( this ) add ( " x " , 1 ) add ( " y " , " foo " ) to string ( ) ; returns " class name { x = 1 } " objects to string helper ( this ) omit null values ( ) add ( " x " , 1 ) add ( " y " , null ) to string ( ) ; } note that in gwt , class names are often obfuscated

public static to string helper to string helper ( object self ) { return new to string helper ( self get class ( ) get simple name ( ) ) ; }


return the row mapper held by this parameter , if any

public row mapper < ? > get row mapper ( ) { return this row mapper ; }


replaces the { @ link channel handler } of the specified type with a new handler in this pipeline

< t extends channel handler > t replace ( class < t > old handler type , string new name , channel handler new handler ) ;


refreshes the settings for the amazon s 3 clients and clears the cache of existing clients new clients will be build using these new settings old clients are usable until released on release they will be destroyed instead of being returned to the cache

public synchronized void refresh and clear cache ( map < string , s 3 client settings > clients settings ) { / / shutdown all unused clients / / others will shutdown on their respective release release cached clients ( ) ; this static client settings = maps of entries ( clients settings entry set ( ) ) ; derived client settings = empty map ( ) ; assert this static client settings contains key ( " default " ) : " always at least have ' default ' " ; / / clients are built lazily by { @ link client } }


kill background processes must hold { @ code < uses - permission android : name = " android permission kill background processes " > }

public static boolean kill background processes ( @ non null final string package name ) { activity manager am = ( activity manager ) utils get app ( ) get system service ( context activity service ) ; list < activity manager running app process info > info = am get running app processes ( ) ; if ( info = = null | | info size ( ) = = 0 ) return true ; for ( activity manager running app process info a info : info ) { if ( arrays as list ( a info pkg list ) contains ( package name ) ) { am kill background processes ( package name ) ; } } info = am get running app processes ( ) ; if ( info = = null | | info size ( ) = = 0 ) return true ; for ( activity manager running app process info a info : info ) { if ( arrays as list ( a info pkg list ) contains ( package name ) ) { return false ; } } return true ; }


calculate the depth on the litho components in general android view hierarchy

private static int get litho view depth in android ( litho view view ) { int depth = 3 ; view parent parent = view get parent ( ) ; while ( parent ! = null ) { depth + + ; parent = parent get parent ( ) ; } return depth ; }


synchronized protected i o exception get ( ) { return thrown ; }


insert the { @ link job entity } , similar to { @ link # insert ( job entity ) } , but returns a boolean in case the insert did not go through this could happen if the execution related to the { @ link job entity } has been removed

boolean insert job entity ( job entity timer job entity ) ;


public int get section ( ) { return section ; }


sets flag indicating whether the expression should be applied to the directory tree depth first

public void set depth first ( boolean depth first ) { this depth first = depth first ; }


public static < t > consumer < t > ignore fn ( ) { return ( consumer < t > ) ignore fn ; }


returns the nodes which are the endpoints of { @ code edge } in this network

endpoint pair < n > incident nodes ( e edge ) ;


create the primary key of the version marker

static primary key create version marker primary key ( string name ) { return new primary key ( parent , name , child , name ) ; }


applies the given visitor to all referenced classes

public void referenced classes accept ( class visitor class visitor ) { if ( referenced classes ! = null ) { for ( int index = 0 ; index < referenced classes length ; index + + ) { clazz referenced class = referenced classes [ index ] ; if ( referenced class ! = null ) { referenced class accept ( class visitor ) ; } } } }


post pet { pet id } upload image : uploads an image

com netflix hystrix hystrix command < response entity < model api response > > upload file ( @ api param ( value = " id of pet to update " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " additional data to pass to server " ) @ request param ( value = " additional metadata " , required = false ) string additional metadata , @ api param ( value = " file to upload " ) @ request param ( " file " ) multipart file file ) ;


validate that generated mapping maintains input order

private void assert maintain order ( collection < string > input , map < string , integer > output ) { assert that ( output key set ( ) ) contains exactly elements in ( input ) in order ( ) ; }


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

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


model tests for array of array of number only

public void test array of array of number only ( ) { / / todo : test array of array of number only }


sets the offset value for painting dashed lines this allows clients to animate the lines being drawn for edges in the edge direction

public void set dashing pattern offset ( float dashing patter offset ) { this dashing pattern offset = dashing patter offset ; }


public big integer get size ( ) { return size ; }


filter the list to builds on a single node only warning : this method mutates the original list and then returns it

public run list < r > node ( final node node ) { return filter ( new predicate < r > ( ) { public boolean apply ( r r ) { return ( r instanceof abstract build ) & & ( ( abstract build ) r ) get built on ( ) = = node ; } } ) ; }


returns { @ code true } if the application as been deferred ( during the { @ link # apply ( ) } method the { @ link # deferred apply ( ) } method will need to be applied at the appropriate place in the processing sequence ( depending on data dependency ordering ) as determined and driven by the { @ link pdb applicator }

boolean is deferred ( ) { return is deferred ; }


test that a hash code miscomputed by " input hash code ( ) too far value 2 " is correct under our { @ code hash code } implementation

public void test power set hash code input hash code times too far value is zero ( ) { set < object > sum to eighth max int elements = new hash set ( object with hash code ( 1 < < 29 ) , object with hash code ( 0 ) ) ; assert power set hash code ( 1 < < 30 , sum to eighth max int elements ) ; set < object > sum to quarter max int elements = new hash set ( object with hash code ( 1 < < 30 ) , object with hash code ( 0 ) ) ; assert power set hash code ( 1 < < 31 , sum to quarter max int elements ) ; }


this method determines how to translate the source " user " destination to an actual target destination for the given active user session

protected string get target destination ( string source destination , string actual destination , string session id , @ nullable string user ) { return actual destination + " - user " + session id ; }


returns the highest value in the dataset the count must be non - zero < h 3 > non - finite values < h 3 > if the dataset contains { @ link double # na n } then the result is { @ link double # na n } if it contains { @ link double # positive infinity } and not { @ link double # na n } then the result is { @ link double # positive infinity } if it contains { @ link double # negative infinity } and finite values only then the result is the highest finite value if it contains { @ link double # negative infinity } only then the result is { @ link double # negative infinity }

public double max ( ) { check state ( count ! = 0 ) ; return max ; }


get the offset of this data item from the start of its immediate parent

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


public string get capital snake ( ) { return capital snake ; }


helper method that checks if { @ code usage } is strictly less than { @ code share }

private boolean is usage below share ( resource usage , resource share ) { return get queue ( ) get policy ( ) get resource calculator ( ) compare ( scheduler get cluster resource ( ) , usage , share , true ) < 0 ; }


converts this { @ link timestamp data } object to a { @ link instant }

public instant to instant ( ) { long epoch second = millisecond / 1000 ; int milli of second = ( int ) ( millisecond % 1000 ) ; if ( milli of second < 0 ) { - - epoch second ; milli of second + = 1000 ; } long nano adjustment = milli of second * 1 000 000 + nano of millisecond ; return instant of epoch second ( epoch second , nano adjustment ) ; }


returns a formatted string for attaching a qdisc to the root of the deviceinterface additional qdisc parameters can be supplied - for example , the default ' class ' to use for incoming packets

private string get string for add root q disc ( ) { return string format ( format qdisc add to root with default , device , root qdisc handle , default class id ) ; }


get the record with the maximum key value which is less than the specified key

public d b record get record before ( long key ) throws i o exception { synchronized ( db ) { if ( root buffer id < 0 ) { return null ; } try { long key record node leaf = node mgr get long key node ( root buffer id ) get leaf node ( key ) ; return leaf get record before ( key , schema ) ; } finally { node mgr release nodes ( ) ; } } }


returns a duplicate graph with the same set of node labels and the same connectivity relation the labels themselves are not cloned

public digraph < t > clone ( ) { final digraph < t > that = new digraph < t > ( ) ; visit nodes before edges ( new abstract graph visitor < t > ( ) { @ override public void visit edge ( node < t > lhs , node < t > rhs ) { that add edge ( lhs get label ( ) , rhs get label ( ) ) ; } @ override public void visit node ( node < t > node ) { that create node ( node get label ( ) ) ; } } , nodes values ( ) , null ) ; return that ; }


return array of icons that were added to this mult icon

public icon [ ] get icons ( ) { return icon list to array ( new icon [ icon list size ( ) ] ) ; }


dispatches a { @ link player # prepare ( ) } operation

boolean dispatch prepare ( player player ) ;


create a builder that is initialized with the given path

public static uri components builder from path ( string path ) { uri components builder builder = new uri components builder ( ) ; builder path ( path ) ; return builder ; }


get the cluster fs , which will either be hdfs or the local fs

public file system get cluster f s ( ) throws i o exception { mini d f s cluster service mini cluster = get hdfs ( ) ; return mini cluster ! = null ? mini cluster get cluster f s ( ) : file system get local ( yarn get config ( ) ) ; }


returns all top level classes whose package name is { @ code package name } or starts with { @ code package name } followed by a ' '

public immutable set < class info > get top level classes recursive ( string package name ) { check not null ( package name ) ; string package prefix = package name + ' ' ; immutable set builder < class info > builder = immutable set builder ( ) ; for ( class info class info : get top level classes ( ) ) { if ( class info get name ( ) starts with ( package prefix ) ) { builder add ( class info ) ; } } return builder build ( ) ; }


set the { @ link org springframework web util url path helper } to use for the resolution of lookup paths use this to override the default url path helper with a custom subclass , or to share common url path helper settings across multiple web components

public void set url path helper ( url path helper url path helper ) { }


returns true if the log file is still being updated

public boolean is log updated ( ) { return state compare to ( state completed ) < 0 ; }


public string get table name ( int offset len ) { return name prefix + top address add wrap ( offset len * addr size ) to string ( ) ; }


centers the dialog in the stage and calls { @ link # show ( stage , action ) } with a { @ link actions # fade in ( float , interpolation ) } action

public dialog show ( stage stage ) { show ( stage , sequence ( actions alpha ( 0 ) , actions fade in ( 0 4f , interpolation fade ) ) ) ; set position ( math round ( ( stage get width ( ) - get width ( ) ) / 2 ) , math round ( ( stage get height ( ) - get height ( ) ) / 2 ) ) ; return this ; }


gets the bytecode offset ( exclusive ) of the end of this block


public void handle cas registered service deleted event ( final cas registered service deleted event event ) { logger trace ( " received event [ { } ] " , event ) ; this publisher publish ( event get registered service ( ) , event , publisher identifier ) ; }


gets the id associated with this table type


transforms the subclass serializer registry structure , { @ code linked hash map < class < ? > , type serializer < ? > > } to 2 separate structures : a map containing with registered classes as key and their corresponding ids ( order in the original map ) as value , as well as a separate array of the corresponding subclass serializers

private static tuple 2 < linked hash map < class < ? > , integer > , type serializer < object > [ ] > decompose subclass serializer registry ( linked hash map < class < ? > , type serializer < ? > > subclass serializer registry ) { final linked hash map < class < ? > , integer > subclass ids = new linked hash map < > ( subclass serializer registry size ( ) ) ; final type serializer [ ] subclass serializers = new type serializer [ subclass serializer registry size ( ) ] ; subclass serializer registry for each ( ( registered subclass class , serializer ) - > { int id = subclass ids size ( ) ; subclass ids put ( registered subclass class , id ) ; subclass serializers [ id ] = serializer ; } ) ; return tuple 2 of ( subclass ids , subclass serializers ) ; }


remove the docker container referenced in the context

public void remove docker container ( string container id ) { try { privileged operation executor priv op executor = privileged operation executor get instance ( super get conf ( ) ) ; if ( docker command executor is removable ( docker command executor get container status ( container id , priv op executor , nm context ) ) ) { log info ( " removing docker container : { } " , container id ) ; docker rm command docker rm command = new docker rm command ( container id , resource handler module get cgroups relative root ( ) ) ; docker command executor execute docker command ( docker rm command , container id , null , priv op executor , false , nm context ) ; } } catch ( container execution exception e ) { log warn ( " unable to remove docker container : { } " , container id ) ; } }


perform the given action as the daemon ' s login user if the login user cannot be determined , this will log a fatal error and exit the whole jvm

public static < t > t do as login user or fatal ( privileged action < t > action ) { if ( user group information is security enabled ( ) ) { user group information ugi = null ; try { ugi = user group information get login user ( ) ; } catch ( i o exception e ) { log error ( " exception while getting login user " , e ) ; e print stack trace ( ) ; runtime get runtime ( ) exit ( - 1 ) ; } return ugi do as ( action ) ; } else { return action run ( ) ; } }


3 commands , command 1 gets started in bucket a and not completed until bucket b commands 2 and 3 both start and end in bucket b , and there should be a max - concurrency of 3

public void test one command carries over to next bucket ( ) throws interrupted exception { hystrix command group key group key = hystrix command group key factory as key ( " thread pool - concurrency - d " ) ; hystrix thread pool key thread pool key = hystrix thread pool key factory as key ( " thread pool - concurrency - d " ) ; hystrix command key key = hystrix command key factory as key ( " rolling concurrency - d " ) ; stream = rolling thread pool max concurrency stream get instance ( thread pool key , 10 , 100 ) ; stream start caching stream values if unstarted ( ) ; final count down latch latch = new count down latch ( 1 ) ; stream observe ( ) take ( 10 ) subscribe ( get subscriber ( latch ) ) ; command cmd 1 = command from ( group key , key , hystrix event type success , 560 ) ; command cmd 2 = command from ( group key , key , hystrix event type success , 50 ) ; command cmd 3 = command from ( group key , key , hystrix event type success , 75 ) ; cmd 1 observe ( ) ; thread sleep ( 150 ) ; / / bucket roll cmd 2 observe ( ) ; thread sleep ( 1 ) ; cmd 3 observe ( ) ; assert true ( latch await ( 10000 , time unit milliseconds ) ) ; assert equals ( 3 , stream get latest rolling max ( ) ) ; }


creates a delayed { @ link transition } s that will run after a delay

public static < t extends transition > transition delay ( int delay ms , t transition ) { return new delay transition set ( delay ms , transition ) ; }


attempt to obtain a modification lock on the domain object when generating a background snapshot

final synchronized locking task monitor lock for snapshot ( domain object adapter d b domain obj , boolean has progress , string title ) { if ( system utilities is in headless mode ( ) ) { msg warn ( this , " snapshot not supported in headless mode " ) ; return null ; } check domain object ( domain obj ) ; if ( lock count ! = 0 | | get current transaction ( ) ! = null | | locking task monitor ! = null ) { return null ; } + + lock count ; / / prevent prepare to save try { if ( lock ( " snapshot " ) ) { locking task monitor = new locking task monitor ( domain obj , has progress , title ) ; return locking task monitor ; } } finally { - - lock count ; } return null ; }


any comments associated with the element < code > optional string comment = 2 ; < code >

private void clear comment ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 2 ) ; comment = get default instance ( ) get comment ( ) ; }


submit lottery ticket to participate in the lottery

public optional < lottery ticket id > submit ticket ( lottery ticket ticket ) { var player details = ticket get player details ( ) ; var player account = player details get bank account ( ) ; var result = wire transfers transfer funds ( ticket prize , player account , service bank account ) ; if ( ! result ) { notifications ticket submit error ( player details ) ; return optional empty ( ) ; } var optional = repository save ( ticket ) ; if ( optional is present ( ) ) { notifications ticket submitted ( player details ) ; } return optional ; }


returns a hash function implementing the sha - 384 algorithm ( 384 hash bits )

public static hash function sha 3 8 4 ( ) { return sha 3 8 4 holder sha 384 ; }


set the connection to be secure , using the specified keystore and truststore this has to be called before any route mapping is done you have to supply a keystore file , truststore file is optional ( keystore will be reused ) this method is only relevant when using embedded jetty servers it should not be used if you are using servlets , where you will need to secure the connection in the servlet container

public static void secure ( string keystore file , string keystore password , string cert alias , string truststore file , string truststore password ) { get instance ( ) secure ( keystore file , keystore password , cert alias , truststore file , truststore password ) ; }


return the view names ( or name patterns ) that can be handled by this { @ link view resolver }

protected string [ ] get view names ( ) { return this view names ; }


called when the native type is an { @ link float }

t for float ( function < float consumer , grok capture extracter > build extracter ) ;


returns the result bound to the broadcast variable identified by the given { @ code name } important : the broadcast variable data structure is shared between the parallel tasks on one machine any access that modifies its internal state needs to be manually synchronized by the caller

< rt > list < rt > get broadcast variable ( string name ) ;


public queue info [ ] get queues ( ) throws i o exception , interrupted exception { return client get queues ( ) ; }


returns the largest sample timestamp that has been read since the last { @ link # reset }

public final synchronized long get largest read timestamp us ( ) { return max ( largest discarded timestamp us , get largest timestamp ( read position ) ) ; }


perform the lookup based on the service name the returned object will need to be casted into a { @ link service }

public object lookup ( string service name ) { if ( service name equals ( " jndi / service a " ) ) { logger info ( " looking up service a and creating new service for a " ) ; return new service impl ( " jndi / service a " ) ; } else if ( service name equals ( " jndi / service b " ) ) { logger info ( " looking up service b and creating new service for b " ) ; return new service impl ( " jndi / service b " ) ; } else { return null ; } }


sorts the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive in descending order , interpreting them as unsigned 8 - bit integers

public static void sort descending ( byte [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; for ( int i = from index ; i < to index ; i + + ) { array [ i ] ^ = byte max value ; } arrays sort ( array , from index , to index ) ; for ( int i = from index ; i < to index ; i + + ) { array [ i ] ^ = byte max value ; } }


cancel all scheduled tasks this method must be called only when { @ link # in event loop ( ) } is { @ code true }

protected void cancel scheduled tasks ( ) { assert in event loop ( ) ; priority queue < scheduled future task < ? > > scheduled task queue = this scheduled task queue ; if ( is null or empty ( scheduled task queue ) ) { return ; } final scheduled future task < ? > [ ] scheduled tasks = scheduled task queue to array ( new scheduled future task < ? > [ 0 ] ) ; for ( scheduled future task < ? > task : scheduled tasks ) { task cancel without remove ( false ) ; } scheduled task queue clear ignoring indexes ( ) ; }


finds all paths from < code > start < code > to < code > end < code > in the given graph < p > < b > < u > warning : < u > < b > for large , dense graphs ( those with many interconnected vertices ) this algorithm could run indeterminately , possibly causing the jvm to run out of memory < p > you are encouraged to call this method with a monitor that will limit the work to be done , such as the { @ link timeout task monitor }

public static < v , e extends g edge < v > > void find paths ( g directed graph < v , e > g , v start , v end , accumulator < list < v > > accumulator , task monitor monitor ) throws cancelled exception { iterative find paths algorithm < v , e > algo = new iterative find paths algorithm < > ( ) ; algo find paths ( g , start , end , accumulator , monitor ) ; }


public void on remove ( string key ) { data store remove ( key ) ; if ( ! listeners contains key ( key ) ) { return ; } notifier add task ( key , data operation delete ) ; }


public set < string > get all u a m ids ( ) { / / return a clone of the current id set for concurrency reasons , so that the / / returned map won ' t change with the actual map return new hash set < string > ( this unmanaged app master map key set ( ) ) ; }


returns imported package name for the models

public string get import model package name ( ) { return this import model package name ; }


perform whatever is necessary to check and publish this { @ link http resource }

protected abstract void do check and publish ( rest client client , action listener < resource publish result > listener ) ;


public sock js message codec get message codec ( ) { assert state ( this message codec ! = null , " no sock js message codec set " ) ; return this message codec ; }


compute the soname to use for a dynamic library this name is basically the name of the shared library in its final symlinked location

public static string get dynamic library soname ( path fragment library path , boolean preserve name ) { string mangled name ; if ( preserve name ) { mangled name = library path get base name ( ) ; } else { mangled name = " lib " + actions escaped path ( library path get path string ( ) ) ; } return mangled name ; }


public void after properties set ( ) throws exception { if ( this servlet class = = null ) { throw new illegal argument exception ( " ' servlet class ' is required " ) ; } if ( this servlet name = = null ) { this servlet name = this bean name ; } this servlet instance = reflection utils accessible constructor ( this servlet class ) new instance ( ) ; this servlet instance init ( new delegating servlet config ( ) ) ; }


tests that a non existing path throws an exception

public void test replace non existing path ( ) throws exception { final retrievable state storage helper < long > state storage = new testing long state handle helper ( ) ; zoo keeper state handle store < long > store = new zoo keeper state handle store < > ( zookeeper get client ( ) , state storage ) ; store replace ( " / test replace non existing path " , integer resource version value of ( 0 ) , 1l ) ; }


public void un lock ( file target file ) { file lock file = new file ( target file get parent file ( ) get absolute path ( ) concat ( " / lock " ) ) ; if ( ! lock file exists ( ) ) { return ; } if ( this m ref count map contains key ( lock file get absolute path ( ) ) ) { file lock count file lock count = this m ref count map get ( lock file get absolute path ( ) ) ; if ( file lock count ! = null ) { java nio channels file lock file lock = file lock count m file lock ; random access file random access file = file lock count f os ; file channel file channel = file lock count f channel ; try { if ( ref cnt dec ( lock file get absolute path ( ) ) < = 0 ) { if ( file lock ! = null & & file lock is valid ( ) ) { file lock release ( ) ; } if ( random access file ! = null ) { random access file close ( ) ; } if ( file channel ! = null ) { file channel close ( ) ; } } } catch ( i o exception e ) { e print stack trace ( ) ; } } } }


use platform - based toolchain resolution

public void set up ( ) throws exception { overwrite file ( " java / bar / build " , " java library ( " , " name = ' bar ' , " , " srcs = [ ' s java ' ] , " , " data = [ ' robolectric - deps properties ' ] ) " ) ; overwrite file ( " java / bar / foo bzl " , " extra deps = [ ' / / java / bar : bar ' ] " ) ; }


sets the class through which the specified field is accessed

protected void set field class value ( clazz clazz , ref constant ref constant , reference value value ) { / / we don ' t care about the new value }


get the json content of an exported list of { @ link url u r ls } by the service interface , group and version

string get exported u r ls ( string service interface , string group , string version ) ;


for starlark rule classes , returns this rule class ' s rule definition environment ' s label , which is never null is null for native rules ' rule class objects

public label get rule definition environment label ( ) { return rule definition environment label ; }