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


create a duration tracker factory which aggregates the tracking of two other factories

public static duration tracker factory paired tracker factory ( final duration tracker factory first , final duration tracker factory second ) { return new paired duration tracker factory ( first , second ) ; }


instantiates a new instance which uses widevine cdm call { @ link # release ( ) } when the instance is no longer required

public static offline license helper new widevine instance ( string default license url , boolean force default license url , http data source factory http data source factory , drm session event listener event dispatcher event dispatcher ) { return new widevine instance ( default license url , force default license url , http data source factory , / * optional key request parameters = * / null , event dispatcher ) ; }


return the list of all created { @ link query profiler } s so far

public list < query profiler > get query profilers ( ) { return collections unmodifiable list ( query profilers ) ; }


a wrapper around { @ code private static final dalvik system dex path list # make dex elements }

private static object [ ] make dex elements ( object dex path list , array list < file > files , file optimized directory ) throws illegal access exception , invocation target exception , no such method exception { method make dex elements = find method ( dex path list , " make dex elements " , array list class , file class ) ; i dex elements method invoker invoker = new dex elements method invoker v 1 4 ( dex path list , optimized directory , make dex elements ) ; dex elements maker dex elements maker = new dex elements maker ( files , invoker ) ; return dex elements maker make ( ) ; }


returns a list of symbols that could not be resolved in the end note that the domain file and function entry point will be null for all these

public list < location > get unresolved symbols ( ) { return new array list < location > ( unresolved symbols ) ; }


returns the appropriate { @ link record category } needed while processing the type program interface } ( vs item program interface )

protected record category get category ( ) { return record category type ; }


get the response that this task finished with will return null if the task was finished by an error , it hasn ' t yet finished , or didn ' t store its result

public bytes reference get response ( ) { return response ; }


returns all of the policies that have been configured for simulation and that meet a minimal set of supported characteristics

public set < policy > policies ( ) { return settings policies ( ) stream ( ) map ( name - > factories get ( name to lower case ( us ) ) ) filter ( factory - > factory characteristics ( ) contains all ( characteristics ) ) flat map ( factory - > factory creator ( ) apply ( settings config ( ) ) stream ( ) ) collect ( to set ( ) ) ; }


public static void click mouse ( component comp , int button , int x , int y , int click count , int modifiers ) { click mouse ( comp , button , x , y , click count , modifiers , false ) ; }


returns true if field success is set ( has been assigned a value ) and false otherwise

public boolean is set success ( ) { return isset bit vector get ( success isset id ) ; }


helper method to create a content chunk indicating a invalid decoding result

private memcache content invalid chunk ( exception cause ) { state = state bad message ; memcache content chunk = new default last memcache content ( unpooled empty buffer ) ; chunk set decoder result ( decoder result failure ( cause ) ) ; return chunk ; }


restores the object from the configuration

public static < k > k load ( configuration conf , string key name , class < k > item class ) throws i o exception { default stringifier < k > stringifier = new default stringifier < k > ( conf , item class ) ; try { string item str = conf get ( key name ) ; return stringifier from string ( item str ) ; } finally { stringifier close ( ) ; } }


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


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

builder options ( string pattern , handler function < server response > handler function ) ;


resets the flag that tells whether any of the branch unit commands was called

public void reset called ( ) { was called = false ; }


gets the writer to use to write to the left column

public writer get left ( ) { return left column ; }


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


creates a table in a given fully qualified path

public void create table ( catalog base table table , object identifier object identifier , boolean ignore if exists ) { execute ( ( catalog , path ) - > catalog create table ( path , table , ignore if exists ) , object identifier , false , " create table " ) ; }


execute a command through the ssh session , pumping its stderr and stdout to our own logs

private int exec command ( session session , string cmd ) throws j sch exception , interrupted exception , i o exception { log debug ( " running cmd : " + cmd ) ; channel exec exec = null ; try { exec = ( channel exec ) session open channel ( " exec " ) ; exec set command ( cmd ) ; exec set input stream ( null ) ; exec connect ( ) ; / / pump stdout of the command to our warn logs stream pumper out pumper = new stream pumper ( log , cmd + " via ssh " , exec get input stream ( ) , stream pumper stream type stdout ) ; out pumper start ( ) ; / / pump stderr of the command to our warn logs stream pumper err pumper = new stream pumper ( log , cmd + " via ssh " , exec get err stream ( ) , stream pumper stream type stderr ) ; err pumper start ( ) ; out pumper join ( ) ; err pumper join ( ) ; return exec get exit status ( ) ; } finally { cleanup ( exec ) ; } }


public long get state size ( ) { return state size ; }


determine this scheme corresponds to a 1 : 1 byte mapping

public boolean is one to one mapping ( ) { return mapped source byte count < = 1 ; }


discovery strategy config get ( hazelcast cluster properties cluster , join config join config , config configuration , network config network config ) ;


converts all input values to math log ( value )

private static double [ ] [ ] get log array values ( long [ ] [ ] values ) { double [ ] [ ] log values = new double [ values length ] [ ] ; for ( int i = 0 ; i < values length ; i + + ) { log values [ i ] = new double [ values [ i ] length ] ; for ( int j = 0 ; j < values [ i ] length ; j + + ) { log values [ i ] [ j ] = values [ i ] [ j ] = = format no value ? 0 : math log ( values [ i ] [ j ] ) ; } } return log values ; }


determine the options present when invoking a jvm with the given user defined options

public static map < string , jvm option > find final options ( final list < string > user defined jvm options ) throws interrupted exception , i o exception { return flags final ( user defined jvm options ) stream ( ) map ( option : : matcher ) filter ( matcher : : matches ) collect ( collectors to unmodifiable map ( m - > m group ( " flag " ) , m - > new jvm option ( m group ( " value " ) , m group ( " origin " ) ) ) ) ; }


public call 1 2 3test special tags oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


using an import map created via { @ link # get all imports mappings ( set ) } to build a list import objects the import objects have two keys : import and classname which hold the key and value of the initial map entry

private set < map < string , string > > to imports objects ( map < string , string > mapped imports ) { set < map < string , string > > result = new tree set < map < string , string > > ( ( comparator < map < string , string > > ) ( o 1 , o 2 ) - > { string s 1 = o 1 get ( " classname " ) ; string s 2 = o 2 get ( " classname " ) ; return s 1 compare to ( s 2 ) ; } ) ; mapped imports entry set ( ) for each ( mapping - > { map < string , string > im = new linked hash map < > ( ) ; im put ( " import " , mapping get key ( ) ) ; im put ( " classname " , mapping get value ( ) ) ; result add ( im ) ; } ) ; return result ; }


public void save ( ) { / / save finished requirements by item type for ( item stack stack : finished requirements ) { core settings put ( " req - " + content name + " - " + stack item name , stack amount ) ; } }


public long get int 6 4 ( ) { return int 6 4 ; }


serializes the source object and returns the byte array result

public byte [ ] convert ( object source ) { try { return this serializer serialize to byte array ( source ) ; } catch ( throwable ex ) { throw new serialization failed exception ( " failed to serialize object using " + this serializer get class ( ) get simple name ( ) , ex ) ; } }


remove stale storages from storage map we must not remove any storages as long as they have associated block replicas

private void prune storage map ( final storage report [ ] reports ) { synchronized ( storage map ) { log debug ( " number of storages reported in heartbeat = { } ; " + " number of storages in storage map = { } " , reports length , storage map size ( ) ) ; hash map < string , datanode storage info > excess storages ; / / init excess storages with all known storages excess storages = new hash map < > ( storage map ) ; / / remove storages that the dn reported in the heartbeat for ( final storage report report : reports ) { excess storages remove ( report get storage ( ) get storage i d ( ) ) ; } / / for each remaining storage , remove it if there are no associated / / blocks for ( final datanode storage info storage info : excess storages values ( ) ) { if ( storage info num blocks ( ) = = 0 ) { datanode storage info info = storage map remove ( storage info get storage i d ( ) ) ; if ( ! has storage type ( info get storage type ( ) ) ) { / / we removed a storage , and as result there is no more such storage / / type , inform the parent about this if ( get parent ( ) instanceof d f s topology node impl ) { ( ( d f s topology node impl ) get parent ( ) ) child remove storage ( get name ( ) , info get storage type ( ) ) ; } } log info ( " removed storage { } from data node { } " , storage info , this ) ; } else { / / this can occur until all block reports are received log debug ( " deferring removal of stale storage { } with { } blocks " , storage info , storage info num blocks ( ) ) ; } } } }


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


writes the java source with the passed subset of the writer values

public void write ( string package name , field initializers symbols to write ) throws i o exception { write source ( package name , values filter ( symbols to write ) ) ; }


compares the specified object with this list for equality returns { @ code true } if and only if the specified object is also an { @ link integer list } , both lists have the same size , and all corresponding pairs of elements in the two lists are equal in other words , two lists are defined to be equal if they contain the same elements in the same order this implementation first checks if the specified object is this list if so , it returns { @ code true } ; if not , it checks if the specified object is an { @ link integer list } if not , it returns { @ code false } ; if so , it checks the size of both lists if the lists are not the same size , it returns { @ code false } ; otherwise it iterates over both lists , comparing corresponding pairs of elements if any comparison returns { @ code false } , this method returns { @ code false }

public boolean equals ( object o ) { if ( o = = this ) { return true ; } if ( ! ( o instanceof integer list ) ) { return false ; } integer list other = ( integer list ) o ; if ( size ! = other size ) { return false ; } for ( int i = 0 ; i < size ; i + + ) { if ( data [ i ] ! = other data [ i ] ) { return false ; } } return true ; }


encodes the specified cookie into a cookie header value

public string encode ( cookie cookie ) { string builder buf = string builder ( ) ; encode ( buf , check not null ( cookie , " cookie " ) ) ; return strip trailing separator ( buf ) ; }


convenient method to run the function without arguments , returning the value as an object

public object run generic ( ) { return find object ( ( object [ ] ) null , null ) ; }


tests that directory making should be successful when the parent directory is same as the existent fallback directory the new dir should be created in fallback instead failing

public void test mkdir of link parent with fallback link with same mount directory tree ( ) throws exception { configuration conf = new configuration ( ) ; conf set boolean ( constants config viewfs mount links as symlinks , false ) ; config util add link ( conf , " / user 1 / hive / warehouse / partition - 0 " , new path ( target test root to string ( ) ) to uri ( ) ) ; path dir 1 = new path ( target test root , " fallback dir / user 1 / hive / warehouse / partition - 0 " ) ; fs target mkdirs ( dir 1 ) ; path fallback target = new path ( target test root , " fallback dir " ) ; config util add link fallback ( conf , fallback target to uri ( ) ) ; abstract file system vfs = abstract file system get ( view fs default cluster uri , conf ) ; path p = new path ( " / user 1 / hive / warehouse / test " ) ; path test = path merge paths ( fallback target , p ) ; assert false ( fs target exists ( test ) ) ; vfs mkdir ( p , null , true ) ; assert true ( fs target exists ( test ) ) ; }


map of string keys and values that can be used to organize and categorize resources within a collection < code > map & lt ; string , string & gt ; labels = 4 ; < code >

public java lang string get labels or throw ( java lang string key ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } java util map < java lang string , java lang string > map = internal get labels ( ) get map ( ) ; if ( ! map contains key ( key ) ) { throw new java lang illegal argument exception ( ) ; } return map get ( key ) ; }


set generator properties otherwise pulled from system properties useful for running tests in parallel without relying on system properties

public void set generator property default ( final string key , final string value ) { this generator property defaults put ( key , value ) ; }


backward compatibility redirect to the thread dump

public void do classic thread dump ( stapler response rsp ) throws i o exception , servlet exception { rsp send redirect 2 ( " thread dump " ) ; }


create an implementation of { @ link has next condition } that knows when to stop iterating over the key value segments used during { @ link segmented bytes store # fetch ( bytes , bytes , long , long ) } operations

has next condition has next condition ( final bytes binary key from , final bytes binary key to , final long from , final long to ) ;


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

@ override public t visit comparison ( eql base parser comparison context ctx ) { return visit children ( ctx ) ; }


returns the contents of this instance as a { @ code dex } file , in a { @ link byte array annotated output } instance

private byte array annotated output to dex 0 ( boolean annotate , boolean verbose ) { / * * the following is ordered so that the prepare ( ) calls which * add items happen before the calls to the sections that get * added to * / class defs prepare ( ) ; class data prepare ( ) ; word data prepare ( ) ; byte data prepare ( ) ; method ids prepare ( ) ; field ids prepare ( ) ; proto ids prepare ( ) ; type lists prepare ( ) ; type ids prepare ( ) ; string ids prepare ( ) ; string data prepare ( ) ; header prepare ( ) ; / / place the sections within the file int count = sections length ; int offset = 0 ; for ( int i = 0 ; i < count ; i + + ) { section one = sections [ i ] ; int placed at = one set file offset ( offset ) ; if ( placed at < offset ) { throw new runtime exception ( " bogus placement for section " + i ) ; } try { if ( one = = map ) { / * * inform the map of all the sections , and add it * to the file this can only be done after all * the other items have been sorted and placed * / map item add map ( sections , map ) ; map prepare ( ) ; } if ( one instanceof mixed item section ) { / * * place the items of a mixed item section that just * got placed * / ( ( mixed item section ) one ) place items ( ) ; } offset = placed at + one write size ( ) ; } catch ( runtime exception ex ) { throw exception with context with context ( ex , " while writing section " + i ) ; } } / / write out all the sections file size = offset ; byte [ ] barr = new byte [ file size ] ; byte array annotated output out = new byte array annotated output ( barr ) ; if ( annotate ) { out enable annotations ( dump width , verbose ) ; } for ( int i = 0 ; i < count ; i + + ) { try { section one = sections [ i ] ; int zero count = one get file offset ( ) - out get cursor ( ) ; if ( zero count < 0 ) { throw new exception with context ( " excess write of " + ( - zero count ) ) ; } out write zeroes ( one get file offset ( ) - out get cursor ( ) ) ; one write to ( out ) ; } catch ( runtime exception ex ) { exception with context ec ; if ( ex instanceof exception with context ) { ec = ( exception with context ) ex ; } else { ec = new exception with context ( ex ) ; } ec add context ( " while writing section " + i ) ; throw ec ; } } if ( out get cursor ( ) ! = file size ) { throw new runtime exception ( " foreshortened write " ) ; } / / perform final bookkeeping calc signature ( barr ) ; calc checksum ( barr ) ; if ( annotate ) { word data write index annotation ( out , item type type code item , " \ nmethod code index : \ n \ n " ) ; get statistics ( ) write annotation ( out ) ; out finish annotating ( ) ; } return out ; }


finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

public set < pet > find pets by tags ( set < string > tags ) throws api exception { api response < set < pet > > local var resp = find pets by tags with http info ( tags ) ; return local var resp get data ( ) ; }


get the pitch euler angle in degrees , which is the rotation around the x axis requires that this quaternion is normalized

public float get pitch ( ) { return get pitch rad ( ) * math utils radians to degrees ; }


gets the zoo keeper root node to use for this service for instance , a root node of { @ code mycompanymyservice } would be the parent of all leader offers for this service obviously all processes that wish to contend for leader status need to use the same root node note : we assume this node already exists

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


retrieves the data at the given properties file

public config data get ( string path ) { map < string , string > data = new hash map < > ( ) ; if ( path = = null | | path is empty ( ) ) { return new config data ( data ) ; } try ( reader reader = reader ( path ) ) { properties properties = new properties ( ) ; properties load ( reader ) ; enumeration < object > keys = properties keys ( ) ; while ( keys has more elements ( ) ) { string key = keys next element ( ) to string ( ) ; string value = properties get property ( key ) ; if ( value ! = null ) { data put ( key , value ) ; } } return new config data ( data ) ; } catch ( i o exception e ) { throw new config exception ( " could not read properties from file " + path ) ; } }


public list < string > get table columns ( ) { return this table columns ; }


return the configured { @ link high availability mode }

public static high availability mode from config ( configuration config ) { string ha mode = config get value ( high availability options ha mode ) ; if ( ha mode = = null ) { return high availability mode none ; } else if ( ha mode equals ignore case ( config constants default recovery mode ) ) { / / map old default to new default return high availability mode none ; } else { try { return high availability mode value of ( ha mode to upper case ( ) ) ; } catch ( illegal argument exception e ) { return factory class ; } } }


the nonce corresponding to mesh config response being a c k n a c ked see above discussion on version info and the mesh config response nonce comment this may be empty if no nonce is available , e g at startup < code > string response nonce = 4 ; < code >

public java lang string get response nonce ( ) { java lang object ref = response nonce ; if ( ref instanceof java lang string ) { return ( java lang string ) ref ; } else { com google protobuf byte string bs = ( com google protobuf byte string ) ref ; java lang string s = bs to string utf 8 ( ) ; response nonce = s ; return s ; } }


create a new synthesizing method parameter for the given parameter descriptor this is a convenience factory method for scenarios where a java 8 { @ link parameter } descriptor is already available

public static synthesizing method parameter for parameter ( parameter parameter ) { return for executable ( parameter get declaring executable ( ) , find parameter index ( parameter ) ) ; }


get the adjusted memory size in bytes of the memory block which relates to this program header ; it may be zero if no block should be created the returned value reflects any adjustment the elf extension may require based upon the specific processorlanguage implementation which may require filtering of file bytes as loaded into memory

public long get adjusted memory size ( ) { return header get load adapter ( ) get adjusted memory size ( this ) ; }


returns the number of retries this job has left whenever the jobexecutor fails to execute the job , this value is decremented when it hits zero , the job is supposed to be dead and not retried again ( ie a manual retry is required then )


public web security configurer adapter cas configuration server web security configurer adapter ( final server properties server properties ) { return new web security configurer adapter ( ) { @ override protected void configure ( final http security http ) throws exception { val path = server properties get servlet ( ) get context path ( ) ; http authorize requests ( ) ant matchers ( path + " / decrypt / * * " ) authenticated ( ) and ( ) csrf ( ) disable ( ) ; http authorize requests ( ) ant matchers ( path + " / encrypt


gets the built - in database name in the built - in catalog the built - in database is used for storing all non - serializable transient meta - objects

public string get built in database name ( ) { / / the default database of the built - in catalog is also the built - in database return catalogs get ( get built in catalog name ( ) ) get default database ( ) ; }


public synchronized void delete repository ( string current user , string name ) throws i o exception { if ( is anonymous user ( current user ) ) { throw new user access exception ( " anonymous user not permitted to delete repository " ) ; } validate user ( current user ) ; repository rep = repository map get ( name ) ; if ( rep = = null ) { return ; } rep delete ( current user ) ; file f = new file ( root dir file , naming utilities mangle ( name ) ) ; if ( ! file utilities delete dir ( f ) ) { throw new i o exception ( " failed to remove directory for " + f get absolute path ( ) ) ; } repository map remove ( name ) ; }


create a target source for bean instances uses any target source creators if set returns { @ code null } if no custom target source should be used this implementation uses the " custom target source creators " property subclasses can override this method to use a different mechanism

protected target source get custom target source ( class < ? > bean class , string bean name ) { / / we can ' t create fancy target sources for directly registered singletons if ( this custom target source creators ! = null & & this bean factory ! = null & & this bean factory contains bean ( bean name ) ) { for ( target source creator tsc : this custom target source creators ) { target source ts = tsc get target source ( bean class , bean name ) ; if ( ts ! = null ) { / / found a matching target source if ( logger is trace enabled ( ) ) { logger trace ( " target source creator [ " + tsc + " ] found custom target source for bean with name ' " + bean name + " ' " ) ; } return ts ; } } } / / no custom target source found return null ; }


simply add a snapshot into the { @ link # snapshots by names } used when loading fsimage

void add snapshot ( snapshot snapshot ) { this snapshots by names add ( snapshot ) ; }


unassign any persistent tasks executing on nodes that are no longer in the cluster if the task ' s assigment has a non - null executor node and that node is no longer in the cluster then the assignment is set to { @ link # lost node assignment }

public static cluster state disassociate dead nodes ( cluster state cluster state ) { persistent tasks custom metadata tasks = get persistent tasks custom metadata ( cluster state ) ; if ( tasks = = null ) { return cluster state ; } persistent tasks custom metadata builder task builder = persistent tasks custom metadata builder ( tasks ) ; for ( persistent task < ? > task : tasks tasks ( ) ) { if ( task get assignment ( ) get executor node ( ) ! = null & & cluster state nodes ( ) node exists ( task get assignment ( ) get executor node ( ) ) = = false ) { task builder reassign task ( task get id ( ) , lost node assignment ) ; } } if ( task builder is changed ( ) = = false ) { return cluster state ; } metadata builder metadata builder = metadata builder ( cluster state metadata ( ) ) ; metadata builder put custom ( type , task builder build ( ) ) ; return cluster state builder ( cluster state ) metadata ( metadata builder ) build ( ) ; }


apply the given { @ code consumer } to this builder instance this can be useful for applying pre - packaged customizations

builder apply ( consumer < builder > builder consumer ) ;


public boolean has more ( ) { return cursor ( ) < array length ; }


return whether buckets should be returned as a hash in case { @ code keyed } is false , buckets will be returned as an array

public boolean keyed ( ) { return keyed ; }


combines < code > value < code > with any previously saved future register value at < code > from addrto addr < code > or any value stored in the program if there is no previously saved future value < br > when < code > value < code > has conflicting bits with the previously saved value , < code > value < code > will take precedence < br > if the register value is the value for the processor context register and a previously saved value does not exist , the user saved values in the stored context of the program will be used as existing value

public void set future register value ( address from addr , address to addr , register value value ) ;


return an iterator over the collection of { @ link schedulable entity } objects which orders them for container assignment

iterator < s > get assignment iterator ( iterator selector sel ) ;


external interface for setting the normalized version of the queue this class cannot normalize on it ' s own , but provides a way to store the normalized name of the target queue

public void update normalized queue ( string normalized queue name ) { this normalized queue = normalized queue name ; }


prune files , in batches there ' s optionally a sleep between each batch

private int inner prune ( final prune mode prune mode , final long cutoff , final string key prefix , final item collection < scan outcome > items ) throws i o exception { int item count = 0 ; try ( ancestor state state = initiate bulk write ( bulk operation state operation type prune , null ) ; duration info ignored = new duration info ( log , " pruning dynamo d b store " ) ) { array list < path > deletion batch = new array list < > ( s3guard ddb batch write request limit ) ; long delay = conf get time duration ( s3guard ddb background sleep msec key , s3guard ddb background sleep msec default , time unit milliseconds ) ; set < path > parent path set = new hash set < > ( ) ; set < path > cleared parent path set = new hash set < > ( ) ; / / declare the operation to delete a batch as a function so / / as to keep the code consistent across multiple uses callable raising i o e < void > delete batch operation = ( ) - > { / / lowest path entries get deleted first deletion batch sort ( path order comparators topmost path last ) ; process batch write request ( state , path to key ( deletion batch ) , null ) ; / / set authoritative false for each pruned dir listing / / if at least one entry was not a tombstone remove authoritative dir flag ( parent path set , state ) ; / / already cleared parent paths cleared parent path set add all ( parent path set ) ; parent path set clear ( ) ; return null ; } ; for ( item item : items ) { d d b path metadata md = path metadata dynamo d b translation item to path metadata ( item , username ) ; path path = md get file status ( ) get path ( ) ; boolean tombstone = md is deleted ( ) ; log debug ( " prune entry { } " , path ) ; deletion batch add ( path ) ; / / add parent path of item so it can be marked as non - auth / / this is only done if / / * it has not already been processed / / * the entry pruned is not a tombstone ( no need to update ) / / * the file is not in the root dir path parent path = path get parent ( ) ; if ( ! tombstone & & parent path ! = null & & ! parent path is root ( ) & & ! cleared parent path set contains ( parent path ) ) { parent path set add ( parent path ) ; } item count + + ; if ( deletion batch size ( ) = = s3guard ddb batch write request limit ) { delete batch operation apply ( ) ; deletion batch clear ( ) ; if ( delay > 0 ) { thread sleep ( delay ) ; } } } / / final batch of deletes if ( ! deletion batch is empty ( ) ) { delete batch operation apply ( ) ; } } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new interrupted i o exception ( " pruning was interrupted " ) ; } catch ( amazon dynamo d b exception e ) { throw translate dynamo d b exception ( key prefix , " prune of " + key prefix + " failed " , e ) ; } log info ( " finished pruning { } items in batches of { } " , item count , s3guard ddb batch write request limit ) ; return item count ; }


test that accept z value parameter correctly parses

public void test ignore z value ( ) throws i o exception { document mapper mapper = create document mapper ( field mapping ( b - > b field ( " type " , " geo shape " ) field ( " tree " , " quadtree " ) field ( " ignore z value " , true ) ) ) ; mapper field mapper = mapper mappers ( ) get mapper ( " field " ) ; assert that ( field mapper , instance of ( legacy geo shape field mapper class ) ) ; boolean ignore z value = ( ( legacy geo shape field mapper ) field mapper ) ignore z value ( ) ; assert that ( ignore z value , equal to ( true ) ) ; / / explicit false accept z value test mapper = create document mapper ( field mapping ( b - > b field ( " type " , " geo shape " ) field ( " tree " , " quadtree " ) field ( " ignore z value " , false ) ) ) ; field mapper = mapper mappers ( ) get mapper ( " field " ) ; assert that ( field mapper , instance of ( legacy geo shape field mapper class ) ) ; ignore z value = ( ( legacy geo shape field mapper ) field mapper ) ignore z value ( ) ; assert that ( ignore z value , equal to ( false ) ) ; assert field warnings ( " strategy " , " tree " ) ; }


an { @ link index setting provider } allows hooking in to parts of an index lifecycle to provide explicit default settings for newly created indices rather than changing the default values for an index - level setting , these act as though the setting has been set explicitly , but still allow the setting to be overridden by a template or creation request body

public collection < index setting provider > get additional index setting providers ( ) { return collections empty list ( ) ; }


returns the end offset of the line that contains the specified offset or if the offset is inside a line delimiter , the end offset of the next line

protected int end of line of ( int offset ) throws bad location exception { i region info = f document get line information of offset ( offset ) ; if ( offset < = info get offset ( ) + info get length ( ) ) return info get offset ( ) + info get length ( ) ; int line = f document get line of offset ( offset ) ; try { info = f document get line information ( line + 1 ) ; return info get offset ( ) + info get length ( ) ; } catch ( bad location exception x ) { return f document get length ( ) ; } }


refresh the ejb home object and retry the given invocation called by invoke on connect failure

protected object refresh and retry ( method invocation invocation ) throws throwable { try { refresh home ( ) ; } catch ( naming exception ex ) { throw new remote lookup failure exception ( " failed to locate remote ejb [ " + get jndi name ( ) + " ] " , ex ) ; } return do invoke ( invocation ) ; }


create but do not start the test webapp server the test webapp dir is preparedchecked in advance

public static http server 2 create test server ( configuration conf , string [ ] path specs ) throws i o exception { prepare test webapp ( ) ; return create server ( test , conf , path specs ) ; }


stop the daemon with the given status code

public void stop ( int rc ) { this result code = rc ; for ( journal node syncer j syncer : journal syncers by id values ( ) ) { j syncer stop sync ( ) ; } if ( rpc server ! = null ) { rpc server stop ( ) ; } if ( http server ! = null ) { try { http server stop ( ) ; } catch ( i o exception ioe ) { log warn ( " unable to stop http server for " + this , ioe ) ; } } for ( journal j : journals by id values ( ) ) { i o utils cleanup with logger ( log , j ) ; } default metrics system shutdown ( ) ; if ( journal node info bean name ! = null ) { m beans unregister ( journal node info bean name ) ; journal node info bean name = null ; } if ( tracer ! = null ) { tracer close ( ) ; tracer = null ; } }


returns all files in an apk that match a given regular expression

public static map < string , byte [ ] > get files ( file apk file , pattern regex ) throws i o exception { map < string , byte [ ] > files = new linked hash map < > ( ) ; / / retain insertion order / / extract apk try ( zip file apk zip = new zip file ( apk file ) ) { enumeration < ? extends zip entry > zip entries = apk zip entries ( ) ; while ( zip entries has more elements ( ) ) { zip entry zip entry = zip entries next element ( ) ; / / visit all files with the given extension if ( regex matcher ( zip entry get name ( ) ) matches ( ) ) { / / map class name to definition try ( input stream is = new buffered input stream ( apk zip get input stream ( zip entry ) ) ) { files put ( zip entry get name ( ) , byte streams to byte array ( is ) ) ; } } } } return files ; }


public void configure ( job conf job ) { super configure ( job ) ; max num items = job get long ( " aggregate max num unique values " , long max value ) ; }


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


sets the byte buffer providing access to the raw content of this zip entry

public zip entry with content ( byte buffer content ) { this content = content ; return this ; }


test verifies watcher type any - removes only the configured child watcher function

public void test remove any child watcher ( boolean use async ) throws exception { zk 1 create ( " / node 1 " , null , ids open acl unsafe , create mode persistent ) ; my watcher w 1 = new my watcher ( " / node 1 " , 2 ) ; my watcher w 2 = new my watcher ( " / node 1 " , 1 ) ; log info ( " adding data watcher { } on path { } " , w 1 , " / node 1 " ) ; assert not null ( zk 2 exists ( " / node 1 " , w 1 ) , " didn ' t set data watches " ) ; / / add multiple child watches log info ( " adding child watcher { } on path { } " , w 1 , " / node 1 " ) ; zk 2 get children ( " / node 1 " , w 2 ) ; log info ( " adding child watcher { } on path { } " , w 2 , " / node 1 " ) ; zk 2 get children ( " / node 1 " , w 1 ) ; remove watches ( zk 2 , " / node 1 " , w 2 , watcher type any , false , code ok , use async ) ; assert true ( w 2 matches ( ) , " didn ' t remove child watcher " ) ; assert equals ( 1 , zk 2 get child watches ( ) size ( ) , " didn ' t find child watcher " ) ; assert equals ( 1 , zk 2 get data watches ( ) size ( ) , " didn ' t find data watcher " ) ; remove watches ( zk 2 , " / node 1 " , w 1 , watcher type any , false , code ok , use async ) ; assert true ( w 1 matches ( ) , " didn ' t remove watchers " ) ; }


1 run a set of operations 2 trigger the nn failover 3 check the retry cache on the original standby nn

public void test retry cache on standby n n ( ) throws exception { / / 1 run operations d f s test util run operations ( cluster , dfs , conf , block size , 0 ) ; / / check retry cache in nn1 f s namesystem fsn 0 = cluster get namesystem ( 0 ) ; light weight cache < cache entry , cache entry > cache set = ( light weight cache < cache entry , cache entry > ) fsn 0 get retry cache ( ) get cache set ( ) ; assert equals ( " retry cache size is wrong " , 39 , cache set size ( ) ) ; map < cache entry , cache entry > old entries = new hash map < cache entry , cache entry > ( ) ; iterator < cache entry > iter = cache set iterator ( ) ; while ( iter has next ( ) ) { cache entry entry = iter next ( ) ; old entries put ( entry , entry ) ; } / / 2 failover the current standby to active cluster get name node ( 0 ) get rpc server ( ) roll edit log ( ) ; cluster get name node ( 1 ) get namesystem ( ) get edit log tailer ( ) do tail edits ( ) ; cluster shutdown name node ( 0 ) ; cluster transition to active ( 1 ) ; / / 3 check the retry cache on the new active nn f s namesystem fsn 1 = cluster get namesystem ( 1 ) ; cache set = ( light weight cache < cache entry , cache entry > ) fsn 1 get retry cache ( ) get cache set ( ) ; assert equals ( " retry cache size is wrong " , 39 , cache set size ( ) ) ; iter = cache set iterator ( ) ; while ( iter has next ( ) ) { cache entry entry = iter next ( ) ; assert true ( old entries contains key ( entry ) ) ; } }


loads a single glyph to the backing texture , if it fits

private boolean render glyph ( glyph glyph , int page x , int page y , int width , int height ) { scratch graphics set composite ( alpha composite clear ) ; scratch graphics fill rect ( 0 , 0 , max glyph size , max glyph size ) ; scratch graphics set composite ( alpha composite src over ) ; byte buffer glyph pixels = scratch byte buffer ; int format ; if ( unicode font get render type ( ) = = render type free type & & unicode font bitmap font ! = null ) { bitmap font data data = unicode font bitmap font get data ( ) ; bitmap font glyph g = data get glyph ( ( char ) glyph get code point ( ) ) ; pixmap font pixmap = unicode font bitmap font get regions ( ) get ( g page ) get texture ( ) get texture data ( ) consume pixmap ( ) ; int font width = font pixmap get width ( ) ; int pad top = unicode font get padding top ( ) , pad bottom = unicode font get padding bottom ( ) ; int pad left bytes = unicode font get padding left ( ) * 4 ; int pad x bytes = pad left bytes + unicode font get padding right ( ) * 4 ; int glyph row bytes = width * 4 , font row bytes = g width * 4 ; byte buffer font pixels = font pixmap get pixels ( ) ; byte [ ] row = new byte [ glyph row bytes ] ; glyph pixels position ( 0 ) ; for ( int i = 0 ; i < pad top ; i + + ) glyph pixels put ( row ) ; glyph pixels position ( ( height - pad bottom ) * glyph row bytes ) ; for ( int i = 0 ; i < pad bottom ; i + + ) glyph pixels put ( row ) ; glyph pixels position ( pad top * glyph row bytes ) ; for ( int y = 0 , n = g height ; y < n ; y + + ) { font pixels position ( ( ( g src y + y ) * font width + g src x ) * 4 ) ; font pixels get ( row , pad left bytes , font row bytes ) ; glyph pixels put ( row ) ; } font pixels position ( 0 ) ; glyph pixels position ( height * glyph row bytes ) ; glyph pixels flip ( ) ; format = gl11 gl rgba ; } else { / / draw the glyph to the scratch image using java 2 d if ( unicode font get render type ( ) = = render type native ) { for ( iterator iter = unicode font get effects ( ) iterator ( ) ; iter has next ( ) ; ) { effect effect = ( effect ) iter next ( ) ; if ( effect instanceof color effect ) scratch graphics set color ( ( ( color effect ) effect ) get color ( ) ) ; } scratch graphics set color ( java awt color white ) ; scratch graphics set font ( unicode font get font ( ) ) ; scratch graphics draw string ( " " + ( char ) glyph get code point ( ) , 0 , unicode font get ascent ( ) ) ; } else if ( unicode font get render type ( ) = = render type java ) { scratch graphics set color ( java awt color white ) ; for ( iterator iter = unicode font get effects ( ) iterator ( ) ; iter has next ( ) ; ) ( ( effect ) iter next ( ) ) draw ( scratch image , scratch graphics , unicode font , glyph ) ; glyph set shape ( null ) ; / / the shape will never be needed again } width = math min ( width , texture get width ( ) ) ; height = math min ( height , texture get height ( ) ) ; writable raster raster = scratch image get raster ( ) ; int [ ] row = new int [ width ] ; for ( int y = 0 ; y < height ; y + + ) { raster get data elements ( 0 , y , width , 1 , row ) ; scratch int buffer put ( row ) ; } format = gl12 gl bgra ; } / / simple deduplication , doesn ' t work across pages of course string hash = " " ; try { message digest md = message digest get instance ( " sha - 256 " ) ; md update ( glyph pixels ) ; big integer big int = new big integer ( 1 , md digest ( ) ) ; hash = big int to string ( 16 ) ; } catch ( no such algorithm exception ex ) { } scratch byte buffer clear ( ) ; scratch int buffer clear ( ) ; try { for ( int i = 0 , n = hashes size ( ) ; i < n ; i + + ) { string other = hashes get ( i ) ; if ( other equals ( hash ) ) { glyph dupe = page glyphs get ( i ) ; glyph set texture ( dupe texture , dupe u , dupe v , dupe u 2 , dupe v 2 ) ; return false ; } } } finally { hashes add ( hash ) ; page glyphs add ( glyph ) ; } gdx gl gl tex sub image 2 d ( texture gl target , 0 , page x , page y , width , height , format , gl11 gl unsigned byte , glyph pixels ) ; float u = page x / ( float ) texture get width ( ) ; float v = page y / ( float ) texture get height ( ) ; float u 2 = ( page x + width ) / ( float ) texture get width ( ) ; float v 2 = ( page y + height ) / ( float ) texture get height ( ) ; glyph set texture ( texture , u , v , u 2 , v 2 ) ; return true ; }


get the preferred load address space for an allocated program segment the other space is reserved and should not be returned by this method

public address space get preferred segment address space ( elf load helper elf load helper , elf program header elf program header ) { program program = elf load helper get program ( ) ; if ( elf program header is execute ( ) ) { return program get address factory ( ) get default address space ( ) ; } / / segment is not marked execute , use the data space by default return program get language ( ) get default data space ( ) ; }


returns the wait time this is the amount of time that the feedback operator keeps listening for feedback elements once the time expires the operation will close and will not receive further elements

public long get wait time ( ) { return wait time ; }


record an attempt to update the metadata that failed we need to keep track of this to avoid retrying immediately

public synchronized void failed update ( long now ) { this last refresh ms = now ; }


writes a trace message to indicate that a given section of code has begun this call must be followed by a corresponding call to { @ link # end section ( ) } on the same thread

public static void begin section ( string name ) { s instance begin section ( name ) ; }


sets the state to state reading adts header

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


waits until all enqueued operations are complete , but at most the given amount of milliseconds if the thread gets interrupted , any { @ link interrupted exception } will be rethrown as a { @ link dao exception }

public synchronized boolean wait for completion ( int max millis ) { if ( ! is completed ( ) ) { try { wait ( max millis ) ; } catch ( interrupted exception e ) { throw new dao exception ( " interrupted while waiting for all operations to complete " , e ) ; } } return is completed ( ) ; }


returns a reader for reading this file as characters @ throw gdx runtime exception if the file handle represents a directory , doesn ' t exist , or could not be read

public reader reader ( ) { return new input stream reader ( read ( ) ) ; }


test serialization of outer string types

public void fake outer string serialize test ( ) throws i o exception { string body = null ; string response = api fake outer string serialize ( body ) ; / / todo : test validations }


tests that a job master will restore the given job graph from its savepoint upon initial submission

public void test restoring from savepoint ( ) throws exception { / / create savepoint data final long savepoint id = 42l ; final file savepoint file = create savepoint ( savepoint id ) ; / / set savepoint settings final savepoint restore settings savepoint restore settings = savepoint restore settings for path ( savepoint file get absolute path ( ) , true ) ; final job graph job graph = create job graph with checkpointing ( savepoint restore settings ) ; final standalone completed checkpoint store completed checkpoint store = new standalone completed checkpoint store ( 1 ) ; final checkpoint recovery factory testing checkpoint recovery factory = use same services for all jobs ( completed checkpoint store , new standalone checkpoint i d counter ( ) ) ; ha services set checkpoint recovery factory ( testing checkpoint recovery factory ) ; final job master job master = new job master builder ( job graph , rpc service ) with high availability services ( ha services ) create job master ( ) ; try { / / starting the job master should have read the savepoint final completed checkpoint savepoint checkpoint = completed checkpoint store get latest checkpoint ( false ) ; assert that ( savepoint checkpoint , matchers not null value ( ) ) ; assert that ( savepoint checkpoint get checkpoint i d ( ) , is ( savepoint id ) ) ; } finally { rpc utils terminate rpc endpoint ( job master , testing timeout ) ; } }


returns a new , empty builder for { @ link immutable int array } instances , with a default initial capacity the returned builder is not thread - safe < b > performance note : < b > the { @ link immutable int array } that is built will very likely occupy more memory than necessary ; to trim memory usage , build using { @ code builder build ( ) trimmed ( ) }

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


protected void update scheduler health information ( resource released resources , int released containers ) { scheduler health update scheduler release details ( get last node update time ( ) , released resources ) ; scheduler health update scheduler release counts ( released containers ) ; }


get or create the specified type namespace the returned namespace may only be a partial namespace if errors occurred the caller should check the returned namespace and adjust any symbol creation accordingly

public static namespace create namespace ( program program , demangled type namespace , namespace parent namespace , boolean function permitted ) { namespace namespace = parent namespace ; if ( namespace = = null ) { namespace = program get global namespace ( ) ; } for ( string namespace name : get namespace list ( type namespace ) ) { / / todo - this is compensating for too long templates we should probably genericize / / templates so that any class with the same number of template parameters and / / same name is the same class - - would that reflect reality ? namespace name = ensure name length ( namespace name ) ; symbol table symbol table = program get symbol table ( ) ; list < symbol > symbols = symbol table get symbols ( namespace name , namespace ) ; symbol namespace symbol = symbols stream ( ) filter ( s - > ( s get symbol type ( ) = = symbol type namespace | | s get symbol type ( ) = = symbol type class ) ) find first ( ) or else ( null ) ; if ( namespace symbol = = null ) { try { namespace = symbol table create name space ( namespace , namespace name , source type imported ) ; } catch ( duplicate name exception e ) { msg error ( demangled object class , " failed to create namespace due to name conflict : " + namespace utils get namespace qualified name ( namespace , namespace name , false ) ) ; break ; } catch ( invalid input exception e ) { msg error ( demangled object class , " failed to create namespace : " + e get message ( ) ) ; break ; } } else if ( is permitted namespace symbol ( namespace symbol , function permitted ) ) { namespace = ( namespace ) namespace symbol get object ( ) ; } else { msg error ( demangled object class , " failed to create namespace due to name conflict : " + namespace utils get namespace qualified name ( namespace , namespace name , false ) ) ; break ; } } return namespace ; }


public synchronized job status get job status ( ) { return current status ; }


interns the f s r l root so that its parent parts are shared with already interned instances caller needs to hold sync mutex

private f s r l root intern ( f s r l root fsrl ) { if ( local f s r l equals ( fsrl ) ) { return local f s r l ; } fsrl container = fsrl get container ( ) ; if ( container ! = null ) { f s r l root parent f s r l = intern ( container get f s ( ) ) ; if ( parent f s r l ! = container get f s ( ) ) { fsrl interned container = parent f s r l with path ( container ) ; fsrl = f s r l root nested f s ( interned container , fsrl ) ; } } f s r l root existing = fsrl intern map get ( fsrl ) ; if ( existing = = null ) { fsrl intern map put ( fsrl , fsrl ) ; existing = fsrl ; } return existing ; }


add an aggregation to perform as part of the search

public search source builder aggregation ( pipeline aggregation builder aggregation ) { if ( aggregations = = null ) { aggregations = aggregator factories builder ( ) ; } aggregations add pipeline aggregator ( aggregation ) ; return this ; }


public void remove ( @ non null final string key ) { remove ( key , false ) ; }


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


public static string get document link ( final string database name , final string collection name , final string document id ) { return get collection link ( database name , collection name ) + " / docs / " + document id ; }


returns { @ code true } if the given exif orientation indicates that a transformation is necessary and { @ code false } otherwise

public static boolean is exif orientation required ( int exif orientation ) { switch ( exif orientation ) { case exif interface orientation flip horizontal : case exif interface orientation rotate 180 : case exif interface orientation flip vertical : case exif interface orientation transpose : case exif interface orientation rotate 90 : case exif interface orientation transverse : case exif interface orientation rotate 270 : return true ; default : return false ; } }


return the type of a given field implementations should be able to determine the type even when the field value is { @ code null } , for example from some associated descriptor

class < ? > get field type ( string field ) ;


performs a traversal about logical the multi - map that results from the union of the given maps this method does not actually build a union of the map , but traverses the hash maps together

public static < k , v > void traverse maps ( final key map < k , v > [ ] maps , final traversal evaluator < k , v > visitor , final long touched tag ) throws exception { / / we need to work on the maps in descending size arrays sort ( maps , capacity descending comparator instance ) ; final int [ ] shifts = new int [ maps length ] ; final int [ ] low bits mask = new int [ maps length ] ; final int num slots = maps [ 0 ] table length ; final int num tables = maps length ; / / figure out how much each hash table collapses the entries for ( int i = 0 ; i < num tables ; i + + ) { shifts [ i ] = maps [ 0 ] log 2size - maps [ i ] log 2size ; low bits mask [ i ] = ( 1 < < shifts [ i ] ) - 1 ; } / / go over all slots ( based on the largest hash table ) for ( int pos = 0 ; pos < num slots ; pos + + ) { / / for each slot , go over all tables , until the table does not have that slot any more / / for tables where multiple slots collapse into one , we visit that one when we process / / the / / latest of all slots that collapse to that one int mask ; for ( int root table = 0 ; root table < num tables & & ( ( mask = low bits mask [ root table ] ) & pos ) = = mask ; root table + + ) { / / use that table to gather keys and start collecting keys from the following tables / / go over all entries of that slot in the table entry < k , v > entry = maps [ root table ] table [ pos > > shifts [ root table ] ] ; while ( entry ! = null ) { / / take only entries that have not been collected as part of other tables if ( entry touched tag < touched tag ) { entry touched tag = touched tag ; final k key = entry key ; final int hash code = entry hash code ; visitor start new key ( key ) ; visitor next value ( entry value ) ; add entries from chain ( entry next , visitor , key , touched tag , hash code ) ; / / go over the other hash tables and collect their entries for the key for ( int followup table = root table + 1 ; followup table < num tables ; followup table + + ) { entry < k , v > followup entry = maps [ followup table ] table [ pos > > shifts [ followup table ] ] ; if ( followup entry ! = null ) { add entries from chain ( followup entry , visitor , key , touched tag , hash code ) ; } } visitor key done ( ) ; } entry = entry next ; } } } }


invokes { @ code unit } { @ link time unit # sleep ( long ) sleep ( sleep for ) } uninterruptibly

public static void sleep uninterruptibly ( long sleep for , time unit unit ) { boolean interrupted = false ; try { long remaining nanos = unit to nanos ( sleep for ) ; long end = system nano time ( ) + remaining nanos ; while ( true ) { try { / / time unit sleep ( ) treats negative timeouts just like zero nanoseconds sleep ( remaining nanos ) ; return ; } catch ( interrupted exception e ) { interrupted = true ; remaining nanos = end - system nano time ( ) ; } } } finally { if ( interrupted ) { thread current thread ( ) interrupt ( ) ; } } }


checks if the given { @ link saveable } is currently in the bulk change the expected usage is from the { @ link saveable # save ( ) } implementation to check if the actual persistence should happen now or not

public static boolean contains ( saveable s ) { for ( bulk change b = current ( ) ; b ! = null ; b = b parent ) if ( b saveable = = s | | b saveable = = all ) return true ; return false ; }


run a set of threads making changes to the deprecations concurrently with another set of threads calling get ( ) and set ( ) on configuration objects

public void test concurrent deprecate and manipulate ( ) throws exception { final int num thread ids = 10 ; final int num keys per thread = 1000 ; scheduled thread pool executor executor = new scheduled thread pool executor ( 2 * num thread ids , new thread factory builder ( ) set daemon ( true ) set name format ( " test concurrent deprecate and manipulate modification thread % d " ) build ( ) ) ; final count down latch latch = new count down latch ( 1 ) ; final atomic integer highest modification thread id = new atomic integer ( 1 ) ; list < future < void > > futures = new linked list < future < void > > ( ) ; for ( int i = 0 ; i < num thread ids ; i + + ) { futures add ( executor schedule ( new callable < void > ( ) { @ override public void call ( ) throws exception { latch await ( ) ; int thread index = highest modification thread id add and get ( 1 ) ; for ( int i = 0 ; i < num keys per thread ; i + + ) { string test key = get test key name ( thread index , i ) ; string test new key = test key + " new " ; configuration add deprecations ( new deprecation delta [ ] { new deprecation delta ( test key , test new key ) } ) ; } return null ; } } , 0 , time unit seconds ) ) ; } final atomic integer highest access thread id = new atomic integer ( 1 ) ; for ( int i = 0 ; i < num thread ids ; i + + ) { futures add ( executor schedule ( new callable < void > ( ) { @ override public void call ( ) throws exception { configuration conf = new configuration ( ) ; latch await ( ) ; int thread index = highest access thread id add and get ( 1 ) ; for ( int i = 0 ; i < num keys per thread ; i + + ) { string test new key = get test key name ( thread index , i ) + " new " ; string value = " value " + thread index + " " + i ; conf set ( test new key , value ) ; assert assert equals ( value , conf get ( test new key ) ) ; } return null ; } } , 0 , time unit seconds ) ) ; } latch count down ( ) ; / / allow all threads to proceed for ( future < void > future : futures ) { uninterruptibles get uninterruptibly ( future ) ; } }


create an array of { @ link sql parameter source } objects populated with data from the values passed in ( either a { @ link map } or a bean object ) this will define what is included in a batch operation

public static sql parameter source [ ] create batch ( collection < ? > candidates ) { sql parameter source [ ] batch = new sql parameter source [ candidates size ( ) ] ; int i = 0 ; for ( object candidate : candidates ) { batch [ i ] = ( candidate instanceof map ? new map sql parameter source ( ( map < string , ? > ) candidate ) : new bean property sql parameter source ( candidate ) ) ; i + + ; } return batch ; }


see { @ link media session compat callback # on skip to previous ( ) }

void on skip to previous ( player player , control dispatcher control dispatcher ) ;


construct the first part of a " tc " command to define a qdisc child handler for the given interface this can only be used if a root handler has been appropriately defined first ( as in { @ link # root handler } )

private void child handler ( string network device , consumer < string > consumer ) { stream of ( " sudo " , " tc " , " qdisc " , " add " , " dev " , network device , " parent " , " 1 : 1 " , " handle " , " 10 : " ) for each ( consumer ) ; }


optional , max retry times for jdbc connector

public builder set max retry times ( int max retry times ) { execution options builder with max retries ( max retry times ) ; return this ; }


returns the pattern given at the constructor , without slashes at both ends

public string pattern ( ) { return pattern ; }


constructor for a mount table entry with a single destinations

public static mount table new instance ( final string src , final map < string , string > destinations , long date created , long date modified ) throws i o exception { mount table record = new instance ( src , destinations ) ; record set date created ( date created ) ; record set date modified ( date modified ) ; return record ; }


current size of { @ link blocking queue } used by the thread - pool

public number get current queue size ( ) { return thread pool get queue ( ) size ( ) ; }


void write successful ( final string dest key ) { log debug ( " finished write to { } " , dest key ) ; }


handles merging all options and verifying from the given command line output and the given base configuration and returns the merged configuration

private configuration handle options ( parsed output opts , configuration base ) throws config exception { / / ensure variables are overwritten and verified config extractor extractor = new config extractor ( base ) ; / / overwrite the map amount and check to ensure > 0 { integer map amount = null ; try { map amount = extractor get map amount ( opts get value ( config option maps get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging map amount " , e ) ; } if ( map amount ! = null ) { if ( map amount < = 0 ) { throw new config exception ( " map amount can not be less than or equal to zero " ) ; } base set ( config option maps get cfg option ( ) , map amount to string ( ) ) ; } } / / overwrite the reducer amount and check to ensure > 0 { integer reduce amount = null ; try { reduce amount = extractor get map amount ( opts get value ( config option reduces get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging reducer amount " , e ) ; } if ( reduce amount ! = null ) { if ( reduce amount < = 0 ) { throw new config exception ( " reducer amount can not be less than or equal to zero " ) ; } base set ( config option reduces get cfg option ( ) , reduce amount to string ( ) ) ; } } / / overwrite the duration amount and ensure > 0 { integer duration = null ; try { duration = extractor get duration ( opts get value ( config option duration get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging duration " , e ) ; } if ( duration ! = null ) { if ( duration < = 0 ) { throw new config exception ( " duration can not be less than or equal to zero " ) ; } base set ( config option duration get cfg option ( ) , duration to string ( ) ) ; } } / / overwrite the operation amount and ensure > 0 { integer operation amount = null ; try { operation amount = extractor get op count ( opts get value ( config option ops get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging operation amount " , e ) ; } if ( operation amount ! = null ) { if ( operation amount < = 0 ) { throw new config exception ( " operation amount can not be less than or equal to zero " ) ; } base set ( config option ops get cfg option ( ) , operation amount to string ( ) ) ; } } / / overwrite the exit on error setting { try { boolean exit on error = extractor should exit on first error ( opts get value ( config option exit on error get opt ( ) ) ) ; base set boolean ( config option exit on error get cfg option ( ) , exit on error ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging exit on error value " , e ) ; } } / / overwrite the truncate wait setting { try { boolean wait on truncate = extractor should wait on truncate ( opts get value ( config option truncate wait get opt ( ) ) ) ; base set boolean ( config option truncate wait get cfg option ( ) , wait on truncate ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging wait on truncate value " , e ) ; } } / / verify and set file limit and ensure > 0 { integer file am = null ; try { file am = extractor get total files ( opts get value ( config option files get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging total file limit amount " , e ) ; } if ( file am ! = null ) { if ( file am < = 0 ) { throw new config exception ( " file amount can not be less than or equal to zero " ) ; } base set ( config option files get cfg option ( ) , file am to string ( ) ) ; } } / / set the grid queue to run on { try { string qname = extractor get queue name ( opts get value ( config option queue name get opt ( ) ) ) ; if ( qname ! = null ) { base set ( config option queue name get cfg option ( ) , qname ) ; } } catch ( exception e ) { throw new config exception ( " error extracting & merging queue name " , e ) ; } } / / verify and set the directory limit and ensure > 0 { integer directory limit = null ; try { directory limit = extractor get dir size ( opts get value ( config option dir size get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging directory file limit " , e ) ; } if ( directory limit ! = null ) { if ( directory limit < = 0 ) { throw new config exception ( " directory file limit can not be less than or equal to zero " ) ; } base set ( config option dir size get cfg option ( ) , directory limit to string ( ) ) ; } } / / set the base directory { path basedir = null ; try { basedir = extractor get base directory ( opts get value ( config option base dir get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging base directory " , e ) ; } if ( basedir ! = null ) { / / always ensure in slive dir basedir = new path ( basedir , constants base dir ) ; base set ( config option base dir get cfg option ( ) , basedir to string ( ) ) ; } } / / set the result file { string fn = null ; try { fn = extractor get result file ( opts get value ( config option result file get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging result file " , e ) ; } if ( fn ! = null ) { base set ( config option result file get cfg option ( ) , fn ) ; } } { string fn = null ; try { fn = extractor get result file ( opts get value ( config option result file get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging result file " , e ) ; } if ( fn ! = null ) { base set ( config option result file get cfg option ( ) , fn ) ; } } / / set the operations { try { base = handle operations ( opts , base , extractor ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging operations " , e ) ; } } / / set the replication amount range { range < short > replication am = null ; try { replication am = extractor get replication ( opts get value ( config option replication am get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging replication amount range " , e ) ; } if ( replication am ! = null ) { int min repl = base get int ( constants min replication , 1 ) ; if ( replication am get lower ( ) < min repl ) { throw new config exception ( " replication amount minimum is less than property configured minimum " + min repl ) ; } if ( replication am get lower ( ) > replication am get upper ( ) ) { throw new config exception ( " replication amount minimum is greater than its maximum " ) ; } if ( replication am get lower ( ) < = 0 ) { throw new config exception ( " replication amount minimum must be greater than zero " ) ; } base set ( config option replication am get cfg option ( ) , replication am to string ( ) ) ; } } / / set the sleep range { range < long > sleep range = null ; try { sleep range = extractor get sleep range ( opts get value ( config option sleep time get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging sleep size range " , e ) ; } if ( sleep range ! = null ) { if ( sleep range get lower ( ) > sleep range get upper ( ) ) { throw new config exception ( " sleep range minimum is greater than its maximum " ) ; } if ( sleep range get lower ( ) < = 0 ) { throw new config exception ( " sleep range minimum must be greater than zero " ) ; } base set ( config option sleep time get cfg option ( ) , sleep range to string ( ) ) ; } } / / set the packet size if given { string p size = opts get value ( config option packet size get opt ( ) ) ; if ( p size = = null ) { p size = config option packet size get default ( ) ; } if ( p size ! = null ) { try { long packet size = string utils traditional binary prefix string 2long ( p size ) ; base set ( config option packet size get cfg option ( ) , packet size to string ( ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging write packet size " , e ) ; } } } / / set the block size range { range < long > block size = null ; try { block size = extractor get block size ( opts get value ( config option block size get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging block size range " , e ) ; } if ( block size ! = null ) { if ( block size get lower ( ) > block size get upper ( ) ) { throw new config exception ( " block size minimum is greater than its maximum " ) ; } if ( block size get lower ( ) < = 0 ) { throw new config exception ( " block size minimum must be greater than zero " ) ; } / / ensure block size is a multiple of bytes per checksum / / if a value is set in the configuration long bytes per checksum = extractor get byte check sum ( ) ; if ( bytes per checksum ! = null ) { if ( ( block size get lower ( ) % bytes per checksum ) ! = 0 ) { throw new config exception ( " blocksize lower bound must be a multiple of " + bytes per checksum ) ; } if ( ( block size get upper ( ) % bytes per checksum ) ! = 0 ) { throw new config exception ( " blocksize upper bound must be a multiple of " + bytes per checksum ) ; } } base set ( config option block size get cfg option ( ) , block size to string ( ) ) ; } } / / set the read size range { range < long > read size = null ; try { read size = extractor get read size ( opts get value ( config option read size get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging read size range " , e ) ; } if ( read size ! = null ) { if ( read size get lower ( ) > read size get upper ( ) ) { throw new config exception ( " read size minimum is greater than its maximum " ) ; } if ( read size get lower ( ) < 0 ) { throw new config exception ( " read size minimum must be greater than or equal to zero " ) ; } base set ( config option read size get cfg option ( ) , read size to string ( ) ) ; } } / / set the write size range { range < long > write size = null ; try { write size = extractor get write size ( opts get value ( config option write size get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging write size range " , e ) ; } if ( write size ! = null ) { if ( write size get lower ( ) > write size get upper ( ) ) { throw new config exception ( " write size minimum is greater than its maximum " ) ; } if ( write size get lower ( ) < 0 ) { throw new config exception ( " write size minimum must be greater than or equal to zero " ) ; } base set ( config option write size get cfg option ( ) , write size to string ( ) ) ; } } / / set the append size range { range < long > append size = null ; try { append size = extractor get append size ( opts get value ( config option append size get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging append size range " , e ) ; } if ( append size ! = null ) { if ( append size get lower ( ) > append size get upper ( ) ) { throw new config exception ( " append size minimum is greater than its maximum " ) ; } if ( append size get lower ( ) < 0 ) { throw new config exception ( " append size minimum must be greater than or equal to zero " ) ; } base set ( config option append size get cfg option ( ) , append size to string ( ) ) ; } } / / set the truncate size range { range < long > truncate size = null ; try { truncate size = extractor get truncate size ( opts get value ( config option truncate size get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging truncate size range " , e ) ; } if ( truncate size ! = null ) { if ( truncate size get lower ( ) > truncate size get upper ( ) ) { throw new config exception ( " truncate size minimum is greater than its maximum " ) ; } if ( truncate size get lower ( ) < 0 ) { throw new config exception ( " truncate size minimum must be greater than or equal to zero " ) ; } base set ( config option truncate size get cfg option ( ) , truncate size to string ( ) ) ; } } / / set the seed { long seed = null ; try { seed = extractor get random seed ( opts get value ( config option random seed get opt ( ) ) ) ; } catch ( exception e ) { throw new config exception ( " error extracting & merging random number seed " , e ) ; } if ( seed ! = null ) { base set ( config option random seed get cfg option ( ) , seed to string ( ) ) ; } } return base ; }


applies this function to the given argument and its index within a stream


returns a builder object for creating classpath arguments

public classpath builder classpath ( ) { return classpath ; }


adds an applier which will be called after all high priority and normal appliers have been called

public void add low priority applier ( cluster state applier applier ) { low priority state appliers add ( applier ) ; }


serialize a hadoop { @ link configuration } into byte [ ]

public static byte [ ] serialize configuration ( configuration conf ) { try { return serialize writable ( conf ) ; } catch ( i o exception e ) { throw new runtime exception ( " encounter an i o exception when serialize the configuration " , e ) ; } }


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

void exit guid escaped literal ( sql base parser guid escaped literal context ctx ) ;


return a handler mapping with the mapped resource handlers ; or { @ code null } in case of no registrations

protected abstract handler mapping get handler mapping ( ) { if ( this registrations is empty ( ) ) { return null ; } map < string , http request handler > url map = new linked hash map < > ( ) ; for ( resource handler registration registration : this registrations ) { for ( string path pattern : registration get path patterns ( ) ) { resource http request handler handler = registration get request handler ( ) ; if ( this path helper ! = null ) { handler set url path helper ( this path helper ) ; } if ( this content negotiation manager ! = null ) { handler set content negotiation manager ( this content negotiation manager ) ; } handler set servlet context ( this servlet context ) ; handler set application context ( this application context ) ; try { handler after properties set ( ) ; } catch ( throwable ex ) { throw new bean initialization exception ( " failed to init resource http request handler " , ex ) ; } url map put ( path pattern , handler ) ; } } return new simple url handler mapping ( url map , this order ) ; }


static stream < arguments > normal bean provider ( ) { business business = new business impl ( ) ; string bean name = " business " ; string cache key = " business - key " ; return stream of ( arguments of ( business , bean name , cache key ) ) ; }


convert the specified dynamic symbol to a named symbol both symbol removed and symbol added notifications are performed , although the symbol instance is changed and continues to be valid

void convert dynamic symbol ( symbol d b symbol , string new name , long new parent i d , source type source ) { if ( source = = source type default ) { string msg = " can ' t rename dynamic symbol ' " + symbol get name ( ) + " ' and set its new source to default " ; throw new illegal argument exception ( msg ) ; } lock acquire ( ) ; try { long old key = symbol get key ( ) ; address address = symbol get address ( ) ; symbol removed ( symbol , address , symbol get name ( ) , old key , namespace global namespace id , null ) ; d b record record = adapter create symbol ( new name , address , new parent i d , symbol type label , 0 , 1 , null , source ) ; symbol set record ( record ) ; / / symbol object was morphed symbol added ( symbol ) ; } catch ( i o exception e ) { db error ( e ) ; } finally { lock release ( ) ; } }


public void remove server ( internal instrumented < server stats > server ) { remove ( servers , server ) ; server socket map prev = per server sockets remove ( id ( server ) ) ; assert prev ! = null ; assert prev is empty ( ) ; }


returns the paths of the files not yet processed

private map < path , file status > list eligible files ( file system file system , path path ) { final file status [ ] statuses ; try { statuses = file system list status ( path ) ; } catch ( i o exception e ) { / / we may run into an i o exception if files are moved while listing their status / / delay the check for eligible files in this case return collections empty map ( ) ; } if ( statuses = = null ) { log warn ( " path does not exist : { } " , path ) ; return collections empty map ( ) ; } else { map < path , file status > files = new hash map < > ( ) ; / / handle the new files for ( file status status : statuses ) { if ( ! status is dir ( ) ) { path file path = status get path ( ) ; long modification time = status get modification time ( ) ; if ( ! should ignore ( file path , modification time ) ) { files put ( file path , status ) ; } } else if ( format get nested file enumeration ( ) & & format accept file ( status ) ) { files put all ( list eligible files ( file system , status get path ( ) ) ) ; } } return files ; } }


schedules a punctuation for the processor

public cancellable schedule ( final long interval , final punctuation type type , final punctuator punctuator ) { switch ( type ) { case stream time : / / align punctuation to 0l , punctuate as soon as we have data return schedule ( 0l , interval , type , punctuator ) ; case wall clock time : / / align punctuation to now , punctuate after interval has elapsed return schedule ( time milliseconds ( ) + interval , interval , type , punctuator ) ; default : throw new illegal argument exception ( " unrecognized punctuation type : " + type ) ; } }


invoked upon completion of the operation

void on completion ( throwable error , v result ) ;


helper method to set username for the first http basic authentication

public void set username ( string username ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof http basic auth ) { ( ( http basic auth ) auth ) set username ( username ) ; return ; } } throw new runtime exception ( " no http basic authentication configured ! " ) ; }


create a { @ code sql xml value } instance for the given xml data , as supported by the underlying jdbc driver

sql xml value new sql xml value ( xml character stream provider provider ) ;


returns the singleton instance of this validator , with local validation as required

public static synchronized domain validator get instance ( boolean allow local ) { in use = true ; if ( allow local ) { return domain validator with local ; } return domain validator ; }


given ' path ' , returns the existing directory inode it designates , following symbolic links may fail with enotdir , or any exception from path walk

private in memory directory info get directory ( path path ) throws i o exception { return ( in memory directory info ) get directory errno ( path ) value or throw ( path ) ; }


returns the value of the specified global variable , or null if not bound does not look in the predeclared environment

public object get global ( string name ) { integer i = global index get ( name ) ; return i ! = null ? globals [ i ] : null ; }


returns the task object that should be used to keep track of the processing of the request

default task create task ( long id , string type , string action , task id parent task id , map < string , string > headers ) { return new task ( id , type , action , get description ( ) , parent task id , headers ) ; }


a debugging tool to print all stack traces , as jstack does

static void print all stack traces ( ) { for ( thread info info : management factory get thread m x bean ( ) dump all threads ( true , true ) ) { system err print ( info ) ; } }


test proper handling where an object tests equal to null

public void test invalid equals null ( ) { object obj = new invalid equals null object ( ) ; equals tester add equality group ( obj ) ; try { equals tester test equals ( ) ; } catch ( assertion failed error e ) { assert error message ( e , obj + " must not be object # equals to null " ) ; return ; } fail ( " should get equal to null error " ) ; }


set the indirect storage flag associated with a record

private void enable indirect storage ( int index , boolean state ) { buffer put byte ( header size + offset size + ( index * entry size ) , state ? ( byte ) 1 : ( byte ) 0 ) ; }


public ok http channel builder keep alive time ( long keep alive time , time unit time unit ) { preconditions check argument ( keep alive time > 0l , " keepalive time must be positive " ) ; keep alive time nanos = time unit to nanos ( keep alive time ) ; keep alive time nanos = keep alive manager clamp keep alive time in nanos ( keep alive time nanos ) ; if ( keep alive time nanos > = as large as infinite ) { / / bump keepalive time to infinite this disables keepalive keep alive time nanos = keepalive time nanos disabled ; } return this ; }


load aggregation white lists based content parameter value

public static void load ( string content ) { if ( string utils is blank ( content ) ) { fatal log error ( " aggr data id whitelist is blank " ) ; return ; } default log warn ( " [ aggr - data ids ] { } " , content ) ; try { list < string > lines = io utils read lines ( new string reader ( content ) ) ; compile ( lines ) ; } catch ( exception ioe ) { default log error ( " failed to load aggr whitelist , " + ioe to string ( ) , ioe ) ; } }


tests setting replication of provided files

public void test set replication for provided files ( ) throws exception { create image ( new f s tree walk ( provided path , conf ) , nn dir path , fixed block resolver class ) ; / / 10 datanodes with both disk and provided storage start cluster ( nn dir path , 10 , new storage type [ ] { storage type provided , storage type disk } , null , false ) ; set and unset replication ( " / " + file prefix + ( num files - 1 ) + file suffix ) ; }


simply verify invocation structure in memory : entrance node ( default context name ) - - interface node ( interface name ) - - - - method node ( resource name )

private void verify invocation structure ( invoker invoker , invocation invocation ) { context context = context util get context ( ) ; assert not null ( context ) ; / / as not call context util enter ( resource name , application ) in sentinel dubbo consumer filter , use default context / / in actual project , a consumer is usually also a provider , the context will be created by sentinel dubbo provider filter / / if consumer is on the top of dubbo rpc invocation chain , use default context string resource name = filter get method resource name ( invoker , invocation ) ; assert equals ( constants context default name , context get name ( ) ) ; assert equals ( " " , context get origin ( ) ) ; default node entrance node = context get entrance node ( ) ; resource wrapper entrance resource = entrance node get id ( ) ; assert equals ( constants context default name , entrance resource get name ( ) ) ; assert same ( entry type in , entrance resource get entry type ( ) ) ; / / as sph u entry ( interface name , entry type out ) ; set < node > child list = entrance node get child list ( ) ; assert equals ( 1 , child list size ( ) ) ; default node interface node = ( default node ) child list iterator ( ) next ( ) ; resource wrapper interface resource = interface node get id ( ) ; assert equals ( demo service class get name ( ) , interface resource get name ( ) ) ; assert same ( entry type out , interface resource get entry type ( ) ) ; / / as sph u entry ( resource name , entry type out ) ; child list = interface node get child list ( ) ; assert equals ( 1 , child list size ( ) ) ; default node method node = ( default node ) child list iterator ( ) next ( ) ; resource wrapper method resource = method node get id ( ) ; assert equals ( resource name , method resource get name ( ) ) ; assert same ( entry type out , method resource get entry type ( ) ) ; / / verify cur entry entry cur entry = context get cur entry ( ) ; assert same ( method node , cur entry get cur node ( ) ) ; assert same ( interface node , cur entry get last node ( ) ) ; assert null ( cur entry get origin node ( ) ) ; / / as context origin is not " " , no origin node should be created in cur entry / / verify cluster node cluster node method cluster node = method node get cluster node ( ) ; cluster node interface cluster node = interface node get cluster node ( ) ; assert not same ( method cluster node , interface cluster node ) ; / / different resource - > different processor slot - > different cluster node / / as context origin is " " , the statistic node should not be created in origin count map of cluster node map < string , statistic node > method origin count map = method cluster node get origin count map ( ) ; assert equals ( 0 , method origin count map size ( ) ) ; map < string , statistic node > interface origin count map = interface cluster node get origin count map ( ) ; assert equals ( 0 , interface origin count map size ( ) ) ; }


returns the fair share as a fraction of the entire cluster capacity

public float get fair share memory fraction ( ) { return fraction mem fair share ; }


get the parameter value that triggered the parameter flow control

public string get limit param ( ) { return get message ( ) ; }


test payload with more than one discriminator

public void test one of multiple discriminators ( ) throws exception { / / ' shape type ' is a discriminator for the ' shape ' model and / / ' triangle type ' is a discriminator forr the ' triangle ' model string str = " { \ " shape type \ " : \ " triangle \ " , \ " triangle type \ " : \ " equilateral triangle \ " } " ; / / we should be able to deserialize a equilateral triangle into a equilateral triangle class equilateral triangle t = json get context ( null ) read value ( str , equilateral triangle class ) ; assert not null ( t ) ; / / we should be able to deserialize a equilateral triangle into a triangle abstract open api schema o = json get context ( null ) read value ( str , triangle class ) ; assert not null ( o ) ; assert true ( o get actual instance ( ) instanceof equilateral triangle ) ; / / we should be able to deserialize a equilateral triangle into a shape o = json get context ( null ) read value ( str , shape class ) ; / / the container is a shape , and the actual instance should be a equilateral triangle assert true ( o instanceof shape ) ; / * comment out while unboxing nested one of / any of is still in discussion assert true ( o get actual instance ( ) instanceof equilateral triangle ) ; / / it is not valid to deserialize a equilateral triangle into a quadrilateral exception exception = assert throws ( json mapping exception class , ( ) - > { json get context ( null ) read value ( str , quadrilateral class ) ; } ) ; assert true ( exception get message ( ) contains ( " failed deserialization for quadrilateral : 0 classes match result " ) ) ; * / }


sets the callback that signals when this path highlighter should not be performing any work

public void set work pauser ( path highlighter work pauser pauser ) { if ( pauser ! = null ) { this work pauser = pauser ; } }


void do recover ( int error code ) { log i ( tag , " attempting to recover the mission : " + storage get name ( ) ) ; if ( recovery info = = null ) { notify error ( error code , null ) ; urls = new string [ 0 ] ; / / mark this mission as dead return ; } join for threads ( 0 ) ; threads = new thread [ ] { run async ( download mission recover m i d , new download mission recover ( this , error code ) ) } ; }


return the list of argument resolvers to use subclasses should also take into account custom argument types configured via { @ link # set argument resolver configurer }

protected abstract list < ? extends handler method argument resolver > init argument resolvers ( ) ;


create a job configuration this creates a new job conf from the yarn cluster configuration then calls { @ link # apply custom config options ( job conf ) } to allow it to be customized

protected job conf new job conf ( ) throws i o exception { job conf job conf = new job conf ( get yarn ( ) get config ( ) ) ; job conf add resource ( get configuration ( ) ) ; apply custom config options ( job conf ) ; return job conf ; }


default collection < single logout url > determine logout url ( final registered service registered service , final web application service single logout service , final optional < http servlet request > http request ) { return new array list < > ( 0 ) ; }


gets the digest of { @ code path } , using a constant - time xattr call if the filesystem supports it , and calculating the digest manually otherwise if { @ link path # get fast digest } has already been attempted and was not available , call { @ link # manually compute digest } to skip an additional attempt to obtain the fast digest

public static byte [ ] get digest with manual fallback ( path path , long file size ) throws i o exception { byte [ ] digest = path get fast digest ( ) ; return digest ! = null ? digest : manually compute digest ( path , file size ) ; }


sets the last number of bytes the user entered for a data type

public void set last num bytes ( int num bytes ) { last num bytes = num bytes ; }


construct an { @ link element } for a single queue , constructing the inner queue & lt ; name & gt ; , & lt ; properties & gt ; , & lt ; state & gt ; and the inner & lt ; queue & gt ; elements recursively

static element get queue element ( document document , job queue info jqi ) { / / queue element q = document create element ( queue tag ) ; / / queue - name element q name = document create element ( queue name tag ) ; q name set text content ( get simple queue name ( jqi get queue name ( ) ) ) ; q append child ( q name ) ; / / queue - properties properties props = jqi get properties ( ) ; element props element = document create element ( properties tag ) ; if ( props ! = null ) { set < string > prop list = props string property names ( ) ; for ( string prop : prop list ) { element property element = document create element ( property tag ) ; property element set attribute ( key tag , prop ) ; property element set attribute ( value tag , ( string ) props get ( prop ) ) ; props element append child ( property element ) ; } } q append child ( props element ) ; / / queue - state string queue state = jqi get state ( ) get state name ( ) ; if ( queue state ! = null & & ! queue state equals ( queue state undefined get state name ( ) ) ) { element q state element = document create element ( state tag ) ; q state element set text content ( queue state ) ; q append child ( q state element ) ; } / / queue - children list < job queue info > children = jqi get children ( ) ; if ( children ! = null ) { for ( job queue info child : children ) { q append child ( get queue element ( document , child ) ) ; } } return q ; }


private static void perform shift ( double shift , double [ ] lons ) { if ( shift ! = 0 ) { for ( int j = 0 ; j < lons length ; j + + ) { lons [ j ] = lons [ j ] + shift ; } } }


handle a local time that happened before the start of an overlap

long before overlap ( long local millis , overlap overlap ) ;


check the given request for supported methods and a required session , if any

protected final void check request ( http servlet request request ) throws servlet exception { / / check whether we should support the request method string method = request get method ( ) ; if ( this supported methods ! = null & & ! this supported methods contains ( method ) ) { throw new http request method not supported exception ( method , this supported methods ) ; } / / check whether a session is required if ( this require session & & request get session ( false ) = = null ) { throw new http session required exception ( " pre - existing session required but none found " ) ; } }


common implementation of { @ code has path capability } for dfs and webhdfs

public static optional < boolean > has path capability ( final path path , final string capability ) { switch ( validate path capability args ( path , capability ) ) { case common path capabilities fs acls : case common path capabilities fs append : case common path capabilities fs checksums : case common path capabilities fs concat : case common path capabilities fs list corrupt file blocks : case common path capabilities fs multipart uploader : case common path capabilities fs pathhandles : case common path capabilities fs permissions : case common path capabilities fs snapshots : case common path capabilities fs storagepolicy : case common path capabilities fs xattrs : return optional of ( true ) ; case common path capabilities fs symlinks : return optional of ( file system are symlinks enabled ( ) ) ; default : return optional empty ( ) ; } }


returns a { @ code converter } that converts strings from this format to { @ code target format }

public converter < string , string > converter to ( case format target format ) { return new string converter ( this , target format ) ; }


initializes all obs sdk settings related to connection management

private static void init connection settings ( final configuration conf , final ext obs configuration obs conf ) { obs conf set max connections ( o b s common utils int option ( conf , o b s constants maximum connections , o b s constants default maximum connections , 1 ) ) ; boolean secure connections = conf get boolean ( o b s constants secure connections , o b s constants default secure connections ) ; obs conf set https only ( secure connections ) ; obs conf set max error retry ( o b s common utils int option ( conf , o b s constants max error retries , o b s constants default max error retries , 0 ) ) ; obs conf set connection timeout ( o b s common utils int option ( conf , o b s constants establish timeout , o b s constants default establish timeout , 0 ) ) ; obs conf set socket timeout ( o b s common utils int option ( conf , o b s constants socket timeout , o b s constants default socket timeout , 0 ) ) ; obs conf set idle connection time ( o b s common utils int option ( conf , o b s constants idle connection time , o b s constants default idle connection time , 1 ) ) ; obs conf set max idle connections ( o b s common utils int option ( conf , o b s constants max idle connections , o b s constants default max idle connections , 1 ) ) ; obs conf set read buffer size ( o b s common utils int option ( conf , o b s constants read buffer size , o b s constants default read buffer size , - 1 ) ) ; / / to be / / modified obs conf set write buffer size ( o b s common utils int option ( conf , o b s constants write buffer size , o b s constants default write buffer size , - 1 ) ) ; / / to be / / modified obs conf set upload stream retry buffer size ( o b s common utils int option ( conf , o b s constants upload stream retry size , o b s constants default upload stream retry size , 1 ) ) ; obs conf set socket read buffer size ( o b s common utils int option ( conf , o b s constants socket recv buffer , o b s constants default socket recv buffer , - 1 ) ) ; obs conf set socket write buffer size ( o b s common utils int option ( conf , o b s constants socket send buffer , o b s constants default socket send buffer , - 1 ) ) ; obs conf set keep alive ( conf get boolean ( o b s constants keep alive , o b s constants default keep alive ) ) ; obs conf set validate certificate ( conf get boolean ( o b s constants validate certificate , o b s constants default validate certificate ) ) ; obs conf set verify response content type ( conf get boolean ( o b s constants verify response content type , o b s constants default verify response content type ) ) ; obs conf set cname ( conf get boolean ( o b s constants cname , o b s constants default cname ) ) ; obs conf set is strict hostname verification ( conf get boolean ( o b s constants strict hostname verification , o b s constants default strict hostname verification ) ) ; / / sdk auth type negotiation enable obs conf set auth type negotiation ( conf get boolean ( o b s constants sdk auth type negotiation enable , o b s constants default sdk auth type negotiation enable ) ) ; / / set sdk auth type to obs when auth type negotiation unenabled if ( ! obs conf is auth type negotiation ( ) ) { obs conf set auth type ( auth type enum obs ) ; } / / okhttp retry on connection failure switch , default set to true obs conf retry on connection failure in okhttp ( conf get boolean ( o b s constants sdk retry on connection failure enable , o b s constants default sdk retry on connection failure enable ) ) ; / / sdk max retry times on unexpected end of stream exception , / / default : - 1 don ' t retry int retry time = conf get int ( o b s constants sdk retry times on unexpected end exception , o b s constants default sdk retry times on unexpected end exception ) ; if ( retry time > 0 & & retry time < o b s constants default max sdk connection retry times | | ! obs conf is retry on connection failure in okhttp ( ) & & retry time < 0 ) { retry time = o b s constants default max sdk connection retry times ; } obs conf set max retry on unexpected end exception ( retry time ) ; }


public set < string > ids ( ) { return this ids ; }


executes a success listener with consistent exception handling this can only be called from current selector thread

public < v > void execute listener ( bi consumer < v , exception > listener , v value ) { assert on selector thread ( ) ; handle task ( ( ) - > listener accept ( value , null ) ) ; }


return a path with the link resolved with the target

public path get resolved path ( ) { / / if the path is absolute we cam throw out the preceding part and / / just append the remainder to the target , otherwise append each / / piece to resolve the link in path boolean no remainder = ( remainder = = null | | " " equals ( remainder ) ) ; path target = new path ( link target ) ; if ( target is uri path absolute ( ) ) { return no remainder ? target : new path ( target , remainder ) ; } else { return no remainder ? new path ( preceding , target ) : new path ( new path ( preceding , link target ) , remainder ) ; } }


get the entry for a corresponding highlight object

public entry get entry for highlight ( highlight highlight ) { if ( highlight get data set index ( ) > = m data sets size ( ) ) return null ; else { return m data sets get ( highlight get data set index ( ) ) get entry for x value ( highlight get x ( ) , highlight get y ( ) ) ; } }


public int get value ( ) { return value ; }


use the { @ linkplain # set database cleaner database cleaner } to clean up the database

public void destroy ( ) { execute ( this database cleaner ) ; }


get delegation tokens for the file systems accessed for a given path

public list < token < ? > > get delegation tokens ( path p , string renewer ) throws i o exception { set < abstract file system > afs set = resolve abstract file systems ( p ) ; list < token < ? > > token list = new array list < token < ? > > ( ) ; for ( abstract file system afs : afs set ) { list < token < ? > > afs tokens = afs get delegation tokens ( renewer ) ; token list add all ( afs tokens ) ; } return token list ; }


extract a byte array from the given { @ link bytes message }

protected byte [ ] extract byte array from message ( bytes message message ) throws j m s exception { byte [ ] bytes = new byte [ ( int ) message get body length ( ) ] ; message read bytes ( bytes ) ; return bytes ; }


helper method to determine if a signed int value fits in a byte

protected static boolean signed fits in byte ( int value ) { return ( byte ) value = = value ; }