retrieve the given column as binary stream from the given result set might simply invoke { @ code result set get ascii stream } or work with { @ code sqlxml } or database - specific classes depending on the database and driver

input stream get xml as binary stream ( result set rs , int column index ) throws s q l exception ;


sets the persistent settings to be updated they will get applied cross restarts

public cluster update settings request builder set persistent settings ( settings settings ) { request persistent settings ( settings ) ; return this ; }


cancels the slot request with the given { @ link slot request id } if the request is already fulfilled with a physical slot , the slot will be released

void cancel slot request ( slot request id slot request id , throwable cause ) ;


patches the instrumentation context class loader by appending extra dex files loaded from the instrumentation apk and the application apk this method should be called in the on create of your { @ link instrumentation } , see { @ link com android test runner multi dex test runner } for an example

public static void install instrumentation ( context instrumentation context , context target context ) { log i ( tag , " installing instrumentation " ) ; if ( is vm multidex capable ) { log i ( tag , " vm has multidex support , multi dex support library is disabled " ) ; return ; } if ( build version sdk int < min sdk version ) { throw new runtime exception ( " multi dex installation failed sdk " + build version sdk int + " is unsupported min sdk version is " + min sdk version + " " ) ; } try { application info instrumentation info = get application info ( instrumentation context ) ; if ( instrumentation info = = null ) { log i ( tag , " no application info available for instrumentation , i e running on a " + " test context : multi dex support library is disabled " ) ; return ; } application info application info = get application info ( target context ) ; if ( application info = = null ) { log i ( tag , " no application info available , i e running on a test context : " + " multi dex support library is disabled " ) ; return ; } string instrumentation prefix = instrumentation context get package name ( ) + " " ; file data dir = new file ( application info data dir ) ; do installation ( target context , new file ( instrumentation info source dir ) , data dir , instrumentation prefix + code cache secondary folder name , instrumentation prefix ) ; do installation ( target context , new file ( application info source dir ) , data dir , code cache secondary folder name , no key prefix ) ; } catch ( exception e ) { log e ( tag , " multi dex installation failure " , e ) ; throw new runtime exception ( " multi dex installation failed ( " + e get message ( ) + " ) " ) ; } log i ( tag , " installation done " ) ; }


gets the tls context manager impl singleton

public static synchronized tls context manager impl get instance ( ) { if ( instance = = null ) { instance = new tls context manager impl ( bootstrapper get instance ( ) ) ; } return instance ; }


returns the aggregated user - defined accumulators as strings

stringified accumulator result [ ] get aggregated user accumulators stringified ( ) ;


create the attributes of an object for subsequent use

private s 3 object attributes create object attributes ( final s 3 a file status file status ) { return create object attributes ( file status get path ( ) , file status get e tag ( ) , file status get version id ( ) , file status get len ( ) ) ; }


public void update pet test ( ) { pet body = null ; / / api update pet ( body ) ; / / todo : test validations }


borrows an object from the { @ code object pool }

public object get target ( ) throws exception { assert state ( this pool ! = null , " no commons object pool available " ) ; return this pool borrow object ( ) ; }


get the set of addresses associated with either the source or destination of a version tracking match

public static address set view get match addresses ( v t match vt match , boolean for source ) { v t match set match set = vt match get match set ( ) ; v t session session = match set get session ( ) ; program program = for source ? session get source program ( ) : session get destination program ( ) ; address factory factory = program get address factory ( ) ; address address ; if ( for source ) { address = vt match get association ( ) get source address ( ) ; } else { address = vt match get association ( ) get destination address ( ) ; } v t association association = vt match get association ( ) ; v t association type association type = association get type ( ) ; address set view match addresses = null ; if ( association type = = v t association type function ) { function function = program get function manager ( ) get function at ( address ) ; if ( function ! = null ) { match addresses = function get body ( ) ; } } else if ( association type = = v t association type data ) { listing listing = program get listing ( ) ; data data = listing get data at ( address ) ; if ( data ! = null ) { match addresses = new address set ( data get min address ( ) , data get max address ( ) ) ; } } if ( match addresses = = null ) { match addresses = new address set ( address , address ) ; } return match addresses ; }


release the given connection , stopping it ( if necessary ) and eventually closing it checks { @ link smart connection factory # should stop } , if available this is essentially a more sophisticated version of { @ link org springframework jms support jms utils # close connection }

public static void release connection ( @ nullable connection con , @ nullable connection factory cf , boolean started ) { if ( con = = null ) { return ; } if ( started & & cf instanceof smart connection factory & & ( ( smart connection factory ) cf ) should stop ( con ) ) { try { con stop ( ) ; } catch ( throwable ex ) { logger debug ( " could not stop jms connection before closing it " , ex ) ; } } try { con close ( ) ; } catch ( throwable ex ) { logger debug ( " could not close jms connection " , ex ) ; } }


get the motor speed , usually in radians per second

public float get motor speed ( ) { return joint get motor speed ( ) ; }


variant of { @ link # metadata to extract ( mime type , class , string ) } that accepts { @ link parameterized type reference } instead of { @ link class } for specifying a target type with generic parameters

default void metadata to extract ( mime type mime type , parameterized type reference < ? > target type , @ nullable string name ) { string key = name ! = null ? name : mime type to string ( ) ; metadata to extract ( mime type , target type , ( value , map ) - > map put ( key , value ) ) ; }


public void next critical path phase ( spawn executed event change phase phase ) { critical path component stats = output artifact to component get ( phase get action ( ) get primary output ( ) ) ; if ( stats ! = null ) { stats change phase ( ) ; } }


return register aliases note : this is generally only supported for context register fields

public iterable < string > get aliases ( ) { if ( aliases = = null ) { return empty collection ; } return aliases ; }


selects the items in the range specified by the given zero - relative indices in the receiver the range of indices is inclusive the current selection is cleared before the new items are selected < p > indices that are out of range are ignored and no items will be selected if start is greater than end if the receiver is single - select and there is more than one item in the given range , then all indices are ignored < p > if cell selection is enabled , all cells within the given range are selected

public void set selection ( int start , int end ) { check widget ( ) ; if ( selection type = = swt single & & start ! = end ) return ; selected cells clear ( ) ; for ( int i = start ; i < = end ; i + + ) { if ( i < 0 ) { continue ; } if ( i > get item count ( ) - 1 ) { break ; } select cells ( get cells ( i ) ) ; } redraw ( ) ; }


returns a sequence of events where some items are more popular than others , according to a zipfian distribution unlike { @ link # zipfian } , the generated sequence scatters the " popular " items across the item space use if you don ' t want the head of the distribution ( the popular items ) clustered together

public static long stream scrambled zipfian ( int items , double constant , int events ) { return generate ( new scrambled zipfian generator ( 0 , items - 1 , constant ) , events ) ; }


the root directory of the java installation

public string java home ( ) { return java home to string ( ) ; }


public void clear ( ) { for ( int i = 0 ; i < capacity ; i + + ) { links [ i ] = ( short ) ( i + 1 ) ; } links [ capacity - 1 ] = end of list ; free ptr = 0 ; arrays fill ( heads , end of list ) ; size = 0 ; }


the field with which to construct the geo tile grouping

public builder set field ( string field ) { this field = field ; return this ; }


protected static boolean is logout request ( final http servlet request request ) { return request get parameter ( pac 4j constants logout endpoint parameter ) ! = null ; }


for compatibility reason , this method may not return a { @ link list view column descriptor } and instead return a plain { @ link descriptor } instance

public descriptor < list view column > get descriptor ( ) { return jenkins get ( ) get descriptor or die ( get class ( ) ) ; }


deleting directory with snapshottable descendant with snapshots must fail

public void test delete directory with snapshot 2 ( ) throws exception { path file 0 = new path ( sub , " file 0 " ) ; path file 1 = new path ( sub , " file 1 " ) ; d f s test util create file ( hdfs , file 0 , blocksize , replication , seed ) ; d f s test util create file ( hdfs , file 1 , blocksize , replication , seed ) ; path subfile 1 = new path ( subsub , " file 0 " ) ; path subfile 2 = new path ( subsub , " file 1 " ) ; d f s test util create file ( hdfs , subfile 1 , blocksize , replication , seed ) ; d f s test util create file ( hdfs , subfile 2 , blocksize , replication , seed ) ; / / allow snapshot for subsub 1 , and create snapshot for it hdfs allow snapshot ( subsub ) ; hdfs create snapshot ( subsub , " s 1 " ) ; / / deleting dir while its descedant subsub 1 having snapshots should fail exception expect ( remote exception class ) ; string error = subsub to string ( ) + " is snapshottable and already has snapshots " ; exception expect message ( error ) ; hdfs delete ( dir , true ) ; }


creates a new dynamic spawn strategy with different strategies for local , remote , and sandboxed execution todo ( jmmv ) : this overload should not be necessary now that we do not special - case the handling of sandboxed strategies any longer remove once the sandbox - specific flags are gone

private strategy and context create spawn strategy with executor ( mock spawn strategy local strategy , mock spawn strategy remote strategy , @ nullable mock spawn strategy sandboxed strategy , executor service executor service ) throws abrupt exit exception { immutable list builder < map entry < string , list < string > > > dynamic local strategies = immutable list < map entry < string , list < string > > > builder ( ) add ( maps immutable entry ( " " , immutable list of ( " mock - local " ) ) ) ; immutable list builder < map entry < string , list < string > > > dynamic remote strategies = immutable list < map entry < string , list < string > > > builder ( ) add ( maps immutable entry ( " " , immutable list of ( " mock - remote " ) ) ) ; if ( sandboxed strategy ! = null ) { dynamic local strategies add ( maps immutable entry ( " test mnemonic " , immutable list of ( " mock - sandboxed " ) ) ) ; dynamic remote strategies add ( maps immutable entry ( " test mnemonic " , immutable list of ( " mock - sandboxed " ) ) ) ; } dynamic execution options options = new dynamic execution options ( ) ; options dynamic local strategy = dynamic local strategies build ( ) ; options dynamic remote strategy = dynamic remote strategies build ( ) ; options dynamic worker strategy = " mock - local " ; options internal spawn scheduler = true ; options local execution delay = 0 ; check state ( executor service for cleanup = = null ) ; executor service for cleanup = executor service ; module action context registry builder module action context registry builder = module action context registry builder ( ) ; spawn strategy registry builder spawn strategy registry builder = spawn strategy registry builder ( ) ; spawn strategy registry builder register strategy ( local strategy , " mock - local " ) ; spawn strategy registry builder register strategy ( remote strategy , " mock - remote " ) ; if ( sandboxed strategy ! = null ) { spawn strategy registry builder register strategy ( sandboxed strategy , " mock - sandboxed " ) ; } dynamic execution module dynamic execution module = new dynamic execution module ( executor service ) ; dynamic execution module register spawn strategies ( spawn strategy registry builder , options ) ; spawn strategy registry spawn strategy registry = spawn strategy registry builder build ( ) ; module action context registry builder register ( spawn strategy registry class , spawn strategy registry ) ; module action context registry builder register ( dynamic strategy registry class , spawn strategy registry ) ; module action context registry module action context registry = module action context registry builder build ( ) ; executor executor = new blaze executor ( / * file system = * / null , test root , / * reporter = * / null , / * clock = * / null , bug reporter default instance ( ) , options parser builder ( ) options classes ( immutable list of ( execution options class ) ) build ( ) , module action context registry , spawn strategy registry ) ; action execution context action execution context = actions test util create context ( / * executor = * / executor , / * event handler = * / null , action key context , out err , test root , / * metadata handler = * / null , / * action graph = * / null ) ; list < ? extends spawn strategy > dynamic strategies = spawn strategy registry get strategies ( new custom spawn ( " run dynamic " , immutable map of ( ) ) , event - > { } ) ; optional < ? extends spawn strategy > optional context = dynamic strategies stream ( ) filter ( c - > c instanceof dynamic spawn strategy ) find any ( ) ; check state ( optional context is present ( ) , " expected module to register a dynamic strategy " ) ; return new auto value dynamic spawn strategy test strategy and context ( optional context get ( ) , action execution context ) ; }


visits any type of class member of the given class

public void visit any class ( clazz clazz ) { throw new unsupported operation exception ( " method must be overridden in [ " + this get class ( ) get name ( ) + " ] if ever called " ) ; }


this method iterates over the input data and reports the key - group for each element

protected void report all element key groups ( ) { preconditions check state ( partitioning source length > = number of elements ) ; for ( int i = 0 ; i < number of elements ; + + i ) { int key group = key group range assignment assign to key group ( key extractor function extract key from element ( partitioning source [ i ] ) , total key groups ) ; report key group of element at index ( i , key group ) ; } }


public response entity < byte [ ] > export config ( @ request param ( value = " data id " , required = false ) string data id , @ request param ( value = " group " , required = false ) string group , @ request param ( value = " app name " , required = false ) string app name , @ request param ( value = " tenant " , required = false , default value = string utils empty ) string tenant , @ request param ( value = " ids " , required = false ) list < long > ids ) { ids remove all ( collections singleton ( null ) ) ; tenant = namespace util process namespace parameter ( tenant ) ; list < config all info > data list = persist service find all config info 4 export ( data id , group , tenant , app name , ids ) ; list < zip utils zip item > zip item list = new array list < > ( ) ; string builder meta data = null ; for ( config info ci : data list ) { if ( string utils is not blank ( ci get app name ( ) ) ) { / / handle app name if ( meta data = = null ) { meta data = new string builder ( ) ; } string meta data id = ci get data id ( ) ; if ( meta data id contains ( " " ) ) { meta data id = meta data id substring ( 0 , meta data id last index of ( " " ) ) + " ~ " + meta data id substring ( meta data id last index of ( " " ) + 1 ) ; } meta data append ( ci get group ( ) ) append ( " " ) append ( meta data id ) append ( " app = " ) / / fixed use of " \ r \ n " here append ( ci get app name ( ) ) append ( " \ r \ n " ) ; } string item name = ci get group ( ) + " / " + ci get data id ( ) ; zip item list add ( new zip utils zip item ( item name , ci get content ( ) ) ) ; } if ( meta data ! = null ) { zip item list add ( new zip utils zip item ( " meta yml " , meta data to string ( ) ) ) ; } http headers headers = new http headers ( ) ; string file name = export config file name + date format utils format ( new date ( ) , export config file name date format ) + export config file name ext ; headers add ( " content - disposition " , " attachment ; filename = " + file name ) ; return new response entity < byte [ ] > ( zip utils zip ( zip item list ) , headers , http status ok ) ; }


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


resets the contents of sorted multiset to have entries a , c , for the navigation tests

private void reset with hole ( ) { list < e > container = new array list < e > ( ) ; container add all ( collections n copies ( a get count ( ) , a get element ( ) ) ) ; container add all ( collections n copies ( c get count ( ) , c get element ( ) ) ) ; super reset container ( get subject generator ( ) create ( container to array ( ) ) ) ; sorted multiset = ( sorted multiset < e > ) get multiset ( ) ; }


get the name of the section to which a new changeset generation is attributed to

public string get attribution ( ) { return m attribution ; }


public int get type ( ) { return type ; }


gets request security token response from result

public requested security token get request security token from result ( final string wresult ) { logger debug ( " result token received from adfs is [ { } ] " , wresult ) ; try ( input stream in = new byte array input stream ( wresult get bytes ( standard charsets utf 8 ) ) ) { logger debug ( " parsing token into a document " ) ; val document = config bean get parser pool ( ) parse ( in ) ; val metadata root = document get document element ( ) ; val unmarshaller factory = config bean get unmarshaller factory ( ) ; val unmarshaller = unmarshaller factory get unmarshaller ( metadata root ) ; if ( unmarshaller = = null ) { throw new illegal argument exception ( " unmarshaller for the metadata root element cannot be determined " ) ; } logger debug ( " unmarshalling the document into a security token response " ) ; val rs token = ( request security token response ) unmarshaller unmarshall ( metadata root ) ; if ( rs token get requested security token ( ) = = null ) { throw new illegal argument exception ( " request security token response is null " ) ; } logger debug ( " locating list of requested security tokens " ) ; val rst = rs token get requested security token ( ) ; if ( rst is empty ( ) ) { throw new illegal argument exception ( " no requested security token response is provided in the response " ) ; } logger debug ( " locating the first occurrence of a requested security token in the list " ) ; val req token = rst get ( 0 ) ; if ( req token get security tokens ( ) = = null | | req token get security tokens ( ) is empty ( ) ) { throw new illegal argument exception ( " requested security token response is not carrying any security tokens " ) ; } return req token ; } catch ( final exception ex ) { logging utils error ( logger , ex ) ; } return null ; }


test case for https : issues apache orgjirabrowse z o o k e e p e r - 2301

public void test quorum peer listend on specified client i p ( ) throws i o exception { long my id = 1 ; file data dir = client base create tmp dir ( ) ; int client port = port assignment unique ( ) ; map < long , quorum server > peers view = new hash map < long , quorum server > ( ) ; inet address client i p = inet address get loopback address ( ) ; peers view put ( long value of ( my id ) , new quorum server ( my id , new inet socket address ( client i p , port assignment unique ( ) ) , new inet socket address ( client i p , port assignment unique ( ) ) , new inet socket address ( client i p , client port ) , learner type participant ) ) ; / * * * quorum peer constructor without quorum verifier * / quorum peer peer 1 = new quorum peer ( peers view , data dir , data dir , client port , election alg , my id , tick time , init limit , sync limit , connect to learner master limit ) ; string host string 1 = peer 1 cnxn factory get local address ( ) get host string ( ) ; assert equals ( client i p get host address ( ) , host string 1 ) ; / / cleanup peer 1 shutdown ( ) ;


public void bool item test ( ) { / / todo : test bool item }


build an error message for an sql script execution failure , based on the supplied arguments

public static string build error message ( string stmt , int stmt number , encoded resource encoded resource ) { return string format ( " failed to execute sql script statement # % s of % s : % s " , stmt number , encoded resource , stmt ) ; }


skips the current ad this method is intended for apps that play audio - only ads and so need to provide their own ui for users to skip skippable ads apps showing video ads should not call this method , as the ima sdk provides the ui to skip ads in the ad view group passed via { @ link ad view provider }

public void skip ad ( ) { if ( ads manager ! = null ) { ads manager skip ( ) ; } }


variant of { @ link # to mono ( class ) } for type information with generics

public static < t > body extractor < mono < t > , reactive http input message > to mono ( parameterized type reference < t > element type ref ) { return to mono ( resolvable type for type ( element type ref get type ( ) ) ) ; }


public void combine ( aggregator < t , numeric column summary < t > > other same type ) { numeric summary aggregator < t > other = ( numeric summary aggregator < t > ) other same type ; null count + = other null count ; nan count + = other nan count ; infinity count + = other infinity count ; if ( non missing count = = 0 ) { non missing count = other non missing count ; min = other min ; max = other max ; sum = other sum ; mean = other mean ; m 2 = other m 2 ; } else if ( other non missing count ! = 0 ) { long combined count = non missing count + other non missing count ; min combine ( other min ) ; max combine ( other max ) ; sum combine ( other sum ) ; double delta mean = other mean value ( ) - mean value ( ) ; mean = mean add ( delta mean * other non missing count / combined count ) ; m 2 = m 2 add ( other m 2 ) add ( delta mean * delta mean * non missing count * other non missing count / combined count ) ; non missing count = combined count ; } }


public static byte [ ] drawable 2 bytes ( final drawable drawable ) { return utils bridge drawable 2 bytes ( drawable ) ; }


public builder color res ( yoga edge edge , @ color res int color res ) { check not built ( ) ; return color ( edge , m resource resolver resolve color res ( color res ) ) ; }


set the additional ( undeclared ) property with the specified name and value if the property does not already exist , create it otherwise replace it

public additional properties boolean put additional property ( string key , boolean value ) { if ( this additional properties = = null ) { this additional properties = new hash map < string , boolean > ( ) ; } this additional properties put ( key , value ) ; return this ; }


public void add ( byte block range range ) { list add ( range ) ; }


return the embedded constant of the given opcode , or 0 if the opcode doesn ' t have one

private static int embedded constant ( byte opcode ) { switch ( opcode ) { case instruction constants op iconst m1 : return - 1 ; case instruction constants op iconst 1 : case instruction constants op lconst 1 : case instruction constants op fconst 1 : case instruction constants op dconst 1 : return 1 ; case instruction constants op iconst 2 : case instruction constants op fconst 2 : return 2 ; case instruction constants op iconst 3 : return 3 ; case instruction constants op iconst 4 : return 4 ; case instruction constants op iconst 5 : return 5 ; default : return 0 ; } }


returns an immutable multiset containing the given elements , in order

public static < e > immutable multiset < e > of ( e e 1 , e e 2 ) { return copy from elements ( e 1 , e 2 ) ; }


returns true if the owner of the field or method designated by this handle is an interface

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


this will be called once the visibility changed

void on visibility state changed ( t model , v view , @ visibility int visibility state ) ;


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


create user this can only be done by the logged in user

public void create user test ( ) { user user = null ; api create user ( user ) block ( ) ; / / todo : test validations }


public list < object > get array items nullable ( ) { return array items nullable ; }


explicitly adds a new class constant for the given class in the given program class

private int add new class constant ( program class program class , string class name , clazz referenced class ) { constant pool editor constant pool editor = new constant pool editor ( program class ) ; int name index = constant pool editor add utf 8 constant ( class name ) ; int class constant index = constant pool editor add constant ( new class constant ( name index , referenced class ) ) ; return class constant index ; }


private void restore views ( string [ ] view names , boolean update view position ) { / / clear existing views for ( string view name : view map key set ( ) ) { remove view ( view name , false ) ; } for ( string view name : view names ) { data format model data format model = get data format model ( view name ) ; if ( data format model ! = null ) { add view ( data format model , false , update view position ) ; } } if ( view map is empty ( ) ) { add view ( default view ) ; } }


get the checksum over the hash ( ) of elements

public long get checksum ( ) { return checksum ; }


returns the value at the 9 8th percentile in the distribution

public double get 9 8th percentile ( ) { return get value ( 0 98 ) ; }


set a custom { @ link content negotiation strategy } to use to determine the content type to use when no content type is requested by default this is not set

public content negotiation configurer default content type strategy ( content negotiation strategy default strategy ) { this factory set default content type strategy ( default strategy ) ; return this ; }


stops this build if it ' s still going if we use thisexecutorstop url , it causes 404 if the build is already killed , as { @ link # get executor ( ) } returns null

public synchronized http response do stop ( ) throws i o exception , servlet exception { executor e = get executor ( ) ; if ( e = = null ) e = get one off executor ( ) ; if ( e ! = null ) return e do stop ( ) ; else / / nothing is building return http responses forward to previous page ( ) ; }


set the end delimiter that identifies block comments within the sql scripts defaults to < code > " & # 47 ; " < code >

public void set block comment end delimiter ( string block comment end delimiter ) { assert has text ( block comment end delimiter , " ' block comment end delimiter ' must not be null or empty " ) ; this block comment end delimiter = block comment end delimiter ; }


returns a resolved address for the given connection , resolving it if necessary

public inet address current address ( string id ) throws unknown host exception { return node state ( id ) current address ( ) ; }


public string get name ( ) { return name ; }


execute a shell command expecting a result of 0

private void exec ( string [ ] args ) throws exception { exec ( 0 , args ) ; }


public void add pet ( pet pet ) throws api exception { add pet with http info ( pet ) ; }


basic idea of the test : 1 register a token for 2 seconds with no cancel at the end 2 cancel it immediately 3 sleep and check that the 2 seconds renew didn ' t happen ( totally 5 renewals ) 4 check cancellation

public void test d t renewal with no cancel ( ) throws exception { my f s dfs = ( my f s ) file system get ( conf ) ; log info ( " dfs = " + ( object ) dfs hash code ( ) + " ; conf = " + conf hash code ( ) ) ; credentials ts = new credentials ( ) ; my token token 1 = dfs get delegation token ( " user 1 " ) ; / / to cause this one to be set for renew in 2 secs renewer token to renew in 2 sec = token 1 ; log info ( " token = " + token 1 + " should be renewed for 2 secs " ) ; string nn 1 = delegation token renewer scheme + " : / / host 1 : 0 " ; ts add token ( new text ( nn 1 ) , token 1 ) ; application id application id 1 = builder utils new application id ( 0 , 1 ) ; delegation token renewer add application async ( application id 1 , ts , false , " user " , new configuration ( ) ) ; wait for events to get processed ( delegation token renewer ) ; delegation token renewer application finished ( application id 1 ) ; wait for events to get processed ( delegation token renewer ) ; int number of expected renewals = renewer counter ; / / number of renewals so far try { thread sleep ( 6 * 1000 ) ; / / sleep 6 seconds , so it has time to renew } catch ( interrupted exception e ) { } log info ( " counter = " + renewer counter + " ; t = " + renewer last renewed ) ; / / counter and the token should still be the old ones assert equals ( " renew wasn ' t called as many times as expected " , number of expected renewals , renewer counter ) ; / / also renewing of the canceled token should not fail , because it has not / / been canceled token 1 renew ( conf ) ; }


http : code google compgoogle - gsonissuesdetail ? id = 349

public void test at sign in serialized name ( ) { assert equals ( " { \ " @ foo \ " : \ " bar \ " } " , new gson ( ) to json ( new at name ( ) ) ) ; }


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


test the sequence of deleting a file that has snapshot , and lease manager ' s hard limit recovery

public void test delete and lease recovery hard limit snapshot ( ) throws exception { final path root path = new path ( " / " ) ; final configuration config = new configuration ( ) ; / / disable permissions so that another user can recover the lease config set boolean ( d f s config keys dfs permissions enabled key , false ) ; config set int ( d f s config keys dfs block size key , block size ) ; long lease recheck = 1000 ; conf set long ( dfs namenode lease recheck interval ms key , lease recheck ) ; conf set long ( dfs lease hardlimit key , lease recheck / 1000 ) ; f s data output stream stm = null ; try { cluster = new mini d f s cluster builder ( config ) num data nodes ( 3 ) build ( ) ; cluster wait active ( ) ; final distributed file system fs = cluster get file system ( ) ; final path test path = new path ( " / testfile " ) ; stm = fs create ( test path ) ; log info ( " test on " + test path ) ; / / write a half block append test util write ( stm , 0 , block size / 2 ) ; stm hflush ( ) ; / / create a snapshot , so delete does not release the file ' s inode snapshot test helper create snapshot ( fs , root path , " snap " ) ; / / delete the file without closing it fs delete ( test path , false ) ; / / write enough bytes to trigger an add block , which would fail in / / the streamer append test util write ( stm , 0 , block size ) ; / / wait for lease manager ' s background ' monitor ' class to check leases thread sleep ( 2 * lease recheck ) ; log info ( " now check we can restart " ) ; cluster restart name nodes ( ) ; log info ( " restart finished " ) ; } finally { if ( stm ! = null ) { i o utils close stream ( stm ) ; } if ( cluster ! = null ) { cluster shutdown ( ) ; } } }


returns whether the player is playing , i e { @ link # get content position ( ) } is advancing if { @ code false } , then at least one of the following is true : the { @ link # get playback state ( ) playback state } is not { @ link # state ready ready } there is no { @ link # get play when ready ( ) intention to play } playback is { @ link # get playback suppression reason ( ) suppressed for other reasons }


writes blob with resolving the blob name using { @ link # blob name } method the blob will optionally by compressed

public void write ( t obj , blob container blob container , string name , boolean compress , big arrays big arrays ) throws i o exception { final string blob name = blob name ( name ) ; serialize ( obj , blob name , compress , big arrays , bytes - > blob container write blob ( blob name , bytes , false ) ) ; }


write all buffered ops to disk and fsync file note : any exception during the sync process will be interpreted as a tragic exception and the writer will be closed before raising the exception

public void sync ( ) throws i o exception { sync up to ( long max value ) ; }


public static completable future < void > close async with timeout ( string component name , throwing runnable < exception > closing sequence , duration close timeout ) { final completable future < void > future = new completable future < > ( ) ; / / start a dedicate thread to close the component final thread t = new thread ( ( ) - > { try { closing sequence run ( ) ; future complete ( null ) ; } catch ( throwable error ) { future complete exceptionally ( error ) ; } } ) ; t start ( ) ; / / if the future fails due to a timeout , we interrupt the thread future exceptionally ( ( error ) - > { if ( error instanceof timeout exception & & t is alive ( ) ) { abort thread ( t ) ; } return null ; } ) ; future utils or timeout ( future , close timeout to millis ( ) , time unit milliseconds , string format ( " failed to close the % s before timeout of % d ms " , component name , close timeout to millis ( ) ) ) ; return future ; }


convenience method for { @ code reset ( false ) }

public final void reset ( ) { reset ( / * reset upstream format = * / false ) ; }


find purchase order by id for valid response try integer i ds with value & lt ; & # x 3 d ; 5 or & gt ; 10 other values will generated exceptions

public api response < order > get order by id with http info ( long order id ) throws api exception { okhttp 3 call local var call = get order by id validate before call ( order id , null ) ; type local var return type = new type token < order > ( ) { } get type ( ) ; return local var api client execute ( local var call , local var return type ) ; }


this is to check the timestamp of the archives to be localized

static void set archive timestamps ( configuration conf , string timestamps ) { conf set ( m r job config cache archives timestamps , timestamps ) ; }


called whenever the structure data type editor internal packing state changes for the data type being edited whether the structure is free form , aligned , or packed to a particular maximum alignment

public abstract void pack state changed ( long packing value ) ;


collection < authentication policy resolver > get authentication policy resolvers ( authentication transaction transaction ) ;


sets the x position so that it is centered on the given x parameter

public void set center x ( float x ) { set x ( x - width / 2 ) ; }


public double get double ( ) { return double ; }


returns the quotient of the given specific integer value and this integer value

public integer value divide of ( specific integer value other ) { return divide of ( ( integer value ) other ) ; }


ensure that any custom default locations are still respected

public void custom abstract refreshable w a c falls back to init param ( ) { xml web application context ctx = new xml web application context ( ) { @ override protected string [ ] get default config locations ( ) { return new string [ ] { " / web - inf / custom xml " } ; } } ; / / ctx set config location ( " programmatic xml " ) ; / / nothing set programmatically context loader listener cll = new context loader listener ( ctx ) ; mock servlet context sc = new mock servlet context ( ) ; sc add init parameter ( context loader config location param , " from - init - param xml " ) ; assert that exception of type ( throwable class ) is thrown by ( ( ) - > cll context initialized ( new servlet context event ( sc ) ) ) with message ending with ( " could not open servlet context resource [ / from - init - param xml ] " ) ; }


public static boolean is limit ( string access key i d ) { rate limiter rate limiter = null ; try { rate limiter = cache get ( access key i d , new callable < rate limiter > ( ) { @ override public rate limiter call ( ) throws exception { return rate limiter create ( limit ) ; } } ) ; } catch ( execution exception e ) { logger error ( " create limit fail " , e ) ; } if ( rate limiter ! = null & & ! rate limiter try acquire ( limit time , time unit milliseconds ) ) { logger error ( " access key id : { } limited " , access key i d ) ; return true ; } return false ; }


returns the summary stats for the state size of completed checkpoints

public min max avg stats get state size stats ( ) { return state size ; }


returns a valid address for akka it returns a string of format ' host : port ' when an i pv 6 address is specified , it normalizes the i pv 6 address to avoid complications with the exact url match policy of akka

public static string unresolved host and port to normalized string ( string host , int port ) { preconditions check argument ( is valid host port ( port ) , " port is not within the valid range , " ) ; return unresolved host to normalized string ( host ) + " : " + port ; }


do not override this ! this method only exists for legacy support no new aggregations need this , nor should they override it

protected boolean serialize target value type ( version version ) { return false ; }


set the current working directory for the given file system all relative paths will be resolved relative to it

public void set working directory ( path new dir ) { working dir = make qualified ( new dir ) ; }


public synchronized thread get current thread ( ) { return task thread ; }


protected int get max conn ( ) { int max conn = config get int ( configuration keys store db max conn , default db max conn ) ; return max conn < 0 ? default db max conn : max conn ; }


delete the given snapshot from the repository in blocking manner

void delete snapshot ( string slm policy , string repo , snapshot id snapshot , snapshot lifecycle stats slm stats , action listener < acknowledged response > listener ) { logger info ( " [ { } ] snapshot retention deleting snapshot [ { } ] " , repo , snapshot ) ; client admin ( ) cluster ( ) prepare delete snapshot ( repo , snapshot get name ( ) ) execute ( action listener wrap ( acknowledged response - > { slm stats snapshot deleted ( slm policy ) ; listener on response ( acknowledged response ) ; } , e - > { try { logger warn ( new parameterized message ( " [ { } ] failed to delete snapshot [ { } ] for retention " , repo , snapshot ) , e ) ; slm stats snapshot delete failure ( slm policy ) ; } finally { listener on failure ( e ) ; } } ) ) ; }


public result set meta data get meta data ( ) throws s q l exception { return null ; }


public static long stream range values ( protos value range range ) { check not null ( range ) ; return long stream range closed ( range get begin ( ) , range get end ( ) ) ; }


protected static void terminate cluster ( cluster binding cluster ) { if ( cluster ! = null ) { cluster terminate ( ) ; } }


get a reference to this object with an updated reference count

public synchronized a w s credential provider list share ( ) { preconditions check state ( ! closed get ( ) , " provider list is closed " ) ; ref count increment and get ( ) ; return this ; }


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


rotates the direction and up vector of this camera by the given angle around the given axis the direction and up vector will not be orthogonalized

public void rotate ( float angle , float axis x , float axis y , float axis z ) { direction rotate ( angle , axis x , axis y , axis z ) ; up rotate ( angle , axis x , axis y , axis z ) ; }


returns the factory field for the given object at index index

public listing field get field ( proxy obj < ? > proxy , int var width ) { object obj = proxy get object ( ) ; if ( ! enabled | | ! ( obj instanceof code unit ) ) { return null ; } code unit cu = ( code unit ) obj ; program program = cu get program ( ) ; program context context = program get program context ( ) ; address cur address = cu get min address ( ) ; function function = program get listing ( ) get function at ( cur address ) ; code unit prev cu = program get listing ( ) get code unit before ( cur address ) ; address prev address = prev cu ! = null ? prev cu get min address ( ) : null ; string stack depth str = null ; integer stack depth change = call depth change info get stack depth change ( program , cur address ) ; if ( stack depth change ! = null ) { string depth str = integer to string ( stack depth change ) ; string absolute depth str = ( depth str starts with ( " - " ) ) ? depth str substring ( 1 ) : depth str ; stack depth str = " stack depth = stack depth " + ( stack depth change > 0 ? " + " : " - " ) + absolute depth str ; } list < register > transition registers = get transition registers ( context , function , cur address , prev address ) ; if ( transition registers is empty ( ) & & stack depth str = = null ) { return null ; } int num registers = transition registers size ( ) ; int num elements = num registers ; if ( stack depth str ! = null ) { num elements + + ; } field element [ ] field elements = new field element [ num elements ] ; for ( int i = 0 ; i < num registers ; i + + ) { register register = transition registers get ( i ) ; attributed string str = new attributed string ( " assume " + register get name ( ) + " = " + get value string ( register , context , cur address ) , reg color , get metrics ( ) ) ; field elements [ i ] = new text field element ( str , i , 0 ) ; } if ( stack depth str ! = null ) { attributed string str = new attributed string ( stack depth str , reg color , get metrics ( ) ) ; field elements [ num registers ] = new text field element ( str , num registers , 0 ) ; } return listing text field create multiline text field ( this , proxy , field elements , start x + var width , width , integer max value , hl provider ) ; }


return the name of this state store supplier this must be a valid kafka topic name ; valid characters are ascii alphanumerics , ' ' , ' ' and ' - '


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


public table pad top ( value pad top ) { if ( pad top = = null ) throw new illegal argument exception ( " pad top cannot be null " ) ; this pad top = pad top ; size invalid = true ; return this ; }


this method repopulates the { @ link cache service } by looking at the files on the disk and for each file found , retrieves the latest synchronized information and puts the cache file into the searchable snapshots cache this method iterates over all node data paths and all shard directories in order to found the " snapshot cache " directories that contain the cache files when such a directory is found , the method iterates over the cache files and looks up their name u u i d in the existing lucene documents that were loaded when instanciating the persistent cache index ) if no information is found ( ie no matching docs in the map of lucene documents ) then the file is deleted from disk if a doc is found the stored fields are extracted from the lucene document and are used to rebuild the necessary { @ link cache key } , { @ link snapshot id } , { @ link index id } , { @ link shard id } and cache file ranges objects the lucene document is then indexed again in the new persistent cache index ( the current { @ link cache index writer } ) and the cache file is added back to the searchable snapshots cache again note that adding cache file to the cache service might trigger evictions so previously reindexed lucene cache files might be delete again ( see cache service # on cache file removal ( cache file ) method which calls { @ link # remove cache file ( cache file ) }

void repopulate cache ( cache service cache service ) { ensure open ( ) ; if ( started compare and set ( false , true ) ) { try { for ( cache index writer writer : writers ) { final node environment node path node path = writer node path ( ) ; logger debug ( " loading persistent cache on data path [ { } ] " , node path ) ; for ( string index u u i d : node environment available index folders for path ( node path ) ) { for ( shard id shard id : node environment find all shard ids ( new index ( " unknown " , index u u i d ) ) ) { final path shard data path = writer node path ( ) resolve ( shard id ) ; final path shard cache path = get shard cache path ( new shard path ( false , shard data path , shard data path , shard id ) ) ; if ( files is directory ( shard cache path ) ) { logger trace ( " found snapshot cache dir at [ { } ] , loading cache files from disk and index " , shard cache path ) ; files walk file tree ( shard cache path , new simple file visitor < > ( ) { @ override public file visit result visit file ( path file , basic file attributes attrs ) { try { final string id = build id ( file ) ; final document cache document = documents get ( id ) ; if ( cache document ! = null ) { logger trace ( " indexing cache file with id [ { } ] in persistent cache index " , id ) ; writer update cache file ( id , cache document ) ; final cache key cache key = build cache key ( cache document ) ; final long file length = get file length ( cache document ) ; final sorted set < tuple < long , long > > ranges = build cache file ranges ( cache document ) ; logger trace ( " adding cache file with [ id = { } , key = { } , ranges = { } ] " , id , cache key , ranges ) ; cache service put ( cache key , file length , file get parent ( ) , id , ranges ) ; } else { logger trace ( " deleting cache file [ { } ] ( does not exist in persistent cache index ) " , file ) ; files delete ( file ) ; } } catch ( exception e ) { throw exceptions helper convert to runtime ( e ) ; } return file visit result continue ; } } ) ; } } } } for ( cache index writer writer : writers ) { writer commit ( ) ; } logger info ( " persistent cache index loaded " ) ; documents clear ( ) ; } catch ( i o exception e ) { try { close ( ) ; } catch ( exception e 2 ) { logger warn ( " failed to close persistent cache index " , e 2 ) ; e add suppressed ( e 2 ) ; } throw new unchecked i o exception ( " failed to load persistent cache " , e ) ; } finally { close if any index writer has tragedy or is closed ( ) ; } } else { assert false : " persistent cache is already loaded " ; } }


set the negative button text , default is { @ link android r string # cancel }

public builder set negative button ( @ string res int text id ) { m negative button text = m context get string ( text id ) ; return this ; }


set < device > get devices ( ) throws exception ;


set of tls related options that govern the server ' s behavior use these options to control if all http requests should be redirected to https , and the tls modes to use < code > istio networking v 1alpha 3 server t l s options tls = 3 ; < code >

public com alibaba nacos istio model server t l s options get tls ( ) { return tls = = null ? com alibaba nacos istio model server t l s options get default instance ( ) : tls ; }


create an instance using a default { @ link moshi } instance for conversion

public static moshi converter factory create ( ) { return create ( new moshi builder ( ) build ( ) ) ; }


returns an immutable substitution instance for the key and list of values the values will be joined by spaces before substitution

public static substitution of space separated list ( final string key , final immutable list < ? > value ) { return new list substitution ( key , value ) ; }


returns an instance for the given register number , type , and variable info this method is allowed to return shared instances ( but doesn ' t necessarily do so )

public static register spec make ( int reg , type bearer type , local item local ) { if ( local = = null ) { throw new null pointer exception ( " local = = null " ) ; } return intern ( reg , type , local ) ; }


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


save a specific version as the last execute version

static void save last exec version ( @ non null string version ) { file last exec version file = get last exec version file ( ) ; try { file utils write ( last exec version file , version , charset default charset ( ) ) ; } catch ( i o exception e ) { logger log ( severe , " failed to save " + last exec version file get absolute path ( ) , e ) ; } }


removed scheme part ( " scheme : " ) from incoming uri

public string crop ( string uri ) { if ( ! belongs to ( uri ) ) { throw new illegal argument exception ( string format ( " uri [ % 1 $ s ] doesn ' t have expected scheme [ % 2 $ s ] " , uri , scheme ) ) ; } return uri substring ( uri prefix length ( ) ) ; }


creates a new image that is the same as the given image but has the given colored pixels replaced with the given new color

public static image change color ( image image , color old color , color new color ) { objects require non null ( image ) ; buffered image src image = new buffered image ( image get width ( null ) , image get height ( null ) , buffered image type int argb ) ; graphics graphics = src image get graphics ( ) ; graphics draw image ( image , 0 , 0 , null ) ; graphics dispose ( ) ; int [ ] old rgb = new int [ ] { old color get red ( ) , old color get green ( ) , old color get blue ( ) } ; int [ ] new rgb = new int [ ] { new color get red ( ) , new color get green ( ) , new color get blue ( ) } ; buffered image dest image = new buffered image ( image get width ( null ) , image get height ( null ) , buffered image type int argb ) ; lookup table table = new lookup table ( 0 , 4 ) { @ override / / overridden to pass in the complete pixel data public int [ ] lookup pixel ( int [ ] src , int [ ] dest ) { return filter rgb change color ( src , dest , old rgb , new rgb ) ; } } ; lookup op lookup op = new lookup op ( table , null ) ; lookup op filter ( src image , dest image ) ; return dest image ; }


returns true if a query on the given field might match nested documents

boolean might match nested docs ( string field ) { if ( field starts with ( " " ) ) { / / meta field every meta field behaves differently , eg nested / / documents have the same uid as their parent , put their path in / / the type field but do not have field names so we just ignore / / meta fields and return true , which is always safe , it just means / / we might add a nested filter when it is nor required return true ; } if ( is mapped field predicate test ( field ) = = false ) { / / field does not exist return false ; } for ( string parent = parent object ( field ) ; parent ! = null ; parent = parent object ( parent ) ) { object mapper mapper = object mapper lookup apply ( parent ) ; if ( mapper ! = null & & mapper nested ( ) is nested ( ) ) { return true ; } } return false ; }


if this is a client - side connection that is not muted , there is no in - progress write , and there is a session expiration time defined that has past then begin the process of re - authenticating the connection and return true , otherwise return false

public boolean maybe begin client reauthentication ( supplier < long > now nanos supplier ) throws authentication exception , i o exception { if ( ! ready ( ) ) throw new illegal state exception ( " kafka channel should always be \ " ready \ " when it is checked for possible re - authentication " ) ; if ( mute state ! = channel mute state not muted | | mid write | | authenticator client session reauthentication time nanos ( ) = = null ) return false ; / * * we ' ve delayed getting the time as long as possible in case we don ' t need it , * but at this point we need it - - so get it now * / long now nanos = now nanos supplier get ( ) ; if ( now nanos < authenticator client session reauthentication time nanos ( ) ) return false ; swap authenticators and begin reauthentication ( new reauthentication context ( authenticator , receive , now nanos ) ) ; receive = null ; return true ; }


state stores owned by the instance as a standby replica

public set < string > standby state store names ( ) { return collections unmodifiable set ( standby state store names ) ; }


set the { @ link error handler } to invoke in case an exception is thrown from a listener default is none , with a listener exception stopping the current multicast and getting propagated to the publisher of the current event if a { @ linkplain # set task executor task executor } is specified , each individual listener exception will get propagated to the executor but won ' t necessarily stop execution of other listeners consider setting an { @ link error handler } implementation that catches and logs exceptions ( a la { @ link org springframework scheduling support task utils # log and suppress error handler } ) or an implementation that logs exceptions while nevertheless propagating them ( e g { @ link org springframework scheduling support task utils # log and propagate error handler } )

public void set error handler ( @ nullable error handler error handler ) { this error handler = error handler ; }


returns a resource named " default " for the specified type

public < t > t get ( class < t > type ) { return get ( " default " , type ) ; }


transfers this buffer ' s data to the specified channel starting at the specified absolute { @ code index } this method does not modify { @ code reader index } or { @ code writer index } of this buffer

public abstract int get bytes ( int index , gathering byte channel out , int length ) throws i o exception ;


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

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


post pet { pet id } : updates a pet in the store with form data

default response entity < void > update pet with form ( long pet id , string name , string status ) { return new response entity < > ( http status not implemented ) ; }


close the b c file writer attempting to use the writer after calling < code > close < code > is not allowed and may lead to undetermined results

public void close ( ) throws i o exception { if ( closed = = true ) { return ; } try { if ( error count = = 0 ) { if ( blk in progress = = true ) { throw new illegal state exception ( " close ( ) called with active block appender " ) ; } / / add meta b c file index to meta index as the last meta block block appender appender = prepare meta block ( data index block name , get default compression algorithm ( ) ) ; try { data index write ( appender ) ; } finally { appender close ( ) ; } long offset index meta = out get pos ( ) ; meta index write ( out ) ; / / meta index and the trailing section are written out directly out write long ( offset index meta ) ; api version write ( out ) ; magic write ( out ) ; out flush ( ) ; } } finally { closed = true ; } }


obtain an accessible constructor for the given class and parameters

public static < t > constructor < t > accessible constructor ( class < t > clazz , class < ? > parameter types ) throws no such method exception { constructor < t > ctor = clazz get declared constructor ( parameter types ) ; make accessible ( ctor ) ; return ctor ; }


private void rolling rollback ( long discard segment tx id , long ckpt id ) throws i o exception { / / discard discard unnecessary editlog segments starting from the given id this edit log discard segments ( discard segment tx id ) ; / / rename the special checkpoint rename checkpoint ( ckpt id , name node file image rollback , name node file image , true ) ; / / purge all the checkpoints after the marker archival manager purge checkpoins after ( name node file image , ckpt id ) ; / / hdfs - 7939 : purge all old fsimage rollback * archival manager purge checkpoints ( name node file image rollback ) ; string nameservice id = d f s util get namenode name service id ( conf ) ; if ( h a util is h a enabled ( conf , nameservice id ) ) { / / close the editlog since it is currently open for write this edit log close ( ) ; / / reopen the editlog for read this edit log init shared journals for read ( ) ; } }


public static void clear ( ) { user to netgroups map clear ( ) ; }


machine under maintenance state won ' t be chosen for invalidation

public void test invalidation ( ) throws i o exception { log info ( " starting test invalidation " ) ; int num namenodes = 1 ; int num datanodes = 3 ; start cluster ( num namenodes , num datanodes ) ; path file = new path ( " / test invalidation dat " ) ; int replicas = 3 ; file system file sys = get cluster ( ) get file system ( 0 ) ; f s namesystem ns = get cluster ( ) get namesystem ( 0 ) ; write file ( file sys , file , replicas ) ; datanode info node outof service = take node outof service ( 0 , null , long max value , null , admin states in maintenance ) ; d f s client client = get dfs client ( 0 ) ; client set replication ( file to string ( ) , ( short ) 1 ) ; / / verify the node outof service remains in blocks map check with retry ( ns , file sys , file , 1 , node outof service ) ; / / restart nn and verify the node outof service remains in blocks map get cluster ( ) restart name node ( 0 ) ; ns = get cluster ( ) get namesystem ( 0 ) ; check with retry ( ns , file sys , file , 1 , node outof service ) ; cleanup file ( file sys , file ) ; }


determine whether a class should be permitted by { @ link class filter # is blacklisted ( string ) } of { @ link class filter # default }

default @ check for null boolean permits ( string name ) { return null ; }


valid if a node label expression specified on container request is valid or not

private void check node label expression ( t container request ) { string exp = container request get node label expression ( ) ; if ( null = = exp | | exp is empty ( ) ) { return ; } / / don ' t support specifying > 1 node labels in a node label expression now if ( exp contains ( " & & " ) | | exp contains ( " | | " ) ) { throw new invalid container request exception ( " cannot specify more than one node label " + " in a single node label expression " ) ; } }


public int get file count ( ) { return file to entry map size ( ) ; }


checks whether a throwable chain contains a specific type of exception and returns it this method handles { @ link serialized throwable } s in the chain and deserializes them with the given class loader serialized throwables are often used when exceptions might come from dynamically loaded code and be transported over rpc http for better error reporting the receiving processes or threads might not have the dynamically loaded code available

public static < t extends throwable > optional < t > find throwable serialized aware ( throwable throwable , class < t > search type , class loader class loader ) { if ( throwable = = null | | search type = = null ) { return optional empty ( ) ; } throwable t = throwable ; while ( t ! = null ) { if ( search type is assignable from ( t get class ( ) ) ) { return optional of ( search type cast ( t ) ) ; } else if ( t instanceof serialized throwable ) { t = ( ( serialized throwable ) t ) deserialize error ( class loader ) ; } else { t = t get cause ( ) ; } } return optional empty ( ) ; }


key set remove all removes all elements from the given collection

public void test remove all ( ) { set full = populated set ( 3 ) ; assert true ( full remove all ( arrays as list ( one , two ) ) ) ; assert equals ( 1 , full size ( ) ) ; assert false ( full remove all ( arrays as list ( one , two ) ) ) ; assert equals ( 1 , full size ( ) ) ; }


public string insn arg string ( dalv insn insn ) { register spec list regs = insn get registers ( ) ; cst literal bits value = ( cst literal bits ) ( ( cst insn ) insn ) get constant ( ) ; return regs get ( 0 ) reg string ( ) + " , " + regs get ( 1 ) reg string ( ) + " , " + literal bits string ( value ) ; }


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


deserialize response body to java object according to the content - type

public < t > t deserialize ( response response , generic type < t > return type ) throws api exception { if ( response = = null | | return type = = null ) { return null ; } if ( " byte [ ] " equals ( return type to string ( ) ) ) { / / handle binary response ( byte array ) return ( t ) response read entity ( byte [ ] class ) ; } else if ( return type get raw type ( ) = = file class ) { / / handle file downloading t file = ( t ) download file from response ( response ) ; return file ; } string content type = null ; list < object > content types = response get headers ( ) get ( " content - type " ) ; if ( content types ! = null & & ! content types is empty ( ) ) content type = string value of ( content types get ( 0 ) ) ; / / read the entity stream multiple times response buffer entity ( ) ; return response read entity ( return type ) ; }


cleans up resources when this field panel is no longer needed

public void dispose ( ) { mouse handler dispose ( ) ; cursor handler dispose ( ) ; listeners clear ( ) ; field mouse listeners clear ( ) ; input listeners clear ( ) ; cursor listeners clear ( ) ; layout listeners clear ( ) ; view listeners clear ( ) ; selection listeners clear ( ) ; highlight listeners clear ( ) ; layouts clear ( ) ; }


registers internal distribution resolutions elasticsearch distributions are resolved as project dependencies either representing the current version pointing to a project either under ` : distribution : archives ` or : distribution : packages ` bwc versions are resolved as project to projects under ` : distribution : bwc `

private void register internal distribution resolutions ( named domain object container < distribution resolution > resolutions ) { resolutions register ( " local build " , distribution resolution - > distribution resolution set resolver ( ( project , distribution ) - > { if ( version properties get elasticsearch ( ) equals ( distribution get version ( ) ) ) { / / non - external project , so depend on local build return new project based distribution dependency ( config - > project dependency ( project , distribution project path ( distribution ) , config ) ) ; } return null ; } ) ) ; resolutions register ( " bwc " , distribution resolution - > distribution resolution set resolver ( ( project , distribution ) - > { bwc versions unreleased version info unreleased info = bwc versions unreleased info ( version from string ( distribution get version ( ) ) ) ; if ( unreleased info ! = null ) { if ( ! distribution get bundled jdk ( ) ) { throw new gradle exception ( " configuring a snapshot bwc distribution ( ' " + distribution get name ( ) + " ' ) " + " without a bundled jdk is not supported " ) ; } string project config = get project config ( distribution , unreleased info ) ; return new project based distribution dependency ( ( config ) - > project dependency ( project , unreleased info gradle project path , project config ) ) ; } return null ; } ) ) ; }


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


returns a { @ link doc value bits } representing all documents from < code > doc values < code > that have a value

public static doc value bits docs with value ( final sorted numeric doc values doc values ) { return new doc value bits ( ) { @ override public boolean advance exact ( int doc ) throws i o exception { return doc values advance exact ( doc ) ; } } ; }


requests coming from the learner should go directly to prep request processor

public void submit learner request ( request request ) { / * * requests coming from the learner should have gone through * submit request ( ) on each server which already perform some request * validation , so we don ' t need to do it again * * additionally , learner handler should start submitting requests into * the leader ' s pipeline only when the leader ' s server is started , so we * can submit the request directly into prep request processor * * this is done so that requests from learners won ' t go through * leader request processor which perform local session upgrade * / prep request processor process request ( request ) ; }


public http host get host ( ) { return host ; }


compute the test environment , which , at configuration level , is a pair consisting of the statically set environment variables with their values and the set of environment variables to be inherited from the client environment

private action environment setup test environment ( ) { / / we make a copy first to remove duplicate entries ; last one wins map < string , string > test env = new hash map < > ( ) ; for ( map entry < string , string > entry : options test environment ) { test env put ( entry get key ( ) , entry get value ( ) ) ; } return action environment split ( test env ) ; }


produce a { @ code value array } for the given { @ code value } type

public static < t > value array < t > create value array ( class < ? extends value > cls ) { if ( byte value class is assignable from ( cls ) ) { return ( value array < t > ) new byte value array ( ) ; } else if ( char value class is assignable from ( cls ) ) { return ( value array < t > ) new char value array ( ) ; } else if ( double value class is assignable from ( cls ) ) { return ( value array < t > ) new double value array ( ) ; } else if ( float value class is assignable from ( cls ) ) { return ( value array < t > ) new float value array ( ) ; } else if ( int value class is assignable from ( cls ) ) { return ( value array < t > ) new int value array ( ) ; } else if ( long value class is assignable from ( cls ) ) { return ( value array < t > ) new long value array ( ) ; } else if ( null value class is assignable from ( cls ) ) { return ( value array < t > ) new null value array ( ) ; } else if ( short value class is assignable from ( cls ) ) { return ( value array < t > ) new short value array ( ) ; } else if ( string value class is assignable from ( cls ) ) { return ( value array < t > ) new string value array ( ) ; } else { throw new illegal argument exception ( " unable to create unbounded value array for type " + cls ) ; } }


invalidates the vertex buffer object so a new open g l buffer handle is created use this in case of a context loss

public void invalidate ( ) { buffer handle = gdx gl 2 0 gl gen buffer ( ) ; create v a o ( ) ; is dirty = true ; }


helper method that generates the next block id for uploading a block to azure storage

private string generate block id ( ) throws i o exception { if ( next block count = = unset blocks count | | block id prefix = = null ) { throw new azure exception ( " append stream in invalid state next block count not set correctly " ) ; } return ( ! block id prefix is empty ( ) ) ? generate newer version block id ( block id prefix , next block count + + ) : generate older version block id ( next block count + + ) ; }


inserts the specified element into the queue represented by this deque ( in other words , at the tail of this deque ) if it is possible to do so immediately without violating capacity restrictions , returning < tt > true < tt > upon success and < tt > false < tt > if no space is currently available when using a capacity - restricted deque , this method is generally preferable to the { @ link # add } method , which can fail to insert an element only by throwing an exception this method is equivalent to { @ link # offer last }


implements { @ link options parser # as list of option values ( ) }

list < option value description > as list of effective options ( ) { list < option value description > result = new array list < > ( ) ; for ( map entry < string , option definition > map entry : options data get all option definitions ( ) ) { option definition option definition = map entry get value ( ) ; option value description option value = option values get ( option definition ) ; if ( option value = = null ) { result add ( option value description get default option value ( option definition ) ) ; } else { result add ( option value ) ; } } return result ; }


returns the time to wait until the next attempt attempts start at { @ code 0 }


public synchronized void add point ( long value ) { current points offer ( new data point ( new date ( ) , value ) ) ; cleanup old points ( ) ; }


protected void start cluster ( int num name nodes , int num datanodes , boolean setup hosts file , long [ ] nodes capacity , boolean check data node host config ) throws i o exception { start cluster ( num name nodes , num datanodes , setup hosts file , nodes capacity , check data node host config , true ) ; }


returns the index of the window that will be played if { @ link # previous ( ) } is called , which may depend on the current repeat mode and whether shuffle mode is enabled returns { @ link c # index unset } if { @ link # has previous ( ) } is { @ code false } note : when the repeat mode is { @ link # repeat mode one } , this method behaves the same as when the current repeat mode is { @ link # repeat mode off } see { @ link # repeat mode one } for more details


should be subclassed by the more specific types for an intermediate catch without type , it ' s simply leaving the event

public void event cancelled by event gateway ( delegate execution execution ) { context get command context ( ) get execution entity manager ( ) delete execution and related data ( ( execution entity ) execution , delete reason event based gateway cancel ) ; }


update the server address if the address corresponding to the host name has changed

private synchronized boolean update address ( ) throws i o exception { / / do a fresh lookup with the old host name inet socket address current addr = net utils create socket addr for host ( server get host name ( ) , server get port ( ) ) ; if ( ! server equals ( current addr ) ) { log warn ( " address change detected old : " + server to string ( ) + " new : " + current addr to string ( ) ) ; server = current addr ; user group information ticket = remote id get ticket ( ) ; this set name ( " ipc client ( " + socket factory hash code ( ) + " ) connection to " + server to string ( ) + " from " + ( ( ticket = = null ) ? " an unknown user " : ticket get user name ( ) ) ) ; return true ; } return false ; }


this gets the base class descriptor ( rtti 1 ) structure for the indicated program

static data type get simple data type ( program program ) { data type manager data type manager = program get data type manager ( ) ; boolean is 6 4 bit = m s data type utils is 6 4 bit ( program ) ; data type rtti 0 dt = type descriptor model get data type ( program ) ; data type rtti 0 ref dt = is 6 4 bit ? new image base offset 3 2 data type ( data type manager ) : new pointer data type ( rtti 0 dt ) ; data type rtti 3 ref dt = is 6 4 bit ? new image base offset 3 2 data type ( data type manager ) : new pointer data type ( ) ; category path category path = new category path ( category path ) ; structure data type struct = get aligned pack 4 structure ( data type manager , category path , structure name ) ; / / add the components struct add ( rtti 0 ref dt , " p type descriptor " , " ref to type descriptor ( rtti 0 ) for class " ) ; d word data type d word data type = new d word data type ( data type manager ) ; struct add ( d word data type , " num contained bases " , " count of extended classes in base class array ( rtti 2 ) " ) ; structure pmd data type = m s data type utils get p m d data type ( program ) ; struct add ( pmd data type , " where " , " member displacement structure " ) ; struct add ( d word data type , " attributes " , " bit flags " ) ; struct add ( rtti 3 ref dt , " p class hierarchy descriptor " , " ref to class hierarchy descriptor ( rtti 3 ) for class " ) ; return new typedef data type ( category path , data type name , struct , data type manager ) ; }


correct offset order when doing both parts and concatenation : power shot is a synonym of power

public void test parts and catenate ( ) throws i o exception { e s test case test analysis analysis = analysis tests helper create test analysis from settings ( settings builder ( ) put ( environment path home setting get key ( ) , create temp dir ( ) to string ( ) ) put ( " index analysis filter my word delimiter type " , type ) put ( " index analysis filter my word delimiter catenate words " , " true " ) put ( " index analysis filter my word delimiter generate word parts " , " true " ) build ( ) , new common analysis plugin ( ) ) ; token filter factory token filter = analysis token filter get ( " my word delimiter " ) ; string source = " power shot " ; int [ ] expected incr = new int [ ] { 1 , 0 , 1 } ; int [ ] expected pos len = new int [ ] { 2 , 1 , 1 } ; int [ ] expected start offsets = new int [ ] { 0 , 0 , 5 } ; int [ ] expected end offsets = new int [ ] { 9 , 5 , 9 } ; string [ ] expected = new string [ ] { " power shot " , " power " , " shot " } ; tokenizer tokenizer = new whitespace tokenizer ( ) ; tokenizer set reader ( new string reader ( source ) ) ; assert token stream contents ( token filter create ( tokenizer ) , expected , expected start offsets , expected end offsets , null , expected incr , expected pos len , null ) ; }


this method is called per vertex and can iterate over all of its neighboring edges with the specified direction if called with { @ link edge direction # out } the group will contain the out - edges of the grouping vertex if called with { @ link edge direction # in } the group will contain the in - edges of the grouping vertex if called with { @ link edge direction # all } the group will contain all edges of the grouping vertex the method can emit any number of output elements , including none

void iterate edges ( iterable < tuple 2 < k , edge < k , ev > > > edges , collector < o > out ) throws exception ;


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


public string get language ( ) { return language to string ( ) ; }


returns and removes the specified property of type map from the specified configuration map if the property value isn ' t of type map an { @ link elasticsearch parse exception } is thrown if the property is missing an { @ link elasticsearch parse exception } is thrown

public static < t > map < string , t > read map ( string processor type , string processor tag , map < string , object > configuration , string property name ) { object value = configuration remove ( property name ) ; if ( value = = null ) { throw new configuration exception ( processor type , processor tag , property name , " required property is missing " ) ; } return read map ( processor type , processor tag , property name , value ) ; }


adapt an { @ link enumeration } to an { @ link iterator }

public static < e > iterator < e > to iterator ( @ nullable enumeration < e > enumeration ) { return ( enumeration ! = null ? new enumeration iterator < > ( enumeration ) : collections empty iterator ( ) ) ; }


validate that no write request is in the pipeline while working on a read request

private void validate read request variant ( request request ) { int write requests = outstanding write requests get ( ) ; if ( write requests ! = 0 ) { fail test ( " there are " + write requests + " outstanding " + " write requests while issuing a read request cxid = " + request cxid + " for session 0x " + long to hex string ( request session id ) ) ; } }


get the number of vftable elements in this vftable

public int get element count ( ) { return element count ; }


concatenate list of suffix strings ' ' separated

static string concat suffixes ( string suffixes ) { if ( suffixes = = null ) { return null ; } return joiner on ( " " ) skip nulls ( ) join ( suffixes ) ; }


to determine whether android is a project , use the android gradle plugin as the basis

public static boolean is android project ( project project ) { return has plugins ( project , android support plugins ) ; }


delete a file this method is abstract in hadoop 1 x ; in 2 x + it is non - abstract and deprecated

public boolean delete ( path f ) throws i o exception { return delete ( f , true ) ; }


increases the size of the backing indices array to accommodate the specified number of additional triangles useful before adding many triangles using { @ link # triangle ( short , short , short ) } to avoid multiple backing array resizes the actual number of indices accounted for depends on the primitive type ( see { @ link # get primitive type ( ) } )

public void ensure triangle indices ( int num triangles ) ;


sets rgb components using the specified hue - saturation - value this is a convenient method for { @ link # from hsv ( float , float , float ) } this is the inverse of { @ link # to hsv ( float [ ] ) }

public color from hsv ( float [ ] hsv ) { return from hsv ( hsv [ 0 ] , hsv [ 1 ] , hsv [ 2 ] ) ; }


perform the last stages of recovery once all translog operations are done note that you should still call { @ link # post recovery ( string ) }

public void finalize recovery ( ) { recovery state ( ) set stage ( recovery state stage finalize ) ; engine engine = get engine ( ) ; engine refresh ( " recovery finalization " ) ; engine config ( ) set enable gc deletes ( true ) ; }


public boolean show dialog ( string path name , project locator project locator ) { this archive path name = path name ; this restore u r l = project locator ; string project name = project name field get text ( ) ; if ( project name = = null | | project name equals ( " " ) ) { project name = archive plugin get project name ( path name ) ; } archive field set text ( path name ) ; restore field set text ( ( project locator ! = null ) ? project locator get location ( ) : null ) ; project name field set text ( project name ) ; action complete = false ; plugin get tool ( ) show dialog ( this ) ; return action complete ; }


returns the layout version in effect under normal operation , this is the same as the software ' s current layout version , defined in { @ link name node layout version # current layout version } during a rolling upgrade , this can retain the layout version that was persisted to metadata prior to starting the rolling upgrade , back to a lower bound defined in { @ link name node layout version # minimum compatible layout version } new fsimage files and edit log segments will continue to be written with this older layout version , so that the files are still readable by the old software version if the admin chooses to downgrade

public int get effective layout version ( ) { return get effective layout version ( is rolling upgrade ( ) , fs image get storage ( ) get layout version ( ) , name node layout version minimum compatible layout version , name node layout version current layout version ) ; }


returns the custom data path that is used to look up information for this shard returns an empty string if no custom data path is used for this index returns null if custom data path information is not available ( due to bwc )

public string get custom data path ( ) { return custom data path ; }


returns true iff this link type is a dynamic library or transitive dynamic library

public boolean is dynamic library ( ) { return this = = nodeps dynamic library | | this = = dynamic library ; }


blocking method to remove a delegation token master key implementations must not return from this method until the key has been removed from the state store

public abstract void remove token master key ( delegation key key ) throws i o exception ;


each thread pretends its a data - node here

private int get num datanodes ( ) { return num threads ; }


get the address which corresponds to the offset 0


returns { @ code true } if there are no values in this array ( { @ link # length } is zero )

public boolean is empty ( ) { return end = = start ; }


set the < code > update requests < code > of the request

public allocate request builder update requests ( list < update container request > update requests ) { allocate request set update requests ( update requests ) ; return this ; }


returns a string representation of the { @ code unsigned integer } value , in base { @ code radix } if { @ code radix < character min radix } or { @ code radix > character max radix } , the radix { @ code 10 } is used

public string to string ( int radix ) { return unsigned ints to string ( value , radix ) ; }


take the bucket key and return it in the format for the index , taking the mapped type into account

object value ( object key , string type ) ;


test with null location its unclear whenif this happens , see https : bugs openjdk java netbrowse j d k - 8129972

public void test null location ( ) throws exception { assume true ( " test cannot run with security manager " , system get security manager ( ) = = null ) ; permission collection no permissions = new permissions ( ) ; e s policy policy = new e s policy ( test codebases , no permissions , collections empty map ( ) , true , new permissions ( ) ) ; assert false ( policy implies ( new protection domain ( new code source ( null , ( certificate [ ] ) null ) , no permissions ) , new file permission ( " foo " , " read " ) ) ) ; }


protected static optional < u r i builder basic name value pair > get entity id as parameter ( final service service ) { val builder = new u r i builder ( service get id ( ) ) ; return builder get query params ( ) stream ( ) filter ( p - > p get name ( ) equals ( saml protocol constants parameter entity id ) ) find first ( ) ; }


adds the given toolchains as requirements for this aspect

public builder add required toolchains ( label toolchain labels ) { iterables add all ( this required toolchains , lists new array list ( toolchain labels ) ) ; return this ; }


wait until enough data ( value records ) has been consumed

public static < v > list < v > wait until min values records received ( final properties consumer config , final string topic , final int expected num records ) throws exception { return wait until min values records received ( consumer config , topic , expected num records , default timeout ) ; }


sets the node specific setting into generic configuration key looks up value of " key nameservice id namenode id " and if found sets that value into generic key in the conf if this is not found , falls back to " key nameservice id " and then the unmodified key note that this only modifies the runtime conf

public static void set generic conf ( configuration conf , string nameservice id , string nn id , string keys ) { for ( string key : keys ) { string value = conf get ( add key suffixes ( key , nameservice id , nn id ) ) ; if ( value ! = null ) { conf set ( key , value ) ; continue ; } value = conf get ( add key suffixes ( key , nameservice id ) ) ; if ( value ! = null ) { conf set ( key , value ) ; } } }


the asynchronous version of get children

public void get children ( string path , boolean watch , children 2 callback cb , object ctx ) { get children ( path , get default watcher ( watch ) , cb , ctx ) ; }


public static void register discriminator ( class < ? > model class , string discriminator property name , map < string , class < ? > > mappings ) { class discriminator mapping m = new class discriminator mapping ( model class , discriminator property name , mappings ) ; model discriminators put ( model class , m ) ; }


convenience method for reading a base 6 4 - encoded file and decoding it as of v 2 3 , if there is a error , the method will throw an java io i o exception < b > this is new to v 2 3 ! < b > in earlier versions , it just returned false , but in retrospect that ' s a pretty poor way to handle it

public static byte [ ] decode from file ( string filename ) throws java io i o exception { byte [ ] decoded data = null ; base 6 4 input stream bis = null ; try { / / set up some useful variables java io file file = new java io file ( filename ) ; byte [ ] buffer = null ; int length = 0 ; int num bytes = 0 ; / / check for size of file if ( file length ( ) > integer max value ) { throw new java io i o exception ( " file is too big for this convenience method ( " + file length ( ) + " bytes ) " ) ; } / / end if : file too big for int index buffer = new byte [ ( int ) file length ( ) ] ; / / open a stream bis = new base 6 4 input stream ( new java io buffered input stream ( new java io file input stream ( file ) ) , base 6 4 decode ) ; / / read until done while ( ( num bytes = bis read ( buffer , length , 4096 ) ) > = 0 ) { length + = num bytes ; } / / end while / / save in a variable to return decoded data = new byte [ length ] ; system arraycopy ( buffer , 0 , decoded data , 0 , length ) ; } / / end try catch ( java io i o exception e ) { throw e ; / / catch and release to execute finally { } } / / end catch : java io i o exception finally { try { bis close ( ) ; } catch ( exception e ) { } } / / end finally return decoded data ; }


test the property ' prefix namespace array '

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


specify a callback for customizing every hibernate { @ code session } resource created for a new transaction managed by this { @ code hibernate transaction manager } this enables convenient customizations for application purposes , e g setting hibernate filters

public void set session initializer ( consumer < session > session initializer ) { this session initializer = session initializer ; }


the peer tells us to stop creating streams it is safe to replay streams with { @ code id > last good stream id } on a new connection in - flight streams with { @ code id < = last good stream id } can only be replayed on a new connection if they are idempotent

void go away ( int last good stream id , io grpc okhttp internal framed error code error code , byte string debug data ) ;


public inet socket address get connection address ( ) { preconditions check state ( factory ! = null , " service not started " ) ; return factory get local address ( ) ; }


return the underlying thread pool executor for native access

public thread pool executor get thread pool executor ( ) throws illegal state exception { assert state ( this thread pool executor ! = null , " thread pool task executor not initialized " ) ; return this thread pool executor ; }


returns a single channel , or else a not found code

public io grpc channelz v 1 get channel response get channel ( io grpc channelz v 1 get channel request request ) { return io grpc stub client calls blocking unary call ( get channel ( ) , get get channel method ( ) , get call options ( ) , request ) ; }


tests the registration of multiple application master serially one at a time

public void test register mulitple application masters ( ) throws exception { for ( int test app id = 0 ; test app id < 3 ; test app id + + ) { register application master response response = register application master ( test app id ) ; assert assert not null ( response ) ; assert assert equals ( integer to string ( test app id ) , response get queue ( ) ) ; } }


given a vandermonde matrix v [ i ] [ j ] = x [ j ] ^ i and vector y , solve for z such that vz = y the output z will be placed in y

public void solve vandermonde system ( int [ ] x , int [ ] y , int len ) { assert ( x length < = len & & y length < = len ) ; for ( int i = 0 ; i < len - 1 ; i + + ) { for ( int j = len - 1 ; j > i ; j - - ) { y [ j ] = y [ j ] ^ mul table [ x [ i ] ] [ y [ j - 1 ] ] ; } } for ( int i = len - 1 ; i > = 0 ; i - - ) { for ( int j = i + 1 ; j < len ; j + + ) { y [ j ] = div table [ y [ j ] ] [ x [ j ] ^ x [ j - i - 1 ] ] ; } for ( int j = i ; j < len - 1 ; j + + ) { y [ j ] = y [ j ] ^ y [ j + 1 ] ; } } }


releases the background timer that this watchdog uses

public void close ( ) { if ( watchdog timer ! = null ) { watchdog timer cancel ( ) ; } watchdog timer = null ; timeout method = null ; }


parse inet socket address in specified format

private string builder append ( string builder sb , inet socket address inet socket address ) { if ( inet socket address ! = null ) { string host = inet socket address get address ( ) get host address ( ) ; int port = inet socket address get port ( ) ; sb append ( host ) append ( " : " ) append ( port ) append ( " ; " ) ; } return sb ; }


assert the response status code is { @ code http status variant also negotiates } ( 506 )

public result matcher is variant also negotiates ( ) { return matcher ( http status variant also negotiates ) ; }


creates a variant of the options factory that applies additional configuration parameters if no configuration is applied , or if the method directly applies configuration values to the ( mutable ) options factory object , this method may return the original options factory object otherwise it typically returns a modified copy

rocks d b options factory configure ( readable config configuration ) ;


given a list of timestamp formats that might contain indeterminate daymonth parts , return the corresponding pattern with the placeholders replaced with concrete daymonth formats

private list < string > determinise java timestamp formats ( list < string > raw java timestamp formats , @ nullable timestamp format only consider format ) { / / this method needs rework if the class is ever made thread safe if ( raw java timestamp formats stream ( ) any match ( format - > format index of ( indeterminate field placeholder ) > = 0 ) ) { boolean is day first = guess is day first ( raw java timestamp formats , only consider format , locale get default ( ) ) ; cached java timestamp formats = raw java timestamp formats stream ( ) map ( format - > determinise java timestamp format ( format , is day first ) ) collect ( collectors to list ( ) ) ; } else { cached java timestamp formats = raw java timestamp formats ; } return cached java timestamp formats ; }


judge whether current server own the lock or not

public boolean can current server own the lock ( ) { boolean current owner is me = sub info collect lock owner = = null | | inet utils get self i p ( ) equals ( sub info collect lock owner ) ; if ( current owner is me ) { return true ; } if ( system current time millis ( ) - this sub info collect lock expire time > lock expire duration ) { return true ; } return false ; }


fire an event to the application bus that the settings have changed

public void fire changed ( ) { application manager get application ( ) get message bus ( ) sync publisher ( config notifier config topic ) config changed ( this ) ; }


set the value of the { @ code if - modified - since } header the date should be specified as the number of milliseconds since january 1 , 1970 gmt

b if modified since ( long if modified since ) ;


transitions from the alpha at the time this action starts to an alpha of 1

static public alpha action fade in ( float duration , @ null interpolation interpolation ) { alpha action action = action ( alpha action class ) ; action set alpha ( 1 ) ; action set duration ( duration ) ; action set interpolation ( interpolation ) ; return action ; }


creates a new instance of this { @ code fragment options } with all flags adjusted as needed to represent the host platform

public fragment options get host ( ) { return get default ( ) ; }


public string get a t t n a m e ( ) { return att name ; }


sets custom { @ linkplain executor executor } for tasks of loading and displaying images < br > < br > < b > note : < b > if you set custom executor then following configuration options will not be considered for this executor : { @ link # thread pool size ( int ) } { @ link # thread priority ( int ) } { @ link # tasks processing order ( queue processing type ) }

public builder task executor ( executor executor ) { if ( thread pool size ! = default thread pool size | | thread priority ! = default thread priority | | tasks processing type ! = default task processing type ) { l w ( warning overlap executor ) ; } this task executor = executor ; return this ; }


@ test public void test new metrics ( ) { final metrics registry r = new metrics registry ( " test " ) ; r new counter ( " c 1 " , " c 1 desc " , 1 ) ; r new counter ( " c 2 " , " c 2 desc " , 2l ) ; r new gauge ( " g 1 " , " g 1 desc " , 3 ) ; r new gauge ( " g 2 " , " g 2 desc " , 4l ) ; r new gauge ( " g 3 " , " g 3 desc " , 5f ) ; r new stat ( " s 1 " , " s 1 desc " , " ops " , " time " ) ; assert equals ( " num metrics in registry " , 6 , r metrics ( ) size ( ) ) ; assert true ( " c 1 found " , r get ( " c 1 " ) instanceof mutable counter int ) ; assert true ( " c 2 found " , r get ( " c 2 " ) instanceof mutable counter long ) ; assert true ( " g 1 found " , r get ( " g 1 " ) instanceof mutable gauge int ) ; assert true ( " g 2 found " , r get ( " g 2 " ) instanceof mutable gauge long ) ; assert true ( " g 3 found " , r get ( " g 3 " ) instanceof mutable gauge float ) ; assert true ( " s 1 found " , r get ( " s 1 " ) instanceof mutable stat ) ; expect metrics exception ( " metric name c 1 already exists " , new runnable ( ) { @ override public void run ( ) { r new counter ( " c 1 " , " test dup " , 0 ) ; } } ) ; }


public static void log login details ( string name , login context login context ) { assert not null ( " null login context " , login context ) ; subject subject = login context get subject ( ) ; log info ( " logged in as { } : \ n { } " , name , subject ) ; }


public void test no record length ( ) throws i o exception { local fs delete ( work dir , true ) ; path file = new path ( work dir , new string ( " test format txt " ) ) ; create file ( file , null , 10 , 10 ) ; / / set the fixed length record length config property job conf job = new job conf ( default conf ) ; file input format set input paths ( job , work dir ) ; fixed length input format format = new fixed length input format ( ) ; format configure ( job ) ; input split splits [ ] = format get splits ( job , 1 ) ; boolean exception thrown = false ; for ( input split split : splits ) { try { record reader < long writable , bytes writable > reader = format get record reader ( split , job , void reporter ) ; } catch ( i o exception ioe ) { exception thrown = true ; log info ( " exception message : " + ioe get message ( ) ) ; } } assert true ( " exception for not setting record length : " , exception thrown ) ; }


public static partition create hive partition ( string db name , string table name , list < string > values , storage descriptor sd , map < string , string > parameters ) { partition partition = new partition ( ) ; partition set db name ( db name ) ; partition set table name ( table name ) ; partition set values ( values ) ; partition set parameters ( parameters ) ; partition set sd ( sd ) ; int current time = ( int ) ( system current time millis ( ) / 1000 ) ; partition set create time ( current time ) ; partition set last access time ( current time ) ; return partition ; }


creates list of users with given input array

public void create users with array input ( list < user > body , api client auth info auth info , handler < async result < void > > result handler ) { object local var body = body ; / / verify the required parameter ' body ' is set if ( body = = null ) { result handler handle ( api exception fail ( 400 , " missing the required parameter ' body ' when calling create users with array input " ) ) ; return ; } / / create path and map variables string local var path = " / user / create with array " ; / / query params list < pair > local var query params = new array list < > ( ) ; / / header params multi map local var header params = multi map case insensitive multi map ( ) ; / / cookie params multi map local var cookie params = multi map case insensitive multi map ( ) ; / / form params / / todo : sending files within multipart / form - data is not supported yet ( because of vertx web - client ) map < string , object > local var form params = new hash map < > ( ) ; string [ ] local var accepts = { } ; string [ ] local var content types = { } ; string [ ] local var auth names = new string [ ] { } ; api client invoke a p i ( local var path , " post " , local var query params , local var body , local var header params , local var cookie params , local var form params , local var accepts , local var content types , local var auth names , auth info , null , result handler ) ; }


get the index field associated with the specified encoded field type

static index field get index field ( byte field type ) throws unsupported field exception { field indexed field = field get field ( ( byte ) ( field type & field type mask ) ) ; byte primary key feld type = ( byte ) ( field type > > index field type shift & field type mask ) ; if ( primary key feld type = = field reserved 15 type ) { / / 0xf 0 0xff - reserved for schema use throw new unsupported field exception ( field type ) ; } if ( primary key feld type = = legacy index long type ) { return new legacy index field ( indexed field ) ; } field primary key type = field get field ( primary key feld type ) ; return new index field ( indexed field , primary key type ) ; }


returns true if the given object is also a { @ link attributes } with an equal attribute values note that if a stored values are mutable , it is possible for two objects to be considered equal at one point in time and not equal at another ( due to concurrent mutation of attribute values ) this method is not implemented efficiently and is meant for testing

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } attributes that = ( attributes ) o ; if ( data size ( ) ! = that data size ( ) ) { return false ; } for ( map entry < key < ? > , object > e : data entry set ( ) ) { if ( ! that data contains key ( e get key ( ) ) ) { return false ; } if ( ! objects equal ( e get value ( ) , that data get ( e get key ( ) ) ) ) { return false ; } } return true ; }


returns the select box ' s style modifying the returned style may not have an effect until { @ link # set style ( select box style ) } is called

public select box style get style ( ) { return style ; }