this setter should only be used during parsing , to set the user value type hint this is information the user provides in the json query to indicate the output type of a script or the type of the ' missing ' replacement value

public ab user value type hint ( value type value type ) { if ( value type = = null ) { / / todo : this is nonsense we allow the value to be null ( via constructor ) , but don ' t allow it to be set to null this means / / thing looking to copy settings ( like rollup request translator ) need to check if user value type hint is not null , and then / / set it if and only if it is non - null throw new illegal argument exception ( " [ user value type hint ] must not be null : [ " + name + " ] " ) ; } this user value type hint = value type ; return ( ab ) this ; }


invoked by instrumented code when network access occurs

public static void notify of network event ( ) { bridge handle network event ( ) ; }


pastes the clipboard content the result depends on which insertion mode is currently active : insert mode replaces the selection with the dnd clipboard clipboard contents or , if there is no selection , inserts at the current caret offset overwrite mode replaces contents at the current caret offset , unless pasting would overflow the content length , in which case does nothing

public void paste ( ) { if ( ! my clipboard has contents ( ) ) return ; handle selected pre modify ( ) ; long caret pos = get caret pos ( ) ; long total = my clipboard get contents ( content , caret pos , is inserting ) ; start position = caret pos ; end position = caret pos + total ; caret stick to start = false ; redraw text areas ( true ) ; restore state after modify ( ) ; }


public file parse file ( string s ) { file f = new file ( s ) ; if ( ! f is file ( ) ) { throw new illegal argument exception ( " invalid file : " + f ) ; } return f ; }


test the use of chained - buffers for record storage chained - buffers will be forced to utilize 3 buffers for storing indexes

public void test insert very large chained buffers var key record ( ) throws i o exception { insert one var key record ( false , false , 2 * buffer size * ( buffer size / 4 ) ) ; }


returns this value as a category 2 value

public category 2 value category 2 value ( ) { throw new illegal argument exception ( " value \ " " + this to string ( ) + " \ " is not a category 2 value [ " + this get class ( ) get name ( ) + " ] " ) ; }


initializes and syncs the graph with the given options , readying it for the next evaluation

public void sync package loading ( options provider options ) throws interrupted exception , abrupt exit exception { / / we want to ensure that we ' re never calling # sync package loading twice in the same build / / because it does the very expensive work of diffing the cache between incremental builds / / { @ link sequenced skyframe executor # handle diffs } is the particular method we don ' t want to be / / calling twice we could feasibly factor it out of this call if ( has synced package loading ) { throw new illegal state exception ( " we should never call this method more than once over the course of a single command " ) ; } has synced package loading = true ; get skyframe executor ( ) sync ( reporter , options get options ( package options class ) , package locator , options get options ( build language options class ) , get command id ( ) , client env , timestamp granularity monitor , options ) ; }


returns the action context for a given mouse event and provider

public action context get action context ( mouse event event , component provider component provider ) { object source = ( event ! = null ) ? event get source ( ) : null ; component source component = ( source instanceof component ) ? ( component ) source : null ; listing code comparison panel dual listing panel = get dual listing panel ( ) ; / / is the action being taken on the dual listing if ( dual listing panel ! = null & & dual listing panel is ancestor of ( source component ) ) { return dual listing panel get action context ( event , component provider ) ; } return null ; }


sets the policy for the case where the configuration is missing the required fragment class ( see { @ link # requires configuration fragments } )

public builder set missing fragment policy ( class < ? > fragment class , missing fragment policy missing fragment policy ) { configuration fragment policy set missing fragment policy ( fragment class , missing fragment policy ) ; return this ; }


applies the given verification type visitor to the stack item

public void stack item accept ( clazz clazz , method method , code attribute code attribute , int offset , verification type visitor verification type visitor ) { stack item accept ( clazz , method , code attribute , offset , verification type visitor ) ; }


record the creation of a new item version

synchronized void version added ( int version , long time , string comment , string user ) throws i o exception { validate ( ) ; / / validate version if ( version ! = cur version + 1 ) { / / check should have been performed by item item log ( " error ! unexpected version " + version + " created , expected version " + ( cur version + 1 ) , user ) ; return ; } item log ( " version " + version + " created " , user ) ; version ver = new version ( version , time , user , comment ) ; append history file ( ver ) ; version [ ] new versions = new version [ versions length + 1 ] ; system arraycopy ( versions , 0 , new versions , 0 , versions length ) ; new versions [ versions length ] = ver ; versions = new versions ; cur version = version ; if ( version = = 1 ) { min version = 1 ; } }


public list < input split > get splits ( job context job ) throws i o exception { result set results = null ; statement statement = null ; try { statement = connection create statement ( ) ; results = statement execute query ( get count query ( ) ) ; results next ( ) ; long count = results get long ( 1 ) ; int chunks = job get configuration ( ) get int ( m r job config num maps , 1 ) ; long chunk size = ( count / chunks ) ; results close ( ) ; statement close ( ) ; list < input split > splits = new array list < input split > ( ) ; / / split the rows into n - number of chunks and adjust the last chunk / / accordingly for ( int i = 0 ; i < chunks ; i + + ) { d b input split split ; if ( ( i + 1 ) = = chunks ) split = new d b input split ( i * chunk size , count ) ; else split = new d b input split ( i * chunk size , ( i * chunk size ) + chunk size ) ; splits add ( split ) ; } connection commit ( ) ; return splits ; } catch ( s q l exception e ) { throw new i o exception ( " got s q l exception " , e ) ; } finally { try { if ( results ! = null ) { results close ( ) ; } } catch ( s q l exception e 1 ) { } try { if ( statement ! = null ) { statement close ( ) ; } } catch ( s q l exception e 1 ) { } close connection ( ) ; } }


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


this test shows that the heavy field is not instantiated until the method get heavy is called

public void test get heavy ( ) throws exception { assert timeout ( of millis ( 3000 ) , ( ) - > { assert null ( get internal heavy value ( ) ) ; assert not null ( get heavy ( ) ) ; assert not null ( get internal heavy value ( ) ) ; assert same ( get heavy ( ) , get internal heavy value ( ) ) ; } ) ; }


public static < t extends describable < t > , d extends descriptor < t > > descriptor extension list < t , d > create descriptor list ( jenkins jenkins , class < t > describable type ) { if ( describable type = = publisher class ) { return ( descriptor extension list ) new publisher descriptor extension list impl ( jenkins ) ; } return new descriptor extension list < > ( jenkins , describable type ) ; }


public void get pet by id ( long pet id , handler < async result < pet > > result handler ) { get pet by id ( pet id , null , result handler ) ; }


public void make sure mocks unused ( ) { mockito verify no interactions ( request marshaller ) ; mockito verify no interactions ( response marshaller ) ; mockito verify no more interactions ( flow handler ) ; mockito verify no more interactions ( couple handler ) ; mockito verify no more interactions ( few handler ) ; }


if { @ link # is created ( ) } returns true , then this method returns the newly created item , which is always of the type { @ link waiting item }

public @ check for null waiting item get create item ( ) { return null ; }


processes file in parallel : { @ link java nio channels file channel } is used to read contents into a sequence of buffers each buffer is split into chunks , which are tokenized in parallel by { @ link file fragment splitter } , using the < code > predicate < code > fragments of tokens ( on the bounds of buffer fragments ) are assembled by { @ link declaration assembler } the resulting tokens ( each can be further parsed independently ) are passed to { @ link declaration consumer } the main ideas behind this implementation are : 1 ) using the nio with direct buffer allocation for reading from file , ( a quote from byte buffer ' s javadoc : " given a direct byte buffer , the java virtual machine will make a best effort to perform native io operations directly upon it that is , it will attempt to avoid copying the buffer ' s content to ( or from ) an intermediate buffer before ( or after ) each invocation of one of the underlying operating system ' s native io operations " ) 2 ) utilizing the possibilities for parallel processing , since splitting into tokens and parsing them can be done in high degree independently 3 ) not creating additional copies of character buffers for keeping tokens and only then specific objects 4 ) for absorbing the results , it is possible to create a consumer for each tokenizer , and escape synchronization , summarizing the results after all parallel work is done , of use just one shared consumer with synchronized data structures please see a comment about performance test results : { @ link com google devtools build lib bazel rules ninja parallel file processing test }

public static void process file ( readable byte channel channel , block parameters parameters , supplier < declaration consumer > token consumer factory , listening executor service executor service ) throws generic parsing exception , i o exception , interrupted exception { new parallel file processing ( channel , parameters , token consumer factory , executor service ) process file impl ( ) ; }


public void test speculate successful with update events ( ) throws exception { m r app app = new m r app ( num mappers , num reducers , false , " test " , true , controlled clk ) ; job job = app submit ( create configuration ( ) , true , true ) ; app wait for state ( job , job state running ) ; map < task id , task > tasks = job get tasks ( ) ; assert assert equals ( " num tasks is not correct " , num mappers + num reducers , tasks size ( ) ) ; iterator < task > task iter = tasks values ( ) iterator ( ) ; while ( task iter has next ( ) ) { app wait for state ( task iter next ( ) , task state running ) ; } / / process the update events note that we should avoid advancing the clock / / by a value that triggers a speculation scan while updating the task / / progress , because the speculator may concurrently speculate tasks before / / we update their progress controlled clk tick msec ( 2000l ) ; event handler app event handler = app get context ( ) get event handler ( ) ; for ( map entry < task id , task > map task : tasks entry set ( ) ) { for ( map entry < task attempt id , task attempt > task attempt : map task get value ( ) get attempts ( ) entry set ( ) ) { update task progress ( app event handler , task attempt get value ( ) , 0 5f ) ; } } task speculated task = null ; int num tasks to finish = num mappers + num reducers - 1 ; controlled clk tick msec ( 1000l ) ; for ( map entry < task id , task > task : tasks entry set ( ) ) { for ( map entry < task attempt id , task attempt > task attempt : task get value ( ) get attempts ( ) entry set ( ) ) { task attempt id ta id = task attempt get key ( ) ; if ( num tasks to finish > 0 & & ta id get id ( ) = = 0 ) { / / skip speculative attempts if any mark t a completed ( app event handler , task attempt get value ( ) ) ; num tasks to finish - - ; wait for t a state ( task attempt get value ( ) , task attempt state succeeded , controlled clk ) ; } else { / / the last task is chosen for speculation speculated task = task get value ( ) ; update task progress ( app event handler , task attempt get value ( ) , 0 7 5f ) ; } } } controlled clk tick msec ( 15000l ) ; for ( map entry < task id , task > task : tasks entry set ( ) ) { for ( map entry < task attempt id , task attempt > task attempt : task get value ( ) get attempts ( ) entry set ( ) ) { / / skip task attempts that are finished or killed if ( ! ( task attempt get value ( ) get state ( ) = = task attempt state succeeded | | task attempt get value ( ) get state ( ) = = task attempt state killed ) ) { update task progress ( app event handler , task attempt get value ( ) , 0 7 5f ) ; } } } final task speculated task const = speculated task ; wait for speculation ( speculated task const , controlled clk ) ; task attempt [ ] ta = make first attempt win ( app event handler , speculated task ) ; wait for t a state ( ta [ 0 ] , task attempt state succeeded , controlled clk ) ; wait for app stop ( app , controlled clk ) ; }


returns { @ code true } if the given string is null or is the empty string consider normalizing your string references with { @ link # null to empty } if you do , you can use { @ link string # is empty ( ) } instead of this method , and you won ' t need special null - safe forms of methods like { @ link string # to upper case } either or , if you ' d like to normalize " in the other direction , " converting empty strings to { @ code null } , you can use { @ link # empty to null }

public static boolean is null or empty ( @ nullable decl string string ) { return platform string is null or empty ( string ) ; }


public void remove all ( ) { indexer clear ( ) ; }


handle the { @ link throwable } by logging and closing the { @ link channel } sub - classes may override this

public void exception caught ( channel handler context ctx , throwable cause ) throws exception { if ( logger is warn enabled ( ) ) { logger warn ( " failed to initialize a channel closing : " + ctx channel ( ) , cause ) ; } ctx close ( ) ; }


test that a configuration with no service information fails

public void test h a conf without service info ( ) { configuration conf = new configuration ( configuration ) ; conf set boolean ( yarn configuration rm ha enabled , true ) ; conf set boolean ( yarn configuration auto failover enabled , true ) ; conf set boolean ( yarn configuration auto failover embedded , true ) ; conf set ( yarn configuration rm ha ids , " rm 1 , rm 2 " ) ; conf set ( yarn configuration rm ha id , " rm 1 " ) ; check bad configuration ( conf ) ; }


creates a new { @ link big arrays } instance used for this node this method can be overwritten by subclasses to change their { @ link big arrays } implementation for instance for testing

big arrays create big arrays ( page cache recycler page cache recycler , circuit breaker service circuit breaker service ) { return new big arrays ( page cache recycler , circuit breaker service , circuit breaker request ) ; }


flushes this output stream @ exception i o exception if an io error occurs

public void flush ( ) throws i o exception { out stream flush ( ) ; }


from label { @ code a } build graph { @ code o - a - > o }

public handle token ref ( terminal a s t node ) { a t n state left = new state ( node ) ; a t n state right = new state ( node ) ; int ttype = g get token type ( node get text ( ) ) ; left add transition ( new atom transition ( right , ttype ) ) ; node atn state = left ; return new handle ( left , right ) ; }


to have the usernamepassword authenticated by the container , submit the form to the url defined by the servlet spec

public string get authentication gateway url ( ) { return " j security check " ; }


test verifies watcher type any - removes all the configured child , data watcher functions

public void test remove all watches on a path ( boolean use async ) throws exception { zk 1 create ( " / node 1 " , null , ids open acl unsafe , create mode persistent ) ; final count down latch watch count = new count down latch ( 2 ) ; final count down latch rm watch count = new count down latch ( 4 ) ; watcher w 1 = event - > { switch ( event get type ( ) ) { case child watch removed : case data watch removed : rm watch count count down ( ) ; break ; case node children changed : case node data changed : watch count count down ( ) ; break ; default : break ; } } ; watcher w 2 = event - > { switch ( event get type ( ) ) { case child watch removed : case data watch removed : rm watch count count down ( ) ; break ; case node children changed : case node data changed : watch count count down ( ) ; break ; default : break ; } } ; / / add multiple child watches log info ( " adding child watcher { } on path { } " , w 1 , " / node 1 " ) ; assert equals ( 0 , zk 2 get children ( " / node 1 " , w 1 ) size ( ) , " didn ' t set child watches " ) ; log info ( " adding child watcher { } on path { } " , w 2 , " / node 1 " ) ; assert equals ( 0 , zk 2 get children ( " / node 1 " , w 2 ) size ( ) , " didn ' t set child watches " ) ; / / add multiple data watches log info ( " adding data watcher { } on path { } " , w 1 , " / node 1 " ) ; assert not null ( zk 2 exists ( " / node 1 " , w 1 ) , " didn ' t set data watches " ) ; log info ( " adding data watcher { } on path { } " , w 2 , " / node 1 " ) ; assert not null ( zk 2 exists ( " / node 1 " , w 2 ) , " didn ' t set data watches " ) ; assert true ( is server session watcher ( zk 2 get session id ( ) , " / node 1 " , watcher type data ) , " server session is not a watcher " ) ; remove all watches ( zk 2 , " / node 1 " , watcher type any , false , code ok , use async ) ; assert true ( rm watch count await ( connection timeout , time unit milliseconds ) , " didn ' t remove data watcher " ) ; assert false ( is server session watcher ( zk 2 get session id ( ) , " / node 1 " , watcher type data ) , " server session is still a watcher after removal " ) ; assert equals ( 2 , watch count get count ( ) , " received watch notification after removal ! " ) ; }


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


returned value is guaranteed to be unique between operators within the same job and to be stable and the same across job submissions this operation is currently only supported in streaming ( data stream ) contexts

public string get operator unique i d ( ) { return operator unique i d ; }


the elements of a { @ link concurrently mutated list } are added and removed over time this method returns every state that the list has passed through at some point


turn a { @ code resource } into a { @ link resource region } using the range information contained in the current { @ code http range }

public resource region to resource region ( resource resource ) { / / don ' t try to determine content length on input stream resource - cannot be read afterwards / / note : custom input stream resource subclasses could provide a pre - calculated content length ! assert is true ( resource get class ( ) ! = input stream resource class , " cannot convert an input stream resource to a resource region " ) ; long content length = get length for ( resource ) ; long start = get range start ( content length ) ; long end = get range end ( content length ) ; assert is true ( start < content length , " ' position ' exceeds the resource length " + content length ) ; return new resource region ( resource , start , end - start + 1 ) ; }


returns the number of { @ link channel } s registered with this { @ link event loop } or { @ code - 1 } if operation is not supported the returned value is not guaranteed to be exact accurate and should be viewed as a best effort

public int registered channels ( ) { return - 1 ; }


public synchronized t from resource ( string resource ) throws i o exception , json parse exception , json mapping exception { try ( input stream res stream = this get class ( ) get resource as stream ( resource ) ) { if ( res stream = = null ) { throw new file not found exception ( resource ) ; } return mapper read value ( res stream , class type ) ; } catch ( i o exception e ) { log error ( " exception while parsing json resource { } " , resource , e ) ; throw e ; } }


returns true if the request is the request loading the full size image and if neither the full nor the thumbnail image have completed successfully

public boolean can notify status changed ( request request ) { synchronized ( request lock ) { return parent can notify status changed ( ) & & request equals ( full ) & & ! is any resource set ( ) ; } }


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


check if the function body exists , and is a place holder single byte function that needs to be fixed

private boolean is place holder function that should be fixed ( program program , listing listing , symbol func symbol ) { function func = program get function manager ( ) get function at ( func symbol get address ( ) ) ; if ( func = = null ) { return false ; } if ( func get body ( ) get num addresses ( ) > 1 ) { return false ; } instruction instr = listing get instruction at ( func get entry point ( ) ) ; if ( instr = = null ) { return false ; } / / if instruction length longer than the body , or the instruction isn ' t terminal if ( instr get length ( ) > 1 | | ! instr get flow type ( ) is terminal ( ) ) { return true ; } return false ; }


applies the given { @ link argument matcher action } to all arguments and corresponding matchers

public boolean for each matcher and argument ( argument matcher action action ) { if ( matching type = = error unsupported number of matchers ) return false ; object [ ] arguments = invocation get arguments ( ) ; for ( int i = 0 ; i < arguments length ; i + + ) { argument matcher < ? > matcher = matchers get ( i ) ; object argument = arguments [ i ] ; if ( ! action apply ( matcher , argument ) ) { return false ; } } return true ; }


find a unique argument matching the given type

public method parameter arg ( class < ? > type , resolvable type generic , resolvable type generics ) { return new arg resolver ( ) arg ( type , generic , generics ) ; }


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


called when a drm error occurs these errors are just for informational purposes and the player may recover

default void on drm session manager error ( event time event time , exception error ) { }


generate the hash smash for a superior full hashinferior id

public static long generate inferior full hash smash ( fid hash quad superior function , function record inferior function ) { long hash value = inferior function get key ( ) * f n v 1a 6 4 message digest fnv 64 prime ; / / improve bit diversity on key return hash value ^ superior function get full hash ( ) ; }


set the underlying output format for lazy output format

public static void set output format class ( job job , class < ? extends output format > the class ) { job set output format class ( lazy output format class ) ; job get configuration ( ) set class ( output format , the class , output format class ) ; }


verify if router set safe mode state correctly

private boolean verify safe mode ( boolean is in safe mode ) { preconditions check not null ( this router get safemode service ( ) ) ; boolean server in safe mode = this router get safemode service ( ) is in safe mode ( ) ; router service state current state = this router get router state ( ) ; return ( is in safe mode & & current state = = router service state safemode & & server in safe mode ) | | ( ! is in safe mode & & current state ! = router service state safemode & & ! server in safe mode ) ; }


returns { @ code true } if the regex implementation behaves like perl - - notably , by supporting possessive quantifiers but also being susceptible to catastrophic backtracking


tests that shutting down the system processing time service will also cancel the scheduled at fix rate future

public void test quiesce and awaiting cancels scheduled at fix rate future ( ) throws exception { final atomic reference < throwable > error ref = new atomic reference < > ( ) ; final long period = 10l ; final system processing time service timer = create system processing time service ( error ref ) ; try { scheduled future < ? > scheduled future = timer schedule at fixed rate ( new processing time callback ( ) { @ override public void on processing time ( long timestamp ) throws exception { } } , 0l , period ) ; assert false ( scheduled future is done ( ) ) ; / / this should cancel our future timer quiesce ( ) get ( ) ; / / it may be that the cancelled status is not immediately visible after the / / termination ( not necessary a volatile update ) , so we need to " get ( ) " the cancellation / / exception to be on the safe side try { scheduled future get ( ) ; fail ( " scheduled future is not cancelled " ) ; } catch ( cancellation exception ignored ) { / / expected } scheduled future = timer schedule at fixed rate ( new processing time callback ( ) { @ override public void on processing time ( long timestamp ) throws exception { throw new exception ( " test exception " ) ; } } , 0l , 100l ) ; assert not null ( scheduled future ) ; assert equals ( 0 , timer get num tasks scheduled ( ) ) ; if ( error ref get ( ) ! = null ) { throw new exception ( error ref get ( ) ) ; } } finally { timer shutdown service ( ) ; } }


called while producing usage this is a good method to override to render the general description of the command that goes beyond a single - line summary

protected void print usage summary ( print stream stderr ) { stderr println ( get short description ( ) ) ; }


protected void reset failures ( ) { if ( inconsistent client ! = null ) { set throttling ( 0 , 0 ) ; } }


check that the digest stored in the txn matches the digest calculated from data tree

public void digest from txn logs matches tree ( ) throws exception { / / reset the mismatch metrics simple counter digest mistaches count = ( simple counter ) server metrics get metrics ( ) digest mismatches count ; digest mistaches count reset ( ) ; / / trigger some write ops perform operations ( create client ( ) , " / digest from txn logs matches tree " ) ; / / make sure there is no digest mismatch assert equals ( 0 , digest mistaches count get ( ) ) ; / / verify that the digest is wrote to disk with txn txn digest last digest = get last txn log digest ( ) ; assert not null ( last digest ) ; assert equals ( server get z k database ( ) get data tree ( ) get tree digest ( ) , last digest get tree digest ( ) ) ; }


get the currently available resources in the cluster a valid value is available after a call to allocate has been made

public resource get available resources ( ) { return client get available resources ( ) ; }


create a < code > version < code > file for datanode inside the specified parent directory if such a file already exists , it will be overwritten the given version string will be written to the file as the layout version none of the parameters may be null

public static void create data node version file ( file [ ] parent , storage info version , string bpid , configuration conf ) throws i o exception { create data node version file ( parent , version , bpid , bpid , conf ) ; }


test the edge case that oom is never resolved

public void test infinite o o m ( ) throws exception { conf set ( yarn configuration nm elastic memory control oom listener path , script get absolute path ( ) ) ; runnable handler = mock ( runnable class ) ; try { file utils write string to file ( script , " # ! / bin / bash \ nprintf oomevent ; sleep 1000 ; \ n " , charset default charset ( ) , false ) ; assert true ( " could not set executable " , script set executable ( true ) ) ; c groups handler cgroups = mock ( c groups handler class ) ; when ( cgroups get path for c group ( any ( ) , any ( ) ) ) then return ( " " ) ; when ( cgroups get c group param ( any ( ) , any ( ) , any ( ) ) ) then return ( " under oom 1 " ) ; do nothing ( ) when ( handler ) run ( ) ; c group elastic memory controller controller = new c group elastic memory controller ( conf , null , cgroups , true , false , 10000 , handler ) ; controller run ( ) ; } finally { verify ( handler , times ( 1 ) ) run ( ) ; assert true ( string format ( " could not clean up script % s " , script get absolute path ( ) ) , script delete ( ) ) ; } }


the number of server - to - client messages that a session can cache while waiting for the next http polling request from the client all http transports use this property since even streaming transports recycle http requests periodically the amount of time between http requests should be relatively brief and will not exceed the allows disconnect delay ( see { @ link # set disconnect delay ( long ) } ) ; 5 seconds by default the default size is 100

public void set http message cache size ( int http message cache size ) { this http message cache size = http message cache size ; }


assert that the counter field is at a specific value

protected void assert counter value ( final int expected ) { assert that ( counter ) described as ( " counter value " ) is equal to ( expected ) ; }


add the given { @ link byte buf } on the specific index be aware that this method does not increase the { @ code writer index } of the { @ link composite byte buf } if you need to have it increased use { @ link # add component ( boolean , int , byte buf ) } { @ link byte buf # release ( ) } ownership of { @ code buffer } is transferred to this { @ link composite byte buf }

public composite byte buf add component ( int c index , byte buf buffer ) { return add component ( false , c index , buffer ) ; }


validate the selection for a case of the multi - selection for either the popup menu or the plugin action

private boolean valid multi selection ( ) { tree path [ ] paths = tree get selection paths ( ) ; if ( paths = = null ) { return false ; } tree path root path = root get tree path ( ) ; for ( tree path element : paths ) { if ( element equals ( root path ) ) { return false ; } } for ( tree path path : paths ) { program node node = ( program node ) path get last path component ( ) ; / / if the node allows children , then verify that / / either ( 1 ) only the parent is selected , or / / ( 2 ) all children are selected if ( node get allows children ( ) & & ! valid path selection ( node , paths ) ) { return false ; } } return true ; }


static set < function signature template > find input only templates ( set < function template > global , set < function template > local , function < function template , function result template > accessor ) { return stream concat ( global stream ( ) , local stream ( ) ) filter ( t - > t get signature template ( ) ! = null & & accessor apply ( t ) = = null ) map ( function template : : get signature template ) collect ( collectors to collection ( linked hash set : : new ) ) ; }


set the parameter types for the pointcut

public void set parameter types ( class < ? > types ) { this pointcut parameter types = types ; }


create the most approximate collection for the given collection warning : since the parameterized type { @ code e } is not bound to the type of elements contained in the supplied { @ code collection } , type safety cannot be guaranteed if the supplied { @ code collection } is an { @ link enum set } in such scenarios , the caller is responsible for ensuring that the element type for the supplied { @ code collection } is an enum type matching type { @ code e } as an alternative , the caller may wish to treat the return value as a raw collection or collection of { @ link object }

public static < e > collection < e > create approximate collection ( @ nullable object collection , int capacity ) { if ( collection instanceof linked list ) { return new linked list < > ( ) ; } else if ( collection instanceof list ) { return new array list < > ( capacity ) ; } else if ( collection instanceof enum set ) { / / cast is necessary for compilation in eclipse 4 4 1 collection < e > enum set = ( collection < e > ) enum set copy of ( ( enum set ) collection ) ; enum set clear ( ) ; return enum set ; } else if ( collection instanceof sorted set ) { return new tree set < > ( ( ( sorted set < e > ) collection ) comparator ( ) ) ; } else { return new linked hash set < > ( capacity ) ; } }


create a { @ link k stream } from the specified topic the { @ code " auto offset reset " } strategy , { @ link timestamp extractor } , key and value deserializers are defined by the options in { @ link consumed } are used note that the specified input topic must be partitioned by key if this is not the case it is the user ' s responsibility to repartition the data before any key based operation ( like aggregation or join ) is applied to the returned { @ link k stream }

public synchronized < k , v > k stream < k , v > stream ( final string topic , final consumed < k , v > consumed ) { return stream ( collections singleton ( topic ) , consumed ) ; }


returns an instance which creates asynchronous observables

public static rx java 2 call adapter factory create async ( ) { return new rx java 2 call adapter factory ( null , true ) ; }


public int compare to ( parameter annotation struct other ) { return method compare to ( other method ) ; }


public void set row key ( string row key ) { this row key = row key ; }


optional - open a p i type conversion this is used to map open a p i types in a ` schema ` into either language specific types via ` type mapping ` or into complex models if there is not a mapping

public string get schema type ( schema p ) { string open a p i type = super get schema type ( p ) ; string type = null ; if ( type mapping contains key ( open a p i type ) ) { type = type mapping get ( open a p i type ) ; if ( language specific primitives contains ( type ) ) return to model name ( type ) ; } else type = open a p i type ; return to model name ( type ) ; }


adds { @ code element } to the { @ code immutable sorted set } if the { @ code immutable sorted set } already contains { @ code element } , then { @ code add } has no effect ( only the previously added element is retained )

public builder < e > add ( e element ) { check not null ( element ) ; copy if necessary ( ) ; if ( n = = elements length ) { sort and dedup ( ) ; / * * sorting operations can only be allowed to occur once every o ( n ) operations to keep * amortized o ( n log n ) performance therefore , ensure there are at least o ( n ) * unused * * spaces in the builder array * / int new length = immutable collection builder expanded capacity ( n , n + 1 ) ; if ( new length > elements length ) { elements = arrays copy of ( elements , new length ) ; } } elements [ n + + ] = element ; return this ; }


add a declared parameter to the list of parameters for the call only parameters declared as { @ code sql parameter } and { @ code sql in out parameter } will be used to provide input values this is different from the { @ code stored procedure } class which - for backwards compatibility reasons - allows input values to be provided for parameters declared as { @ code sql out parameter }

public void add declared parameter ( sql parameter parameter ) { assert not null ( parameter , " the supplied parameter must not be null " ) ; if ( ! string utils has text ( parameter get name ( ) ) ) { throw new invalid data access api usage exception ( " you must specify a parameter name when declaring parameters for \ " " + get procedure name ( ) + " \ " " ) ; } this declared parameters add ( parameter ) ; if ( logger is debug enabled ( ) ) { logger debug ( " added declared parameter for [ " + get procedure name ( ) + " ] : " + parameter get name ( ) ) ; } }


get collection of blocks which map onto this block

collection < memory block d b > get mapped blocks ( ) { return mapped blocks ; }


create the panel for the buttons ; the button are aligned vertically ; the side margins on the panel has a default value of 20

public static j panel create button panel ( j button [ ] buttons ) { return create button panel ( buttons , side margin , y axis ) ; }


test serialization of object with outer number type

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


invoked when the mouse exits a menu item

public void menu item exited ( docking action if action ) { }


returns an immutable set of the mappings in this map the iteration order is specified by the method used to create this map typically , this is insertion order

public immutable set < entry < k , v > > entry set ( ) { immutable set < entry < k , v > > result = entry set ; return ( result = = null ) ? entry set = create entry set ( ) : result ; }


finds object by its name ( case insensitive )

public static < t extends d b p named object > t find object ( @ nullable collection < t > the list , string object name , boolean case insensitive ) { if ( the list ! = null & & ! the list is empty ( ) ) { for ( t object : the list ) { if ( case insensitive ? object get name ( ) equals ignore case ( object name ) : object get name ( ) equals ( object name ) ) { return object ; } } } return null ; }


mono < server response > handle request ( server web exchange exchange , throwable t ) ;


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


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

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


returns the number of bytes remaining in the compressed data buffer indicates a concatenated data stream if { @ link # finished ( ) } returns < code > true < code > and get remaining ( ) returns a positive value if { @ link # finished ( ) } returns < code > true < code > and get remaining ( ) returns a zero value , indicates that the end of data stream has been reached and is not a concatenated data stream


configures the delimiter that separates fields in a row for the csv reader used to read the vertices ( { @ code ' , ' } ) is used by default

public graph csv reader field delimiter vertices ( string delimiter ) { if ( this vertex reader ! = null ) { this vertex reader field delimiter ( delimiter ) ; } return this ; }


this method determines if there is enough space left in the memory cache to write to the requested length + space for subsequent eof makers

boolean reserve space ( int length ) throws i o exception { int available size = block size - used size ; if ( available size > = length + eof marker size ) { return true ; } / / not enough available close this block assert ( ! in reset ) ; create in memory segment ( ) ; / / create a new block int tmp = math max ( length + eof marker size , default block size ) ; available size = create new memory block ( tmp , ( length + eof marker size ) ) ; return ( available size = = 0 ) ? false : true ; }


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


read a long stored in variable - length format using zig - zag decoding from < a href = " http : code google comapisprotocolbuffersdocsencoding html " > google protocol buffers

public static long read varlong ( byte buffer buffer ) { long value = 0l ; int i = 0 ; long b ; while ( ( ( b = buffer get ( ) ) & 0x 8 0 ) ! = 0 ) { value | = ( b & 0x 7f ) < < i ; i + = 7 ; if ( i > 63 ) throw illegal varlong exception ( value ) ; } value | = b < < i ; return ( value > > > 1 ) ^ - ( value & 1 ) ; }


returns { @ code true } iff this attribute requires documentation

public boolean is documented ( ) { return ! get property flag ( property flag undocumented ) ; }


configures the closure cleaner please see { @ link closure cleaner level } for details on the different settings

public execution config set closure cleaner level ( closure cleaner level level ) { this closure cleaner level = level ; return this ; }


tests when the node returns data with a shard allocation id that does not match active allocation ids , it will be moved to ignore unassigned

public void test no matching allocation id found ( ) { routing allocation allocation = routing allocation with one primary no replicas ( yes allocation deciders ( ) , cluster recovered , " id 2 " ) ; test allocator add data ( node 1 , " id 1 " , random boolean ( ) ) ; allocate all unassigned ( allocation ) ; assert that ( allocation routing nodes changed ( ) , equal to ( true ) ) ; assert that ( allocation routing nodes ( ) unassigned ( ) ignored ( ) size ( ) , equal to ( 1 ) ) ; assert that ( allocation routing nodes ( ) unassigned ( ) ignored ( ) get ( 0 ) shard id ( ) , equal to ( shard id ) ) ; assert cluster health status ( allocation , cluster health status yellow ) ; }


configure the { @ link clock } to use to set last access time on every created session and to calculate if it is expired this may be useful to align to different timezone or to set the clock back in a test , e g { @ code clock offset ( clock , duration of minutes ( - 31 ) ) } in order to simulate session expiration by default this is { @ code clock system ( zone id of ( " gmt " ) ) }

public void set clock ( clock clock ) { assert not null ( clock , " clock is required " ) ; this clock = clock ; remove expired sessions ( ) ; }


reads window state generated using an { @ link aggregate function }

public < k , t , acc , r > data set < r > aggregate ( string uid , aggregate function < t , acc , r > aggregate function , type information < k > key type , type information < t > input type , type information < r > output type ) throws i o exception { return aggregate ( uid , aggregate function , new pass through reader < > ( ) , key type , input type , output type ) ; }


public date parse date ( string str ) { try { return date format parse ( str ) ; } catch ( java text parse exception e ) { throw new runtime exception ( e ) ; } }


creates a new build of this project for immediate execution calls the ( { @ link job } ) constructor of { @ link # get build class } suitable for { @ link sub task # create executable }

public final synchronized run t new build ( ) throws i o exception { try { run t last build = get build class ( ) get constructor ( as job ( ) get class ( ) ) new instance ( as job ( ) ) ; builds put ( last build ) ; last build get previous build ( ) ; / / jenkins - 20662 : create connection to previous build return last build ; } catch ( invocation target exception e ) { logger log ( level warning , string format ( " a new build could not be created in job % s " , as job ( ) get full name ( ) ) , e ) ; throw handle invocation target exception ( e ) ; } catch ( reflective operation exception | illegal state exception e ) { logger log ( level warning , string format ( " a new build could not be created in job % s " , as job ( ) get full name ( ) ) , e ) ; throw new error ( e ) ; } }


resets a to - many relationship , making the next get call to query for a fresh result

public synchronized void reset date entity list ( ) { date entity list = null ; }


returns the single instance of the default language service

public static synchronized language service get language service ( ) { if ( language service = = null ) { language service = new default language service ( ) ; } else if ( ! language service search completed ) { language service search for providers ( ) ; } return language service ; }


returns the { @ link http 2 connection } to use

protected http 2 connection connection ( ) { return connection ; }


parses a time - to - live value from a string

static long parse ttl string ( string max ttl string ) throws i o exception { long max ttl = null ; if ( max ttl string ! = null ) { if ( max ttl string equals ignore case ( " never " ) ) { max ttl = cache pool info relative expiry never ; } else { max ttl = d f s util parse relative time ( max ttl string ) ; } } return max ttl ; }


test that the fencing configuration can be overridden per - nameservice or per - namenode

public void test fencing config per name node ( ) throws exception { mockito do return ( standby ready result ) when ( mock protocol ) get service status ( ) ; final string ns specific key = d f s config keys dfs ha fence methods key + " " + nsid ; final string nn specific key = ns specific key + " nn 1 " ; hdfs configuration conf = get h a conf ( ) ; / / set the default fencer to succeed conf set ( d f s config keys dfs ha fence methods key , get fencer true command ( ) ) ; tool set conf ( conf ) ; assert equals ( 0 , run tool ( " - failover " , " nn 1 " , " nn 2 " , " - - forcefence " ) ) ; / / set the nn - specific fencer to fail should fail to fence conf set ( nn specific key , get fencer false command ( ) ) ; tool set conf ( conf ) ; assert equals ( - 1 , run tool ( " - failover " , " nn 1 " , " nn 2 " , " - - forcefence " ) ) ; conf unset ( nn specific key ) ; / / set an ns - specific fencer to fail should fail conf set ( ns specific key , get fencer false command ( ) ) ; tool set conf ( conf ) ; assert equals ( - 1 , run tool ( " - failover " , " nn 1 " , " nn 2 " , " - - forcefence " ) ) ; / / set the ns - specific fencer to succeed should succeed conf set ( ns specific key , get fencer true command ( ) ) ; tool set conf ( conf ) ; assert equals ( 0 , run tool ( " - failover " , " nn 1 " , " nn 2 " , " - - forcefence " ) ) ; }


sets the handle for the canceller to this pending checkpoint this method fails with an exception if a handle has already been set

public boolean set canceller handle ( scheduled future < ? > canceller handle ) { synchronized ( lock ) { if ( this canceller handle = = null ) { if ( ! disposed ) { this canceller handle = canceller handle ; return true ; } else { return false ; } } else { throw new illegal state exception ( " a canceller handle was already set " ) ; } } }


add a configuration resource the properties of this resource will override properties of previously added resources , unless they were marked < a href = " # final " > final

public void add resource ( path file ) { add resource object ( new resource ( file ) ) ; }


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


retrieve shard snapshot status for the stored snapshot

index shard snapshot status get shard snapshot status ( snapshot id snapshot id , index id index id , shard id shard id ) ;


sets the token , which together with the scheme , will be sent as the value of the authorization header

public void set bearer token ( string bearer token ) { this bearer token = bearer token ; }


@ before public void set up ( ) { when ( channel new call ( argument matchers < method descriptor < string , integer > > any ( ) , any ( call options class ) ) ) then return ( call ) ; }


get the actual instance of ` complex quadrilateral ` if the actual instanct is not ` complex quadrilateral ` , the class cast exception will be thrown

public complex quadrilateral get complex quadrilateral ( ) throws class cast exception { return ( complex quadrilateral ) super get actual instance ( ) ; }


returns the network address the instance ' s task manager binds its sockets to

public inet address address ( ) { return inet address ; }


internal method to identify if owner name returned by the adls backend is short name or not if name contains " @ " , this code assumes that whatever comes after ' @ ' is domain name and ignores it

private boolean is short user name ( string owner ) { return ( owner ! = null ) & & ! owner contains ( at ) ; }


updates an object as if by the starlark statement { @ code object [ key ] = value }

static void set index ( object object , object key , object value ) throws eval exception { if ( object instanceof dict ) { @ suppress warnings ( " unchecked " ) dict < object , object > dict = ( dict < object , object > ) object ; dict put entry ( key , value ) ; } else if ( object instanceof starlark list ) { @ suppress warnings ( " unchecked " ) starlark list < object > list = ( starlark list < object > ) object ; int index = starlark to int ( key , " list index " ) ; index = eval utils get sequence index ( index , list size ( ) ) ; list set element at ( index , value ) ; } else { throw starlark errorf ( " can only assign an element in a dictionary or a list , not in a ' % s ' " , starlark type ( object ) ) ; } }


helper method for summarizing a list of values this method breaks the rule of " testing only one thing " by aggregating and combining a bunch of different ways

protected boolean column summary summarize ( boolean values ) { return new aggregate combine harness < boolean , boolean column summary , boolean summary aggregator > ( ) { @ override protected void compare results ( boolean column summary result 1 , boolean column summary result 2 ) { assert assert equals ( result 1 get null count ( ) , result 2 get null count ( ) ) ; assert assert equals ( result 1 get non null count ( ) , result 2 get non null count ( ) ) ; assert assert equals ( result 1 get true count ( ) , result 2 get true count ( ) ) ; assert assert equals ( result 1 get false count ( ) , result 2 get false count ( ) ) ; } } summarize ( values ) ; }


creates { @ link work processor } from { @ link process } { @ link process } instance will be dereferenced immediately after { @ link work processor } is finished

static < t > work processor < t > create ( process < t > process ) { return work processor utils create ( process ) ; }


public decoded instruction with index ( int new index ) { return new register range decoded instruction ( get format ( ) , get opcode ( ) , new index , get index type ( ) , get target ( ) , get literal ( ) , a , register count ) ; }


create the sse - c structure for the aws sdk , if the encryption secrets contain the informationsettings for this this will contain a secret extracted from the bucketconfiguration

private optional < s s e customer key > generate s s e customer key ( ) { return encryption secret operations create s s e customer key ( encryption secrets ) ; }


informs the peer that we ' ve applied its latest settings

void ack settings ( settings peer settings ) throws i o exception ;


creates a time limiter instance using the given executor service to execute method calls < b > warning : < b > using a bounded executor may be counterproductive ! if the thread pool fills up , any time callers spend waiting for a thread may count toward their time limit , and in this case the call may even time out before the target method is ever invoked

public static simple time limiter create ( executor service executor ) { return new simple time limiter ( executor ) ; }


public short get type i d ( ) { return type i d ; }


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


configure a result mapping { @ link function function } and enter the execution stage

default < r > rows fetch spec < r > map ( function < row , r > mapping function ) { assert not null ( mapping function , " mapping function must not be null " ) ; return map ( ( row , row metadata ) - > mapping function apply ( row ) ) ; }


enabling a user forces a doc to be written to the security index , and " user doc with empty password " has a special case code in the reserved realm

public void test authenticate after enabling user ( ) throws i o exception { final rest high level client rest client = new test rest high level client ( ) ; final list < string > usernames = arrays as list ( elastic user name , kibana user name , kibana system user name , logstash system user name , beats system user name , a p m system user name , remote monitoring user name ) ; for ( string username : usernames ) { rest client security ( ) enable user ( new enable user request ( username , refresh policy get default ( ) ) , security request options ) ; cluster health response response = client ( ) filter with header ( singleton map ( " authorization " , basic auth header value ( username , get reserved password ( ) ) ) ) admin ( ) cluster ( ) prepare health ( ) get ( ) ; assert that ( response get cluster name ( ) , is ( cluster ( ) get cluster name ( ) ) ) ; } }


tests that a non - dynamic { @ link event sample stream } will return a buffer with { @ link c # buffer flag end of stream } when trying to read sample out - of - bound

public void read data out of bound return end of stream after format for non dynamic event sample stream ( ) { event stream event stream = new event stream ( scheme id , value , time scale , new long [ 0 ] , new event message [ 0 ] ) ; event sample stream sample stream = new event sample stream ( event stream , format , false ) ; / / first read - read format read data ( sample stream ) ; int result = read data ( sample stream ) ; assert that ( result ) is equal to ( c result buffer read ) ; assert that ( input buffer is end of stream ( ) ) is true ( ) ; }


protected one time token account build one time token account ( final request context request context ) { val current acct = get candidate account from ( request context ) ; val account name = request context get request parameters ( ) get required ( request parameter account name ) ; return one time token account builder ( ) username ( current acct get username ( ) ) secret key ( current acct get secret key ( ) ) validation code ( current acct get validation code ( ) ) scratch codes ( current acct get scratch codes ( ) ) name ( account name ) build ( ) ; }


creates a new client - side { @ link ssl context }

public static ssl context new client context ( file cert chain file , trust manager factory trust manager factory , iterable < string > ciphers , cipher suite filter cipher filter , application protocol config apn , long session cache size , long session timeout ) throws s s l exception { return new client context ( null , cert chain file , trust manager factory , ciphers , cipher filter , apn , session cache size , session timeout ) ; }


closes the streams ignoring { @ link throwable } must only be called in cleaning up from exception handlers

public static void close streams ( java io closeable streams ) { if ( streams ! = null ) { cleanup with logger ( null , streams ) ; } }


set the value of the ' { @ code disabled } ' attribute

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


the first time of the { @ code value } ' s load


default engine delete pre delete ( shard id shard id , engine delete delete ) { return delete ; }


require that the service is in a given state

protected void require service state ( final state state ) throws illegal state exception { preconditions check state ( is in state ( state ) , " required state : % s ; actual state % s " , state , get service state ( ) ) ; }


set the cache name ( s ) that this resolver should use

public void set cache names ( collection < string > cache names ) { this cache names = cache names ; }


update settings according to given settings config

public builder update ( settings config update ) { / / if explicit { @ code null } s have been set in the update , we do not want to carry the default , but get rid / / of the setting if ( update get docs per second ( ) ! = null ) { this docs per second = update get docs per second ( ) equals ( default docs per second ) ? null : update get docs per second ( ) ; } if ( update get max page search size ( ) ! = null ) { this max page search size = update get max page search size ( ) equals ( default max page search size ) ? null : update get max page search size ( ) ; } if ( update get dates as epoch millis for update ( ) ! = null ) { this dates as epoch millis = update get dates as epoch millis for update ( ) equals ( default dates as epoch millis ) ? null : update get dates as epoch millis for update ( ) ; } return this ; }


public void process ( history event event ) { if ( finalized ) { throw new illegal state exception ( " job builder process ( history event event ) called after parsed job built " ) ; } / / these are in lexicographical order by class name if ( event instanceof a m started event ) { / / ignore this event as rumen currently doesnt need this event / / todo enhance rumen to process this event and capture restarts return ; } else if ( event instanceof normalized resource event ) { / / log an warn message as normalized resource event shouldn ' t be written log warn ( " normalized resource event should be ignored in history server " ) ; } else if ( event instanceof job finished event ) { process job finished event ( ( job finished event ) event ) ; } else if ( event instanceof job info change event ) { process job info change event ( ( job info change event ) event ) ; } else if ( event instanceof job inited event ) { process job inited event ( ( job inited event ) event ) ; } else if ( event instanceof job priority change event ) { process job priority change event ( ( job priority change event ) event ) ; } else if ( event instanceof job queue change event ) { process job queue change event ( ( job queue change event ) event ) ; } else if ( event instanceof job status changed event ) { process job status changed event ( ( job status changed event ) event ) ; } else if ( event instanceof job submitted event ) { process job submitted event ( ( job submitted event ) event ) ; } else if ( event instanceof job unsuccessful completion event ) { process job unsuccessful completion event ( ( job unsuccessful completion event ) event ) ; } else if ( event instanceof map attempt finished event ) { process map attempt finished event ( ( map attempt finished event ) event ) ; } else if ( event instanceof reduce attempt finished event ) { process reduce attempt finished event ( ( reduce attempt finished event ) event ) ; } else if ( event instanceof task attempt finished event ) { process task attempt finished event ( ( task attempt finished event ) event ) ; } else if ( event instanceof task attempt started event ) { process task attempt started event ( ( task attempt started event ) event ) ; } else if ( event instanceof task attempt unsuccessful completion event ) { process task attempt unsuccessful completion event ( ( task attempt unsuccessful completion event ) event ) ; } else if ( event instanceof task failed event ) { process task failed event ( ( task failed event ) event ) ; } else if ( event instanceof task finished event ) { process task finished event ( ( task finished event ) event ) ; } else if ( event instanceof task started event ) { process task started event ( ( task started event ) event ) ; } else if ( event instanceof task updated event ) { process task updated event ( ( task updated event ) event ) ; } else throw new illegal argument exception ( " job builder process ( history event ) : unknown event type : " + event get event type ( ) + " for event : " + event ) ; }


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


requests that the controller daemon start an autodetect process

public void build ( ) throws i o exception , interrupted exception { list < string > command = build autodetect command ( ) ; build filters config ( command ) ; build scheduled events config ( command ) ; build job config ( command ) ; build quantiles ( command ) ; process pipes add args ( command ) ; controller start process ( command ) ; }


starts the process and waits for its completion

public int join ( ) throws i o exception , interrupted exception { / / the logging around proc holder for join prevents the preliminary object deallocation we saw in jenkins - 23271 final proc proc holder for join = start ( ) ; logger log ( level finer , " started the process { 0 } " , proc holder for join ) ; if ( proc holder for join instanceof proc with jenkins 2 3 2 7 1 patch ) { return proc holder for join join ( ) ; } else { / / fallback to the internal handling logic if ( ! ( proc holder for join instanceof local proc ) ) { / / we consider that the process may be at risk of jenkins - 23271 logger log ( level fine , " process { 0 } of type { 1 } is neither { 2 } nor instance of { 3 } " + " if this process operates with jenkins agents via remote invocation , you may get into jenkins - 23271 " , new object [ ] { proc holder for join , proc holder for join get class ( ) , local proc class , proc with jenkins 2 3 2 7 1 patch class } ) ; } try { final int return code = proc holder for join join ( ) ; if ( logger is loggable ( level finer ) ) { logger log ( level finer , " process { 0 } has finished with the return code { 1 } " , new object [ ] { proc holder for join , return code } ) ; } return return code ; } finally { if ( proc holder for join is alive ( ) ) { / / should never happen but this forces proc to not be removed and early gc by escape analysis logger log ( level warning , " process { 0 } has not finished after the join ( ) method completion " , proc holder for join ) ; } } } }


stop the heartbeat of a datanode in the mini d f s cluster

private data node stop data node heartbeat ( mini d f s cluster cluster , string host name ) { for ( data node dn : cluster get data nodes ( ) ) { if ( dn get datanode id ( ) get host name ( ) equals ( host name ) ) { data node test utils set heartbeats disabled for tests ( dn , true ) ; return dn ; } } return null ; }


close a stream : decide whether to abort or close , based on the length of the stream and the current position if a close ( ) is attempted and fails , the operation escalates to an abort this does not set the { @ link # closed } flag

private void close stream ( string reason , long length , boolean force abort ) { if ( ! is object stream open ( ) ) { / / steam is already closed return ; } / / if the amount of data remaining in the current request is greater / / than the readahead value : abort long remaining = remaining in current request ( ) ; log debug ( " closing stream { } : { } " , reason , force abort ? " abort " : " soft " ) ; boolean should abort = force abort | | remaining > readahead ; try { if ( ! should abort ) { try { / / clean close this will read to the end of the stream , / / so , while cleaner , can be pathological on a multi - gb object / / explicitly drain the stream long drained = 0 ; while ( wrapped stream read ( ) > = 0 ) { drained + + ; } log debug ( " drained stream of { } bytes " , drained ) ; / / now close it wrapped stream close ( ) ; / / this must come after the close , so that if the io operations fail / / and an abort is triggered , the initial attempt ' s statistics / / aren ' t collected stream statistics stream close ( false , drained ) ; } catch ( exception e ) { / / exception escalates to an abort log debug ( " when closing { } stream for { } , will abort the stream " , uri , reason , e ) ; should abort = true ; } } if ( should abort ) { / / abort , rather than just close , the underlying stream otherwise , the / / remaining object payload is read from s3 while closing the stream log debug ( " aborting stream { } " , uri ) ; try { wrapped stream abort ( ) ; } catch ( exception e ) { log warn ( " when aborting { } stream after failing to close it for { } " , uri , reason , e ) ; } stream statistics stream close ( true , remaining ) ; } log debug ( " stream { } { } : { } ; remaining = { } stream pos = { } , " + " next read pos = { } , " + " request range { } - { } length = { } " , uri , ( should abort ? " aborted " : " closed " ) , reason , remaining , pos , next read pos , content range start , content range finish , length ) ; } finally { wrapped stream = null ; object = null ; } }


determine the charset of the response ( for inclusion in a status exception )

protected charset get charset ( client http response response ) { http headers headers = response get headers ( ) ; media type content type = headers get content type ( ) ; return ( content type ! = null ? content type get charset ( ) : null ) ; }


returns a list of all data including { @ code default data }

public array list < fake data > get all data ( ) { array list < fake data > fake datas = new array list < > ( data map values ( ) ) ; if ( default data ! = null ) { fake datas add ( default data ) ; } return fake datas ; }


allowed derived classes to modify the behavior of operations which change the current stream position by adjusting the target token index of a seek operation the default implementation simply returns { @ code i } if an exception is thrown in this method , the current stream index should not be changed for example , { @ link common token stream } overrides this method to ensure that the seek target is always an on - channel token

protected int adjust seek index ( int i ) { return i ; }


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


shorthand for { @ link query builder # build count ( ) build count ( ) } { @ link count query # count ( ) count ( ) } ; see { @ link count query # count ( ) } for details to execute a query more than once , you should build the query and keep the { @ link count query } object for efficiency reasons

public long count ( ) { return build count ( ) count ( ) ; }


creates a { @ link checkpoint i d counter } instance for a job

checkpoint i d counter create checkpoint i d counter ( job i d job id ) throws exception ;


adds several root symlinks neither keys nor values may be null

public builder add root symlinks ( map < path fragment , artifact > symlinks ) { for ( map entry < path fragment , artifact > symlink : symlinks entry set ( ) ) { root symlinks builder add ( new symlink entry ( symlink get key ( ) , symlink get value ( ) ) ) ; } return this ; }


the raw text of the string < code > optional string value = 1 ; < code >

private void set value ( java lang string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; value = value ; }


block until await termination ( ) has been called on this class

public void wait until await termination ( long timeout , time unit time unit ) throws interrupted exception , timeout exception { await termination waiter await ( timeout , time unit ) ; }


function to run a log handler with directories failing the get file status call the function accepts the log handler , setup the mocks to fail with specific exceptions and ensures the deletion service has the correct calls

public static void run mocked failed dirs ( log handler log handler , application id app id , string user , deletion service mock del service , local dirs handler service dirs handler , configuration conf , abstract file system spylfs , file context lfs , file [ ] local log dirs ) throws exception { map < application access type , string > app acls = new hash map < application access type , string > ( ) ; if ( local log dirs length < 7 ) { throw new illegal argument exception ( " argument local log dirs must be at least of length 7 " ) ; } path [ ] local app log dir paths = new path [ local log dirs length ] ; for ( int i = 0 ; i < local app log dir paths length ; i + + ) { local app log dir paths [ i ] = new path ( local log dirs [ i ] get absolute path ( ) , app id to string ( ) ) ; } final list < string > local log dir paths = new array list < string > ( local log dirs length ) ; for ( int i = 0 ; i < local log dirs length ; i + + ) { local log dir paths add ( local log dirs [ i ] get absolute path ( ) ) ; } / / setup mocks fs permission default permission = fs permission get dir default ( ) apply u mask ( lfs get u mask ( ) ) ; final file status fs = new file status ( 0 , true , 1 , 0 , system current time millis ( ) , 0 , default permission , " " , " " , new path ( local log dirs [ 0 ] get absolute path ( ) ) ) ; do return ( fs ) when ( spylfs ) get file status ( is a ( path class ) ) ; do return ( local log dir paths ) when ( dirs handler ) get log dirs for cleanup ( ) ; log handler handle ( new log handler app started event ( app id , user , null , app acls ) ) ; / / test case where some dirs have the log dir to delete / / mock some dirs throwing various exceptions / / verify deletion happens only on the others mockito do throw ( new file not found exception ( ) ) when ( spylfs ) get file status ( eq ( local app log dir paths [ 0 ] ) ) ; do return ( fs ) when ( spylfs ) get file status ( eq ( local app log dir paths [ 1 ] ) ) ; mockito do throw ( new access control exception ( ) ) when ( spylfs ) get file status ( eq ( local app log dir paths [ 2 ] ) ) ; do return ( fs ) when ( spylfs ) get file status ( eq ( local app log dir paths [ 3 ] ) ) ; mockito do throw ( new i o exception ( ) ) when ( spylfs ) get file status ( eq ( local app log dir paths [ 4 ] ) ) ; mockito do throw ( new unsupported file system exception ( " test " ) ) when ( spylfs ) get file status ( eq ( local app log dir paths [ 5 ] ) ) ; do return ( fs ) when ( spylfs ) get file status ( eq ( local app log dir paths [ 6 ] ) ) ; log handler handle ( new log handler app finished event ( app id ) ) ; test deletion service call ( mock del service , user , 5000 , local app log dir paths [ 1 ] , local app log dir paths [ 3 ] , local app log dir paths [ 6 ] ) ; return ; }


evaluate the callother op which corresponds to this behavior

public void evaluate ( emulate emu , varnode out , varnode [ ] inputs ) ;


parse xml values and store them in a j s o n array

private static object parse ( x m l tokener x , boolean array form , j s o n array ja ) throws j s o n exception { string attribute ; char c ; string close tag = null ; int i ; j s o n array newja = null ; j s o n object newjo = null ; object token ; string tag name = null ; / / test for and skip past these forms : / / < ! - - - - > / / < ! [ ] ] > / / < ! > / / < ? ? > while ( true ) { token = x next content ( ) ; if ( token = = xml lt ) { token = x next token ( ) ; if ( token instanceof character ) { if ( token = = xml slash ) { / / close tag < / token = x next token ( ) ; if ( ! ( token instanceof string ) ) { throw new j s o n exception ( " expected a closing name instead of ' " + token + " ' " ) ; } if ( x next token ( ) ! = xml gt ) { throw x syntax error ( " misshaped close tag " ) ; } return token ; } else if ( token = = xml bang ) { / / < ! c = x next ( ) ; if ( c = = ' - ' ) { if ( x next ( ) = = ' - ' ) { x skip past ( " - - > " ) ; } x back ( ) ; } else if ( c = = ' [ ' ) { token = x next token ( ) ; if ( token equals ( " cdata " ) & & x next ( ) = = ' [ ' ) { if ( ja ! = null ) { ja put ( x next c d a t a ( ) ) ; } } else { throw x syntax error ( " expected ' cdata [ ' " ) ; } } else { i = 1 ; do { token = x next meta ( ) ; if ( token = = null ) { throw x syntax error ( " missing ' > ' after ' < ! ' " ) ; } else if ( token = = xml lt ) { i + = 1 ; } else if ( token = = xml gt ) { i - = 1 ; } } while ( i > 0 ) ; } } else if ( token = = xml quest ) { / / < ? x skip past ( " ? > " ) ; } else { throw x syntax error ( " misshaped tag " ) ; } / / open tag < } else { if ( ! ( token instanceof string ) ) { throw x syntax error ( " bad tag name ' " + token + " ' " ) ; } tag name = ( string ) token ; newja = new j s o n array ( ) ; newjo = new j s o n object ( ) ; if ( array form ) { newja put ( tag name ) ; if ( ja ! = null ) { ja put ( newja ) ; } } else { newjo put ( " tag name " , tag name ) ; if ( ja ! = null ) { ja put ( newjo ) ; } } token = null ; for ( ; ; ) { if ( token = = null ) { token = x next token ( ) ; } if ( token = = null ) { throw x syntax error ( " misshaped tag " ) ; } if ( ! ( token instanceof string ) ) { break ; } / / attribute = value attribute = ( string ) token ; if ( ! array form & & ( " tag name " equals ( attribute ) | | " child node " equals ( attribute ) ) ) { throw x syntax error ( " reserved attribute " ) ; } token = x next token ( ) ; if ( token = = xml eq ) { token = x next token ( ) ; if ( ! ( token instanceof string ) ) { throw x syntax error ( " missing value " ) ; } newjo accumulate ( attribute , j s o n object string to value ( ( string ) token ) ) ; token = null ; } else { newjo accumulate ( attribute , " " ) ; } } if ( array form & & newjo length ( ) > 0 ) { newja put ( newjo ) ; } / / empty tag < / > if ( token = = xml slash ) { if ( x next token ( ) ! = xml gt ) { throw x syntax error ( " misshaped tag " ) ; } if ( ja = = null ) { if ( array form ) { return newja ; } else { return newjo ; } } / / content , between < > and < / > } else { if ( token ! = xml gt ) { throw x syntax error ( " misshaped tag " ) ; } close tag = ( string ) parse ( x , array form , newja ) ; if ( close tag ! = null ) { if ( ! close tag equals ( tag name ) ) { throw x syntax error ( " mismatched ' " + tag name + " ' and ' " + close tag + " ' " ) ; } tag name = null ; if ( ! array form & & newja length ( ) > 0 ) { newjo put ( " child nodes " , newja ) ; } if ( ja = = null ) { if ( array form ) { return newja ; } else { return newjo ; } } } } } } else { if ( ja ! = null ) { ja put ( token instanceof string ? j s o n object string to value ( ( string ) token ) : token ) ; } } } }


get the hash code of an array of methods methods are sorted before hashcode is calculated so the returned value is irrelevant of the method order in the array

static int get fingerprint ( method [ ] methods ) { return get fingerprint ( get fingerprints ( methods ) ) ; }


check whether the given sql type is numeric

public static boolean is numeric ( int sql type ) { return ( types bit = = sql type | | types bigint = = sql type | | types decimal = = sql type | | types double = = sql type | | types float = = sql type | | types integer = = sql type | | types numeric = = sql type | | types real = = sql type | | types smallint = = sql type | | types tinyint = = sql type ) ; }


returns the prefix for a label to be created based on the address table element that points to it the prefix consists of " addr table " followed by the address that is indicated as an offset from the beginning of the table followed by " element " the element number can then be appended to this to create the label

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


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


performs a manual merge of external program conflicts

public void merge conflicts ( int chosen conflict option , task monitor monitor ) throws cancelled exception { monitor set message ( " resolving external program name conflicts " ) ; boolean ask user = ( chosen conflict option = = ask user ) ; int total conflicts = ext pgms size ( ) ; monitor initialize ( total conflicts ) ; for ( int conflict index = 0 ; conflict index < total conflicts ; conflict index + + ) { i d group id group = ext pgms get ( conflict index ) ; if ( ( external program choice = = ask user ) & & ask user & & merge manager ! = null ) { monitor check canceled ( ) ; show merge panel ( id group , monitor ) ; } else { int option to use = ( external program choice = = ask user ) ? chosen conflict option : external program choice ; merge ( id group , option to use , monitor ) ; } monitor set progress ( conflict index + 1 ) ; } }


returns ' true ' if the list contains the specified word

public boolean contains ( string word ) { return list contains key ( word ) ; }


returns all built - in float data - types

public static abstract float data type [ ] get float data types ( data type manager dtm ) { tree map < integer , abstract float data type > float map = get float types ( ) ; tree map < integer , abstract float data type > new float map = float map ; if ( dtm ! = null ) { data organization data organization = dtm get data organization ( ) ; if ( data organization ! = null ) { new float map = new tree map < integer , abstract float data type > ( ) ; new float map put ( data organization get float size ( ) , ( abstract float data type ) float data type data type clone ( dtm ) ) ; if ( ! new float map contains key ( data organization get double size ( ) ) ) { new float map put ( data organization get double size ( ) , ( abstract float data type ) double data type data type clone ( dtm ) ) ; } if ( ! new float map contains key ( data organization get long double size ( ) ) ) { new float map put ( data organization get long double size ( ) , ( abstract float data type ) long double data type data type clone ( dtm ) ) ; } for ( int size : float map key set ( ) ) { if ( ! new float map contains key ( size ) ) { new float map put ( size , ( abstract float data type ) float map get ( size ) clone ( dtm ) ) ; } } } } abstract float data type [ ] float type array = new abstract float data type [ new float map size ( ) ] ; new float map values ( ) to array ( float type array ) ; return float type array ; }


handles the erasure coding reconstruction work commands

public void process erasure coding tasks ( collection < block e c reconstruction info > ec tasks ) { for ( block e c reconstruction info recon info : ec tasks ) { int xmits submitted = 0 ; try { striped reconstruction info striped recon info = new striped reconstruction info ( recon info get extended block ( ) , recon info get erasure coding policy ( ) , recon info get live block indices ( ) , recon info get source dn infos ( ) , recon info get target dn infos ( ) , recon info get target storage types ( ) , recon info get target storage i ds ( ) ) ; / / it may throw illegal argument exception from task # striped reader / / constructor final striped block reconstructor task = new striped block reconstructor ( this , striped recon info ) ; if ( task has valid targets ( ) ) { / / see hdfs - 12044 we increase xmits in progress even the task is only / / enqueued , so that / / 1 ) nn will not send more tasks than what dn can execute and / / 2 ) dn will not throw away reconstruction tasks , and instead keeps / / an unbounded number of tasks in the executor ' s task queue xmits submitted = math max ( ( int ) ( task get xmits ( ) * xmit weight ) , 1 ) ; get datanode ( ) increment xmits in process ( xmits submitted ) ; striped reconstruction pool submit ( task ) ; } else { log warn ( " no missing internal block skip reconstruction for task : { } " , recon info ) ; } } catch ( throwable e ) { get datanode ( ) decrement xmits in progress ( xmits submitted ) ; log warn ( " failed to reconstruct striped block { } " , recon info get extended block ( ) get local block ( ) , e ) ; } } }


returns the set of execution options specified for this request

public execution options get execution options ( ) { return get options ( execution options class ) ; }


get the name of the attribute this service prefers to consume as username

registered service username attribute provider get username attribute provider ( ) ;


applies the given { @ link transformation } for { @ link bitmap bitmaps } to the default types ( { @ link bitmap } , { @ link android graphics drawable bitmap drawable } , and { @ link com bumptech glide load resource gif gif drawable } ) and ignores unknown types this will override previous calls to { @ link # dont transform ( ) }

public t optional transform ( @ non null transformation < bitmap > transformation ) { return transform ( transformation , / * is required = * / false ) ; }


set the { @ link key field based comparator } options used to compare keys

public static void set key field comparator options ( job job , string key spec ) { job get configuration ( ) set ( comparator options , key spec ) ; }


read entire reader content and writes it to writer then closes reader and flushed output

public static void copy text ( java io reader reader , java io writer writer , int buffer size ) throws i o exception { char [ ] write buffer = new char [ buffer size ] ; for ( int br = reader read ( write buffer ) ; br ! = - 1 ; br = reader read ( write buffer ) ) { writer write ( write buffer , 0 , br ) ; } writer flush ( ) ; }


draws a cone using { @ link shape type # line } or { @ link shape type # filled }

public void cone ( float x , float y , float z , float radius , float height , int segments ) { if ( segments < = 0 ) throw new illegal argument exception ( " segments must be > 0 " ) ; check ( shape type line , shape type filled , segments * 4 + 2 ) ; float color bits = color to float bits ( ) ; float angle = 2 * math utils pi / segments ; float cos = math utils cos ( angle ) ; float sin = math utils sin ( angle ) ; float cx = radius , cy = 0 ; if ( shape type = = shape type line ) { for ( int i = 0 ; i < segments ; i + + ) { renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; renderer color ( color bits ) ; renderer vertex ( x , y , z + height ) ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; float temp = cx ; cx = cos * cx - sin * cy ; cy = sin * temp + cos * cy ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; } / / ensure the last segment is identical to the first renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; } else { segments - - ; for ( int i = 0 ; i < segments ; i + + ) { renderer color ( color bits ) ; renderer vertex ( x , y , z ) ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; float temp = cx ; float temp 2 = cy ; cx = cos * cx - sin * cy ; cy = sin * temp + cos * cy ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; renderer color ( color bits ) ; renderer vertex ( x + temp , y + temp 2 , z ) ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; renderer color ( color bits ) ; renderer vertex ( x , y , z + height ) ; } / / ensure the last segment is identical to the first renderer color ( color bits ) ; renderer vertex ( x , y , z ) ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; } float temp = cx ; float temp 2 = cy ; cx = radius ; cy = 0 ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; if ( shape type ! = shape type line ) { renderer color ( color bits ) ; renderer vertex ( x + temp , y + temp 2 , z ) ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , z ) ; renderer color ( color bits ) ; renderer vertex ( x , y , z + height ) ; } }


returns the position of the first ts sync byte within the range [ start position , limit position ) from the provided data array , or returns limit position if sync byte could not be found

public static int find sync byte position ( byte [ ] data , int start position , int limit position ) { int position = start position ; while ( position < limit position & & data [ position ] ! = ts extractor ts sync byte ) { position + + ; } return position ; }


sets the message type for the option dialog which will determine the icon that is in the dialog

public option dialog builder set message type ( int message type ) { this message type = message type ; return this ; }


clean the unused connections for this pool

void cleanup ( connection pool pool ) { if ( pool get num connections ( ) > pool get min size ( ) ) { / / check if the pool hasn ' t been active in a while or not 50 % are used long time since last active = time now ( ) - pool get last active time ( ) ; int total = pool get num connections ( ) ; int active = pool get num active connections ( ) ; float pool min active ratio = pool get min active ratio ( ) ; if ( time since last active > connection cleanup period ms | | active < pool min active ratio * total ) { / / remove and close 1 connection list < connection context > conns = pool remove connections ( 1 ) ; for ( connection context conn : conns ) { conn close ( ) ; } log debug ( " removed connection { } used { } seconds ago " + " pool has { } / { } connections " , pool get connection pool id ( ) , time unit milliseconds to seconds ( time since last active ) , pool get num connections ( ) , pool get max size ( ) ) ; } } }


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


the label of this command line event is always " tool , " so that the build starting event correctly tracks its children the provided command line may have its own label that will be more descriptive

public build event id get event id ( ) { return build event id util structured commandline id ( label ) ; }


closes this reader and frees any allocated resources


public final state get task state ( final task id localtask id ) { if ( localtask id equals ( this task id ) ) { return get run state ( ) ; } else { return null ; } }


configure the intercepting point on constructor

public constructor point builder on constructor ( final element matcher < ? super method description > matcher ) { return new constructor point builder ( this , matcher ) ; }


total number of open connection pools to a nn each connection pool represents one user + one nn

public int get num connection pools ( ) { return this connection manager get num connection pools ( ) ; }


builds a comma - separated list of class names

public static < t extends class < ? > > string build class list string ( list < t > classes ) { string builder sb = new string builder ( ) ; for ( int i = 0 ; i < classes size ( ) ; + + i ) { if ( i > 0 ) { sb append ( ' , ' ) ; } sb append ( classes get ( i ) get name ( ) ) ; } return sb to string ( ) ; }


< code > optional aapt pb primitive prim = 7 ; < code >

private void set prim ( com android aapt resources primitive builder builder for value ) { prim = builder for value build ( ) ; bit field 0 | = 0x 0 0 0 0 0 0 4 0 ; }


public static < l , r > either < l , r > left ( l value ) { return new left < l , r > ( value ) ; }


register a callback to execute on destruction of the specified attribute the callback is executed when the session is closed

public void register destruction callback ( string name , runnable callback ) { synchronized ( get session mutex ( ) ) { if ( is session completed ( ) ) { throw new illegal state exception ( " session id = " + get session id ( ) + " already completed " ) ; } this attributes put ( destruction callback name prefix + name , callback ) ; } }


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


add the given header value ( s ) under the given name

builder header ( string header name , string header values ) ;


public static void put ( long flow id , integer now calls ) { now calls map put ( flow id , new atomic integer ( now calls ) ) ; }


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


returns a generic iso date parser for parsing local dates the returned formatter can only be used for parsing , printing is unsupported this parser is initialised with the local ( utc ) time zone it accepts formats described by the following syntax : date - element = std - date - element | ord - date - element | week - date - element std - date - element = yyyy [ ' - ' mm [ ' - ' dd ] ] ord - date - element = yyyy [ ' - ' ddd ] week - date - element = xxxx ' - w ' ww [ ' - ' e ]

public static date time formatter local date parser ( ) { return constants ldp ; }


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

default response entity < set < pet > > find pets by tags ( @ not null @ api param ( value = " tags to filter by " , required = true ) @ valid @ request param ( value = " tags " , required = true ) set < string > tags ) { get request ( ) if present ( request - > { 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 = " { \ " photo urls \ " : [ \ " photo urls \ " , \ " photo urls \ " ] , \ " name \ " : \ " doggie \ " , \ " id \ " : 0 , \ " category \ " : { \ " name \ " : \ " default - name \ " , \ " id \ " : 6 } , \ " tags \ " : [ { \ " name \ " : \ " name \ " , \ " id \ " : 1 } , { \ " name \ " : \ " name \ " , \ " id \ " : 1 } ] , \ " status \ " : \ " available \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < pet > < id > 123456789 < / id > < name > doggie < / name > < photo urls > < photo urls > aeiou < / photo urls > < / photo urls > < tags > < / tags > < status > aeiou < / status > < / pet > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


public string get application data ( ) { return application data ; }


public void reset ( ) { byte offset = 0 ; bit offset = 0 ; }


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

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


sets the default alignment to be used for any data type that isn ' t a structure , union , array , pointer , type definition , and whose size isn ' t in the sizealignment map

public void set default alignment ( int default alignment ) { this default alignment = default alignment ; }


returns a new { @ link media item } instance with the current builder values

public media item build ( ) { assertions check state ( drm license uri = = null | | drm uuid ! = null ) ; @ nullable playback properties playback properties = null ; if ( uri ! = null ) { playback properties = new playback properties ( uri , mime type , drm uuid ! = null ? new drm configuration ( drm uuid , drm license uri , drm license request headers , drm multi session , drm force default license uri , drm play clear content without key , drm session for clear types , drm key set id ) : null , stream keys , custom cache key , subtitles , ad tag uri , tag ) ; media id = media id ! = null ? media id : uri to string ( ) ; } return new media item ( assertions check not null ( media id ) , new clipping properties ( clip start position ms , clip end position ms , clip relative to live window , clip relative to default position , clip starts at key frame ) , playback properties , media metadata ! = null ? media metadata : new media metadata builder ( ) build ( ) ) ; }


null safe assert throws and assert does not throw

public static < t extends throwable > t assert throws or not ( final t expected , final executable executable , final supplier < string > message supplier ) { if ( expected = = null ) { assert does not throw ( executable , message supplier ) ; return null ; } return ( t ) assert throws ( expected get class ( ) , executable , message supplier ) ; }


the reader returns the block type ( long array block or int array block ) based on the physical type of the column in parquet file , but operators after scan expect output block type based on the metadata defined in hive table this causes issues as the operators call methods that are based on the expected output block type which the returned block type may not have implemented to overcome this issue rewrite the block

private static column chunk type coercion ( column chunk column chunk , primitive type name physical data type , type output type ) { block new block = null ; if ( smallint equals ( output type ) | | tinyint equals ( output type ) ) { if ( column chunk get block ( ) instanceof int array block ) { new block = rewrite integer array block ( ( int array block ) column chunk get block ( ) , output type ) ; } else if ( column chunk get block ( ) instanceof long array block ) { new block = rewrite long array block ( ( long array block ) column chunk get block ( ) , output type ) ; } } else if ( integer equals ( output type ) & & physical data type = = primitive type name int64 ) { if ( column chunk get block ( ) instanceof long array block ) { new block = rewrite long array block ( ( long array block ) column chunk get block ( ) , output type ) ; } } else if ( bigint equals ( output type ) & & physical data type = = primitive type name int32 ) { if ( column chunk get block ( ) instanceof int array block ) { new block = rewrite integer array block ( ( int array block ) column chunk get block ( ) , output type ) ; } } if ( new block ! = null ) { return new column chunk ( new block , column chunk get definition levels ( ) , column chunk get repetition levels ( ) ) ; } return column chunk ; }


add multiple records from the given split id

public void add all ( string split id , collection < e > records ) { this records by splits compute ( split id , ( id , r ) - > { if ( r = = null ) { r = records ; } else { r add all ( records ) ; } return r ; } ) ; }


return the temporary directory for the current web application , as provided by the servlet container

public static file get temp dir ( servlet context servlet context ) { assert not null ( servlet context , " servlet context must not be null " ) ; return ( file ) servlet context get attribute ( temp dir context attribute ) ; }