remove token stats to the owner to token count mapping

private void remove token for owner stats ( token ident id ) { string real owner = get token real owner ( id ) ; if ( token owner stats contains key ( real owner ) ) { / / unlikely to be less than 1 but in case if ( token owner stats get ( real owner ) < = 1 ) { token owner stats remove ( real owner ) ; } else { token owner stats put ( real owner , token owner stats get ( real owner ) - 1 ) ; } } }


builds a version 0 pssh atom for a given system id , containing the given data

public static byte [ ] build pssh atom ( uuid system id , @ nullable byte [ ] data ) { return build pssh atom ( system id , null , data ) ; }


copies the input stream to the writer , while performing variable substitutions the variable substitution processing supports 2 constructs for each key in @ { code substitutions } , any sequence of < code > $ { key } < code > in the input is replaced with the substitution value any line in the input that has the form < code > # if key < code > causes the following block to be output if - only - if key exists with a non - empty value in { @ code substitutions } a block is terminated with { @ code # endif } lines with { @ code # else } are also supported nested blocks are not supported

static void copy with substitutions ( input stream stream , print writer writer , map < string , string > substitutions ) throws i o exception { boolean skip = false ; for ( string line : streams read all lines ( stream ) ) { for ( map entry < string , string > subst : substitutions entry set ( ) ) { line = line replace ( " $ { " + subst get key ( ) + " } " , subst get value ( ) ) ; } if ( line starts with ( " # if " ) ) { final string key = line substring ( 4 ) trim ( ) ; skip = strings is null or empty ( substitutions get ( key ) ) ; continue ; } else if ( line equals ( " # else " ) ) { skip = ! skip ; continue ; } else if ( line equals ( " # endif " ) ) { skip = false ; continue ; } else if ( skip ) { continue ; } writer println ( line ) ; } }


opens a file for reading , and returns an input stream

public input stream get input stream ( string filename ) throws i o exception { return new file input stream ( filename ) ; }


initializes the connection to rmq using the default connection factory from { @ link # setup connection factory ( ) } the user may override this method to setup and configure their own { @ link connection }

protected connection setup connection ( ) throws exception { return setup connection factory ( ) new connection ( ) ; }


archive any log files that are older than the given txid if the edit log is not open for write , then this call returns with no effect

public synchronized void purge logs older than ( final long min tx id to keep ) { / / should not purge logs unless they are open for write / / this prevents the sbn from purging logs on shared storage , for example if ( ! is open for write ( ) ) { return ; } assert cur segment tx id = = hdfs server constants invalid txid | | / / on format this is no - op min tx id to keep < = cur segment tx id : " cannot purge logs older than txid " + min tx id to keep + " when current segment starts at " + cur segment tx id ; if ( min tx id to keep = = 0 ) { return ; } / / this could be improved to not need synchronization but currently , / / journal set is not threadsafe , so we need to synchronize this method try { journal set purge logs older than ( min tx id to keep ) ; } catch ( i o exception ex ) { / / all journals have failed , it will be handled in log sync } }


indicate whether external xml entities are processed when converting to a source default is { @ code false } , meaning that external entities are not resolved note : setting this option to { @ code true } also automatically sets { @ link # set support dtd } to { @ code true }

public void set process external entities ( boolean process external entities ) { this process external entities = process external entities ; if ( process external entities ) { this support dtd = true ; } }


sets the indicator style of this m t config object

public void set indicator style ( final indicator styles indicator style ) { this indicator style = indicator style ; }


removes the external entry point at the given address

public void remove external entry point ( address addr ) { if ( is external entry point ( addr ) ) { remove reference ( address ext from address , addr , code unit mnemonic ) ; external entry point removed ( addr ) ; } }


public void my boolean test ( ) { / / todo : test my boolean }


returns the short cache key for the configuration of the action owner special action owners that are not targets can return any string here if the underlying configuration is null , this should return " null "

public abstract string get configuration checksum ( ) ;


verify that locked ram is released when blocks are evicted from ram disk

public void test release on eviction ( ) throws exception { get cluster builder ( ) set num datanodes ( 1 ) set max locked memory ( block size ) set ram disk replica capacity ( block size * 2 - 1 ) build ( ) ; final string method name = generic test utils get method name ( ) ; final fs dataset impl fsd = ( fs dataset impl ) cluster get data nodes ( ) get ( 0 ) get f s dataset ( ) ; path path 1 = new path ( " / " + method name + " 01 dat " ) ; make test file ( path 1 , block size , true ) ; assert that ( fsd get cache used ( ) , is ( ( long ) block size ) ) ; / / wait until the replica is written to persistent storage wait for metric ( " ram disk blocks lazy persisted " , 1 ) ; / / trigger eviction and verify locked bytes were released fsd evict lazy persist blocks ( long max value ) ; verify ram disk j m x metric ( " ram disk blocks evicted " , 1 ) ; wait for locked bytes used ( fsd , 0 ) ; }


releases the period should not be called directly from application code

void release period ( media period media period ) ;


returns true if the drop operation is ok a drop is deemed to be okay if < ol > < li > the drop target accepts one of the data flavors that the event ' s transferable provides < li > < li > the drop action ( i e copy , move , etc ) is accepted by the target < li > < li > the drop is accepted by the droppable component < li > < ol >

protected boolean is drop ok ( drop target drag event e ) { / / does this target accept the drop action type being dropped on it ? int da = e get drop action ( ) ; if ( ( da & drop actions ) = = 0 ) { return false ; } / / does the event ' s transferable have a flavor that this drop target accepts ? if ( ! is drag flavor supported ( e ) ) { return false ; } / / does the target component allow the drop if ( ! drop component is drop ok ( e ) ) { return false ; } return true ; }


actually find a method with matching parameter type , i e where each argument value is assignable to the corresponding parameter type

protected method do find matching method ( object [ ] arguments ) { type converter converter = get type converter ( ) ; if ( converter ! = null ) { string target method = get target method ( ) ; method matching method = null ; int arg count = arguments length ; class < ? > target class = get target class ( ) ; assert state ( target class ! = null , " no target class set " ) ; method [ ] candidates = reflection utils get all declared methods ( target class ) ; int min type diff weight = integer max value ; object [ ] arguments to use = null ; for ( method candidate : candidates ) { if ( candidate get name ( ) equals ( target method ) ) { / / check if the inspected method has the correct number of parameters int parameter count = candidate get parameter count ( ) ; if ( parameter count = = arg count ) { class < ? > [ ] param types = candidate get parameter types ( ) ; object [ ] converted arguments = new object [ arg count ] ; boolean match = true ; for ( int j = 0 ; j < arg count & & match ; j + + ) { / / verify that the supplied argument is assignable to the method parameter try { converted arguments [ j ] = converter convert if necessary ( arguments [ j ] , param types [ j ] ) ; } catch ( type mismatch exception ex ) { / / ignore - > simply doesn ' t match match = false ; } } if ( match ) { int type diff weight = get type difference weight ( param types , converted arguments ) ; if ( type diff weight < min type diff weight ) { min type diff weight = type diff weight ; matching method = candidate ; arguments to use = converted arguments ; } } } } } if ( matching method ! = null ) { set arguments ( arguments to use ) ; return matching method ; } } return null ; }


public static string format ( double value , int fraction digits ) { return format ( value , false , 1 , fraction digits , true ) ; }


get the last acked offset , which is one greater than the offset of the last record which was acked by the state machine

public synchronized long last acked offset ( ) { return last acked offset ; }


projects a pair of crossed elements to a { @ link tuple } with the previously selected fields

public < t0 , t1 , t2 > project cross < i1 , i2 , tuple 3 < t0 , t1 , t2 > > project tuple 3 ( ) { type information < ? > [ ] f types = extract field types ( field indexes ) ; tuple type info < tuple 3 < t0 , t1 , t2 > > t type = new tuple type info < tuple 3 < t0 , t1 , t2 > > ( f types ) ; return new project cross < i1 , i2 , tuple 3 < t0 , t1 , t2 > > ( this ds 1 , this ds 2 , this field indexes , this is field in first , t type , this , hint ) ; }


establishes a new connection to the given node the connection is not maintained by this service , it ' s the callers responsibility to close the connection once it goes out of scope the action listener will be called on the calling thread or the generic thread pool

public void open connection ( final discovery node node , connection profile connection profile , action listener < transport connection > listener ) { if ( is local node ( node ) ) { listener on response ( local node connection ) ; } else { connection manager open connection ( node , connection profile , listener ) ; } }


void close ( ) throws i o exception { if ( recovery file = = null ) return ; if ( ! read only & & modified & & ! recovery file is read only ( ) ) { save buffer map ( ) ; save free index list ( ) ; recovery file set parameter ( index count parm , index cnt ) ; recovery file set free indexes ( vf index provider get free indexes ( ) ) ; long t = ( new date ( ) ) get time ( ) ; recovery file set parameter ( timestamp hi parm , ( int ) ( t > > > 32 ) ) ; recovery file set parameter ( timestamp low parm , ( int ) ( t & 0xffffffff l ) ) ; recovery file set parameter ( is valid parm , valid ) ; / / mark as valid } recovery file close ( ) ; recovery file = null ; }


create undefined data at a specific address in the program

private data create undefined ( listing listing , memory memory , address addr , int size ) throws code unit insertion exception , data type conflict exception { memory block block = memory get block ( addr ) ; if ( block = = null | | ! block is initialized ( ) ) { return null ; } data type undefined = undefined get undefined data type ( size ) ; return listing create data ( addr , undefined ) ; }


the job has completed , so do following commit job , include : move all committed tasks to the final output dir ( algorithm 1 only ) delete the temporary directory , including all of the work directories create a success file to make it as successful

protected void commit job internal ( job context context ) throws i o exception { if ( has output path ( ) ) { path final output = get output path ( ) ; file system fs = final output get file system ( context get configuration ( ) ) ; if ( algorithm version = = 1 ) { for ( file status stat : get all committed task paths ( context ) ) { merge paths ( fs , stat , final output , context ) ; } } if ( skip cleanup ) { log info ( " skip cleanup the temporary folders under job ' s output " + " directory in commit job " ) ; } else { / / delete the temporary folder and create a success file in the o / p / / folder try { cleanup job ( context ) ; } catch ( i o exception e ) { if ( ignore cleanup failures ) { / / swallow exceptions in cleanup as user configure to make sure / / commit job could be success even when cleanup get failure log error ( " error in cleanup job , manually cleanup is needed " , e ) ; } else { / / throw back exception to fail commit job throw e ; } } } / / true if the job requires output dir marked on successful job / / note that by default it is set to true / / create a success file in the o / p folder if ( context get configuration ( ) get boolean ( successful job output dir marker , true ) ) { path marker path = new path ( output path , succeeded file name ) ; / / if job commit is repeatable and previous / another am could write / / mark file already , we need to set overwritten to be true explicitly / / in case other fs implementations don ' t overwritten by default if ( is commit job repeatable ( context ) ) { fs create ( marker path , true ) close ( ) ; } else { fs create ( marker path ) close ( ) ; } } } else { log warn ( " output path is null in commit job ( ) " ) ; } }


gets the { @ link standard socket options # ip tos } option


{ @ inherit doc } the implementation for { @ link rule tag token } always returns 0


returns the data set that contains the provided entry , or null , if no data set contains this entry

public t get data set for entry ( entry e ) { if ( e = = null ) return null ; for ( int i = 0 ; i < m data sets size ( ) ; i + + ) { t set = m data sets get ( i ) ; for ( int j = 0 ; j < set get entry count ( ) ; j + + ) { if ( e equal to ( set get entry for x value ( e get x ( ) , e get y ( ) ) ) ) return set ; } } return null ; }


returns < code > true < code > iff the { @ link index metadata } for a given index has changed between the previous cluster state and the new cluster state note that this is an object reference equality test , not an equals test

public static boolean index metadata changed ( index metadata metadata 1 , index metadata metadata 2 ) { assert metadata 1 ! = null & & metadata 2 ! = null ; / / no need to check on version , since disco modules will make sure to use the / / same instance if its a version match return metadata 1 ! = metadata 2 ; }


set whether to display the extended stats ( stdev , minmax etc ) or not

public synchronized void set extended ( boolean extended ) { this extended = extended ; }


the test creates 2 electors which try to become active using a real zookeeper server it verifies that 1 becomes active and 1 becomes standby upon becoming active the leader quits election and the test verifies that the standby now becomes active

public void test active standby transition ( ) throws exception { log info ( " starting test with parent dir : " + parent dir ) ; assert false ( electors [ 0 ] parent z node exists ( ) ) ; electors [ 0 ] ensure parent z node ( ) ; assert true ( electors [ 0 ] parent z node exists ( ) ) ; / / first elector joins election , becomes active electors [ 0 ] join election ( app datas [ 0 ] ) ; active standby elector test util wait for active lock data ( null , zk server , parent dir , app datas [ 0 ] ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) become active ( ) ; check fatals and reset ( ) ; / / second elector joins election , becomes standby electors [ 1 ] join election ( app datas [ 1 ] ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) become standby ( ) ; check fatals and reset ( ) ; / / first elector quits , second one should become active electors [ 0 ] quit election ( true ) ; active standby elector test util wait for active lock data ( null , zk server , parent dir , app datas [ 1 ] ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) become active ( ) ; check fatals and reset ( ) ; / / first one rejoins , becomes standby , second one stays active electors [ 0 ] join election ( app datas [ 0 ] ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) become standby ( ) ; check fatals and reset ( ) ; / / second one expires , first one becomes active electors [ 1 ] prevent session reestablishment for tests ( ) ; try { zk server close session ( electors [ 1 ] get z k session id for tests ( ) ) ; active standby elector test util wait for active lock data ( null , zk server , parent dir , app datas [ 0 ] ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) enter neutral mode ( ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) fence old active ( additional matchers ary eq ( app datas [ 1 ] ) ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) become active ( ) ; } finally { electors [ 1 ] allow session reestablishment for tests ( ) ; } / / second one eventually reconnects and becomes standby mockito verify ( cbs [ 1 ] , mockito timeout ( 5000 ) ) become standby ( ) ; check fatals and reset ( ) ; / / first one expires , second one should become active electors [ 0 ] prevent session reestablishment for tests ( ) ; try { zk server close session ( electors [ 0 ] get z k session id for tests ( ) ) ; active standby elector test util wait for active lock data ( null , zk server , parent dir , app datas [ 1 ] ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) enter neutral mode ( ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) fence old active ( additional matchers ary eq ( app datas [ 0 ] ) ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) become active ( ) ; } finally { electors [ 0 ] allow session reestablishment for tests ( ) ; } check fatals and reset ( ) ; }


execute the task sometime in the future , using thread pools

synchronized void execute ( fs volume impl volume , runnable task ) { if ( executors = = null ) { throw new runtime exception ( " async disk service is already shutdown " ) ; } if ( volume = = null ) { throw new runtime exception ( " a null volume does not have a executor " ) ; } thread pool executor executor = executors get ( volume get storage i d ( ) ) ; if ( executor = = null ) { throw new runtime exception ( " cannot find volume " + volume + " for execution of task " + task ) ; } else { executor execute ( task ) ; } }


sets the < tt > reader index < tt > of this buffer

void set reader index ( int reader index ) throws index out of bounds exception ;


this is a best effort automatic test for method forwarding between a delegate and its wrapper , where the wrapper class is a subtype of the delegate this ignores methods that are inherited from object

public static < d , w > void test method forwarding ( class < d > delegate class , function < d , w > wrapper factory ) throws no such method exception , illegal access exception , invocation target exception { test method forwarding ( delegate class , wrapper factory , ( ) - > spy ( delegate class ) , collections empty set ( ) ) ; }


public builder with created ( date created ) { this created = created ; return this ; }


sets the block currently being worked on

public void set block ( basic block block , code address last address ) { this block = block ; this last address = last address ; }


public void set host ( string host ) { this host = host ; }


skips the encryption data for the current sample this is not supported yet for samples specified in the sample table

public void skip sample encryption data ( ) { @ nullable track encryption box encryption box = get encryption box if encrypted ( ) ; if ( encryption box = = null ) { return ; } parsable byte array sample encryption data = fragment sample encryption data ; if ( encryption box per sample iv size ! = 0 ) { sample encryption data skip bytes ( encryption box per sample iv size ) ; } if ( fragment sample has subsample encryption table ( current sample index ) ) { sample encryption data skip bytes ( 6 * sample encryption data read unsigned short ( ) ) ; } }


return the number of records encapsulated in this action ; that is , the number of times { @ code record } was called to produce this action , including the current one


clears all listeners note : this will result in race conditions if { @ link # add timer listener ( com netflix hystrix util hystrix timer timer listener ) } is being concurrently called

public static void reset ( ) { scheduled executor ex = instance executor get and set ( null ) ; if ( ex ! = null & & ex get thread pool ( ) ! = null ) { ex get thread pool ( ) shutdown now ( ) ; } }


populates the task for partition and tasks for topic group maps , and checks that partitions are assigned to exactly one task

private void populate tasks for maps ( final map < topic partition , task id > task for partition , final map < integer , set < task id > > tasks for topic group , final set < string > all source topics , final map < task id , set < topic partition > > partitions for task , final cluster full metadata ) { / / check if all partitions are assigned , and there are no duplicates of partitions in multiple tasks final set < topic partition > all assigned partitions = new hash set < > ( ) ; for ( final map entry < task id , set < topic partition > > entry : partitions for task entry set ( ) ) { final task id id = entry get key ( ) ; final set < topic partition > partitions = entry get value ( ) ; for ( final topic partition partition : partitions ) { task for partition put ( partition , id ) ; if ( all assigned partitions contains ( partition ) ) { log warn ( " partition { } is assigned to more than one tasks : { } " , partition , partitions for task ) ; } } all assigned partitions add all ( partitions ) ; tasks for topic group compute if absent ( id topic group id , k - > new hash set < > ( ) ) add ( id ) ; } check all partitions ( all source topics , partitions for task , all assigned partitions , full metadata ) ; }


returns pet inventories by status returns a map of status codes to quantities

public map < string , integer > get inventory ( ) throws api exception , processing exception ;


is delegated client authorized for boolean

public boolean is delegated client authorized for ( final string client name , final service service ) { if ( service = = null | | string utils is blank ( service get id ( ) ) ) { logger debug ( " can not evaluate delegated authentication policy without a service " ) ; return true ; } if ( string utils is blank ( client name ) ) { logger debug ( " no client is provided to enforce authorization for delegated authentication sso session " + " may have been established without delegated authentication " ) ; return true ; } val registered service = this services manager find service by ( service ) ; if ( registered service = = null | | ! registered service get access strategy ( ) is service access allowed ( ) ) { logger warn ( " service access for [ { } ] is denied " , registered service ) ; return false ; } logger trace ( " located registered service definition [ { } ] matching [ { } ] " , registered service , service ) ; val context = auditable context builder ( ) registered service ( registered service ) properties ( collection utils wrap ( client class get simple name ( ) , client name ) ) build ( ) ; val result = delegated authentication policy enforcer execute ( context ) ; if ( ! result is execution failure ( ) ) { logger debug ( " delegated authentication policy for [ { } ] allows for using client [ { } ] " , registered service , client name ) ; return true ; } logger warn ( " delegated authentication policy for [ { } ] refuses access to client [ { } ] " , registered service get service id ( ) , client name ) ; return false ; }


returns whether the state created from this descriptor is queryable

public boolean is queryable ( ) { return queryable state name ! = null ; }


public synchronized type id item intern ( type type ) { if ( type = = null ) { throw new null pointer exception ( " type = = null " ) ; } throw if prepared ( ) ; type id item result = type ids get ( type ) ; if ( result = = null ) { result = new type id item ( new cst type ( type ) ) ; type ids put ( type , result ) ; } return result ; }


assert that the target bean class is an instance of the class where the given method is declared in some cases the actual endpoint instance at request - processing time may be a jdk dynamic proxy ( lazy initialization , prototype beans , and others ) endpoint classes that require proxying should prefer class - based proxy mechanisms

protected void assert target bean ( method method , object target bean , object [ ] args ) { class < ? > method declaring class = method get declaring class ( ) ; class < ? > target bean class = target bean get class ( ) ; if ( ! method declaring class is assignable from ( target bean class ) ) { string text = " the mapped handler method class ' " + method declaring class get name ( ) + " ' is not an instance of the actual endpoint bean class ' " + target bean class get name ( ) + " ' if the endpoint requires proxying " + " ( e g due to @ transactional ) , please use class - based proxying " ; throw new illegal state exception ( format invoke error ( text , args ) ) ; } }


set the group path object in the given node

void set group path ( program node node ) { tree node [ ] pnodes = node get path ( ) ; string [ ] names = new string [ pnodes length ] ; for ( int i = 0 ; i < pnodes length ; i + + ) { program node n = ( program node ) pnodes [ i ] ; names [ i ] = n to string ( ) ; } node set group path ( new group path ( names ) ) ; }


populates index data structures should only be called at initialization times

void init existing ( ) throws i o exception { log info ( " initializing existing jobs " ) ; list < file status > timestamped dir list = find timestamped directories ( ) ; / / sort first just so insertion is in a consistent order collections sort ( timestamped dir list ) ; log info ( " found " + timestamped dir list size ( ) + " directories to load " ) ; for ( file status fs : timestamped dir list ) { / / todo could verify the correct format for these directories add directory to serial number index ( fs get path ( ) ) ; } final double max cache size = ( double ) job list cache max size ; int prev cache size = job list cache size ( ) ; for ( int i = timestamped dir list size ( ) - 1 ; i > = 0 & & ! job list cache is full ( ) ; i - - ) { file status fs = timestamped dir list get ( i ) ; add directory to job list cache ( fs get path ( ) ) ; int curr cache size = job list cache size ( ) ; if ( ( curr cache size - prev cache size ) / max cache size > = 0 05 ) { log info ( curr cache size * 100 0 / max cache size + " % of cache is loaded " ) ; } prev cache size = curr cache size ; } final double loaded percent = max cache size = = 0 0 ? 100 : prev cache size * 100 0 / max cache size ; log info ( " existing job initialization finished " + loaded percent + " % of cache is occupied " ) ; }


find the hierarchy of the subsystem the kernel ensures that a subsystem can only be part of a single hierarchy the subsystem can be part of multiple mount points , if they belong to the same hierarchy

static string find controller in mtab ( string controller , map < string , set < string > > entries ) { for ( map entry < string , set < string > > e : entries entry set ( ) ) { if ( e get value ( ) contains ( controller ) ) { if ( new file ( e get key ( ) ) can read ( ) ) { return e get key ( ) ; } else { log warn ( string format ( " skipping inaccessible cgroup mount point % s " , e get key ( ) ) ) ; } } } return null ; }


verify the given ongoing verification data , and confirm that it satisfies the delegate verification mode before the full duration has passed in practice , this polls the delegate verification mode until it is satisfied if it is not satisfied once the full duration has passed , the last error returned by the delegate verification mode will be thrown here in turn this may be thrown early if the delegate is unsatisfied and the verification mode is known to never recover from this situation ( e g { @ link at most } ) if it is satisfied before the full duration has passed , behaviour is dependent on the return on success parameter given in the constructor if true , this verification mode is immediately satisfied once the delegate is if false , this verification mode is not satisfied until the delegate is satisfied and the full time has passed

public void verify ( verification data data ) { assertion error error = null ; timer start ( ) ; while ( timer is counting ( ) ) { try { delegate verify ( data ) ; if ( return on success ) { return ; } else { error = null ; } } catch ( mockito assertion error e ) { error = handle verify exception ( e ) ; } catch ( assertion error e ) { error = handle verify exception ( e ) ; } } if ( error ! = null ) { throw error ; } }


public static data source pool properties build ( environment environment ) { data source pool properties result = new data source pool properties ( ) ; binder get ( environment ) bind ( " db pool config " , bindable of instance ( result get data source ( ) ) ) ; return result ; }


this method is called for each joined pair of elements it can output zero or more elements through the provided { @ link collector } and has access to the timestamps of the joined elements and the result through the { @ link context }

public abstract void process element ( in1 left , in2 right , context ctx , collector < out > out ) throws exception ;


perform a binary search to locate the specified key and derive an index into the buffer id storage this method is intended to locate the child node which contains the specified key the returned index corresponds to a child ' s stored buffernode id and may correspond to another interior node or a leaf record node each stored key within this interior node effectively identifies the maximum key contained within the corresponding child node

int get id index ( long key ) { int min = 1 ; int max = key count - 1 ; while ( min < = max ) { int i = ( min + max ) / 2 ; long k = get key ( i ) ; if ( k = = key ) { return i ; } else if ( k < key ) { min = i + 1 ; } else { max = i - 1 ; } } return max ; }


provides notifiication when a model is removed

public void model removed ( string mode name , int model type ) ;


returns an unmodifiable < b > view < b > of the intersection of two sets the returned set contains all elements that are contained by both backing sets the iteration order of the returned set matches that of { @ code set 1 } results are undefined if { @ code set 1 } and { @ code set 2 } are sets based on different equivalence relations ( as { @ code hash set } , { @ code tree set } , and the key set of an { @ code identity hash map } all are ) < b > note : < b > the returned view performs slightly better when { @ code set 1 } is the smaller of the two sets if you have reason to believe one of your sets will generally be smaller than the other , pass it first unfortunately , since this method sets the generic type of the returned set based on the type of the first set passed , this could in rare cases force you to make a cast , for example : { @ code set < object > a few bad objects = set < string > many bad strings = impossible for a non - string to be in the intersection suppress warnings ( " unchecked " ) set < string > bad strings = ( set ) sets intersection ( a few bad objects , many bad strings ) ; } this is unfortunate , but should come up only very rarely

public static < e > set view < e > intersection ( final set < e > set 1 , final set < ? > set 2 ) { check not null ( set 1 , " set 1 " ) ; check not null ( set 2 , " set 2 " ) ; return new set view < e > ( ) { @ override public unmodifiable iterator < e > iterator ( ) { return new abstract iterator < e > ( ) { final iterator < e > itr = set 1 iterator ( ) ; @ override protected e compute next ( ) { while ( itr has next ( ) ) { e e = itr next ( ) ; if ( set 2 contains ( e ) ) { return e ; } } return end of data ( ) ; } } ; } @ override public stream < e > stream ( ) { return set 1 stream ( ) filter ( set 2 : : contains ) ; } @ override public stream < e > parallel stream ( ) { return set 1 parallel stream ( ) filter ( set 2 : : contains ) ; } @ override public int size ( ) { int size = 0 ; for ( e e : set 1 ) { if ( set 2 contains ( e ) ) { size + + ; } } return size ; } @ override public boolean is empty ( ) { return collections disjoint ( set 2 , set 1 ) ; } @ override public boolean contains ( object object ) { return set 1 contains ( object ) & & set 2 contains ( object ) ; } @ override public boolean contains all ( collection < ? > collection ) { return set 1 contains all ( collection ) & & set 2 contains all ( collection ) ; } } ; }


execute work as part of a test , after creating the job after the execution , { @ link # abort job quietly ( job data ) } is called for abortcleanup

protected void execute work ( string name , action to test action ) throws exception { execute work ( name , start job ( false ) , action ) ; }


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


reads the bootstrap methods attribute to compute the offset of each bootstrap method

private int [ ] read bootstrap methods attribute ( final int max string length ) { char [ ] char buffer = new char [ max string length ] ; int current attribute offset = get first attribute offset ( ) ; int [ ] current bootstrap method offsets = null ; for ( int i = read unsigned short ( current attribute offset - 2 ) ; i > 0 ; - - i ) { / / read the attribute info ' s attribute name and attribute length fields string attribute name = read u t f 8 ( current attribute offset , char buffer ) ; int attribute length = read int ( current attribute offset + 2 ) ; current attribute offset + = 6 ; if ( constants bootstrap methods equals ( attribute name ) ) { / / read the num bootstrap methods field and create an array of this size current bootstrap method offsets = new int [ read unsigned short ( current attribute offset ) ] ; / / compute and store the offset of each ' bootstrap methods ' array field entry int current bootstrap method offset = current attribute offset + 2 ; for ( int j = 0 ; j < current bootstrap method offsets length ; + + j ) { current bootstrap method offsets [ j ] = current bootstrap method offset ; / / skip the bootstrap method ref and num bootstrap arguments fields ( 2 bytes each ) , / / as well as the bootstrap arguments array field ( of size num bootstrap arguments * 2 ) current bootstrap method offset + = 4 + read unsigned short ( current bootstrap method offset + 2 ) * 2 ; } return current bootstrap method offsets ; } current attribute offset + = attribute length ; } throw new illegal argument exception ( ) ; }


returns { @ code true } if the rows are equal to each other and { @ code false } otherwise

boolean equals ( row data row 1 , row data row 2 ) ;


returns { @ code true } if the bit field for pp2 client cert conn was set

public boolean is p p 2 client cert conn ( ) { return ( client bit field & 0x 2 ) ! = 0 ; }


get the value of the ' { @ code accesskey } ' attribute

protected string get accesskey ( ) { return this accesskey ; }


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 static void scal ( double a , double [ ] x ) { f2j blas dscal ( x length , a , x , 1 ) ; }


get a { @ link reader } that corresponds to a specified column index from { @ link result set }

public reader get nullable result ( result set rs , int column index ) throws s q l exception { return to reader ( rs get clob ( column index ) ) ; }


tests that the { @ link actor system } fails with an expressive exception if it cannot be instantiated due to an occupied port

public void test actor system instantiation failure when port occupied ( ) throws exception { final server socket port occupier = new server socket ( 0 , 10 , inet address get by name ( " 0 0 0 0 " ) ) ; try { final int port = port occupier get local port ( ) ; bootstrap tools start remote actor system ( new configuration ( ) , " 0 0 0 0 " , string value of ( port ) , log ) ; fail ( " expected to fail with a bind exception " ) ; } catch ( exception e ) { assert that ( exception utils find throwable ( e , bind exception class ) is present ( ) , is ( true ) ) ; } finally { port occupier close ( ) ; } }


perform a lookup on the given method and return associated metadata , if any


test that a command that times out will still be cached and when retrieved will re - throw the exception

public void test request cache with command timeout ( ) { concurrent linked queue < hystrix command < list < string > > > commands = new concurrent linked queue < hystrix command < list < string > > > ( ) ; final test collapser timer timer = new test collapser timer ( ) ; successful cacheable collapsed command command 1 = new successful cacheable collapsed command ( timer , " timeout " , true , commands ) ; successful cacheable collapsed command command 2 = new successful cacheable collapsed command ( timer , " timeout " , true , commands ) ; future < string > f 1 = command 1 queue ( ) ; future < string > f 2 = command 2 queue ( ) ; / / increment past batch time so it executes timer increment time ( 15 ) ; try { assert equals ( " a " , f 1 get ( 1000 , time unit milliseconds ) ) ; assert equals ( " a " , f 2 get ( 1000 , time unit milliseconds ) ) ; fail ( " exception should have been thrown " ) ; } catch ( exception e ) { / / expected } / / it should have executed 1 command assert equals ( 1 , commands size ( ) ) ; assert true ( commands peek ( ) get execution events ( ) contains ( hystrix event type timeout ) ) ; assert true ( commands peek ( ) get execution events ( ) contains ( hystrix event type collapsed ) ) ; future < string > f 3 = command 1 queue ( ) ; / / increment past batch time so it executes timer increment time ( 15 ) ; try { assert equals ( " a " , f 3 get ( 1000 , time unit milliseconds ) ) ; fail ( " exception should have been thrown " ) ; } catch ( exception e ) { / / expected } / / it should still be 1 no new executions assert equals ( 1 , commands size ( ) ) ; assert equals ( 1 , hystrix request log get current request ( ) get all executed commands ( ) size ( ) ) ; iterator < hystrix invokable info < ? > > cmd iterator = hystrix request log get current request ( ) get all executed commands ( ) iterator ( ) ; assert equals ( 1 , cmd iterator next ( ) get number collapsed ( ) ) ; }


returns whether it ' s possible to read the next sample

private boolean may read sample ( int relative read index ) { return current drm session = = null | | current drm session get state ( ) = = drm session state opened with keys | | ( ( flags [ relative read index ] & c buffer flag encrypted ) = = 0 & & current drm session play clear samples without keys ( ) ) ; }


public string get location ( ) { return location ; }


given the id of a state document it extracts the job id

public static string extract job id ( string doc id ) { int suffix index = doc id last index of ( " " + type + " " ) ; return suffix index < = 0 ? v 5 4 extract job id ( doc id ) : doc id substring ( 0 , suffix index ) ; }


test serialization of object with outer number type < b > 200 < b > - output composite

public response entity < outer composite > fake outer composite serialize with http info ( outer composite body ) throws rest client exception { object post body = body ; string path = api client expand path ( " / fake / outer / composite " , collections < string , object > empty map ( ) ) ; final multi value map < string , string > query params = new linked multi value map < string , string > ( ) ; final http headers header params = new http headers ( ) ; final multi value map < string , string > cookie params = new linked multi value map < string , string > ( ) ; final multi value map < string , object > form params = new linked multi value map < string , object > ( ) ; final string [ ] local var accepts = { " * / * " } ; final list < media type > local var accept = api client select header accept ( local var accepts ) ; final string [ ] content types = { } ; final media type content type = api client select header content type ( content types ) ; string [ ] auth names = new string [ ] { } ; parameterized type reference < outer composite > return type = new parameterized type reference < outer composite > ( ) { } ; return api client invoke a p i ( path , http method post , query params , post body , header params , cookie params , form params , local var accept , content type , auth names , return type ) ; }


set the given property , if it is currently unset

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


public static void toggle full screen ( @ non null final activity activity ) { boolean is full screen = is full screen ( activity ) ; window window = activity get window ( ) ; if ( is full screen ) { window clear flags ( window manager layout params flag fullscreen ) ; } else { window add flags ( window manager layout params flag fullscreen ) ; } }


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


converts the policy into a byte array representation in the input { @ link byte buffer }

public byte buffer to byte buffer ( ) throws federation policy initialization exception { if ( jsonjaxb context = = null ) { throw new federation policy initialization exception ( " j s o n j a x b context should " + " not be null " ) ; } try { string s = to j s o n string ( ) ; return byte buffer wrap ( s get bytes ( standard charsets utf 8 ) ) ; } catch ( j a x b exception j ) { throw new federation policy initialization exception ( j ) ; } }


public static void stub get bitmap ( drawable drawable ) { if ( ! ( drawable instanceof bitmap drawable ) ) { return ; } bitmap drawable bitmap drawable = ( bitmap drawable ) drawable ; final bitmap bitmap = mock ( bitmap class ) ; when ( bitmap drawable get bitmap ( ) ) then return ( bitmap ) ; }


post usercreate with list : creates list of users with given input array

default response entity < void > create users with list input ( @ api param ( value = " list of user object " , required = true ) @ valid @ request body list < user > body ) { return new response entity < > ( http status not implemented ) ; }


schedules the specified { @ link timer task } for one - time execution after the specified delay

timeout new timeout ( timer task task , long delay , time unit unit ) ;


processing when receiving the address list

list < url > notify ( list < url > addresses , url consumer url , directory registry directory ) ;


public static histogram builder histogram ( meter id meter id ) { return new histogram builder ( meter id ) ; }


create or reuse a bt triangle index vertex array instance based on the specified { @ link mesh part } array use { @ link # release ( ) } to release the mesh when it ' s no longer needed

public static < t extends mesh part > bt triangle index vertex array obtain ( final array < t > mesh parts ) { bt triangle index vertex array result = get instance ( mesh parts ) ; if ( result = = null ) { result = new bt triangle index vertex array ( mesh parts ) ; instances add ( result ) ; } result obtain ( ) ; return result ; }


similar to { @ link # get ( long , java util concurrent time unit ) } , just catching the { @ link interrupted exception } and throwing an { @ link illegal state exception } instead also catches { @ link java util concurrent execution exception } and throws the actual cause instead


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


discover the vendor ' s fpga devices with execution time constraint

list < fpga device > discover ( int timeout ) ;


public boolean is active ( ) { return body is active ( ) ; }


public static string to json ( @ non null final gson gson , final object src , @ non null final type type of src ) { return gson to json ( src , type of src ) ; }


reentrant if { @ code instance } was registered for injection at injector - creation time , this method will ensure that all its members have been injected before returning

public t get ( errors errors ) throws errors exception { if ( ready get count ( ) = = 0 ) { return instance ; } / / just wait for everything to be injected by another thread if ( thread current thread ( ) ! = creating thread ) { try { ready await ( ) ; return instance ; } catch ( interrupted exception e ) { / / give up , since we don ' t know if our injection is ready throw new runtime exception ( e ) ; } } / / to inject needs injection , do it right away we only do this once , even if it fails if ( pending injection remove ( instance ) ! = null ) { members injector inject and notify ( instance , errors with source ( source ) ) ; } return instance ; }


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


html page for tracking one queue or job use d 3 js

private void print page track ( http servlet request request , http servlet response response , int timeunit , string timeunit label ) throws i o exception { response set content type ( " text / html " ) ; response set status ( http servlet response sc ok ) ; / / tracked queues { 0 } string builder tracked queue info = new string builder ( ) ; set < string > tracked queues = wrapper get tracker ( ) get queue set ( ) ; for ( string queue : tracked queues ) { tracked queue info append ( " < option value = ' queue " ) append ( queue ) append ( " ' > " ) append ( queue ) append ( " < / option > " ) ; } / / tracked apps { 1 } string builder tracked app info = new string builder ( ) ; set < string > tracked apps = wrapper get tracker ( ) get tracked app set ( ) ; for ( string job : tracked apps ) { tracked app info append ( " < option value = ' job " ) append ( job ) append ( " ' > " ) append ( job ) append ( " < / option > " ) ; } / / timeunit label { 2 } / / time unit { 3 } / / ajax update time { 4 } / / final html string track info = message format format ( track template , tracked queue info to string ( ) , tracked app info to string ( ) , timeunit label , " " + timeunit , " " + ajax update time m s ) ; response get writer ( ) println ( track info ) ; ( ( request ) request ) set handled ( true ) ; }


assert that the no of partitions written matches expectations

protected void assert partitions written ( string action , f s data output stream out , long expected ) { output stream native stream = out get wrapped stream ( ) ; int written = get partitions written ( out ) ; if ( written ! = expected ) { assert fail ( action + " : " + test swift file system partitioned uploads wrong partition count + " + expected : " + expected + " actual : " + written + " - - " + native stream ) ; } }


returns libraries that should be passed to the linker

private immutable list < string > library names ( objc provider objc provider ) { immutable list builder < string > args = new immutable list builder < > ( ) ; for ( string dylib : objc provider get ( sdk dylib ) to list ( ) ) { if ( dylib starts with ( " lib " ) ) { / / remove lib prefix if it exists which is standard / / for libraries ( libxml dylib - > - lxml ) dylib = dylib substring ( 3 ) ; } args add ( dylib ) ; } return args build ( ) ; }


returns the address set , which contains the address for the comment

public address set get address set ( object obj , program program ) { address set addrs = new address set ( ) ; if ( obj = = null ) { return addrs ; } address addr = ( address ) obj ; addrs add range ( addr , addr ) ; return addrs ; }


make a clean target source available if code wants to use it the target must be set verification will be automatic in tear down to ensure that it was used appropriately by code

public void set up ( ) { mock target source reset ( ) ; }


get the list of { @ link function bit pattern info } objects for the program ( one object per function )

public list < function bit pattern info > get func bit pattern info ( ) { return func bit pattern info ; }


returns the appropriate { @ code conv } rop for the given types the result is a shared instance

public static rop op conv ( type bearer dest , type bearer source ) { int dbt = dest get basic frame type ( ) ; switch ( source get basic frame type ( ) ) { case type bt int : { switch ( dbt ) { case type bt long : return conv i2l ; case type bt float : return conv i2f ; case type bt double : return conv i2d ; default : break ; } } case type bt long : { switch ( dbt ) { case type bt int : return conv l2i ; case type bt float : return conv l2f ; case type bt double : return conv l2d ; default : break ; } } case type bt float : { switch ( dbt ) { case type bt int : return conv f2i ; case type bt long : return conv f2l ; case type bt double : return conv f2d ; default : break ; } } case type bt double : { switch ( dbt ) { case type bt int : return conv d2i ; case type bt long : return conv d2l ; case type bt float : return conv d2f ; default : break ; } } } return throw bad types ( std type list make ( dest get type ( ) , source get type ( ) ) ) ; }


returns the options contained in this collection

public collection < fragment options > get native options ( ) { return fragment options map values ( ) ; }


set the instance that matches the one of child schema , check the instance parameter is valid against the one of child schemas : equilateral triangle , isosceles triangle , scalene triangle it could be an instance of the ' one of ' schemas the one of child schemas may themselves be a composed schema ( all of , any of , one of )

public void set actual instance ( object instance ) { if ( json is instance of ( equilateral triangle class , instance , new hash set < class < ? > > ( ) ) ) { super set actual instance ( instance ) ; return ; } if ( json is instance of ( isosceles triangle class , instance , new hash set < class < ? > > ( ) ) ) { super set actual instance ( instance ) ; return ; } if ( json is instance of ( scalene triangle class , instance , new hash set < class < ? > > ( ) ) ) { super set actual instance ( instance ) ; return ; } throw new runtime exception ( " invalid instance type must be equilateral triangle , isosceles triangle , scalene triangle " ) ; }


helper for asserting tls info in s s l session { @ link io grpc server call # get attributes ( ) }

protected void assert x 5 0 0 subject dn ( string tls info ) { test service grpc test service blocking stub stub = blocking stub with deadline after ( 5 , time unit seconds ) ; stub unary call ( simple request get default instance ( ) ) ; list < certificate > certificates ; s s l session ssl session = server call capture get ( ) get attributes ( ) get ( grpc transport attr ssl session ) ; try { certificates = arrays as list ( ssl session get peer certificates ( ) ) ; } catch ( s s l peer unverified exception e ) { / / should never happen throw new assertion error ( e ) ; } x 5 0 9 certificate x 5 0 9cert = ( x 5 0 9 certificate ) certificates get ( 0 ) ; assert equals ( 1 , certificates size ( ) ) ; assert equals ( tls info , x 5 0 9cert get subject d n ( ) to string ( ) ) ; }


returns a future that completes when the in - flight requests that were registered prior to calling this method are deregistered

public completable future < void > await async ( ) { phaser arrive and deregister ( ) ; return termination future ; }


set the password that this factory should use to access the remote service default is none the password will be sent by hessian via http basic authentication

public void set password ( string password ) { this proxy factory set password ( password ) ; }


search for the register which has the specified address among register keys contained with in the reg index map

private register get register ( address addr , map < register , integer > reg index map ) { for ( register reg : reg index map key set ( ) ) { if ( reg get address ( ) equals ( addr ) ) { return reg ; } } return null ; }


protected void init typed writers ( ) { this typed writers clear ( ) ; if ( ! this register defaults ) { return ; } this typed writers add all ( get base typed writers ( ) ) ; extend typed writers ( this typed writers ) ; }


returns whether skipping silences in the audio stream is enabled


writes any remaining bits to the output { @ link byte buf } , zero padding to a whole byte as required

void flush ( byte buf out ) { final int bit count = this bit count ; if ( bit count > 0 ) { final long bit buffer = this bit buffer ; final int shift to right = 64 - bit count ; if ( bit count < = 8 ) { out write byte ( ( int ) ( bit buffer > > > shift to right < < 8 - bit count ) ) ; } else if ( bit count < = 16 ) { out write short ( ( int ) ( bit buffer > > > shift to right < < 16 - bit count ) ) ; } else if ( bit count < = 24 ) { out write medium ( ( int ) ( bit buffer > > > shift to right < < 24 - bit count ) ) ; } else { out write int ( ( int ) ( bit buffer > > > shift to right < < 32 - bit count ) ) ; } } }


return the qualified name of the given method , consisting of fully qualified interfaceclass name + " " + method name

public static string get qualified method name ( method method , @ nullable class < ? > clazz ) { assert not null ( method , " method must not be null " ) ; return ( clazz ! = null ? clazz : method get declaring class ( ) ) get name ( ) + ' ' + method get name ( ) ; }


adds the deprecated key to the global deprecation map it does not override any existing entries in the deprecation map this is to be used only by the developers in order to add deprecation of keys , and attempts to call this method after loading resources once , would lead to < tt > unsupported operation exception < tt > if you have multiple deprecation entries to add , it is more efficient to use # add deprecations ( deprecation delta [ ] deltas ) instead

public static void add deprecation ( string key , string new key , string custom message ) { add deprecation ( key , new string [ ] { new key } , custom message ) ; }


returns 1 if { @ code x < y } as unsigned integers , and 0 otherwise assumes that x - y fits into a signed int the implementation is branch - free , and benchmarks suggest it is measurably ( if narrowly ) faster than the straightforward ternary expression

static int less than branch free ( int x , int y ) { / / the double negation is optimized away by normal java , but is necessary for gwt / / to make sure bit twiddling works as expected return ~ ~ ( x - y ) > > > ( integer size - 1 ) ; }


publish the specified sequence this action marks this particular message as being available to be read

public void publish ( long sequence ) { sequencer publish ( sequence ) ; }


get the process id of the c + + process whose log messages are being read this will arrive in the first log message logged by the c + + process they all log their version number immediately on startup so it should not take long to arrive , but will not be available instantly after the process starts

public long get pid ( duration timeout ) throws timeout exception { / / there ' s an assumption here that 0 is not a valid pid this is certainly true for / / userland processes on windows the " system idle process " has pid 0 and on * nix / / pid 0 is for " sched " , which is part of the kernel if ( pid = = 0 ) { try { pid latch await ( timeout to millis ( ) , time unit milliseconds ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; } if ( pid = = 0 ) { throw new timeout exception ( " timed out waiting for c + + process pid " ) ; } } return pid ; }


updates the named field of x as if by the starlark statement { @ code x field = value }

static void set field ( object x , string field , object value ) throws eval exception { if ( x instanceof structure ) { ( ( structure ) x ) set field ( field , value ) ; } else { throw starlark errorf ( " cannot set % s field of % s value " , field , starlark type ( x ) ) ; } }


each value of the attributes table must be an attribute structure a code attribute can have any number of optional attributes associated with it the only attributes defined by this specification as appearing in the attributes table of a code attribute are the line number table , local variable table , local variable type table , and stack map table attributes if a java virtual machine implementation recognizes class files whose version number is 50 0 or above , it must recognize and correctly read stack map table attributes found in the attributes table of a code attribute of a class file whose version number is 50 0 or above a java virtual machine implementation is required to silently ignore any or all attributes in the attributes table of a code attribute that it does not recognize attributes not defined in this specification are not allowed to affect the semantics of the class file , but only to provide additional descriptive information

public abstract attribute info [ ] get attributes ( ) { return attributes ; }


get the address set which makes up a function

synchronized address set view get body ( long function key ) { address set body = new address set ( ) ; index range iterator iter = range map get value range iterator ( function key ) ; while ( iter has next ( ) ) { index range range = iter next ( ) ; body add range ( addr map decode address ( range get start ( ) ) , addr map decode address ( range get end ( ) ) ) ; } return body ; } / / / * * / / * get the function key for the first function containing the specified address / / * @ param addr / / * @ return function key / / * @ throws not found exception if no function exists for the addr specified / / * / / / synchronized long get first function containing ( address addr ) throws not found exception { / / long index = addr map get key ( addr , false ) ; / / iterator < field > iter = range map get value iterator ( index , index ) ; / / if ( ! iter has next ( ) ) { / / throw new not found exception ( ) ; / / } / / return ( ( long field ) iter next ( ) ) get long value ( ) ; / / } / / / / / * * / / * get all function keys whoose body contains the specified address / / * @ param addr / / * @ return a long field function key iterator / / * / / / synchronized iterator < field > get functions containing ( address addr ) { / / long index = addr map get key ( addr , false ) ; / / return range map get value iterator ( index , index ) ; / / } / / / /


gets a list of all component ids in this topology

public set < string > get component ids ( ) { return thrift topology utils get component ids ( get raw topology ( ) ) ; }


adds { @ code node } if it is not already present < b > nodes must be unique < b > , just as { @ code map } keys must be they must also be non - null


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


get the path to use for this nested aggregation

public string path ( ) { return path ; }


if a returning variable was specified and there is only one choice remaining , bind it

private void maybe bind returning variable ( ) { if ( this number of remaining unbound arguments = = 0 ) { throw new illegal state exception ( " algorithm assumes that there must be at least one unbound parameter on entry to this method " ) ; } if ( this returning name ! = null ) { if ( this number of remaining unbound arguments > 1 ) { throw new ambiguous binding exception ( " binding of returning parameter ' " + this returning name + " ' is ambiguous , there are " + this number of remaining unbound arguments + " candidates " ) ; } / / we ' re all set find the unbound parameter , and bind it for ( int i = 0 ; i < this parameter name bindings length ; i + + ) { if ( this parameter name bindings [ i ] = = null ) { bind parameter name ( i , this returning name ) ; break ; } } } }


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


adds a new { @ link lifecycle listener } to the application this can be used by extensions to hook into the lifecycle more easily the { @ link application listener } methods are sufficient for application level development

public void add lifecycle listener ( lifecycle listener listener ) ;


test restoring from an legacy empty state , when no partitions could be found for topics

public void test restore from empty state no partitions ( ) throws exception { final dummy flink kafka consumer < string > consumer function = new dummy flink kafka consumer < > ( collections singleton list ( " dummy - topic " ) , collections < kafka topic partition > empty list ( ) , flink kafka consumer base partition discovery disabled ) ; stream source < string , dummy flink kafka consumer < string > > consumer operator = new stream source < > ( consumer function ) ; final abstract stream operator test harness < string > test harness = new abstract stream operator test harness < > ( consumer operator , 1 , 1 , 0 ) ; test harness set time characteristic ( time characteristic processing time ) ; test harness setup ( ) ; / / restore state from binary snapshot file test harness initialize state ( operator snapshot util get resource filename ( " kafka - consumer - migration - test - flink " + test migrate version + " - empty - state - snapshot " ) ) ; test harness open ( ) ; / / assert that no partitions were found and is empty assert true ( consumer function get subscribed partitions to start offsets ( ) ! = null ) ; assert true ( consumer function get subscribed partitions to start offsets ( ) is empty ( ) ) ; / / assert that no state was restored assert true ( consumer function get restored state ( ) is empty ( ) ) ; consumer operator close ( ) ; consumer operator cancel ( ) ; }


locates the next sample start , advancing the position to the byte that immediately follows identifier if a sample was not located , the position is advanced to the limit

private void find next sample ( parsable byte array pes buffer ) { byte [ ] adts data = pes buffer get data ( ) ; int position = pes buffer get position ( ) ; int end offset = pes buffer limit ( ) ; while ( position < end offset ) { int data = adts data [ position + + ] & 0x f f ; if ( match state = = match state ff & & is adts sync bytes ( ( byte ) 0x f f , ( byte ) data ) ) { if ( found first frame | | check sync position valid ( pes buffer , / * sync position candidate = * / position - 2 ) ) { current frame version = ( data & 0x 8 ) > > 3 ; has crc = ( data & 0x 1 ) = = 0 ; if ( ! found first frame ) { set checking adts header state ( ) ; } else { set reading adts header state ( ) ; } pes buffer set position ( position ) ; return ; } } switch ( match state | data ) { case match state start | 0x f f : match state = match state ff ; break ; case match state start | ' i ' : match state = match state i ; break ; case match state i | ' d ' : match state = match state id ; break ; case match state id | ' 3 ' : set reading id 3 header state ( ) ; pes buffer set position ( position ) ; return ; default : if ( match state ! = match state start ) { / / if matching fails in a later state , revert to match state start and / / check this byte again match state = match state start ; position - - ; } break ; } } pes buffer set position ( position ) ; }


populates a cache entry if the cache entry for given key already exists , the value will be replaced to the new value


all tests run as a an administrative user but use < code > es - security - runas - user < code > to become a less privileged user

protected settings rest client settings ( ) { string token = basic auth header value ( user , new secure string ( pass to char array ( ) ) ) ; return settings builder ( ) put ( thread context prefix + " authorization " , token ) put ( certificate authorities , http certificate authority ) build ( ) ; }


gets the label for the given special - purpose block the given label should be one of the static constants defined by this class

private int get special label ( int label ) { / * * the label is bitwise - complemented so that mistakes where * label is used instead of get special label ( label ) cause a * failure at block construction time , since negative labels * are illegal 0 max label ( exclusive ) are the original blocks and * max label ( max label + method get catches ( ) size ( ) ) are reserved for exception handler * setup blocks ( see get available label ( ) , exception setup label allocator ) * / return max label + method get catches ( ) size ( ) + ~ label ; }


public void prefix ns array test ( ) { / / todo : test prefix ns array }


launch a service with the given list of arguments returns the service launcher , from which the created service can be extracted via { @ link service launcher # get service ( ) } the service is has its execute ( ) method called , but

protected < s extends service > service launcher < s > launch service ( class service class , configuration conf , list < string > args , boolean execute ) throws exit util exit exception { service launcher < s > service launcher = new service launcher < > ( service class get name ( ) ) ; exit util exit exception exit exception = service launcher launch service ( conf , args , false , execute ) ; if ( exit exception get exit code ( ) = = 0 ) { / / success return service launcher ; } else { / / launch failure throw exit exception ; } }


returns true if the paste operation is valid for the given node if the node and node to paste have the same name , then return false

private boolean is paste ok ( program node dest node ) { transferable t = null ; boolean is cut operation = false ; try { t = g clipboard get system clipboard ( ) get contents ( this ) ; if ( t = = null ) { return false ; } transferable temp = temp clipboard get contents ( this ) ; is cut operation = ( temp ! = null ) ; } catch ( exception e ) { / / bad stuff on the clipboard , so ignore it return false ; } if ( ! t is data flavor supported ( tree transferable local tree node flavor ) ) { return false ; } try { if ( ! t is data flavor supported ( tree transferable local tree node flavor ) ) { return false ; } list < program node > list = ( list < program node > ) t get transfer data ( tree transferable local tree node flavor ) ; if ( list = = null ) { / / scr 7990 - - something bad has happened to the copy buffer return false ; } boolean paste enabled = false ; for ( int i = 0 ; i < list size ( ) ; i + + ) { program node paste node = list get ( i ) ; boolean paste allowed = paste mgr is paste allowed ( dest node , paste node , is cut operation ) ; if ( is cut operation & & ! paste allowed ) { / / for cut operation all nodes must be able to be pasted at dest node return false ; } else if ( ! is cut operation & & paste allowed ) { / / for copy operation at least one node must be able to be pasted at dest node return true ; } paste enabled | = paste allowed ; } return paste enabled ; } catch ( unsupported flavor exception e ) { / / data flavor is not supported throw new assert exception ( " data flavor in clipboard is not supported " ) ; } catch ( i o exception e ) { / / data is no longer available msg show error ( this , null , " cut from clipboard failed " , " data is no longer available for paste operation " , e ) ; } catch ( exception e ) { string msg = e get message ( ) ; if ( msg = = null ) { msg = e to string ( ) ; } msg show error ( this , null , " check clipboard failed " , msg , e ) ; } return false ; }


determine if the channel should be closed after the result of { @ link # new continue response ( object , int , channel pipeline ) } is written

protected abstract boolean close after continue response ( object msg ) throws exception ;


the actual sync activity happens while not synchronized on this object thus , synchronized activities that require that they are not concurrent with file operations should wait for any running sync to finish

synchronized void wait for sync to finish ( ) { while ( is sync running ) { try { wait ( 1000 ) ; } catch ( interrupted exception ie ) { } } }


creates a { @ code end of central directory } with a heap allocated buffer

public static end of central directory allocate ( string comment ) { byte [ ] comment data = comment ! = null ? comment get bytes ( utf 8 ) : empty ; int size = size + comment data length ; byte buffer buffer = byte buffer allocate ( size ) order ( little endian ) ; return new end of central directory ( buffer ) init ( comment data ) ; }


returns a new message that is sent at first time when the connection to the proxy server has been established

protected abstract object new initial message ( channel handler context ctx ) throws exception ;


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

public d b record get record at or 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 at or before ( key , schema ) ; } finally { node mgr release nodes ( ) ; } } }


convert a whitespace - separate list of tokens into a set of { @ link label } s

public static set < label atom > parse ( string labels ) { final set < label atom > r = new tree set < > ( ) ; labels = fix null ( labels ) ; if ( labels length ( ) > 0 ) { final quoted string tokenizer tokenizer = new quoted string tokenizer ( labels ) ; while ( tokenizer has more tokens ( ) ) r add ( jenkins get ( ) get label atom ( tokenizer next token ( ) ) ) ; } return r ; }


refreshes node if refresh cannot be done in this level then refreshes parent node do not actually changes navigation tree if some underlying object is refreshed it must fire db model event which will cause actual tree nodes refresh underlying object could present multiple times in navigation model - each occurrence will be refreshed then

public d b n node refresh node ( d b r progress monitor monitor , object source ) throws d b exception { if ( is locked ( ) ) { log warn ( " attempt to refresh locked node ' " + get node name ( ) + " ' " ) ; / / $ non - nls - 1 $ / / $ non - nls - 2 $ return null ; } d b s object object = get object ( ) ; if ( object instanceof d b p refreshable object ) { d b p data source data source = object get data source ( ) ; if ( object is persisted ( ) & & data source ! = null ) { d b s object [ ] new object = new d b s object [ 1 ] ; d b exec utils try execute recover ( monitor , data source , param - > { try { new object [ 0 ] = ( ( d b p refreshable object ) object ) refresh object ( monitor ) ; } catch ( d b exception e ) { throw new invocation target exception ( e ) ; } } ) ; if ( new object [ 0 ] = = null ) { if ( parent node instanceof d b n database node ) { ( ( d b n database node ) parent node ) remove child item ( object ) ; } return null ; } else { refresh node content ( monitor , new object [ 0 ] , source , true ) ; return this ; } } else { / / not persisted node - nothing to refresh get model ( ) fire node update ( source , this , d b n event node change refresh ) ; return this ; } } else { return super refresh node ( monitor , source ) ; } }


acquire permit to continue processing the request for specific ns id

private void acquire permit ( final string ns id , final user group information ugi , final remote method m ) throws i o exception { if ( router rpc fairness policy controller ! = null & & ! router rpc fairness policy controller acquire permit ( ns id ) ) { / / throw stand by exception , / / clients could fail over and try another router if ( rpc monitor ! = null ) { rpc monitor get r p c metrics ( ) incr proxy op permit rejected ( ) ; } log debug ( " permit denied for ugi : { } for method : { } " , ugi , m get method name ( ) ) ; string msg = " router " + router get router id ( ) + " is overloaded for ns : " + ns id ; throw new standby exception ( msg ) ; } }


returns the file that indicates a ghidra project

public file get marker file ( ) { return new file ( location , name + project file suffix ) ; }


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

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


returns the number of occurrences of obj in coll

public static < e > int cardinality ( e obj , final collection < e > coll ) { if ( coll = = null ) return 0 ; if ( coll instanceof set ) { return ( coll contains ( obj ) ? 1 : 0 ) ; } int count = 0 ; if ( obj = = null ) { for ( e e : coll ) { if ( e = = null ) { count + + ; } } } else { for ( e e : coll ) { if ( obj equals ( e ) ) { count + + ; } } } return count ; }


determines whether a { @ link path data } item is recursable default implementation is to recurse directories but can be overridden to recurse through symbolic links

protected boolean is path recursable ( path data item ) throws i o exception { return item stat is directory ( ) ; }


gets the absolute offset of this item as a string , suitable for including in annotations

public final string offset string ( ) { return ' [ ' + integer to hex string ( get absolute offset ( ) ) + ' ] ' ; }


public final multi search template response msearch template ( multi search template request multi search template request , request options options ) throws i o exception { return perform request and parse entity ( multi search template request , request converters : : multi search template , options , multi search template response : : from x context , empty set ( ) ) ; }


provides direct access to the indices array being built , use with care the size of the array might be bigger , do not rely on the length of the array instead use { @ link # get num indices ( ) } to calculate the usable size of the array must be called in between the call to # begin and # end

protected short [ ] get indices ( ) { return indices items ; }


return the current task executor for this multicaster

protected executor get task executor ( ) { return this task executor ; }


filters { @ code args } by removing superfluous items : the client ' s environment variables may contain sensitive data , so we filter it out { @ code - - default override } is spammy

private static immutable list < string > filter args ( iterable < string > args ) { if ( args = = null ) { return null ; } immutable list builder < string > filtered args = immutable list builder ( ) ; for ( string arg : args ) { if ( arg ! = null & & ! arg starts with ( " - - client env = " ) & & ! arg starts with ( " - - default override = " ) ) { filtered args add ( arg ) ; } } return filtered args build ( ) ; }


we never render " null " values to x content , but we should test that we can parse them ( and they return correct defaults )

public void test parsing null ( ) throws i o exception { final string range aggregation = " { \ n " + " \ " field \ " : \ " price \ " , \ n " + " \ " ranges \ " : [ \ n " + " { \ " from \ " : null , \ " to \ " : null } \ n " + " ] \ n " + " } " ; x content parser parser = create parser ( json x content json x content , range aggregation ) ; range aggregation builder aggregation builder = range aggregation builder parser parse ( parser , " aggregation name " ) ; assert equals ( 1 , aggregation builder ranges ( ) size ( ) ) ; assert equals ( double negative infinity , aggregation builder ranges ( ) get ( 0 ) get from ( ) , 0 0 ) ; assert equals ( double positive infinity , aggregation builder ranges ( ) get ( 0 ) get to ( ) , 0 0 ) ; }


compare task in progress ids by first job ids , then by tip numbers reduces are defined as greater then maps

public int compare to ( j v m id that ) { int job comp = this job id compare to ( that job id ) ; if ( job comp = = 0 ) { if ( this is map = = that is map ) { return long compare ( this jvm id , that jvm id ) ; } else { return this is map ? - 1 : 1 ; } } else { return job comp ; } }


get the instant recursively when the schemas defined in one ofanyof happen to be one ofany of schema as well

public object get actual instance recursively ( ) { return get actual instance recursively ( this ) ; }


returns a { @ link thread local } reused { @ code char [ ] } for use when decoding bytes into hex , ip literals , or { @ link # short string length short strings } the buffer must never be leaked outside the method most will { @ link string # string ( char [ ] , int , int ) copy it into a string }

public static char [ ] short string buffer ( ) { char [ ] short string buffer = short string buffer get ( ) ; if ( short string buffer = = null ) { short string buffer = new char [ short string length ] ; short string buffer set ( short string buffer ) ; } return short string buffer ; }


retract the input record and emit updated records this works for outputting with row number

private boolean retract record with row number ( sorted map < row data , long > sorted map , row data sort key , row data input row , collector < row data > out ) throws exception { iterator < map entry < row data , long > > iterator = sorted map entry set ( ) iterator ( ) ; long current rank = 0l ; row data prev row = null ; boolean finds sort key = false ; while ( iterator has next ( ) & & is in rank end ( current rank ) ) { map entry < row data , long > entry = iterator next ( ) ; row data key = entry get key ( ) ; if ( ! finds sort key & & key equals ( sort key ) ) { list < row data > inputs = data state get ( key ) ; if ( inputs = = null ) { / / skip the data if it ' s state is cleared because of state ttl if ( lenient ) { log warn ( state cleared warn msg ) ; } else { throw new runtime exception ( state cleared warn msg ) ; } } else { iterator < row data > input iter = inputs iterator ( ) ; while ( input iter has next ( ) & & is in rank end ( current rank ) ) { row data current row = input iter next ( ) ; if ( ! finds sort key & & equaliser equals ( current row , input row ) ) { prev row = current row ; finds sort key = true ; input iter remove ( ) ; } else if ( finds sort key ) { collect update before ( out , prev row , current rank ) ; collect update after ( out , current row , current rank ) ; prev row = current row ; } current rank + = 1 ; } if ( inputs is empty ( ) ) { data state remove ( key ) ; } else { data state put ( key , inputs ) ; } } } else if ( finds sort key ) { list < row data > inputs = data state get ( key ) ; int i = 0 ; while ( i < inputs size ( ) & & is in rank end ( current rank ) ) { row data current row = inputs get ( i ) ; collect update before ( out , prev row , current rank ) ; collect update after ( out , current row , current rank ) ; prev row = current row ; current rank + = 1 ; i + + ; } } else { current rank + = entry get value ( ) ; } } if ( is in rank end ( current rank ) ) { / / there is no enough elements in top - n , emit delete message for the retract record collect delete ( out , prev row , current rank ) ; } return finds sort key ; }


see original { @ link stubber # do throw ( class ) }

b d d stubber will throw ( class < ? extends throwable > to be thrown ) ;


public synchronized void append ( object key , object val ) throws i o exception { if ( key get class ( ) ! = key class ) throw new i o exception ( " wrong key class : " + key + " is not " + key class ) ; if ( val get class ( ) ! = val class ) throw new i o exception ( " wrong value class : " + val + " is not " + val class ) ; / / save key / value into respective buffers int old key length = key buffer get length ( ) ; key serializer serialize ( key ) ; int key length = key buffer get length ( ) - old key length ; if ( key length < 0 ) throw new i o exception ( " negative length keys not allowed : " + key ) ; writable utils write v int ( key len buffer , key length ) ; int old val length = val buffer get length ( ) ; uncompressed val serializer serialize ( val ) ; int val length = val buffer get length ( ) - old val length ; writable utils write v int ( val len buffer , val length ) ; / / added another key / value pair + + no buffered records ; / / compress and flush ? int current block size = key buffer get length ( ) + val buffer get length ( ) ; if ( current block size > = compression block size ) { sync ( ) ; } }


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


get the date format used to parseformat date parameters

public date format get date format ( ) { return date format ; }


gets a copy of the buffer that has the right length for the data serialized so far the returned buffer is an exclusive copy and can be safely used without being overwritten by future write calls to this serializer this method is equivalent to { @ code arrays copy of ( get shared buffer ( ) , length ( ) ) ; }

public byte [ ] get copy of buffer ( ) { return arrays copy of ( buffer , position ) ; }


get the packing storage size in bytes associated with this bit - field which may be larger than the base type associated with the fields original definition returned value is the same as { @ link # get length ( ) }

public int get storage size ( ) { return storage size ; }


insert the specified record at the specified key index existing data may be shifted within the buffer to make room for the new record parent must be notified if this changes the leftmost key

boolean insert record ( int index , d b record record ) throws i o exception { / / check for use of indirect chained record node ( s ) int len = record length ( ) ; int max record length = ( ( buffer length ( ) - header size ) > > 2 ) - entry size ; / / min 4 records per node boolean use indirect = ( len > max record length ) ; if ( use indirect ) { len = 4 ; } if ( ( len + entry size ) > get free space ( ) ) { return false ; / / insufficient space for record storage } / / make room for new record int offset = move records ( index , - len ) ; / / make room for new key / offset entry int start = key base offset + ( index * entry size ) ; len = ( key count - index ) * entry size ; buffer move ( start , start + entry size , len ) ; / / store new record key / offset buffer put ( start , record get key field ( ) get binary data ( ) ) ; buffer put int ( start + key size , offset ) ; set key count ( key count + 1 ) ; / / store record data if ( use indirect ) { chained buffer chained buffer = new chained buffer ( record length ( ) , node mgr get buffer mgr ( ) ) ; buffer put int ( offset , chained buffer get id ( ) ) ; record write ( chained buffer , 0 ) ; } else { record write ( buffer , offset ) ; } enable indirect storage ( index , use indirect ) ; return true ; }


return the abstract syntax tree for the expression

public spel node get a s t ( ) { return this ast ; }


get the record key offset within the buffer

private int get record key offset ( int index ) { return buffer get int ( header size + ( index * entry size ) ) ; }


to test enum parameters to test enum parameters

public void test enum parameters test ( ) { list < string > enum header string array = null ; string enum header string = null ; list < string > enum query string array = null ; string enum query string = null ; integer enum query integer = null ; double enum query double = null ; list < string > enum form string array = null ; string enum form string = null ; / / api test enum parameters ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string ) ; / / todo : test validations }


public static void main ( string [ ] args ) { customer registry customer registry = customer registry get instance ( ) ; var john = new customer ( " 1 " , " john " ) ; customer registry add customer ( john ) ; var julia = new customer ( " 2 " , " julia " ) ; customer registry add customer ( julia ) ; logger info ( " john { } " , customer registry get customer ( " 1 " ) ) ; logger info ( " julia { } " , customer registry get customer ( " 2 " ) ) ; }


add a system property definition - must be used before setting the main entry point

public void sysprop ( string property , string value ) { preconditions check argument ( property ! = null , " null property name " ) ; preconditions check argument ( value ! = null , " null value " ) ; add ( " - d " + property + " = " + value ) ; }


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


since flow execution repository exception is a common ancestor to these exceptions and other error cases we would likely want to hide from the user , it seems reasonable to check for flow execution repository exception badly formatted flow execution key exception is specifically ignored by this handler because redirecting to the requested uri with this exception may cause an infinite redirect loop ( i e when invalid " execution " parameter exists as part of the query string

public model and view resolve exception ( final http servlet request request , final http servlet response response , final object handler , final exception exception ) { if ( ! ( exception instanceof flow execution repository exception ) | | exception instanceof badly formatted flow execution key exception ) { logger debug ( " ignoring the received exception [ { } ] due to a type mismatch with handler [ { } ] " , exception , handler ) ; return null ; } val url to redirect to = request get request u r i ( ) + ( request get query string ( ) ! = null ? ' ? ' + request get query string ( ) : string utils empty ) ; logger debug ( " error getting flow information for url [ { } ] " , url to redirect to , exception ) ; val model = new hash map < string , object > ( ) ; model put ( this model key , string escape utils escape html 4 ( exception get message ( ) ) ) ; return new model and view ( new redirect view ( url to redirect to ) , model ) ; }


publishes a creation event for the entry to all of the interested listeners

public void publish created ( cache < k , v > cache , k key , v value ) { publish ( cache , event type created , key , / * has old value * / false , / * old value * / null , / * new value * / value , / * quiet * / false ) ; }


public string get name text ( ) { return name field get text ( ) ; }


resolves , and if necessary updates , the list of index names in the provided < code > request < code > in accordance with the user ' s < code > authorized indices < code > wildcards are expanded at this phase to ensure that all security and execution decisions are made against a fixed set of index names that is consistent and does not change during the life of the request if the provided < code > request < code > is of a type that { @ link # allows remote indices ( indices request ) allows remote indices } , then the index names will be categorized into those that refer to { @ link resolved indices # get local ( ) local indices } , and those that refer to { @ link resolved indices # get remote ( ) remote indices } this categorization follows the standard { @ link remote cluster aware # build remote index name ( string , string ) remote index - name format } and also respects the currently defined remote clusters } < br > thus an index name n will considered to be remote if - and - only - if all of the following are true < code > request < code > supports remote indices n is in the format cluster < code > : < code > index it is allowable for cluster and index to contain wildcards , but the separator ( < code > : < code > ) must be explicit cluster matches one or more remote cluster names that are registered within this cluster in which case , any wildcards in the cluster portion of the name will be expanded and the resulting remote - index - name ( s ) will be added to the remote index list < br > otherwise , n will be added to the local index list

resolved indices resolve ( transport request request , metadata metadata , list < string > authorized indices ) { if ( request instanceof indices aliases request ) { resolved indices builder resolved indices builder = new resolved indices builder ( ) ; indices aliases request indices aliases request = ( indices aliases request ) request ; for ( indices request indices request : indices aliases request get alias actions ( ) ) { final resolved indices resolved = resolve indices and aliases ( indices request , metadata , authorized indices ) ; resolved indices builder add local ( resolved get local ( ) ) ; resolved indices builder add remote ( resolved get remote ( ) ) ; } return resolved indices builder build ( ) ; } / / if for some reason we are missing an action just for safety we ' ll reject if ( request instanceof indices request = = false ) { throw new illegal state exception ( " request [ " + request + " ] is not an indices request , but should be " ) ; } return resolve indices and aliases ( ( indices request ) request , metadata , authorized indices ) ; }


void ingest failed ( ) { ingest failed inc ( ) ; }


a convenience method for reading a value directly from a varnode rather than querying for the offset and space

public final long get value ( varnode vn ) { address addr = vn get address ( ) ; return get value ( addr get address space ( ) , addr get offset ( ) , vn get size ( ) ) ; }


public boolean equals ( object other ) { if ( ! ( other instanceof cst nat ) ) { return false ; } cst nat other nat = ( cst nat ) other ; return name equals ( other nat name ) & & descriptor equals ( other nat descriptor ) ; }


public static map < string , map < string , object > > parse request claims ( final j e e context context ) throws exception { val claims = context get request parameter ( o auth 2 0 constants claims ) map ( string : : value of ) or else ( string utils empty ) ; if ( string utils is blank ( claims ) ) { return new hash map < > ( 0 ) ; } return mapper read value ( json value read hjson ( claims ) to string ( ) , map class ) ; }


returns a triangularly distributed random number between { @ code min } ( inclusive ) and { @ code max } ( exclusive ) , where values around { @ code mode } are more likely

public static float random triangular ( float min , float max , float mode ) { float u = random next float ( ) ; float d = max - min ; if ( u < = ( mode - min ) / d ) return min + ( float ) math sqrt ( u * d * ( mode - min ) ) ; return max - ( float ) math sqrt ( ( 1 - u ) * d * ( max - mode ) ) ; }


null - safe equivalent of { @ code a equals ( b ) }

public static boolean both null or equal ( @ nullable object a , @ nullable object b ) { return a = = null ? b = = null : a equals ( b ) ; }


return block location of the given file for the given offset and len for a nonexistent file or regions , null will be returned this call is most helpful with dfs , where it returns hostnames of machines that contain the given file in hdfs , if file is three - replicated , the returned array contains elements like : block location ( offset : 0 , length : block size , hosts : { " host 1 : 9866 " , " host 2 : 9866 , host 3 : 9866 " } ) block location ( offset : block size , length : block size , hosts : { " host 2 : 9866 " , " host 3 : 9866 , host 4 : 9866 " } ) and if a file is erasure - coded , the returned block location are logical block groups suppose we have a rs 3 2 coded file ( 3 data units and 2 parity units ) 1 if the file size is less than one stripe size , say 2 cell size , then there will be one block location returned , with 0 offset , actual file size and 4 hosts ( 2 data blocks and 2 parity blocks ) hosting the actual blocks 3 if the file size is less than one group size but greater than one stripe size , then there will be one block location returned , with 0 offset , actual file size with 5 hosts ( 3 data blocks and 2 parity blocks ) hosting the actual blocks 4 if the file size is greater than one group size , 3 block size + 123 for example , then the result will be like : block location ( offset : 0 , length : 3 block size , hosts : { " host 1 : 9866 " , " host 2 : 9866 " , " host 3 : 9866 " , " host 4 : 9866 " , " host 5 : 9866 " } ) block location ( offset : 3 block size , length : 123 , hosts : { " host 1 : 9866 " , " host 4 : 9866 " , " host 5 : 9866 " } )

public block location [ ] get file block locations ( final path f , final long start , final long len ) throws access control exception , file not found exception , unsupported file system exception , i o exception { final path abs f = fix relative part ( f ) ; return new f s link resolver < block location [ ] > ( ) { @ override public block location [ ] next ( final abstract file system fs , final path p ) throws i o exception , unresolved link exception { return fs get file block locations ( p , start , len ) ; } } resolve ( this , abs f ) ; }


set the map input data compression ratio in the given conf

static void set map input compression emulation ratio ( configuration conf , float ratio ) { conf set float ( gridmix map input compression ratio , ratio ) ; }


resets the cursor to a specific value this can be applied at any time , but it is worth noting that it can cause a data race and should only be used in controlled circumstances e g during initialisation

public void reset to ( long sequence ) { sequencer claim ( sequence ) ; sequencer publish ( sequence ) ; }


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


ensure that the long value is in the range of an integer

public static int ensure output parameter in range ( string name , long size ) { if ( size > integer max value ) { log warn ( " s 3a : { } capped to ~ 2 14gb " + " ( maximum allowed size with current output mechanism ) " , name ) ; return integer max value ; } else { return ( int ) size ; } }


set the number of seconds to wait after initialization before starting the scheduler asynchronously default is 0 , meaning immediate synchronous startup on initialization of this bean setting this to 10 or 20 seconds makes sense if no jobs should be run before the entire application has started up

public void set startup delay ( int startup delay ) { this startup delay = startup delay ; }


which partition ( s ) of the topic is handled in cluster mode currently , we have to specify the handler working for partition ( s )

default list < topic partition > get topic partitions ( ) { if ( string util is empty ( get consume partitions ( ) ) ) { return collections empty list ; } list < topic partition > topic partitions = lists new array list ( ) ; for ( final string partition : get consume partitions ( ) trim ( ) split ( " \ \ s * , \ \ s * " ) ) { topic partitions add ( new topic partition ( get topic ( ) , integer parse int ( partition ) ) ) ; } return topic partitions ; }


check and prepare the given request and response according to the settings of this generator

protected final void check and prepare ( http servlet request request , http servlet response response , boolean last modified ) throws servlet exception { check request ( request ) ; prepare response ( response ) ; }


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


private void move into fragment ( string name , address start , address end , string file name ) { if ( file name ! = null ) { program module module = null ; int index = root module get index ( file name ) ; if ( index = = - 1 ) { try { module = root module create module ( file name ) ; } catch ( duplicate name exception e ) { msg error ( this , " error while moving fragment " + name + " from " + start + " to " + end , e ) ; return ; } } else { group [ ] children = root module get children ( ) ; / / todo add a get child at ( index ) method module = ( program module ) children [ index ] ; } if ( module ! = null ) { try { program fragment frag = null ; index = module get index ( name ) ; if ( index = = - 1 ) { frag = module create fragment ( name ) ; } else { group [ ] children = module get children ( ) ; / / todo add a get child at ( index ) method frag = ( program fragment ) children [ index ] ; } frag move ( start , end ) ; } catch ( not found exception e ) { msg error ( this , " error moving fragment from " + start + " to " + end , e ) ; return ; } catch ( duplicate name exception e ) { / / todo : thrown by create fragment if fragment name exists in any other module } } } }


returns all of the policy variations that have been configured

public set < policy > policy ( string name ) { factory factory = factories get ( name to lower case ( us ) ) ; check not null ( factory , " % s not found " , name ) ; return factory creator ( ) apply ( settings config ( ) ) ; }


the response resources wrapped in the common mcp resource message these are typed resources that match the type url in the request resources message when ` incremental ` is true , this contains an array of resources to addupdate for the specified collection this modifies the existing collection at the sink when ` incremental ` is false , this contains the full set of resources for the specified collection this replaces any previously delivered resources < code > repeated istio mcp v 1alpha 1 resource resources = 3 ; < code >

public java util list < com alibaba nacos istio model mcp resource > get resources list ( ) { return resources ; }


calculate a user bucket for a given feature flag , uuid , and part per modulus

public static long bucket ( @ non null string key , @ non null uuid uuid , long modulus ) { message digest digest ; try { digest = message digest get instance ( " sha - 256 " ) ; } catch ( no such algorithm exception e ) { throw new assertion error ( e ) ; } digest update ( key get bytes ( ) ) ; digest update ( " " get bytes ( ) ) ; byte buffer byte buffer = byte buffer wrap ( new byte [ 16 ] ) ; byte buffer order ( byte order big endian ) ; byte buffer put long ( uuid get most significant bits ( ) ) ; byte buffer put long ( uuid get least significant bits ( ) ) ; digest update ( byte buffer array ( ) ) ; return new big integer ( arrays copy of range ( digest digest ( ) , 0 , 8 ) ) mod ( big integer value of ( modulus ) ) long value ( ) ; }


returns the position offset in the first unplayed ad at which to begin playback , in microseconds

public long get ad resume position us ( ) { return ad playback state ad resume position us ; }


add the specified dynamic entry type to the specified map

public static void add dynamic type ( elf dynamic type type , map < integer , elf dynamic type > dynamic type map ) throws duplicate name exception { elf dynamic type conflict type = dynamic type map get ( type value ) ; if ( conflict type ! = null ) { throw new duplicate name exception ( " elf dynamic type conflict during initialization ( " + type name + " / " + conflict type name + " ) , value = 0x " + integer to hex string ( type value ) ) ; } for ( elf dynamic type existing type : dynamic type map values ( ) ) { if ( type name equals ignore case ( existing type name ) ) { throw new duplicate name exception ( " elf dynamic type conflict during initialization , name = " + type name ) ; } } dynamic type map put ( type value , type ) ; }


public event type get event type ( ) { return event type task failed ; }


public void set ( long value ) { this value = value ; }


creates a rule instance that can perform lazy verifications

public static verification collector collector ( ) { return new verification collector impl ( ) ; }