public string get source file name ( ) { string id ms type string id type = pdb get type record ( get source file name string id record number ( ) , string id ms type class ) ; if ( string id type = = null ) { return null ; } return string id type get string ( ) ; }


patch another - fakedummy : to test special tags to test special tags and operation id starting with number

public response entity < client > call 1 2 3test special tags ( @ api param ( value = " client model " , required = true ) @ valid @ request body client body ) { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " client \ " : \ " client \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } } return new response entity < > ( http status not implemented ) ; }


returns a singleton instance of this clock

public static realtime since boot clock get ( ) { return instance ; }


updates artifact nested set function options if the flags ' values changed

private static boolean nested set as sky key options changed ( options provider options ) { build request options build request options = options get options ( build request options class ) ; if ( build request options = = null ) { return false ; } return artifact nested set function size threshold updated ( build request options nested set as sky key threshold ) ; }


public void maximize window ( ) { glfw glfw maximize window ( window handle ) ; }


test method ' task counters ' should print message about error or set counters page class for rendering

public void test get task counters ( ) { when ( job check access ( any ( user group information class ) , any ( job a c l class ) ) ) then return ( false ) ; app controller task counters ( ) ; verify ( app controller response ( ) ) set content type ( mime type text ) ; assert equals ( " access denied : user user does not have permission to view job job 01 01 " , app controller get data ( ) ) ; when ( job check access ( any ( user group information class ) , any ( job a c l class ) ) ) then return ( true ) ; app controller get property ( ) remove ( a m params task id ) ; app controller task counters ( ) ; assert equals ( " access denied : user user does not have permission to view job job 01 0 1missing task id " , app controller get data ( ) ) ; app controller get property ( ) put ( a m params task id , task id ) ; app controller task counters ( ) ; assert equals ( counters page class , app controller get clazz ( ) ) ; }


add a new pet to the store ( asynchronously )

public okhttp 3 call add pet async ( pet body , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = add pet validate before call ( body , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


returns the length of the supplied array

static public int get length ( object array ) { return reflection cache get type ( array get class ( ) ) get array length ( array ) ; }


public resource list w ( resource r ) { all add ( r ) ; write put ( r , unbox ( write get ( r ) ) + 1 ) ; return this ; }


appends a { @ code short } value to the stream this corresponds to the { @ code int 1 6 } value type in the ubjson specification

public u b json writer value ( short value ) throws i o exception { check name ( ) ; out write byte ( ' i ' ) ; out write short ( value ) ; return this ; }


public account find account by user ( user user ) { if ( ! user 2 account contains key ( user ) ) { return null ; } return user 2 account get ( user ) ; }


get flowed context value at a destination address , that has been flowed from the from addr , without affecting state

public register value get flow context value ( address from addr , address dest addr , boolean is fall through ) { if ( is flow active ( ) & & current address equals ( dest addr ) ) { return context register value ; } register value next context register value = program context get flow value ( context register value ) ; / / strip non - flowing context / / combine in any context register value from the future flow state register value future context register value = null ; / / get next context value within flow , combining current , future , previously stored and default context values map < register , register value > future state map = get future register state map ( from addr , dest addr , false ) ; if ( future state map ! = null ) { future context register value = future state map get ( context register ) ; next context register value = combine register values ( next context register value , future context register value , true ) ; } / / combine any previously stored context with future state value register value pre existing context register value = program context get disassembly context ( dest addr ) ; if ( is fall through ) { pre existing context register value = program context get non flow value ( pre existing context register value ) ; } next context register value = combine register values ( pre existing context register value , next context register value , true ) ; / / combine default context register value default value = program context get default value ( context register , dest addr ) ; next context register value = combine register values ( default value , next context register value , true ) ; if ( next context register value = = null ) { next context register value = new register value ( context register ) ; } return next context register value ; }


apply authentication settings to header and query params

void apply to params ( list < pair > query params , map < string , string > header params , map < string , string > cookie params , string payload , string method , uri uri ) throws api exception ;


public void test rename 1 ( ) throws exception { string src = " / test namenode retry cache / test rename 1 / src " ; string target = " / test namenode retry cache / test rename 1 / target " ; reset call ( ) ; nn rpc mkdirs ( src , perm , true ) ; / / retried renames succeed new call ( ) ; assert assert true ( nn rpc rename ( src , target ) ) ; assert assert true ( nn rpc rename ( src , target ) ) ; assert assert true ( nn rpc rename ( src , target ) ) ; / / a non - retried request fails new call ( ) ; assert assert false ( nn rpc rename ( src , target ) ) ; }


perform identity transformation when calling get acl status ( )

void transform acl entries for get request ( final list < acl entry > acl entries , string local user , string local group ) throws i o exception ;


private void print results ( list < plugin wrapper plugin disable result > results ) { for ( plugin wrapper plugin disable result one result : results ) { print result ( one result , 0 ) ; } }


checks if this size is negative , excluding zero

public boolean is negative ( ) { return this bytes < 0 ; }


simply picks from alphabetically - sorted active subclusters based on the hash of quey name jobs of the same queue will all be routed to the same sub - cluster , as far as the number of active sub - cluster and their names remain the same

public sub cluster id get home subcluster ( application submission context app submission context , list < sub cluster id > black list sub clusters ) throws yarn exception { / / throws if no active subclusters available map < sub cluster id , sub cluster info > active subclusters = get active subclusters ( ) ; federation policy utils validate sub cluster availability ( new array list < sub cluster id > ( active subclusters key set ( ) ) , black list sub clusters ) ; if ( black list sub clusters ! = null ) { / / remove from the active sub clusters from state store the blacklisted ones for ( sub cluster id sc id : black list sub clusters ) { active subclusters remove ( sc id ) ; } } validate ( app submission context ) ; int chosen position = math abs ( app submission context get queue ( ) hash code ( ) % active subclusters size ( ) ) ; list < sub cluster id > list = new array list < > ( active subclusters key set ( ) ) ; collections sort ( list ) ; return list get ( chosen position ) ; }


marks the action as no longer scanning because we may receive events out of order , this does nothing if the action is already scheduled or running

synchronized void set stop scanning ( long nano change time ) { if ( scheduling strategies bitmap = = 0 & & running strategies bitmap = = 0 ) { scanning = false ; nano start time = nano change time ; } }


a shortcut to { @ link # claim } with null user in order to unclaim the task


this method creates an internal block at the given index of a block group

public static located block construct internal block ( located striped block bg , int idx in returned locs , int cell size , int data blk num , int idx in block group ) { final extended block blk = construct internal block ( bg get block ( ) , cell size , data blk num , idx in block group ) ; final located block located block ; if ( idx in returned locs < bg get locations ( ) length ) { located block = new located block ( blk , new datanode info [ ] { bg get locations ( ) [ idx in returned locs ] } , new string [ ] { bg get storage i ds ( ) [ idx in returned locs ] } , new storage type [ ] { bg get storage types ( ) [ idx in returned locs ] } , bg get start offset ( ) , bg is corrupt ( ) , null ) ; } else { located block = new located block ( blk , null , null , null , bg get start offset ( ) , bg is corrupt ( ) , null ) ; } token < block token identifier > [ ] block tokens = bg get block tokens ( ) ; if ( idx in returned locs < block tokens length ) { located block set block token ( block tokens [ idx in returned locs ] ) ; } return located block ; }


get all allocated slot from same task manager

set < allocated slot > remove slots for task manager ( final resource i d resource i d ) { set < allocated slot > slots for task manager = allocated slots by task manager remove ( resource i d ) ; if ( slots for task manager ! = null ) { for ( allocated slot allocated slot : slots for task manager ) { allocated slots by id remove key a ( allocated slot get allocation id ( ) ) ; } return slots for task manager ; } else { return collections empty set ( ) ; } }


get the " name " of this production this is mostly just notional and for debugging the name is taken as the name of the lhs

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


enumerate the parameter names and values with their corresponding sql type if available , or just return the simple { @ code sql parameter source } implementation class name otherwise

public string to string ( ) { string [ ] parameter names = get parameter names ( ) ; if ( parameter names ! = null ) { string joiner result = new string joiner ( " , " , get class ( ) get simple name ( ) + " { " , " } " ) ; for ( string parameter name : parameter names ) { object value = get value ( parameter name ) ; if ( value instanceof sql parameter value ) { value = ( ( sql parameter value ) value ) get value ( ) ; } string type name = get type name ( parameter name ) ; if ( type name = = null ) { int sql type = get sql type ( parameter name ) ; if ( sql type ! = type unknown ) { type name = jdbc utils resolve type name ( sql type ) ; if ( type name = = null ) { type name = string value of ( sql type ) ; } } } string builder entry = new string builder ( ) ; entry append ( parameter name ) append ( ' = ' ) append ( value ) ; if ( type name ! = null ) { entry append ( " ( type : " ) append ( type name ) append ( ' ) ' ) ; } result add ( entry ) ; } return result to string ( ) ; } else { return get class ( ) get simple name ( ) ; } }


this method has the same semantics as { @ link runnable # run ( ) }

protected abstract void do run ( ) throws exception ;


public metric registry get metric registry ( ) { return metric registry ; }


returns the label by which it was referred to in the build file for non - alias rules , it ' s the label of the rule itself , for alias rules , it ' s the label of the alias rule

public static label get dependency label ( transitive info collection dep ) { alias provider alias provider = dep get provider ( alias provider class ) ; return alias provider ! = null ? alias provider get alias chain ( ) get ( 0 ) : dep get label ( ) ; }


returns the comparator that orders the multimap values , with { @ code null } indicating that natural ordering is used

comparator < ? super v > value comparator ( ) ;


closes all given { @ link closeable } s if a non - null exception is passed in , or closing a stream causes an exception , throws the exception with other { @ link runtime exception } or { @ link i o exception } exceptions added as suppressed

public static void close ( final exception ex , final iterable < ? extends closeable > objects ) throws i o exception { exception first exception = ex ; for ( final closeable object : objects ) { try { close ( object ) ; } catch ( final i o exception | runtime exception e ) { if ( first exception = = null ) { first exception = e ; } else { first exception add suppressed ( e ) ; } } } if ( first exception ! = null ) { if ( first exception instanceof i o exception ) { throw ( i o exception ) first exception ; } else { / / since we only assigned an i o exception or a runtime exception to ex above , in this case ex must be a runtime exception throw ( runtime exception ) first exception ; } } }


each argument is prepended by the before each param

public builder add before ( @ compile time constant string before each ) { preconditions check not null ( before each ) ; this before each = before each ; return this ; }


public synchronized void unset ( string name ) { string [ ] names = null ; if ( ! is deprecated ( name ) ) { names = get alternative names ( name ) ; if ( names = = null ) { names = new string [ ] { name } ; } } else { names = handle deprecation ( deprecation context get ( ) , name ) ; } for ( string n : names ) { get overlay ( ) remove ( n ) ; get props ( ) remove ( n ) ; } }


creates a new { @ code settable data source }

public static < v > settable data source < v > create ( ) { return new settable data source < v > ( ) ; }


turn zk sasl on < b > important : < b > this is jvm - wide

protected static void enable zookeeper client s a s l ( ) { system set property ( prop zk enable sasl client , " true " ) ; }


public static byte array input stream output 2 input stream ( final output stream out ) { if ( out = = null ) return null ; return new byte array input stream ( ( ( byte array output stream ) out ) to byte array ( ) ) ; }


animate vertically the toaster the toaster could be moved from bottom to upper or to upper to bottom

protected void animate vertically ( int posx , int from y , int to y ) throws interrupted exception { toaster set location ( posx , from y ) ; if ( to y < from y ) { for ( int i = from y ; i > to y ; i - = step ) { toaster set location ( posx , i ) ; thread sleep ( step time ) ; } } else { for ( int i = from y ; i < to y ; i + = step ) { toaster set location ( posx , i ) ; thread sleep ( step time ) ; } } toaster set location ( posx , to y ) ; }


set the path to use for this nested aggregation the path must match the path to a nested object in the mappings if it is not specified then this aggregation will go back to the root document

public reverse nested aggregation builder path ( string path ) { if ( path = = null ) { throw new illegal argument exception ( " [ path ] must not be null : [ " + name + " ] " ) ; } this path = path ; return this ; }


returns an enumeration of u r ls representing all the resources with the given name by searching the class loader ' s classpath

public enumeration / * < url > * / find resources ( string name ) throws i o exception { return find resources ( name , true ) ; }


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

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


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

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


public void place order test ( ) throws api exception { order order = null ; order response = api place order ( order ) ; / / todo : test validations }


indicates whether this domain name ends in a { @ linkplain # is registry suffix ( ) registry suffix } , including if it is a registry suffix itself for example , returns { @ code true } for { @ code www google com } , { @ code foo co uk } and { @ code com } , but not for { @ code invalid } or { @ code google invalid } note that this method is equivalent to { @ link # has public suffix ( ) } because all registry suffixes are public suffixes and all public suffixes have registry suffixes

public boolean has registry suffix ( ) { return registry suffix index ! = no suffix found ; }


returns a { @ link stored fields reader } optimized for sequential access ( adjacent doc ids )

public stored fields reader get sequential stored fields reader ( ) { if ( in instanceof codec reader ) { codec reader reader = ( codec reader ) in ; return do get sequential stored fields reader ( reader get fields reader ( ) get merge instance ( ) ) ; } else if ( in instanceof sequential stored fields leaf reader ) { sequential stored fields leaf reader reader = ( sequential stored fields leaf reader ) in ; return do get sequential stored fields reader ( reader get sequential stored fields reader ( ) ) ; } else { throw new illegal state exception ( " requires a codec reader or a sequential stored fields leaf reader , got " + in get class ( ) ) ; } }


public put repository request settings ( settings builder settings ) { this settings = settings build ( ) ; return this ; }


sets the < code > prefix ns array < code > property

public xml item prefix ns array ( list < integer > prefix ns array ) { this prefix ns array = prefix ns array ; return this ; }


returns the relocations defined in this table

public elf relocation [ ] get relocations ( ) { return relocs ; }


extracts all vertices of the supplied geometry

public static multi point to multi point ( geometry geometry ) { return geometry visit ( new geometry visitor < > ( ) { @ override public multi point visit ( circle circle ) throws runtime exception { throw new unsupported operation exception ( " not supporting circles yet " ) ; } @ override public multi point visit ( geometry collection < ? > collection ) throws runtime exception { list < point > points = new array list < > ( ) ; collection for each ( geometry - > to multi point ( geometry ) for each ( points : : add ) ) ; return new multi point ( points ) ; } @ override public multi point visit ( line line ) throws runtime exception { list < point > points = new array list < > ( ) ; for ( int i = 0 ; i < line length ( ) ; i + + ) { points add ( new point ( line get x ( i ) , line get y ( i ) , line get z ( i ) ) ) ; } return new multi point ( points ) ; } @ override public multi point visit ( linear ring ring ) throws runtime exception { return visit ( ( line ) ring ) ; } @ override public multi point visit ( multi line multi line ) throws runtime exception { return visit ( ( geometry collection < ? > ) multi line ) ; } @ override public multi point visit ( multi point multi point ) throws runtime exception { return multi point ; } @ override public multi point visit ( multi polygon multi polygon ) throws runtime exception { return visit ( ( geometry collection < ? > ) multi polygon ) ; } @ override public multi point visit ( point point ) throws runtime exception { return new multi point ( collections singleton list ( point ) ) ; } @ override public multi point visit ( polygon polygon ) throws runtime exception { list < geometry > multi points = new array list < > ( ) ; multi points add ( to multi point ( polygon get polygon ( ) ) ) ; for ( int i = 0 ; i < polygon get number of holes ( ) ; i + + ) { multi points add ( to multi point ( polygon get hole ( i ) ) ) ; } return to multi point ( new geometry collection < > ( multi points ) ) ; } @ override public multi point visit ( rectangle rectangle ) throws runtime exception { return new multi point ( arrays as list ( new point ( rectangle get min x ( ) , rectangle get min y ( ) , rectangle get min z ( ) ) , new point ( rectangle get max x ( ) , rectangle get max y ( ) , rectangle get max z ( ) ) ) ) ; } } ) ; }


determine the charset to use for json input by default this is either the charset from the input { @ code media type } or otherwise falling back on { @ code utf - 8 } can be overridden in subclasses

protected charset get charset ( @ nullable media type content type ) { if ( content type ! = null & & content type get charset ( ) ! = null ) { return content type get charset ( ) ; } else { return standard charsets utf 8 ; } }


refresh table data from the master table records are returned in the list ordered by their table number key

table record [ ] refresh table records ( ) throws i o exception { try { int master root id = db parms get ( d b parms master table root buffer id parm ) ; if ( master record get root buffer id ( ) ! = master root id ) { master record set root buffer id ( master root id ) ; table table record changed ( ) ; } } catch ( array index out of bounds exception e ) { throw new i o exception ( " corrupt database parameters " , e ) ; } array list < table record > tr list = new array list < table record > ( ) ; int ix = 0 ; int old table cnt = table records length ; record iterator it = table iterator ( ) ; while ( it has next ( ) ) { d b record rec = it next ( ) ; long tablenum = rec get key ( ) ; while ( ix < table records length & & tablenum > table records [ ix ] get table num ( ) ) { table records [ ix + + ] invalidate ( ) ; / / table no longer exists } if ( ix = = old table cnt | | tablenum < table records [ ix ] get table num ( ) ) { tr list add ( new table record ( dbh , rec ) ) ; / / new table } else if ( tablenum = = table records [ ix ] get table num ( ) ) { table records [ ix ] set record ( dbh , rec ) ; tr list add ( table records [ ix + + ] ) ; / / update existing table } } while ( ix < table records length ) { table records [ ix + + ] invalidate ( ) ; / / table no longer exists } table records = tr list to array ( new table record [ tr list size ( ) ] ) ; return table records ; }


public shape type get current type ( ) { return shape type ; }


fake endpoint to test group parameters ( optional ) fake endpoint to test group parameters ( optional )

public completable future < void > test group parameters ( integer required string group , boolean required boolean group , long required int 6 4 group , integer string group , boolean boolean group , long int 6 4 group ) throws api exception { try { http request builder local var request builder = test group parameters request builder ( required string group , required boolean group , required int 6 4 group , string group , boolean group , int 6 4 group ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " test group parameters " , local var response ) ) ; } return completable future completed future ( null ) ; } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


registers all subscriber methods on the given listener object

void register ( object listener ) { multimap < class < ? > , subscriber > listener methods = find all subscribers ( listener ) ; for ( entry < class < ? > , collection < subscriber > > entry : listener methods as map ( ) entry set ( ) ) { class < ? > event type = entry get key ( ) ; collection < subscriber > event methods in listener = entry get value ( ) ; copy on write array set < subscriber > event subscribers = subscribers get ( event type ) ; if ( event subscribers = = null ) { copy on write array set < subscriber > new set = new copy on write array set < > ( ) ; event subscribers = more objects first non null ( subscribers put if absent ( event type , new set ) , new set ) ; } event subscribers add all ( event methods in listener ) ; } }


add a file that has been localized to the conf used by internal distributed cache code

public static void add local files ( configuration conf , string str ) { string files = conf get ( cache localfiles ) ; conf set ( cache localfiles , files = = null ? str : files + " , " + str ) ; }


if there is no wf on the cp , then we always downgrade to default

public void test default downgrades no wildfly ( ) throws throwable { assume that ( has wildfly ) is false ( ) ; expect bound ( default , default jsse ) ; }


returns the path up to the random directory component

private path get path to delete ( path local path ) { path del path = local path get parent ( ) ; string name = del path get name ( ) ; matcher matcher = random dir pattern matcher ( name ) ; if ( matcher matches ( ) ) { return del path ; } else { log warn ( " random directory component did not match " + " deleting localized path only " ) ; return local path ; } }


get the entries that are restored to a key value store when it is constructed with this driver ' s { @ link # context ( ) processor context }

public iterable < key value < byte [ ] , byte [ ] > > restored entries ( ) { return restorable entries ; }


reverses the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive this is equivalent to { @ code collections reverse ( shorts as list ( array ) sub list ( from index , to index ) ) } , but is likely to be more efficient

public static void reverse ( short [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; for ( int i = from index , j = to index - 1 ; i < j ; i + + , j - - ) { short tmp = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = tmp ; } }


sets a new width and height which should be used to render

public litho view rule set size px ( int width px , int height px ) { m width spec = make measure spec ( width px , exactly ) ; m height spec = make measure spec ( height px , exactly ) ; return this ; }


this method is called before the popup menu becomes invisible note that a j popup menu can become invisible any time

public void popup menu will become invisible ( popup menu event e ) { }


construct a new u r l connection factory based on the configuration it will try to load ssl certificates when it is specified

public static u r l connection factory new default u r l connection factory ( configuration conf ) { connection configurator conn = get s s l connection configuration ( default socket timeout , default socket timeout , conf ) ; return new u r l connection factory ( conn ) ; }


private void assert id ( meter id meter id , string name , meter id meter type type , list < meter id tag > tags ) { assert assert equals ( name , meter id get name ( ) ) ; assert assert equals ( type , meter id get type ( ) ) ; assert assert equals ( tags , meter id get tags ( ) ) ; }


get statistics pertaining to blocks of type { @ link block type # contiguous } in the filesystem

replicated block stats get replicated block stats ( ) throws i o exception ;


dispatches { @ code event } to this subscriber using the proper executor

final void dispatch event ( final object event ) { executor execute ( new runnable ( ) { @ override public void run ( ) { try { invoke subscriber method ( event ) ; } catch ( invocation target exception e ) { bus handle subscriber exception ( e get cause ( ) , context ( event ) ) ; } } } ) ; }


private static map x attr names to j s o n ( list < string > names ) throws i o exception { map json map = new linked hash map ( ) ; json map put ( http f s file system xattrnames json , j s o n array to j s o n string ( names ) ) ; return json map ; }


inserts the given node into this organization node which is different than calling the { @ link # add node ( g tree node ) } method , which is used during construction this method knows how to recursively find the correct { @ link organization node } node into which the given node should be inserted

public void insert node ( g tree node new node ) { int index = collections binary search ( get children ( ) , new node , get children comparator ( ) ) ; if ( index > = 0 ) { / / found a match g tree node matching node = get child ( index ) ; if ( matching node instanceof organization node ) { organization node org node = ( organization node ) matching node ; org node insert node ( new node ) ; return ; } } else { index = - index - 1 ; } add node ( index , new node ) ; }


async observable and semaphore isolation with functioning request context use hystrix context scheduler to make the user provided scheduler capture context

public void test timeout request context with semaphore isolated asynchronous observable and captured context scheduler ( ) { request context test results results = test request context on timeout ( execution isolation strategy semaphore , new hystrix context scheduler ( schedulers new thread ( ) ) ) ; assert true ( results is context initialized get ( ) ) ; / / the user scheduler captures context assert true ( results origin thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / the user provided thread / scheduler assert true ( results is context initialized observe on get ( ) ) ; / / the user scheduler captures context assert true ( results observe on thread get ( ) get name ( ) starts with ( " hystrix timer " ) ) ; / / timeout schedules on hystrix timer since the original thread was timed out / / semaphore isolated assert false ( results command is executed in thread ( ) ) ; hystrix circuit breaker factory reset ( ) ; }


private boolean initialize when gpu requested ( container container ) throws container execution exception { if ( ! requests gpu ( container ) ) { return false ; } / / do lazy initialization of gpu - docker plugin if ( additional commands = = null ) { init ( ) ; } return true ; }


get the parser to parse a submitted value for a field of { @ code field type } annotated with { @ code annotation } if the object the parser returns is not assignable to { @ code field type } , a coercion to { @ code field type } will be attempted before the field is set

parser < ? > get parser ( a annotation , class < ? > field type ) ;


returns the annotation hover which will provide the information to be shown in a hover popup window when requested for the given source viewer

public i annotation hover get annotation hover ( i source viewer source viewer ) { return new s q l annotation hover ( get s q l editor ( ) ) ; }


sets the spread of the distance field the spread is the maximum distance in pixels that we ' ll scan while for a nearby edge the resulting distance is also normalized by the spread

public void set spread ( float spread ) { if ( spread < = 0 ) throw new illegal argument exception ( " spread must be positive " ) ; this spread = spread ; }


analyzes a given { @ link rex node } and decides whenever it is safe to unwind " safe " means that it only contains a combination of known good operators division is an unsafe operator ; consider the following : case when a & gt ; 0 then 1 a else null end

static boolean is safe expression ( rex node r ) { return r accept ( safe rex visitor instance ) ; }


creates list of users with given input array

public void create users with list input ( list < user > body , api client auth info auth info , handler < async result < void > > result handler ) { delegate create users with list input ( body , auth info , result handler ) ; }


logs that this action or some portion of it completed successfully

void log completion ( string completed action ) { get logger ( ) fine ( string format ( " % s finished at % sms " , completed action , timer elapsed ( ) to millis ( ) ) ) ; }


set the configuration source { @ code object } for this metadata element the exact type of the object will depend on the configuration mechanism used

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


creates a builder for { @ link json row serialization schema builder }

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


creates a new factory with the specified policy

public static cycle detecting lock factory new instance ( policy policy ) { return new cycle detecting lock factory ( policy ) ; }


fresh instance of { @ link upgrade wizard } to test its behavior

private upgrade wizard get instance ( ) throws exception { try { upgrade wizard uw = upgrade wizard get ( ) ; uw initialize state ( ) ; return uw ; } catch ( exception e ) { e print stack trace ( ) ; throw e ; } }


gets the numeric api levels from the contents of the platforms directory in descending order note that the directory entries are assumed to match { @ code android - [ 0 - 9 ] + } any directory entries that are not directories or do not match that pattern are ignored

static final immutable sorted set < integer > get api levels ( dirents platforms directories ) { immutable sorted set builder < integer > api levels = immutable sorted set reverse order ( ) ; for ( dirent platform directory : platforms directories ) { if ( platform directory get type ( ) = = dirent type directory | | platform directory get type ( ) = = dirent type symlink ) { matcher matcher = platforms api level pattern matcher ( platform directory get name ( ) ) ; if ( matcher matches ( ) ) { api levels add ( integer parse int ( matcher group ( 1 ) ) ) ; } } } return api levels build ( ) ; }


converts a parse exception at compile - time or link - time to a script exception

private static script exception convert to script exception ( string message , string source , string portion , throwable cause ) { list < string > stack = new array list < > ( ) ; stack add ( portion ) ; string builder pointer = new string builder ( ) ; if ( cause instanceof parse exception ) { int offset = ( ( parse exception ) cause ) get error offset ( ) ; for ( int i = 0 ; i < offset ; i + + ) { pointer append ( ' ' ) ; } } pointer append ( " ^ - - - - here " ) ; stack add ( pointer to string ( ) ) ; throw new script exception ( message , cause , stack , source , name ) ; }


basically same as { @ link # update ( class , content values , long ) } but pending to a new thread for executing

public static update or delete executor update async ( final class < ? > model class , final content values values , final long id ) { return operator update async ( model class , values , id ) ; }


adds a releasable that will be freed when this context is closed

public void add releasable ( releasable releasable ) { / / todo most releasables are managed by their callers we probably don ' t need this releasables add ( releasable ) ; }


public void cluster set up ( configuration hdfs conf ) throws exception { cluster set up ( false , hdfs conf ) ; }


this test adds random fields and objects to the x content rendered out to ensure we can parse it back to be forward compatible with additions to the x content

public void test from x content with random fields ( ) throws i o exception { do from x content test with random fields ( true ) ; }


{ @ link # get diff string ( int ) } that doesn ' t show anything for + - 0

public static string get diff string 2 ( int i ) { if ( i = = 0 ) return " " ; string s = integer to string ( i ) ; if ( i > 0 ) return " + " + s ; else return s ; }


returns the merge policy that should be used for this index

public merge policy get merge policy ( ) { return merge policy config get merge policy ( ) ; }


get the { @ link deletion service } for this deletion task

public deletion service get deletion service ( ) { return deletion service ; }


returns a file that is properly resolved with respect to the project directory , or < code > null < code > or empty if its name is actually a boolean flag

private file optional file ( file file ) { string file name = file get name ( ) ; return file name equals ignore case ( " false " ) | | file name equals ignore case ( " no " ) | | file name equals ignore case ( " off " ) ? null : file name equals ignore case ( " true " ) | | file name equals ignore case ( " yes " ) | | file name equals ignore case ( " on " ) ? configuration std out : resolved file ( file ) ; }


returns the name of the rowtime attribute

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


creates a new tuple and assigns the given values to the tuple ' s fields this is more convenient than using the constructor , because the compiler can infer the generic type arguments implicitly for example : { @ code tuple 3 of ( n , x , s ) } instead of { @ code new tuple 3 < integer , double , string > ( n , x , s ) }


{ @ link component host } contains the logic for setting the { @ link node info } containing the { @ link event handler } s for its delegate instance whenever it is setunset

void set node info ( node info node info ) { m node info = node info ; }


gets the name that the aggregator is registered under

public string get name ( ) { return name ; }


exit a parse tree produced by { @ link eql base parser # function name }

void exit function name ( eql base parser function name context ctx ) ;


returns the { @ link starlark method } annotation for the given method , if it exists , and null otherwise note that the annotation may be defined on a supermethod , rather than directly on the given method { @ code class obj } is the class on which the given method is defined

public static starlark method get starlark method ( class < ? > class obj , method method ) { starlark method callable = get annotation on class matching signature ( class obj , method ) ; if ( callable ! = null ) { return callable ; } if ( class obj get superclass ( ) ! = null ) { starlark method annotation = get starlark method ( class obj get superclass ( ) , method ) ; if ( annotation ! = null ) { return annotation ; } } for ( class < ? > interface obj : class obj get interfaces ( ) ) { starlark method annotation = get starlark method ( interface obj , method ) ; if ( annotation ! = null ) { return annotation ; } } return null ; }


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


public static file find containing jar ( class my class ) throws i o exception { class loader loader = my class get class loader ( ) ; if ( loader = = null ) { throw new i o exception ( " class " + my class + " does not have a classloader ! " ) ; } string class file = my class get name ( ) replace all ( " \ \ " , " / " ) + " class " ; enumeration < url > url enumeration = loader get resources ( class file ) ; for ( ; url enumeration has more elements ( ) ; ) { url url = url enumeration next element ( ) ; if ( " jar " equals ( url get protocol ( ) ) ) { string to return = url get path ( ) ; if ( to return starts with ( " file : " ) ) { to return = to return substring ( " file : " length ( ) ) ; } / / u r l decoder is a misnamed class , since it actually decodes / / x - www - form - urlencoded mime type rather than actual / / url encoding ( which the file path has ) therefore it would / / decode + s to ' ' s which is incorrect ( spaces are actually / / either unencoded or encoded as " % 20 " ) replace + s first , so / / that they are kept sacred during the decoding process to return = to return replace all ( " \ \ + " , " % 2b " ) ; to return = u r l decoder decode ( to return , " utf - 8 " ) ; string jar file path = to return replace all ( " ! * $ " , " " ) ; return new file ( jar file path ) ; } else { log info ( " could not locate jar containing { } url = { } " , my class , url ) ; } } return null ; }


{ @ link org greenrobot greendao async async operation } flags set for all operations ( will be o red with call flags )

public int get session flags ( ) { return session flags ; }


public date range aggregation builder add unbounded to ( string key , double to ) { add range ( new range aggregator range ( key , null , to ) ) ; return this ; }


takes a reader in any state and returns the next value as a json element

public static json element parse ( json reader reader ) throws json parse exception { boolean is empty = true ; try { reader peek ( ) ; is empty = false ; return type adapters json element read ( reader ) ; } catch ( e o f exception e ) { / * * for compatibility with json 1 5 and earlier , we return a json null for * empty documents instead of throwing * / if ( is empty ) { return json null instance ; } / / the stream ended prematurely so it is likely a syntax error throw new json syntax exception ( e ) ; } catch ( malformed json exception e ) { throw new json syntax exception ( e ) ; } catch ( i o exception e ) { throw new json i o exception ( e ) ; } catch ( number format exception e ) { throw new json syntax exception ( e ) ; } }


get the base directory for this mini d f s instance < p > within the mini d f cluster class and any subclasses , this method should be used instead of { @ link # get base directory ( ) } which doesn ' t support configuration - specific base directories < p > first the configuration property { @ link # hdfs minidfs basedir } is fetched if non - null , this is returned if this is null , then { @ link # get base directory ( ) } is called

protected string determine dfs base dir ( ) { if ( conf ! = null ) { final string dfsdir = conf get ( hdfs minidfs basedir , null ) ; if ( dfsdir ! = null ) { return dfsdir ; } } return get base directory ( ) ; }


close this serializer this method must be idempotent as it may be called multiple times

default void close ( ) { / / intentionally left blank }


return true if this inline object object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } inline object inline object = ( inline object ) o ; return objects equals ( this name , inline object name ) & & objects equals ( this status , inline object status ) ; }


public void append table modifiers ( d b r progress monitor monitor , string builder ddl ) { / / nothing }


public void increment gauge ( statistic statistic , long count ) { instrumentation increment gauge ( statistic , count ) ; }


applies logic of this class to another { @ link ms symbol applier } instead of to the program

abstract void apply to ( ms symbol applier apply to applier ) throws pdb exception , cancelled exception ;


void test json form data ( @ param ( " param " ) string param , @ param ( " param 2 " ) string param 2 ) ;


returns all variations of this policy based on the configuration parameters

public static set < policy > policies ( config config ) { random window tiny lfu settings settings = new random window tiny lfu settings ( config ) ; return settings percent main ( ) stream ( ) map ( percent main - > new random window tiny lfu policy ( percent main , settings ) ) collect ( to set ( ) ) ; }


determines if the content of the specified buffer is identical to the content of this array ' identical ' here means : the size of the contents of the two buffers are same and every single byte of the content of the two buffers are same please note that it does not compare { @ link # reader index ( ) } nor { @ link # writer index ( ) } this method also returns { @ code false } for { @ code null } and an object which is not an instance of { @ link byte buf } type

public abstract boolean equals ( object obj ) ;


tells whether the action is a main one or a subaction used to decide whether we need to register the main transport handler in fact if the action is a subaction , its execute method will be called locally to its parent action

protected boolean is sub action ( ) { return false ; }


reports a failed checkpoint with the given optional cause

private void report failed checkpoint ( exception cause ) { / / to prevent null - pointers from concurrent modification , copy reference onto stack final pending checkpoint stats stats callback = this stats callback ; if ( stats callback ! = null ) { long failure timestamp = system current time millis ( ) ; stats callback report failed checkpoint ( failure timestamp , cause ) ; } }


returns the { @ link symbol parser } created for this pdb

public symbol parser get symbol parser ( ) { return symbol parser ; }


outputs a reasonably normalized javac option list

public static list < string > normalize options with normalizers ( list < string > javacopts , javac option normalizer normalizers ) { return new javac options ( immutable list copy of ( normalizers ) ) normalize ( javacopts ) ; }


defines the maximum time interval in which a matching pattern has to be completed in order to be considered valid this interval corresponds to the maximum time gap between first and the last event

public pattern < t , f > within ( time window time ) { if ( window time ! = null ) { this window time = window time ; } return this ; }


same as { @ link # convert ( list ) } but on an { @ link iterable }

private static list < ? > convert ( iterable < ? > values ) { list < ? > list ; if ( values instanceof list < ? > ) { list = ( list < ? > ) values ; } else { array list < object > array list = new array list < > ( ) ; for ( object o : values ) { array list add ( o ) ; } list = array list ; } return convert ( list ) ; }


add current pass count of the resource name

void on pass ( resource wrapper rw , int batch count , object [ ] args ) ;


this tests a custom session window assigner that assigns some elements to " point windows " , windows that have the same timestamp for start and end in this test , elements that have 33 as the second tuple field will be put into a point window

public void test point sessions ( ) throws exception { close called set ( 0 ) ; window operator operator = window operator builder builder ( ) with input fields ( input field types ) assigner ( new point session window assigner ( 3000 ) ) with event time ( 2 ) aggregate and build ( get time window agg function ( ) , equaliser , acc types , agg result types , window types ) ; one input stream operator test harness < row data , row data > test harness = create test harness ( operator ) ; concurrent linked queue < object > expected output = new concurrent linked queue < > ( ) ; test harness open ( ) ; / / add elements out - of - order test harness process element ( insert record ( " key 2 " , 1 , 0l ) ) ; test harness process element ( insert record ( " key 2 " , 33 , 1000l ) ) ; / / do a snapshot , close and restore again operator subtask state snapshot = test harness snapshot ( 0l , 0 ) ; test harness close ( ) ; test harness = create test harness ( operator ) ; test harness setup ( ) ; test harness initialize state ( snapshot ) ; test harness open ( ) ; test harness process element ( insert record ( " key 2 " , 33 , 2500l ) ) ; test harness process element ( insert record ( " key 1 " , 1 , 10l ) ) ; test harness process element ( insert record ( " key 1 " , 2 , 1000l ) ) ; test harness process element ( insert record ( " key 1 " , 33 , 2500l ) ) ; test harness process watermark ( new watermark ( 12000 ) ) ; expected output add all ( double record ( is table aggregate , insert record ( " key 1 " , 36l , 3l , 10l , 4000l , 3999l ) ) ) ; expected output add all ( double record ( is table aggregate , insert record ( " key 2 " , 67l , 3l , 0l , 3000l , 2999l ) ) ) ; expected output add ( new watermark ( 12000 ) ) ; assertor assert output equals sorted ( " output was not correct " , expected output , test harness get output ( ) ) ; test harness close ( ) ; / / we close once in the rest assert equals ( " close was not called " , 2 , close called get ( ) ) ; }


private void stall focus flashing ( ) { / / this prevents focus from flashing for minimum time between flashes last flash time = system current time millis ( ) ; }


public < e > e [ ] to array ( e [ ] a ) { throw new unsupported operation exception ( ) ; }


find the first annotation of the specified { @ code annotation name } within the annotation hierarchy above the supplied { @ code element } and merge that annotation ' s attributes with matching attributes from annotations in lower levels of the annotation hierarchy attributes from lower levels in the annotation hierarchy override attributes of the same name from higher levels , and { @ link alias for @ alias for } semantics are fully supported , both within a single annotation and within the annotation hierarchy in contrast to { @ link # get all annotation attributes } , the search algorithm used by this method will stop searching the annotation hierarchy once the first annotation of the specified { @ code annotation name } has been found as a consequence , additional annotations of the specified { @ code annotation name } will be ignored this method follows find semantics as described in the { @ linkplain annotated element utils class - level javadoc }

public static annotation attributes find merged annotation attributes ( annotated element element , string annotation name , boolean class values as string , boolean nested annotations as map ) { merged annotation < ? > merged annotation = find annotations ( element ) get ( annotation name , null , merged annotation selectors first directly declared ( ) ) ; return get annotation attributes ( merged annotation , class values as string , nested annotations as map ) ; }


get rid of all entries on the linked list

public void clear ( ) { terminal next node = terminal ; terminal previous node = terminal ; / / recreate empty list }


public void set up ( ) throws exception { super set up ( ) ; byte [ ] block = swift test utils dataset ( seek file len , 0 , 255 ) ; / / delete the test directory test path = path ( " / test " ) ; read file = new path ( test path , " test read past buffer txt " ) ; create file ( read file , block ) ; }


asserts that filters with the given configuration accept the given record

static void should accept ( subset configuration conf , metrics record record ) { assert true ( " accepts " + record , new glob filter ( conf ) accepts ( record ) ) ; assert true ( " accepts " + record , new regex filter ( conf ) accepts ( record ) ) ; }


find the fields constant that matches field id , or null if its not found

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / id return id ; default : return null ; } }


converts the given boxed boolean to a ternary boolean a null value results in { @ link # undefined } , while a non - null value results in { @ link # true } or { @ link # false } respectively

public static ternary boolean from boxed boolean ( @ nullable boolean bool ) { return bool = = null ? undefined : from boolean ( bool ) ; }


public void add ( geometry geometry ) { geometry visit ( visitor ) ; }


public void visit constant ( int opcode , int offset , int length , constant cst , int value ) { visit common ( offset , length , true ) ; if ( ( cst instanceof cst member ref ) | | ( cst instanceof cst type ) | | ( cst instanceof cst string ) ) { / * * instructions with these sorts of constants have the * possibility of throwing , so this instruction needs to * end its block ( since it can throw , and possible - throws * are branch points ) * / visit throwing ( offset , length , true ) ; } }


returns if this attribute is an implicit dependency according to the naming policy that designates implicit attributes

public boolean is implicit ( ) { return is implicit ( get name ( ) ) ; }


public boolean is name boolean ( ) { return name boolean ; }


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


removes the specified element from the given array

public static void remove ( object [ ] array , int size , int index ) { system arraycopy ( array , index + 1 , array , index , array length - index - 1 ) ; array [ size - 1 ] = null ; }


load the required publicprivate keys , create the zone dnskey record , and sign the zone level records

private void enable d n s s e c if necessary ( zone zone , configuration conf , s o a record soa record , n s record ns record ) throws i o exception , no such algorithm exception , invalid key spec exception , dnssec d n s s e c exception { if ( is d n s s e c enabled ( ) ) { / / read in the dnskey and create the d n s k e y record / / todo : reading these out of config seems wrong string public key = conf get ( key dnssec public key ) ; if ( public key = = null ) { throw new i o exception ( " dnssec key not configured " ) ; } / / todo - perhaps read in actual dnskey record structure ? name zone name = zone get origin ( ) ; d n s k e y record dnskey record = dns key recs get ( zone name ) ; if ( dnskey record = = null ) { byte [ ] key = base 6 4 decode base 6 4 ( public key get bytes ( " utf - 8 " ) ) ; dnskey record = new d n s k e y record ( zone name , d class in , ttl , d n s k e y record flags zone key , d n s k e y record protocol dnssec , dnssec algorithm rsasha256 , key ) ; dns key recs put if absent ( zone name , dnskey record ) ; } log info ( " registering { } " , dnskey record ) ; try ( closeable lock lock = write lock lock ( ) ) { zone add record ( dnskey record ) ; string private key file = conf get ( key dnssec private key file , default dnssec private key file ) ; properties props = new properties ( ) ; try ( file input stream input stream = new file input stream ( private key file ) ) { props load ( input stream ) ; } string private modulus = props get property ( " modulus " ) ; string private exponent = props get property ( " private exponent " ) ; r s a private key spec private spec = new r s a private key spec ( new big integer ( 1 , base 6 4 decode base 6 4 ( private modulus ) ) , new big integer ( 1 , base 6 4 decode base 6 4 ( private exponent ) ) ) ; key factory factory = key factory get instance ( " rsa " ) ; private key = factory generate private ( private spec ) ; sign site record ( zone , dnskey record ) ; sign site record ( zone , soa record ) ; sign site record ( zone , ns record ) ; } / / create required ds records / / domain / / d s record ds record = new d s record ( zone name , d class in , ttl , / / d s record digest sha1 , dnskey record ) ; / / zone add record ( ds record ) ; / / sign site record ( zone , ds record ) ; } }


the children of this element < code > repeated aapt pb xml node child = 5 ; < code >

private void add child ( com android aapt resources xml node value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } ensure child is mutable ( ) ; child add ( value ) ; }


creates a new builder for the given server host , port and cronet engine

public static cronet channel builder for address ( string host , int port , cronet engine cronet engine ) { preconditions check not null ( cronet engine , " cronet engine " ) ; return new cronet channel builder ( host , port , cronet engine ) ; }


finds all { @ link plugin description } objects that match a given set of plugin classes this effectively tells the caller which of the given plugins have been loaded by the class loader eg : if the list of plugin classes contains the class " foo plugin class " , this method will search the { @ link plugin configuration model } for any plugin with the name " foo plugin " and return its { @ link plugin description } note that this method does not take pathpackage information into account when finding plugins ; in the example above , if there is more than one plugin with the name " foo plugin " , only one will be found ( the one found is not guaranteed to be the first )

public static list < plugin description > get plugin descriptions ( plugin tool tool , list < class < ? > > plugins ) { / / first define the list of plugin descriptions to return list < plugin description > ret plugins = new array list < > ( ) ; / / get all plugins that have been loaded plugin configuration model model = new plugin configuration model ( tool , null ) ; list < plugin description > all plugin descriptions = model get all plugin descriptions ( ) ; / / for each plugin classes we ' re searching for , see if an entry exists in the list of all / / loaded plugins for ( class < ? > plugin : plugins ) { string plugin name = plugin get simple name ( ) ; optional < plugin description > desc = all plugin descriptions stream ( ) filter ( d - > ( plugin name equals ( d get name ( ) ) ) ) find any ( ) ; if ( desc is present ( ) ) { ret plugins add ( desc get ( ) ) ; } } return ret plugins ; }


just like assert null ( x ) , but additionally recording ( using thread record failure ) any assertion failed error thrown , so that the current testcase will fail

public void thread assert null ( object x ) { try { assert null ( x ) ; } catch ( assertion failed error t ) { thread record failure ( t ) ; throw t ; } }


sets { @ link android net traffic stats } tag to use when accounting socket traffic caused by this channel see { @ link android net traffic stats } for more information if no tag is set ( e g this method isn ' t called ) , then android accounts for the socket traffic caused by this channel as if the tag value were set to 0 < b > note : < b > setting a tag disallows sharing of sockets with channels with other tags , which may adversely effect performance by prohibiting connection sharing in other words use of multiplexed sockets ( e g http2 and quic ) will only be allowed if all channels have the same socket tag

final cronet channel builder set traffic stats tag ( int tag ) { traffic stats tag set = true ; traffic stats tag = tag ; return this ; }


tests that the task manager sends a proper exception back to the sender if the submit task message fails

public void test submit task failure ( ) throws exception { final execution attempt i d eid = new execution attempt i d ( ) ; final task deployment descriptor tdd = create test task deployment descriptor ( " test task " , eid , blocking no op invokable class , 0 ) ; / / this will make the submission fail because the number of key groups / / must be > = 1 try ( task submission test environment env = new task submission test environment builder ( job id ) build ( ) ) { task executor gateway tm gateway = env get task executor gateway ( ) ; task slot table task slot table = env get task slot table ( ) ; task slot table allocate slot ( 0 , job id , tdd get allocation id ( ) , time seconds ( 60 ) ) ; tm gateway submit task ( tdd , env get job master id ( ) , timeout ) get ( ) ; } catch ( exception e ) { assert that ( e get cause ( ) , instance of ( illegal argument exception class ) ) ; } }


returns the current value of the field or null if the field has no current value

public big integer get value ( ) { string text = text field get text ( ) ; return compute value from string ( text ) ; }


public string get task status ( ) { return task status to string ( ) ; }


private void setup arrays ( rop method method ) { basic block list blocks = method get blocks ( ) ; int sz = blocks size ( ) ; for ( int i = 0 ; i < sz ; i + + ) { basic block one = blocks get ( i ) ; int label = one get label ( ) ; insn insn = one get insns ( ) get ( 0 ) ; starts [ label ] = new code address ( insn get position ( ) ) ; source position pos = one get last insn ( ) get position ( ) ; lasts [ label ] = new code address ( pos ) ; ends [ label ] = new code address ( pos ) ; } }


public router rpc client get r p c client ( ) { return rpc client ; }


opens a new { @ link output stream } for writing to this sink this method returns a new , independent stream each time it is called the caller is responsible for ensuring that the returned stream is closed

public abstract output stream open stream ( ) throws i o exception ;


encodes this instance to the given output

public final void encode ( code output out ) { format encode ( this , out ) ; }


verify a node can transition from admin states entering maintenance to admin states normal

public void test take node out of entering maintenance ( ) throws exception { log info ( " starting test take node out of entering maintenance " ) ; final int replicas = 1 ; final path file = new path ( " / test take node out of entering maintenance dat " ) ; start cluster ( 1 , 1 ) ; final file system file sys = get cluster ( ) get file system ( 0 ) ; final f s namesystem ns = get cluster ( ) get namesystem ( 0 ) ; write file ( file sys , file , replicas , 1 ) ; final datanode info node outof service = take node outof service ( 0 , null , long max value , null , admin states entering maintenance ) ; / / when node is in entering maintenance state , it can still serve read / / requests check with retry ( ns , file sys , file , replicas , null , node outof service ) ; put node in service ( 0 , node outof service get datanode uuid ( ) ) ; cleanup file ( file sys , file ) ; }


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


convert a j s o n object into a cookie list a cookie list is a sequence of namevalue pairs the names are separated from the values by ' = ' the pairs are separated by ' ; ' the characters ' % ' , ' + ' , ' = ' , and ' ; ' in the names and values are replaced by " % hh "

public static string to string ( j s o n object o ) throws j s o n exception { boolean b = false ; iterator keys = o keys ( ) ; string s ; string builder sb = new string builder ( ) ; while ( keys has next ( ) ) { s = keys next ( ) to string ( ) ; if ( ! o is null ( s ) ) { if ( b ) { sb append ( ' ; ' ) ; } sb append ( cookie escape ( s ) ) ; sb append ( " = " ) ; sb append ( cookie escape ( o get string ( s ) ) ) ; b = true ; } } return sb to string ( ) ; }


returns a triangularly distributed random number between - 1 0 ( exclusive ) and 1 0 ( exclusive ) , where values around zero are more likely this is an optimized version of { @ link # random triangular ( float , float , float ) random triangular ( - 1 , 1 , 0 ) }

public static float random triangular ( ) { return random next float ( ) - random next float ( ) ; }


returns true if the barycentric coordinates are inside the triangle

static public boolean barycoord inside triangle ( vector 2 barycentric ) { return barycentric x > = 0 & & barycentric y > = 0 & & barycentric x + barycentric y < = 1 ; }


retrieve the innermost cause of the given exception , if any

public static throwable get root cause ( @ nullable throwable original ) { if ( original = = null ) { return null ; } throwable root cause = null ; throwable cause = original get cause ( ) ; while ( cause ! = null & & cause ! = root cause ) { root cause = cause ; cause = cause get cause ( ) ; } return root cause ; }


get the headers as an instance of { @ link http headers }


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

public builder merge c dubbo p b request type ( org apache dubbo metadata definition protobuf model google p b p b request type value ) { if ( c dubbo p b request type builder = = null ) { if ( ( ( bit field 0 & 0x 0 0 0 0 0 0 0 2 ) = = 0x 0 0 0 0 0 0 0 2 ) & & c dubbo p b request type ! = null & & c dubbo p b request type ! = org apache dubbo metadata definition protobuf model google p b p b request type get default instance ( ) ) { c dubbo p b request type = org apache dubbo metadata definition protobuf model google p b p b request type new builder ( c dubbo p b request type ) merge from ( value ) build partial ( ) ; } else { c dubbo p b request type = value ; } on changed ( ) ; } else { c dubbo p b request type builder merge from ( value ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; return this ; }


returns an immutable multimap containing the given entries , in order

public static < k , v > immutable list multimap < k , v > of ( k k 1 , v v 1 , k k 2 , v v 2 , k k 3 , v v 3 , k k 4 , v v 4 , k k 5 , v v 5 ) { immutable list multimap builder < k , v > builder = immutable list multimap builder ( ) ; builder put ( k 1 , v 1 ) ; builder put ( k 2 , v 2 ) ; builder put ( k 3 , v 3 ) ; builder put ( k 4 , v 4 ) ; builder put ( k 5 , v 5 ) ; return builder build ( ) ; } / / looking for of ( ) with > 5 entries ? use the builder instead


returns the set of superclasses and interfaces that are initialized

private set initialized super classes ( clazz clazz ) { set set = new hash set ( ) ; / / visit all superclasses and interfaces , collecting the ones that have / / static initializers clazz hierarchy accept ( true , true , true , false , new static initializer containing class filter ( new class collector ( set ) ) ) ; return set ; }


assert that the upstream signalled the specified values in order , then failed with a specific class or subclass of throwable and with the given exact error message

public final u assert failure and message ( class < ? extends throwable > error , string message , t values ) { return assert subscribed ( ) assert values ( values ) assert error ( error ) assert error message ( message ) assert not complete ( ) ; }


public static input stream string 2 input stream ( final string string , final string charset name ) { if ( string = = null ) return null ; try { return new byte array input stream ( string get bytes ( get safe charset ( charset name ) ) ) ; } catch ( unsupported encoding exception e ) { e print stack trace ( ) ; return null ; } }


is a path directly contained in the set of deleted directories

boolean is contained ( path dir ) { return directories get if present ( dir ) ! = null ; }


public final cancellable termvectors async ( term vectors request request , request options options , action listener < term vectors response > listener ) { return perform request async and parse entity ( request , request converters : : term vectors , options , term vectors response : : from x content , listener , empty set ( ) ) ; }


try to cancel the { @ link promise } and log if { @ code logger } is not { @ code null } in case this fails

public static void try cancel ( promise < ? > p , internal logger logger ) { if ( ! p cancel ( false ) & & logger ! = null ) { throwable err = p cause ( ) ; if ( err = = null ) { logger warn ( " failed to cancel promise because it has succeeded already : { } " , p ) ; } else { logger warn ( " failed to cancel promise because it has failed already : { } , unnotified cause : " , p , err ) ; } } }


test { @ link java j a x r s spec server codegen # add operation to group ( string , string , operation , codegen operation , map ) } for resource with path " subresource "

public void test add operation to group for subresource ( ) { codegen operation codegen operation = new codegen operation ( ) ; codegen operation path = " / subresource " ; operation operation = new operation ( ) ; map < string , list < codegen operation > > operation list = new hash map < > ( ) ; codegen add operation to group ( " default " , " / subresource " , operation , codegen operation , operation list ) ; assert assert equals ( codegen operation base name , " subresource " ) ; assert assert equals ( operation list size ( ) , 1 ) ; assert true ( operation list contains key ( " subresource " ) ) ; }


returns an { @ link ads loader } for the given { @ link media item playback properties # ad tag uri ad tag uri } , or null if no ads loader is available for the given ad tag uri this method is called each time a { @ link media source } is created from a { @ link media item } that defines an { @ link media item playback properties # ad tag uri ad tag uri }

ads loader get ads loader ( uri ad tag uri ) ;


schedules this periodic work now in a new thread , if one isn ' t already running

public final void do run ( ) { try { if ( thread ! = null & & thread is alive ( ) ) { logger log ( this get slow logging level ( ) , " { 0 } thread is still running execution aborted " , name ) ; return ; } thread = new thread ( ( ) - > { logger log ( get normal logging level ( ) , " started { 0 } " , name ) ; long start time = system current time millis ( ) ; long stop time ; stream task listener l = create listener ( ) ; try { l get logger ( ) printf ( " started at % tc % n " , new date ( start time ) ) ; try ( a c l context ctx = acl as 2 ( acl system2 ) ) { execute ( l ) ; } } catch ( i o exception e ) { functions print stack trace ( e , l fatal error ( e get message ( ) ) ) ; } catch ( interrupted exception e ) { functions print stack trace ( e , l fatal error ( " aborted " ) ) ; } finally { stop time = system current time millis ( ) ; try { l get logger ( ) printf ( " finished at % tc % dms % n " , new date ( stop time ) , stop time - start time ) ; } finally { l close quietly ( ) ; } } logger log ( get normal logging level ( ) , " finished { 0 } { 1 , number } ms " , new object [ ] { name , stop time - start time } ) ; } , name + " thread " ) ; thread start ( ) ; } catch ( throwable t ) { log record lr = new log record ( this get error logging level ( ) , " { 0 } thread failed with error " ) ; lr set thrown ( t ) ; lr set parameters ( new object [ ] { name } ) ; logger log ( lr ) ; } }


creates a bitmap from a source bitmap and rounds the corners

public static bitmap rounded corners ( @ non null bitmap pool pool , @ non null bitmap in bitmap , @ suppress warnings ( " unused " ) int width , @ suppress warnings ( " unused " ) int height , int rounding radius ) { return rounded corners ( pool , in bitmap , rounding radius ) ; }


converts this object into an equiv { @ link category path }

public category path as category path ( ) { return new category path ( f s utilities append path ( organizational category path get path ( ) , namespace path is root ( ) ? null : namespace path as category path string ( ) ) ) ; }


changes the type of the current property name token to a string value

public abstract void promote name to value ( json reader reader ) throws i o exception ;


test datanode block pool initialization error handling failure in initializing a block pool should not cause npe

public void test b p init error handling ( ) throws exception { final data node mock dn = mockito mock ( data node class ) ; mockito do return ( true ) when ( mock dn ) should run ( ) ; configuration conf = new configuration ( ) ; file dn data dir = new file ( new file ( test build data , " test b p init error handling " ) , " data " ) ; conf set ( dfs datanode data dir key , dn data dir to u r i ( ) to string ( ) ) ; mockito do return ( conf ) when ( mock dn ) get conf ( ) ; mockito do return ( new d n conf ( mock dn ) ) when ( mock dn ) get dn conf ( ) ; mockito do return ( data node metrics create ( conf , " fake dn " ) ) when ( mock dn ) get metrics ( ) ; final atomic integer count = new atomic integer ( ) ; mockito do answer ( new answer < void > ( ) { @ override public void answer ( invocation on mock invocation ) throws throwable { if ( count get and increment ( ) = = 0 ) { throw new i o exception ( " faked init block pool exception " ) ; } / / the init block pool is called again now mock init is done mockito do return ( mock f s dataset ) when ( mock dn ) get f s dataset ( ) ; return null ; } } ) when ( mock dn ) init block pool ( mockito any ( b p offer service class ) ) ; b p offer service bpos = setup b p o s for n ns ( mock dn , mock n n 1 , mock n n 2 ) ; list < b p service actor > actors = bpos get b p service actors ( ) ; assert equals ( 2 , actors size ( ) ) ; bpos start ( ) ; try { wait for initialization ( bpos ) ; / / even if one of the actor initialization fails , the other one will be / / finish block report wait for block report ( mock n n 1 , mock n n 2 ) ; } finally { bpos stop ( ) ; bpos join ( ) ; } }


assert that a connector is running with at least the given number of tasks all in running state

public void assert connector and at least num tasks are running ( string connector name , int num tasks , string detail message ) throws interrupted exception { try { wait for condition ( ( ) - > check connector state ( connector name , abstract status state running , num tasks , abstract status state running , ( actual , expected ) - > actual > = expected ) or else ( false ) , connector setup duration ms , " the connector or at least " + num tasks + " of tasks are not running " ) ; } catch ( assertion error e ) { throw new assertion error ( detail message , e ) ; } }


reads a code of given length and at given index in an array of bits

private static int read code ( boolean [ ] rawbits , int start index , int length ) { int res = 0 ; for ( int i = start index ; i < start index + length ; i + + ) { res < < = 1 ; if ( rawbits [ i ] ) { res | = 0x 0 1 ; } } return res ; }


remove a reference to the mnemonic for this instruction

public void remove mnemonic reference ( address ref addr ) { if ( ref mgr = = null ) throw new unsupported operation exception ( ) ; reference ref = ref mgr get reference ( address , ref addr , mnemonic ) ; if ( ref ! = null ) { ref mgr delete ( ref ) ; } }


this method has to be called in the activity # on create ( bundle ) method it sets up all the things necessary to get input , render via open g l and so on uses a default { @ link android application configuration }

public void initialize ( application listener listener ) { android application configuration config = new android application configuration ( ) ; initialize ( listener , config ) ; }


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


adds a starlark option to the builder overrides previous instances of the same key

public builder add starlark option ( label key , object value ) { starlark options put ( key , value ) ; return this ; }


public void remove layout listener ( layout listener < v , e > listener ) ;


write the next value into key , value as accepted by the operation associated with this set of record readers

public boolean flush ( tuple writable value ) throws i o exception { while ( has next ( ) ) { value clear written ( ) ; if ( next ( value ) & & combine ( kids , value ) ) { return true ; } } return false ; }


public cancellable enable user async ( request options options , enable user request request , action listener < boolean > listener ) { return enable user async ( request , options , listener ) ; }


this test also serves to test { @ link h a util # get proxies for all name nodes in nameservice ( configuration , string ) } and { @ link d f s util # get rpc addresses for nameservice id ( configuration , string , string ) } by virtue of the fact that it wouldn ' t work properly if the proxies returned were not for the correct n ns

public void test is at least one active ( ) throws exception { mini d f s cluster cluster = new mini d f s cluster builder ( new hdfs configuration ( ) ) nn topology ( mini d f s n n topology simple h a topology ( ) ) num data nodes ( 0 ) build ( ) ; try { configuration conf = new hdfs configuration ( ) ; h a test util set failover configurations ( cluster , conf ) ; list < client protocol > namenodes = h a util get proxies for all name nodes in nameservice ( conf , h a test util get logical hostname ( cluster ) ) ; assert equals ( 2 , namenodes size ( ) ) ; assert false ( h a util is at least one active ( namenodes ) ) ; cluster transition to active ( 0 ) ; assert true ( h a util is at least one active ( namenodes ) ) ; cluster transition to standby ( 0 ) ; assert false ( h a util is at least one active ( namenodes ) ) ; cluster transition to active ( 1 ) ; assert true ( h a util is at least one active ( namenodes ) ) ; cluster transition to standby ( 1 ) ; assert false ( h a util is at least one active ( namenodes ) ) ; } finally { if ( cluster ! = null ) { cluster shutdown ( ) ; } } }


checks it the segment from p 1x to p 2x intersects with anti - meridian p 1x must be with in - 180 + 180 range

private static double intersection ( double p 1x , double p 2x ) { if ( p 1x = = p 2x ) { return double na n ; } final double t = ( ( p 1x < p 2x ? dateline : - dateline ) - p 1x ) / ( p 2x - p 1x ) ; if ( t > = 1 | | t < = 0 ) { return double na n ; } else { return t ; } }


applies a flat select function to the detected pattern sequence for each pattern sequence the provided { @ link pattern flat select function } is called the pattern flat select function can produce an arbitrary number of resulting elements

public < r > single output stream operator < r > flat select ( final pattern flat select function < t , r > pattern flat select function ) { / / we have to extract the output type from the provided pattern selection function manually / / because the type extractor cannot do that if the method is wrapped in a map function final type information < r > out type info = type extractor get unary operator return type ( pattern flat select function , pattern flat select function class , 0 , 1 , new int [ ] { 1 , 0 } , builder get input type ( ) , null , false ) ; return flat select ( pattern flat select function , out type info ) ; }


ensures the truth of an expression involving the state of the calling instance , but not involving any parameters to the calling method see { @ link # check state ( boolean , string , object ) } for details

public static void check state ( boolean b , @ nullable decl string error message template , int p 1 ) { if ( ! b ) { throw new illegal state exception ( lenient format ( error message template , p 1 ) ) ; } }


test that when the diagram is generated for a model without graphic info then the default diagram image is returned or the activiti interchange info not found exception is thrown depending on the value of the generate default diagram parameter

public void test generate default diagram ( ) throws exception { / / given string id = repository service create process definition query ( ) process definition key ( " fix system failure " ) single result ( ) get id ( ) ; bpmn model bpmn model = repository service get bpmn model ( id ) ; process diagram generator image generator = new default process diagram generator ( ) ; string activity font name = image generator get default activity font name ( ) ; string label font name = image generator get default label font name ( ) ; string annotation font name = image generator get default annotation font name ( ) ; / / when try ( final input stream resource stream = image generator generate diagram ( bpmn model , empty list ( ) , empty list ( ) , activity font name , label font name , annotation font name , true ) ) { / / then assert that ( resource stream ) is not null ( ) ; byte [ ] diagram = i o utils to byte array ( resource stream ) ; assert that ( diagram ) is not null ( ) ; try ( input stream image stream = get class ( ) get resource as stream ( image generator get default diagram image file name ( ) ) ) { assert that ( diagram ) is equal to ( i o utils to byte array ( image stream ) ) ; } } / / then assert that exception of type ( activiti interchange info not found exception class ) is thrown by ( / / when ( ) - > image generator generate diagram ( bpmn model , empty list ( ) , empty list ( ) , activity font name , label font name , annotation font name , false ) ) with message ( " no interchange information found " ) ; / / then assert that exception of type ( activiti image exception class ) is thrown by ( / / when ( ) - > image generator generate diagram ( bpmn model , empty list ( ) , empty list ( ) , empty list ( ) , activity font name , label font name , annotation font name , true , " invalid - file - name " ) ) with message ( " error occurred while getting default diagram image from file : invalid - file - name " ) ; }


the number of edges incident with v for unweighted graphs valence and degree are the same , except valence is an int while degree is a double

public int valence ( vertex v ) { return ( in valence ( v ) + out valence ( v ) - num loops ( v ) ) ; }


this method syncs token information from current tokens to token owner stats it is used when the current tokens is initialized or refreshed this is called from a single thread thus no synchronization is needed

protected void sync token owner stats ( ) { token owner stats clear ( ) ; for ( token ident id : current tokens key set ( ) ) { add token for owner stats ( id ) ; } }


sets the element i in the array object to value

public void set array element ( object obj , int i , object value ) { reflection cache set array element ( this , obj , i , value ) ; }


called after a build is moved to the { @ code run state completed } state at this point , all the records related to a build is written down to the disk as such , { @ link task listener } is no longer available this happens later than { @ link # on completed ( run , task listener ) }


public string login user ( string username , string password ) throws api exception { return login user with http info ( username , password ) get data ( ) ; }


int get row ( ) throws invalid result set access exception ;


public object get anytype 3 ( ) { return anytype 3 ; }


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


sets the semantic properties for the user - defined function ( udf ) the semantic properties define how fields of tuples and other objects are modified or preserved through this udf the configured properties can be retrieved via { @ link udf operator # get semantic properties ( ) }

public void set semantic properties ( dual input semantic properties properties ) { this udf semantics = properties ; this analyzed udf semantics = false ; }


only for use by { @ code blaze runtime }

public void set command name cache ( command name cache cache ) { / / can be set multiple times in tests this delegate = cache ; }


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


build the accompanying kubernetes resources that should be introduced to support this feature this could only be applicable on the client - side submission process

list < has metadata > build accompanying kubernetes resources ( ) throws i o exception ;


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


splits { @ code sequence } into string components and returns them as an immutable list if you want an { @ link iterable } which may be lazily evaluated , use { @ link # split ( char sequence ) }

public list < string > split to list ( char sequence sequence ) { check not null ( sequence ) ; iterator < string > iterator = splitting iterator ( sequence ) ; list < string > result = new array list < > ( ) ; while ( iterator has next ( ) ) { result add ( iterator next ( ) ) ; } return collections unmodifiable list ( result ) ; }


public top level item new instance ( string name ) { return new instance ( jenkins get ( ) , name ) ; }


the timestamp of the last processed record when this instance was created

public date get timestamp ( ) { return timestamp ; }


schedule a read from some new source dn if some dn is corrupted or slow , this is called from the read iteration initially we may only have < code > min required sources < code > number of striped block reader if the position is at the end of target block , don ' t need to do real read , and return the array index of source dn , otherwise - 1

private int schedule new read ( bit set used , int reconstruct length , corrupted blocks corrupted blocks ) { striped block reader reader = null ; / / step 1 : initially we may only have < code > min required sources < / code > / / number of striped block reader , and there may be some source d ns we never / / read before , so will try to create striped block reader for one new source / / dn and try to read from it if found , go to step 3 int m = readers size ( ) ; int to read = 0 ; while ( reader = = null & & m < sources length ) { reader = create reader ( m , reconstructor get position in block ( ) ) ; readers add ( reader ) ; to read = get read length ( live indices [ m ] , reconstruct length ) ; if ( to read > 0 ) { if ( reader get block reader ( ) = = null ) { reader = null ; m + + ; } } else { used set ( m ) ; return m ; } } / / step 2 : if there is no new source dn we can use , try to find a source / / dn we ever read from but because some reason , e g , slow , it / / is not in the success dn list at the begin of this iteration , so / / we have not tried it in this iteration now we have a chance to / / revisit it again for ( int i = 0 ; reader = = null & & i < readers size ( ) ; i + + ) { if ( ! used get ( i ) ) { striped block reader striped reader = readers get ( i ) ; to read = get read length ( live indices [ i ] , reconstruct length ) ; if ( to read > 0 ) { striped reader close block reader ( ) ; striped reader reset block reader ( reconstructor get position in block ( ) ) ; if ( striped reader get block reader ( ) ! = null ) { striped reader get read buffer ( ) position ( 0 ) ; m = i ; reader = striped reader ; } } else { used set ( i ) ; striped reader get read buffer ( ) position ( 0 ) ; return i ; } } } / / step 3 : schedule if find a correct source dn and need to do real read if ( reader ! = null ) { callable < block read stats > read callable = reader read from block ( to read , corrupted blocks ) ; future < block read stats > f = read service submit ( read callable ) ; futures put ( f , m ) ; used set ( m ) ; } return - 1 ; }


set whether to detect all view resolver beans in this servlet ' s context otherwise , just a single bean with name " view resolver " will be expected default is " true " turn this off if you want this servlet to use a single view resolver , despite multiple view resolver beans being defined in the context

public void set detect all view resolvers ( boolean detect all view resolvers ) { this detect all view resolvers = detect all view resolvers ; }


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

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


encode a couple of contexts where scandinavian , slavic or german names should get an alternate , native pronunciation of ' sv ' or ' xv '

boolean encode special sw ( ) { if ( m current = = 0 ) { / / if ( names beginning with sw that get alt sv ( ) ) { metaph add ( " s " , " sv " ) ; m current + = 2 ; return true ; } / / if ( names beginning with sw that get alt xv ( ) ) { metaph add ( " s " , " xv " ) ; m current + = 2 ; return true ; } } return false ; }


creates a new purging trigger from the given { @ code trigger }

public static < t , w extends window > purging trigger < t , w > of ( trigger < t , w > nested trigger ) { return new purging trigger < > ( nested trigger ) ; }


set the { @ code time zone } to normalize the date values into , if any

public void set time zone ( time zone time zone ) { this time zone = time zone ; }


add the id of an associated model into self model ' s associated ids m 2 m map

void add associated model for join table ( string associated model name , long associated id ) { list < long > associated ids m 2 m set = get associated models map for join table ( ) get ( associated model name ) ; if ( associated ids m 2 m set = = null ) { associated ids m 2 m set = new array list < long > ( ) ; associated ids m 2 m set add ( associated id ) ; associated models map for join table put ( associated model name , associated ids m 2 m set ) ; } else { associated ids m 2 m set add ( associated id ) ; } }


get the number of occurrences of the pattern

public int get num occurrences ( ) { return num occurrences ; }


sets the cassandra hostport to connect to

public cassandra sink builder < in > set host ( final string host , final int port ) { if ( this builder ! = null ) { throw new illegal argument exception ( " builder was already set you must use either set host ( ) or set cluster builder ( ) " ) ; } this builder = new cluster builder ( ) { @ override protected cluster build cluster ( cluster builder builder ) { return builder add contact point ( host ) with port ( port ) build ( ) ; } } ; return this ; }


loads the instructions in the given selection and displays them in the gui

public void load instructions ( program selection selection , instruction search plugin plugin ) throws invalid input exception { if ( selection = = null & & get message panel ( ) ! = null ) { get message panel ( ) set message text ( " select instructions from the listing ( and hit reload ) to populate the table " , color blue ) ; } if ( selection ! = null & & plugin is selection valid ( selection , this ) ) { if ( get control panel ( ) ! = null ) { get control panel ( ) get range widget ( ) update search range by selection ( ) ; } / / load the instructions , but note that we only allow a single selection range if / / there ' s more than one we will process the first one , and display a warning message populate search data ( plugin get current program ( ) , selection ) ; } }


fixme channel get url ( ) always binds to a fixed service , and this service is random we can choose to use a common service to carry on connect event if there ' s no easy way to get the specific service this connection is binding to

private invocation create invocation ( channel channel , url url , string method key ) { string method = url get parameter ( method key ) ; if ( method = = null | | method length ( ) = = 0 ) { return null ; } rpc invocation invocation = new rpc invocation ( method , url get parameter ( interface key ) , " " , new class < ? > [ 0 ] , new object [ 0 ] ) ; invocation set attachment ( path key , url get path ( ) ) ; invocation set attachment ( group key , url get parameter ( group key ) ) ; invocation set attachment ( interface key , url get parameter ( interface key ) ) ; invocation set attachment ( version key , url get parameter ( version key ) ) ; if ( url get parameter ( stub event key , false ) ) { invocation set attachment ( stub event key , boolean true to string ( ) ) ; } return invocation ; }


create an f s data output stream at the indicated path

public f s data output stream create ( path f , boolean overwrite , int buffer size , short replication , long block size ) throws i o exception { return create ( f , overwrite , buffer size , replication , block size , null ) ; }


modifies a directive , skipping most error checking this is for careful internal use only modify directive can be non - deterministic since its error checking depends on current system time , which poses a problem for edit log replay

void modify directive from edit log ( cache directive info info ) throws invalid request exception { / / check for invalid i ds long id = info get id ( ) ; if ( id = = null ) { throw new invalid request exception ( " must supply an id " ) ; } cache directive prev entry = get by id ( id ) ; cache directive info new info = create from info and defaults ( info , prev entry ) ; remove internal ( prev entry ) ; add internal ( new cache directive ( new info ) , get cache pool ( new info get pool ( ) ) ) ; }


reads the next four bytes , returning the integer portion of the fixed point 16 16 integer

public int read unsigned fixed point 1 6 1 6 ( ) { int result = ( data [ position + + ] & 0x f f ) < < 8 | ( data [ position + + ] & 0x f f ) ; position + = 2 ; / / skip the non - integer portion return result ; }


resizes internal data structures if necessary to store the specified number of distinct elements

private void ensure capacity ( int min capacity ) { if ( min capacity > deduped elements length ) { int new capacity = immutable collection builder expanded capacity ( deduped elements length , min capacity ) ; deduped elements = arrays copy of ( deduped elements , new capacity ) ; } }


iterates over all sub - partitions and collects the total number of queued buffers in a best - effort way

long refresh and get total ( ) { return partition get number of queued buffers ( ) ; }


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


public void namespace array test ( ) { / / todo : test namespace array }


writes a data stream to the file specified by the path parameter for every field of an element of the data stream the result of { @ link object # to string ( ) } is written this method can only be used on data streams of tuples

public data stream sink < t > write as csv ( string path ) { return write as csv ( path , null , csv output format default line delimiter , csv output format default field delimiter ) ; }


checks , whether the input that is blocked by this iterator , has further elements available this method may be used to forecast ( for example at the point where a block is full ) whether there will be more data ( possibly in another block )

public boolean has further input ( ) { return ! this no more blocks ; }


returns the unsafe - using comparator , or falls back to the pure - java implementation if unable to do so

static comparator < byte [ ] > get best comparator ( ) { try { class < ? > the class = class for name ( unsafe comparator name ) ; / / yes , unsafe comparator does implement comparator < byte [ ] > @ suppress warnings ( " unchecked " ) comparator < byte [ ] > comparator = ( comparator < byte [ ] > ) the class get enum constants ( ) [ 0 ] ; return comparator ; } catch ( throwable t ) { / / ensure we really catch * everything * return lexicographical comparator java impl ( ) ; } }


creates get api key request for given api key name

public static get api key request using api key name ( string api key name , boolean owned by authenticated user ) { return new get api key request ( null , null , null , api key name , owned by authenticated user ) ; }


sets whether the job should be submitted in a detached manner

public job submission builder set detached ( final boolean detached ) { this detached = detached ; return this ; }


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

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


makes sure that the given string is a base 6 4 encoded text

public static form validation validate base 6 4 ( string value , boolean allow whitespace , boolean allow empty , string error message ) { try { string v = value ; if ( ! allow whitespace ) { if ( v index of ( ' ' ) > = 0 | | v index of ( ' \ n ' ) > = 0 ) return error ( error message ) ; } v = v trim ( ) ; if ( ! allow empty & & v length ( ) = = 0 ) return error ( error message ) ; base 6 4 get decoder ( ) decode ( v get bytes ( standard charsets utf 8 ) ) ; return ok ( ) ; } catch ( illegal argument exception e ) { return error ( error message ) ; } }


public void test update with alias 1 ( ) { direct jdbc template update ( " delete from user 1 where id = ? " , new object [ ] { 1 } ) ; direct jdbc template update ( " insert into user 1 ( id , name , g mt ) values ( ? , ? , ? ) " , new object [ ] { 1 , " xxx " , new date ( ) } ) ; root context bind global lock flag ( ) ; jdbc template update ( " update user 1 a set a name = ' yyy ' where a name = ? " , new object [ ] { " xxx " } ) ; }


public static glide get ( @ non null context context ) { if ( glide = = null ) { generated app glide module annotation generated module = get annotation generated glide modules ( context get application context ( ) ) ; synchronized ( glide class ) { if ( glide = = null ) { check and initialize glide ( context , annotation generated module ) ; } } } return glide ; }


asynchronously create or modify a snapshot lifecycle definition see https : www elastic coguideenelasticsearchclientjava - restcurrent java - rest - high - ilm - slm - put - snapshot - lifecycle - policy html for more

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


set the rationale dialog default is " this app may not work correctly without the requested permissions open the app settings screen to modify app permissions "

public builder set rationale ( @ string res int rationale ) { m rationale = m context get string ( rationale ) ; return this ; }


returns the labels for this metrics context

map < string , string > context labels ( ) ;


public void test complex flush ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; file contents = append test util init buffer ( append test util file size ) ; file builder base dir = new file ( generic test utils get randomized temp path ( ) ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf , builder base dir ) build ( ) ; distributed file system fs = cluster get file system ( ) ; try { / / create a new file path file 1 = new path ( " / complex flush dat " ) ; f s data output stream stm = append test util create file ( fs , file 1 , 1 ) ; system out println ( " created file complex flush dat " ) ; int start = 0 ; for ( start = 0 ; ( start + 29 ) < append test util file size ; ) { stm write ( file contents , start , 29 ) ; stm hflush ( ) ; start + = 29 ; } stm write ( file contents , start , append test util file size - start ) ; / / need to make sure we completely write out all full blocks before / / the check file ( ) call ( see f s output summer # flush ) stm flush ( ) ; / / verify that full blocks are sane check file ( fs , file 1 , 1 ) ; stm close ( ) ; / / verify that entire file is good append test util check full file ( fs , file 1 , append test util file size , file contents , " read 2 " ) ; } catch ( i o exception e ) { system out println ( " exception : " + e ) ; throw e ; } catch ( throwable e ) { system out println ( " throwable : " + e ) ; e print stack trace ( ) ; throw new i o exception ( " throwable : " + e ) ; } finally { fs close ( ) ; cluster shutdown ( ) ; } }


callback method for when a new record is added used for maintaining indexes only may be called before the old record is actually inserted

void inserted record ( d b record record ) throws i o exception { / / add secondary index entries for new record for ( int indexed column : indexed columns ) { index table index table = secondary indexes get ( indexed column ) ; index table add entry ( record ) ; } }


public < t > t execute ( function < response , t > handler ) { return handler apply ( rest assured given ( ) spec ( req spec build ( ) ) expect ( ) spec ( resp spec build ( ) ) when ( ) request ( req method , req uri ) ) ; }


the name of the type this corresponds to the ' type ' part of a full resource name of the form package : typeentry the set of legal type names is listed in resource cpp < code > optional string name = 2 ; < code >

private void set name bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; name = value to string utf 8 ( ) ; }


public pet get pet by id ( long pet id ) throws api exception { api response < pet > local var response = get pet by id with http info ( pet id ) ; return local var response get data ( ) ; }


a given grammar t , return the visitor name such as t visitor java , if we ' re using the java target

public string get visitor file name ( boolean header ) { code generator gen = get code generator ( ) ; grammar g = gen g ; assert g name ! = null ; return g name to lower case ( ) + " visitor go " ; }