returns an ordering that compares objects according to the order in which they are given to this method only objects present in the argument list ( according to { @ link object # equals } ) may be compared this comparator imposes a " partial ordering " over the type { @ code t } null values in the argument list are not supported the returned comparator throws a { @ link class cast exception } when it receives an input parameter that isn ' t among the provided values the generated comparator is serializable if all the provided values are serializable

public static < t > ordering < t > explicit ( t least value , t remaining values in order ) { return explicit ( lists as list ( least value , remaining values in order ) ) ; } / / ordering < object > singletons


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

public static fields find by name ( string name ) { return by name get ( name ) ; }


see { @ link socket # connect ( socket address ) } calling this method does not trigger mode detection

public void connect ( socket address endpoint ) throws i o exception { get socket allow unknown mode ( ) connect ( endpoint ) ; }


return a new unique integer in the channel value space

public int get new channel number ( ) { max channel type + + ; return max channel type ; }


merges the { @ link cc compilation context } of a dependency into this one by adding the contents of all of its attributes

public builder merge dependent cc compilation context ( cc compilation context other cc compilation context ) { preconditions check not null ( other cc compilation context ) ; compilation prerequisites add transitive ( other cc compilation context get transitive compilation prerequisites ( ) ) ; include dirs add transitive ( other cc compilation context get include dirs ( ) ) ; quote include dirs add transitive ( other cc compilation context get quote include dirs ( ) ) ; system include dirs add transitive ( other cc compilation context get system include dirs ( ) ) ; framework include dirs add transitive ( other cc compilation context get framework include dirs ( ) ) ; loose hdrs dirs add transitive ( other cc compilation context get loose hdrs dirs ( ) ) ; declared include srcs add transitive ( other cc compilation context get declared include srcs ( ) ) ; header info builder add dep ( other cc compilation context header info ) ; transitive modules add transitive ( other cc compilation context transitive modules ) ; if ( other cc compilation context header info header module ! = null ) { transitive modules add ( other cc compilation context header info header module ) ; } transitive pic modules add transitive ( other cc compilation context transitive pic modules ) ; if ( other cc compilation context header info pic header module ! = null ) { transitive pic modules add ( other cc compilation context header info pic header module ) ; } non code inputs add transitive ( other cc compilation context non code inputs ) ; / / all module maps of direct dependencies are inputs to the current compile independently of / / the build type if ( other cc compilation context get cpp module map ( ) ! = null ) { direct module maps add ( other cc compilation context get cpp module map ( ) get artifact ( ) ) ; } / / likewise , module maps re - exported from dependencies are inputs to the current compile for ( cpp module map module map : other cc compilation context exporting module maps ) { direct module maps add ( module map get artifact ( ) ) ; } defines add transitive ( other cc compilation context get defines ( ) ) ; virtual to original headers add transitive ( other cc compilation context get virtual to original headers ( ) ) ; return this ; }


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


public boolean is support dtd ( ) { return this support dtd ; }


public map < string , big integer > get value map ( ) { return values ; }


required if mode is ` mutual ` the path to a file containing certificate authority certificates to use in verifying a presented client side certificate < code > string ca certificates = 5 ; < code >

public builder clear ca certificates ( ) { ca certificates = get default instance ( ) get ca certificates ( ) ; on changed ( ) ; return this ; }


closes current { @ link strings segment } and adds a { @ link reference segment } to the store

segment mapper adopt ( fully qualified name adopted key ) { segment store put ( segment key , new strings segment ( current lines ) ) ; adopted add ( adopted key ) ; segment store put ( segment key , new reference segment ( adopted key , segment store ) ) ; current lines = new array list < > ( ) ; return this ; }


finds the offset to each instruction in the bytecode array the result is a bit set with the offset of each opcode - per - se flipped on

public int [ ] get instruction offsets ( ) { int sz = bytes size ( ) ; int [ ] result = bits make bit set ( sz ) ; int at = 0 ; while ( at < sz ) { bits set ( result , at , true ) ; int length = parse instruction ( at , null ) ; at + = length ; } return result ; }


returns the remainder of this long value divided by the given particular long value

public long value remainder ( particular long value other ) { return remainder ( ( specific long value ) other ) ; }


read the next key in a set into < code > key < code > returns true if such a key exists and false when at the end of the set

public boolean next ( writable comparable key ) throws i o exception { return next ( key , null writable get ( ) ) ; }


returns true if the join key contains the unique key of the input

public boolean join key contains unique key ( ) { return join key contains unique key ; }


public string get d l l name ( ) { return dll name ; }


fetch invalid u r ls https : github com open refine open refineissues 1 2 1 9

public void test invalid url ( ) throws exception { try ( mock web server server = new mock web server ( ) ) { server start ( ) ; http url url = server url ( " / random " ) ; server enqueue ( new mock response ( ) ) ; row row 0 = new row ( 2 ) ; row 0 set cell ( 0 , new cell ( " auinrestrsc " , null ) ) ; / / malformed - > null project rows add ( row 0 ) ; row row 1 = new row ( 2 ) ; row 1 set cell ( 0 , new cell ( url to string ( ) , null ) ) ; / / fine project rows add ( row 1 ) ; row row 2 = new row ( 2 ) ; / / well - formed but not resolvable row 2 set cell ( 0 , new cell ( " http : / / domain invalid / random " , null ) ) ; project rows add ( row 2 ) ; engine dependent operation op = new column addition by fetching u r ls operation ( engine config , " fruits " , " value " , on error store error , " junk " , 1 , 50 , true , null ) ; run and wait ( op , 3000 ) ; int new col = project column model get column by name ( " junk " ) get cell index ( ) ; / / inspect rows assert assert equals ( project rows get ( 0 ) get cell value ( new col ) , null ) ; assert assert true ( project rows get ( 1 ) get cell value ( new col ) ! = null ) ; assert assert true ( expression utils is error ( project rows get ( 2 ) get cell value ( new col ) ) ) ; } }


flatten a sequence of entries into a single map

private static map < path fragment , artifact > entries to map ( nested set < symlink entry > entry set , @ nullable conflict checker checker ) { checker = ( checker ! = null ) ? checker : conflict checker ignore checker ; map < path fragment , artifact > map = new linked hash map < > ( ) ; for ( symlink entry entry : entry set to list ( ) ) { checker put ( map , entry get path ( ) , entry get artifact ( ) ) ; } return map ; }


creates a { @ link zoo keeper checkpoint i d counter } instance

public static zoo keeper checkpoint i d counter create checkpoint i d counter ( curator framework client , configuration configuration , job i d job id ) { string checkpoint id counter path = configuration get string ( high availability options ha zookeeper checkpoint counter path ) ; checkpoint id counter path + = get path for job ( job id ) ; return new zoo keeper checkpoint i d counter ( client , checkpoint id counter path , new default last state connection state listener ( ) ) ; }


public void compare post to 1 subscriber 1 0 0 0 0 0 0 times ( ) { compare post template ( " post to 1 subscriber 1000000 times " , 1 , 1000000 ) ; }


get the running task attempt i ds for this task

public collection < task attempt i d > get running task attempts ( ) { collection < task attempt i d > attempts = new array list < task attempt i d > ( ) ; for ( org apache hadoop mapreduce task attempt i d id : super get running task attempt ids ( ) ) { attempts add ( task attempt i d downgrade ( id ) ) ; } return attempts ; }


public void set data ( byte buffer byte buffer data ) { this byte buffer data = byte buffer data ; this extractor input = null ; }


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


deletes this file or directory and all children , recursively @ throw gdx runtime exception if this file handle is a { @ link file type # classpath } or { @ link file type # internal } file

public boolean delete directory ( ) { throw new gdx runtime exception ( " cannot delete an internal file : " + file ) ; }


{ @ inherit doc } the action may have a { @ code summary jelly } view containing a { @ code < t : summary > } or other { @ code < tr > }

@ override public void add action ( action a ) { super add action ( a ) ; }


abstract < k , v > reference entry < k , v > new entry ( segment < k , v > segment , k key , int hash , @ nullable decl reference entry < k , v > next ) ;


public void put ( @ non null final string key , byte [ ] value , final int save time ) { m cache memory utils put ( key , value , save time ) ; m cache disk utils put ( key , value , save time ) ; }


test to check whether containers are scheduled based on request delay

public void test get to be scheduled containers ( ) throws exception { d a g a m simulator dagam simulator = new d a g a m simulator ( ) ; list < container simulator > container simulators = new array list < > ( ) ; / / containers are requested with 0 , 1000 , 1500 and 4 0 0 0ms delay container simulators add ( create container sim ( 1 , 0 ) ) ; container simulators add ( create container sim ( 2 , 1000 ) ) ; container simulators add ( create container sim ( 3 , 1500 ) ) ; container simulators add ( create container sim ( 4 , 4000 ) ) ; long start time = system current time millis ( ) ; list < container simulator > res = dagam simulator get to be scheduled containers ( container simulators , start time ) ; / / we should get only one container with request delay set to 0 assert equals ( 1 , res size ( ) ) ; assert equals ( 1 , res get ( 0 ) get allocation id ( ) ) ; start time - = 1000 ; res = dagam simulator get to be scheduled containers ( container simulators , start time ) ; / / we should get containers with request delay set < 1000 assert equals ( 2 , res size ( ) ) ; assert equals ( 1 , res get ( 0 ) get allocation id ( ) ) ; assert equals ( 2 , res get ( 1 ) get allocation id ( ) ) ; start time - = 2000 ; res = dagam simulator get to be scheduled containers ( container simulators , start time ) ; / / we should get containers with request delay set < 2000 assert equals ( 3 , res size ( ) ) ; assert equals ( 1 , res get ( 0 ) get allocation id ( ) ) ; assert equals ( 2 , res get ( 1 ) get allocation id ( ) ) ; assert equals ( 3 , res get ( 2 ) get allocation id ( ) ) ; }


returns the command line options of the blaze command being executed

public options provider get options ( ) { return executor get options ( ) ; }


public void proxy ( string server , string api , map < string , string > params , http method method ) throws exception { / / do proxy if ( ! i p util contains port ( server ) ) { server = server + i p util ip port spliter + env util get port ( ) ; } string url = " http : / / " + server + env util get context path ( ) + api ; rest result < string > result ; switch ( method ) { case get : result = http client http get ( url , null , params ) ; break ; case post : result = http client http post ( url , null , params ) ; break ; case delete : result = http client http delete ( url , null , params ) ; break ; default : throw new runtime exception ( " unsupported method : " + method ) ; } if ( ! result ok ( ) ) { throw new illegal state exception ( " leader failed , caused by : " + result get message ( ) ) ; } }


public method parameter get return type ( ) { return new handler method parameter ( - 1 ) ; }


test serialization and deserialization of job

public void test job serialize and deserialize ( ) throws exception { balance job builder builder = new balance job builder < record procedure > ( ) ; for ( int i = 0 ; i < 5 ; i + + ) { record procedure r = new record procedure ( " record - " + i , 1000l ) ; builder next procedure ( r ) ; } builder next procedure ( new retry procedure ( " retry " , 1000 , 3 ) ) ; balance job < record procedure > job = builder build ( ) ; job set id ( balance procedure scheduler allocate job id ( ) ) ; / / serialize byte array output stream bao = new byte array output stream ( ) ; job write ( new data output stream ( bao ) ) ; bao flush ( ) ; byte array input stream bai = new byte array input stream ( bao to byte array ( ) ) ; / / deserialize balance job new job = new balance job builder < > ( ) build ( ) ; new job read fields ( new data input stream ( bai ) ) ; assert equals ( job , new job ) ; }


public item update build ( ) { built = true ; return new item update ( qid , added statements , deleted statements , labels , labels if new , descriptions , descriptions if new , aliases ) ; }


public boolean get bool item ( ) { return bool item ; }


public void enable motor ( boolean flag ) { joint enable motor ( flag ) ; }


public byte as byte ( ) { switch ( type ) { case string value : return byte parse byte ( string value ) ; case double value : return ( byte ) double value ; case long value : return ( byte ) long value ; case boolean value : return long value ! = 0 ? ( byte ) 1 : 0 ; } throw new illegal state exception ( " value cannot be converted to byte : " + type ) ; }


returns the live datanodes and its storage details , which has available space ( & gt ; 0 ) to schedule block moves this will return array of datanodes from its local cache it has a configurable refresh interval in millis and periodically refresh the datanode cache by fetching latest { @ link context # get live datanode storage report ( ) } once it elapsed refresh interval

public datanode map get live datanode storage report ( context sps context ) throws i o exception { long now = time monotonic now ( ) ; long elapsed time ms = now - last accessed time ; boolean refresh needed = elapsed time ms > = refresh interval ms ; last accessed time = now ; if ( refresh needed ) { if ( log is debug enabled ( ) ) { log debug ( " elapsed time ms > refresh interval ms : { } > { } , " + " so refreshing cache " , elapsed time ms , refresh interval ms ) ; } datanode map reset ( ) ; / / clear all previously cached items / / fetch live datanodes from namenode and prepare datanode map datanode storage report [ ] live dns = sps context get live datanode storage report ( ) ; for ( datanode storage report storage : live dns ) { storage report [ ] storage reports = storage get storage reports ( ) ; list < storage type > storage types = new array list < > ( ) ; list < long > remaining size list = new array list < > ( ) ; for ( storage report t : storage reports ) { if ( t get remaining ( ) > 0 ) { storage types add ( t get storage ( ) get storage type ( ) ) ; remaining size list add ( t get remaining ( ) ) ; } } datanode map add target ( storage get datanode info ( ) , storage types , remaining size list ) ; } if ( log is debug enabled ( ) ) { log debug ( " live datanodes : { } " , datanode map ) ; } / / get network topology cluster = sps context get network topology ( datanode map ) ; } return datanode map ; }


public void update node labels ( node id node ) { synchronized ( lock ) { newly registered nodes add ( node ) ; } }


public io grpc testing integration messages simple response unary call ( io grpc testing integration messages simple request request ) { return io grpc stub client calls blocking unary call ( get channel ( ) , get unary call method ( ) , get call options ( ) , request ) ; }


determine if the resource needs to be checked

public boolean is dirty ( ) { return state get ( ) ! = state clean ; }


specify a custom message interpolator to use for this validator

public void set message interpolator ( message interpolator message interpolator ) { this message interpolator = message interpolator ; }


enters this monitor blocks indefinitely , but may be interrupted

public void enter interruptibly ( ) throws interrupted exception { lock lock interruptibly ( ) ; }


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

public void test graceful failure request context with thread isolated asynchronous observable and captured context scheduler ( ) { request context test results results = test request context on graceful failure ( execution isolation strategy thread , new hystrix context scheduler ( schedulers new thread ( ) ) ) ; assert true ( results is context initialized get ( ) ) ; / / the user scheduler captures context assert true ( results origin thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / the user provided thread / scheduler assert true ( results is context initialized observe on get ( ) ) ; / / the user scheduler captures context assert true ( results observe on thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / thread isolated assert true ( results command is executed in thread ( ) ) ; }


rewrite sort rewrite logic : change the collations field to reference the new input

public frame decorrelate rel ( sort rel ) { / / sort itself should not reference cor vars assert ! cm map ref rel to cor ref contains key ( rel ) ; / / sort only references field positions in collations field / / the collations field in the new rel now need to refer to the / / new output positions in its input / / its output does not change the input ordering , so there ' s no / / need to call propagate expr final rel node old input = rel get input ( ) ; final frame frame = get invoke ( old input ) ; if ( frame = = null ) { / / if input has not been rewritten , do not rewrite this rel return null ; } final rel node new input = frame r ; mappings target mapping mapping = mappings target ( frame old to new outputs , old input get row type ( ) get field count ( ) , new input get row type ( ) get field count ( ) ) ; rel collation old collation = rel get collation ( ) ; rel collation new collation = rex util apply ( mapping , old collation ) ; final sort new sort = logical sort create ( new input , new collation , rel offset , rel fetch ) ; / / sort does not change input ordering return new frame ( rel , new sort , frame c , frame old to new outputs ) ; }


public void test do retry ( ) throws exception { final atomic reference < boolean > notified = new atomic reference < boolean > ( false ) ; / / the latest latch just for 3 because retry method has been removed final count down latch latch = new count down latch ( 2 ) ; notify listener listner = new notify listener ( ) { @ override public void notify ( list < url > urls ) { notified set ( boolean true ) ; } } ; registry = new mock registry ( registry url , latch ) ; registry set bad ( true ) ; registry register ( service url ) ; registry unregister ( service url ) ; registry subscribe ( service url set protocol ( consumer protocol ) add parameters ( collection utils to string map ( " check " , " false " ) ) , listner ) ; registry unsubscribe ( service url set protocol ( consumer protocol ) add parameters ( collection utils to string map ( " check " , " false " ) ) , listner ) ; / / failure can not be called to listener assert equals ( false , notified get ( ) ) ; assert equals ( 2 , latch get count ( ) ) ; registry set bad ( false ) ; for ( int i = 0 ; i < trytimes ; i + + ) { system out println ( " failback registry retry , times : " + i ) ; / / system out println ( latch get count ( ) ) ; if ( latch get count ( ) = = 0 ) break ; thread sleep ( sleeptime ) ; } / / thread sleep ( 100000 ) ; / / for debug assert equals ( 0 , latch get count ( ) ) ; / / the failedsubcribe corresponding key will be cleared when unsubscribing assert equals ( false , notified get ( ) ) ; }


protected void delete ( path path , boolean recursive ) throws i o exception { describe ( " deleting % s " , path ) ; contract test utils nano timer timer = new contract test utils nano timer ( ) ; get file system ( ) delete ( path , recursive ) ; timer end ( " time to delete % s " , path ) ; }


this is like { @ link # get h t m l string ( ) } , but does not put html tags around the data

public string get h t m l content string ( ) { return original h t m l data ; }


waits for the value returned by the supplier to be non - null , throwing an exception if that does not happen by the default timeout

public static < t > t wait for ( supplier < t > supplier , string failure message ) { return wait for value ( supplier , failure message , true ) ; }


adds an assignment association for the given instruction and register spec this throws an exception if the instruction doesn ' t actually perform a named variable assignment < b > note : < b > although the instruction contains its own spec for the result , it still needs to be passed in explicitly to this method , since the spec that is stored here should always have a simple type and the one in the instruction can be an arbitrary { @ link type bearer } ( such as a constant value )

public void add assignment ( insn insn , register spec spec ) { throw if immutable ( ) ; if ( insn = = null ) { throw new null pointer exception ( " insn = = null " ) ; } if ( spec = = null ) { throw new null pointer exception ( " spec = = null " ) ; } insn assignments put ( insn , spec ) ; }


public void set pdb file type ( pdb file type file type ) { this file type = file type ; }


public void set election type ( int election type ) { this election type = election type ; }


public static string string blank and then execute ( string source , callable < string > callable ) { if ( string utils is blank ( source ) ) { try { return callable call ( ) ; } catch ( exception e ) { log utils naming logger error ( " string empty and then execute cause an exception " , e ) ; } } return source trim ( ) ; }


compares two equates to determine if they are equal

private boolean same equates ( equate equate 1 , equate equate 2 ) { if ( equate 1 = = null ) { return ( equate 2 = = null ) ; } return equate 1 equals ( equate 2 ) ; }


creates a new listenable future - style stub that supports unary calls on the service

public static handshaker service future stub new future stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < handshaker service future stub > factory = new io grpc stub abstract stub stub factory < handshaker service future stub > ( ) { @ java lang override public handshaker service future stub new stub ( io grpc channel channel , io grpc call options call options ) { return new handshaker service future stub ( channel , call options ) ; } } ; return handshaker service future stub new stub ( factory , channel ) ; }


start a continuously executing set of duplex streaming ping - pong calls that will terminate when { @ code done get ( ) } is true each completed call will increment the counter by the specified delta which benchmarks can use to measure messages per second or bandwidth

protected count down latch start flow controlled streaming calls ( int calls per channel , final atomic long counter , final atomic boolean record , final atomic boolean done , final long counter delta ) { final count down latch latch = new count down latch ( calls per channel * channels length ) ; for ( final managed channel channel : channels ) { for ( int i = 0 ; i < calls per channel ; i + + ) { final client call < byte buf , byte buf > streaming call = channel new call ( flow controlled streaming , call options ) ; final atomic reference < stream observer < byte buf > > request observer ref = new atomic reference < > ( ) ; final atomic boolean ignore messages = new atomic boolean ( ) ; stream observer < byte buf > request observer = client calls async bidi streaming call ( streaming call , new stream observer < byte buf > ( ) { @ override public void on next ( byte buf value ) { stream observer < byte buf > obs = request observer ref get ( ) ; if ( done get ( ) ) { if ( ! ignore messages get and set ( true ) ) { obs on completed ( ) ; } return ; } if ( record get ( ) ) { counter add and get ( counter delta ) ; } / / request is called automatically because the observer implicitly has auto / / inbound flow control } @ override public void on error ( throwable t ) { logger log ( level warning , " call error " , t ) ; latch count down ( ) ; } @ override public void on completed ( ) { latch count down ( ) ; } } ) ; request observer ref set ( request observer ) ; / / add some outstanding requests to ensure the server is filling the connection streaming call request ( 5 ) ; request observer on next ( request slice ( ) ) ; } } return latch ; }


returns the tag record with the given id

abstract d b record get record ( long id ) throws i o exception ;


deep equality for tuples by calling equals ( ) on the tuple members

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( ! ( o instanceof tuple 2 ) ) { return false ; } @ suppress warnings ( " rawtypes " ) tuple 2 tuple = ( tuple 2 ) o ; if ( f 0 ! = null ? ! f 0 equals ( tuple f 0 ) : tuple f 0 ! = null ) { return false ; } if ( f 1 ! = null ? ! f 1 equals ( tuple f 1 ) : tuple f 1 ! = null ) { return false ; } return true ; }


return a color between dark and light colors according to the current look and feel

public static color light or dark ( final color u i resource dark color , final color u i resource light color ) { return u i util is under darcula ( ) ? dark color : light color ; }


post fakeinline - additional properties : test inline additional properties

default mono < response entity < void > > test inline additional properties ( mono < map < string , string > > param , server web exchange exchange ) { mono < void > result = mono empty ( ) ; exchange get response ( ) set status code ( http status not implemented ) ; return result then ( mono empty ( ) ) ; }


public map < url , invoker < t > > get url invoker map ( ) { return url invoker map ; }


create the rmi stub , typically by looking it up called on interceptor initialization if " cache stub " is " true " ; else called for each invocation by { @ link # get stub ( ) } the default implementation retrieves the service from the jndi environment this can be overridden in subclasses

protected object lookup stub ( ) throws remote lookup failure exception { try { return lookup ( ) ; } catch ( naming exception ex ) { throw new remote lookup failure exception ( " jndi lookup for rmi service [ " + get jndi name ( ) + " ] failed " , ex ) ; } }


encodes the abgr int color as a float the alpha is compressed to use only even numbers between 0 - 254 to avoid using bits in the na n range ( see { @ link float # int bits to float ( int ) } javadocs ) rendering which uses colors encoded as floats should expand the 0 - 254 back to 0 - 255 , else colors cannot be fully opaque

public static float int to float color ( int value ) { return float int bits to float ( value & 0xfeffffff ) ; }


create an { @ link in memory sorter } instance with the given memory segments

in memory sorter < t > create ( list < memory segment > sort segments ) ;


public final int get exit code ( ) { return exit code ; }


for testing purposes , set the file system to use here instead of relying on getting it from the file system class based on the uri

public void set mock file system for testing ( file system file system ) { this mock file system for testing = file system ; }


public void shape type test ( ) { / / todo : test shape type }


called from { @ link directory browser support # generate response ( stapler request , stapler response , object ) } to obtain a token to use when rendering a response

public token get token ( @ non null directory browser support dbs , @ non null stapler request req ) { / / this is the " rest of path " of the directory browser support , i e the directory / file / pattern " inside " the dbs final string dbs file = req get original rest of path ( ) ; / / now get the ' rest of url ' after the top - level ancestor ( which is the jenkins singleton ) / / in other words , this is the complete url after jenkins handled the top - level request final string complete url = req get ancestors ( ) get ( 0 ) get rest of url ( ) ; / / and finally , remove the ' rest of path ' suffix from the complete url , as that ' s the path from jenkins to the dbs string dbs url = complete url substring ( 0 , complete url length ( ) - dbs file length ( ) ) ; logger fine ( ( ) - > " determined dbs url : " + dbs url + " from rest of url : " + complete url + " and rest of path : " + dbs file ) ; authentication authentication = jenkins get authentication 2 ( ) ; string authentication name = authentication equals ( jenkins anonymous2 ) ? " " : authentication get name ( ) ; try { return new token ( dbs url , authentication name , instant now ( ) ) ; } catch ( exception ex ) { logger log ( level warning , " failed to encode token for url : " + dbs url + " user : " + authentication name , ex ) ; } return null ; }


test the use of chained - buffers for record storage chained - buffers will not utilize an index buffer

public void test insert single chained buffer fixed key record ( ) throws i o exception { insert one fixed key record ( false , false , buffer size / 4 ) ; }


sets the partitioning of the { @ link data stream } so that the output elements are broadcasted to every parallel instance of the next operation in addition , it implicitly as many { @ link org apache flink api common state broadcast state broadcast states } as the specified descriptors which can be used to store the element of the stream

public broadcast stream < t > broadcast ( final map state descriptor < ? , ? > broadcast state descriptors ) { preconditions check not null ( broadcast state descriptors ) ; final data stream < t > broadcast stream = set connection type ( new broadcast partitioner < > ( ) ) ; return new broadcast stream < > ( environment , broadcast stream , broadcast state descriptors ) ; }


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


public void set highlight color enabled ( final boolean enabled ) { is highlight color enabled = enabled ; }


create a located status iterator over a file status iterator

public remote iterator < s 3 a located file status > create located file status iterator ( remote iterator < s 3 a file status > status iterator ) { return remote iterators mapping remote iterator ( status iterator , listing operation callbacks : : to located file status ) ; }


connect to the specified server via framed transport

public t transport connect ( t transport transport , string server host ) throws t transport exception { / / create a framed transport t transport conn = new t framed transport ( transport ) ; / / connect conn open ( ) ; log debug ( " simple client transport has been established " ) ; return conn ; }


shutdown all datanodes in { @ link # cluster } the call blocks for { @ link # wait for dn shutdown ms } until client report has no datanode labeled as live

protected void shutdown data nodes ( ) throws timeout exception , interrupted exception { cluster shutdown data nodes ( ) ; generic test utils wait for ( ( ) - > { try { datanode info [ ] info = client datanode report ( hdfs constants datanode report type live ) ; return info length = = 0 ; } catch ( i o exception e ) { return false ; } } , wait poll interval large ms , wait for dn shutdown ms ) ; }


creates a domain entity key with column name suffix , of the form token master key entry prefix + sequence number

private static byte [ ] create token master key entry key ( int key id ) throws i o exception { return key builder new instance ( ) add ( token master key entry prefix ) add ( integer to string ( key id ) ) get bytes ( ) ; }


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

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


post fakeouternumber test serialization of outer number types

default mono < response entity < big decimal > > fake outer number serialize ( @ api param ( value = " input number as post body " ) @ valid @ request body ( required = false ) mono < big decimal > body , @ api ignore final server web exchange exchange ) { return get delegate ( ) fake outer number serialize ( body , exchange ) ; }


public void test json form data test ( ) throws api exception { string param = null ; string param 2 = null ; api test json form data ( param , param 2 ) ; / / todo : test validations }


returns a string representation of the object

public string to string ( ) { return string format ( " % s \ t % s \ t % s \ t % s % n " , this get source volume ( ) get path ( ) , this get destination volume ( ) get path ( ) , get size string ( this get bytes to move ( ) ) , this get destination volume ( ) get storage type ( ) ) ; }


check that if a template matches the index to be created , but that template has the allow auto create setting turned off , then it overrides the global setting

public void test disabled auto create template setting does not override ( ) { string random index = random alpha of length between ( 2 , 10 ) ; final composable index template template = new composable index template builder ( ) index patterns ( list of ( random index char at ( 0 ) + " * " ) ) component templates ( list of ( ) ) metadata ( map of ( ) ) allow auto create ( false ) build ( ) ; final metadata metadata = metadata builder ( ) index templates ( map of ( " test template " , template ) ) build ( ) ; final cluster state cluster state = cluster state builder ( build cluster state ( ) ) metadata ( metadata ) build ( ) ; settings settings = settings builder ( ) put ( auto create index auto create index setting get key ( ) , false ) build ( ) ; auto create index auto create index = new auto create index ( settings ) ; index not found exception e = expect throws ( index not found exception class , ( ) - > auto create index should auto create ( random index , cluster state ) ) ; assert equals ( " no such index [ composable template [ " + random index char at ( 0 ) + " * ] forbids index auto creation ] " , e get message ( ) ) ; }


gets the maximum allowed message size acceptable from the remote peer

public integer get max inbound message size ( ) { return max inbound message size ; }


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


public boolean next key value ( ) throws i o exception { try { if ( key = = null ) { key = new long writable ( ) ; } if ( value = = null ) { value = create value ( ) ; } if ( null = = this results ) { / / first time into this method , run the query this results = execute query ( get select query ( ) ) ; } if ( ! results next ( ) ) return false ; / / set the key field value as the output key value key set ( pos + split get start ( ) ) ; value read fields ( results ) ; pos + + ; } catch ( s q l exception e ) { throw new i o exception ( " s q l exception in next key value " , e ) ; } return true ; }


returns the buffered position in microseconds if the period is buffered to the end , then the period duration is returned

public long get buffered position us ( ) { if ( ! prepared ) { return info start position us ; } long buffered position us = has enabled tracks ? media period get buffered position us ( ) : c time end of source ; return buffered position us = = c time end of source ? info duration us : buffered position us ; }


source line and column info < code > optional aapt pb source position source = 3 ; < code >

public com android aapt resources source position get source ( ) { return source = = null ? com android aapt resources source position get default instance ( ) : source ; }


this method returns a { @ code immutable sorted map } , consisting of the entries whose keys are less than { @ code to key } the { @ link sorted map # head map } documentation states that a submap of a submap throws an { @ link illegal argument exception } if passed a { @ code to key } greater than an earlier { @ code to key } however , this method doesn ' t throw an exception in that situation , but instead keeps the original { @ code to key }

public immutable sorted map < k , v > head map ( k to key ) { return head map ( to key , false ) ; }


get the current number of nodes in the cluster a valid values is available after a call to allocate has been made

public int get cluster node count ( ) { return client get cluster node count ( ) ; }


atomically removes all of the elements from this queue the queue will be empty after this call returns

public void clear ( ) { final monitor monitor = this monitor ; monitor enter ( ) ; try { q clear ( ) ; } finally { monitor leave ( ) ; } }


protected void dismiss callback ( ) { close ( ) ; }


called when an event - time timer that was set using the trigger context fires

public abstract trigger result on event time ( long time , w window , trigger context ctx ) throws exception ;


assert on the comparison ordering of the state enum since we guarantee it

public void test state ordering ( ) { / / list every valid ( direct ) state transition assert less than ( new , starting ) ; assert less than ( new , terminated ) ; assert less than ( starting , running ) ; assert less than ( starting , stopping ) ; assert less than ( starting , failed ) ; assert less than ( running , stopping ) ; assert less than ( running , failed ) ; assert less than ( stopping , failed ) ; assert less than ( stopping , terminated ) ; }


access to available { @ link function definition } s


returns the element at the specified position in an iterable or a default value otherwise < b > { @ code stream } equivalent : < b > { @ code stream skip ( position ) find first ( ) or else ( default value ) } ( returns the default value if the index is out of bounds )

public static < t > t get ( iterable < ? extends t > iterable , int position , @ nullable decl t default value ) { check not null ( iterable ) ; iterators check nonnegative ( position ) ; if ( iterable instanceof list ) { list < ? extends t > list = lists cast ( iterable ) ; return ( position < list size ( ) ) ? list get ( position ) : default value ; } else { iterator < ? extends t > iterator = iterable iterator ( ) ; iterators advance ( iterator , position ) ; return iterators get next ( iterator , default value ) ; } }


applies a touch up event to the stage and returns true if an actor in the scene { @ link event # handle ( ) handled } the event only { @ link input listener listeners } that returned true for touch down will receive this event

public boolean touch up ( int screen x , int screen y , int pointer , int button ) { pointer touched [ pointer ] = false ; pointer screen x [ pointer ] = screen x ; pointer screen y [ pointer ] = screen y ; if ( touch focuses size = = 0 ) return false ; screen to stage coordinates ( temp coords set ( screen x , screen y ) ) ; input event event = pools obtain ( input event class ) ; event set type ( type touch up ) ; event set stage ( this ) ; event set stage x ( temp coords x ) ; event set stage y ( temp coords y ) ; event set pointer ( pointer ) ; event set button ( button ) ; snapshot array < touch focus > touch focuses = this touch focuses ; touch focus [ ] focuses = touch focuses begin ( ) ; for ( int i = 0 , n = touch focuses size ; i < n ; i + + ) { touch focus focus = focuses [ i ] ; if ( focus pointer ! = pointer | | focus button ! = button ) continue ; if ( ! touch focuses remove value ( focus , true ) ) continue ; / / touch focus already gone event set target ( focus target ) ; event set listener actor ( focus listener actor ) ; if ( focus listener handle ( event ) ) event handle ( ) ; pools free ( focus ) ; } touch focuses end ( ) ; boolean handled = event is handled ( ) ; pools free ( event ) ; return handled ; }


returns the end position of a string sets the error state if the column is empty

protected final int next string end pos ( byte [ ] bytes , int start pos , int limit , byte [ ] delimiter ) { int end pos = start pos ; final int delim limit = limit - delimiter length + 1 ; while ( end pos < limit ) { if ( end pos < delim limit & & delimiter next ( bytes , end pos , delimiter ) ) { break ; } end pos + + ; } if ( end pos = = start pos ) { set error state ( parse error state empty column ) ; return - 1 ; } return end pos ; }


test operations specific for state incremental visitor in { @ code test random modifications and copy on write isolation ( ) } check next , update and remove during global iteration of state incremental visitor

private static void test state iterator with update ( state incremental visitor < integer , integer , array list < integer > > updating iterator , copy on write state map < integer , integer , array list < integer > > state map , hash map < tuple 2 < integer , integer > , array list < integer > > reference map , boolean update , boolean remove ) { for ( state entry < integer , integer , array list < integer > > state entry : updating iterator next entries ( ) ) { integer key = state entry get key ( ) ; integer namespace = state entry get namespace ( ) ; tuple 2 < integer , integer > composite key = new tuple 2 < > ( key , namespace ) ; assert assert equals ( reference map get ( composite key ) , state entry get state ( ) ) ; if ( update ) { array list < integer > new state = new array list < > ( state entry get state ( ) ) ; if ( ! new state is empty ( ) ) { new state remove ( 0 ) ; } updating iterator update ( state entry , new state ) ; reference map put ( composite key , new array list < > ( new state ) ) ; assert assert equals ( new state , state map get ( key , namespace ) ) ; } if ( remove ) { updating iterator remove ( state entry ) ; reference map remove ( composite key ) ; } } }


public final cancellable update by query rethrottle async ( rethrottle request rethrottle request , request options options , action listener < list tasks response > listener ) { return perform request async and parse entity ( rethrottle request , request converters : : rethrottle update by query , options , list tasks response : : from x content , listener , empty set ( ) ) ; }


get all property values , given a prefix ( which will be stripped ) and add the bean they define to the factory with the given name

protected void register bean definition ( string bean name , map < ? , ? > map , string prefix , string resource description ) throws beans exception { string class name = null ; string parent = null ; string scope = bean definition scope singleton ; boolean is abstract = false ; boolean lazy init = false ; constructor argument values cas = new constructor argument values ( ) ; mutable property values pvs = new mutable property values ( ) ; string prefix with sep = prefix + separator ; int begin index = prefix with sep length ( ) ; for ( map entry < ? , ? > entry : map entry set ( ) ) { string key = string utils trim whitespace ( ( string ) entry get key ( ) ) ; if ( key starts with ( prefix with sep ) ) { string property = key substring ( begin index ) ; if ( class key equals ( property ) ) { class name = string utils trim whitespace ( ( string ) entry get value ( ) ) ; } else if ( parent key equals ( property ) ) { parent = string utils trim whitespace ( ( string ) entry get value ( ) ) ; } else if ( abstract key equals ( property ) ) { string val = string utils trim whitespace ( ( string ) entry get value ( ) ) ; is abstract = true value equals ( val ) ; } else if ( scope key equals ( property ) ) { / / spring 2 0 style scope = string utils trim whitespace ( ( string ) entry get value ( ) ) ; } else if ( singleton key equals ( property ) ) { / / spring 1 2 style string val = string utils trim whitespace ( ( string ) entry get value ( ) ) ; scope = ( ! string utils has length ( val ) | | true value equals ( val ) ? bean definition scope singleton : bean definition scope prototype ) ; } else if ( lazy init key equals ( property ) ) { string val = string utils trim whitespace ( ( string ) entry get value ( ) ) ; lazy init = true value equals ( val ) ; } else if ( property starts with ( constructor arg prefix ) ) { if ( property ends with ( ref suffix ) ) { int index = integer parse int ( property substring ( 1 , property length ( ) - ref suffix length ( ) ) ) ; cas add indexed argument value ( index , new runtime bean reference ( entry get value ( ) to string ( ) ) ) ; } else { int index = integer parse int ( property substring ( 1 ) ) ; cas add indexed argument value ( index , read value ( entry ) ) ; } } else if ( property ends with ( ref suffix ) ) { / / this isn ' t a real property , but a reference to another prototype / / extract property name : property is of form dog ( ref ) property = property substring ( 0 , property length ( ) - ref suffix length ( ) ) ; string ref = string utils trim whitespace ( ( string ) entry get value ( ) ) ; / / it doesn ' t matter if the referenced bean hasn ' t yet been registered : / / this will ensure that the reference is resolved at runtime object val = new runtime bean reference ( ref ) ; pvs add ( property , val ) ; } else { / / it ' s a normal bean property pvs add ( property , read value ( entry ) ) ; } } } if ( logger is trace enabled ( ) ) { logger trace ( " registering bean definition for bean name ' " + bean name + " ' with " + pvs ) ; } / / just use default parent if we ' re not dealing with the parent itself , / / and if there ' s no class name specified the latter has to happen for / / backwards compatibility reasons if ( parent = = null & & class name = = null & & ! bean name equals ( this default parent bean ) ) { parent = this default parent bean ; } try { abstract bean definition bd = bean definition reader utils create bean definition ( parent , class name , get bean class loader ( ) ) ; bd set scope ( scope ) ; bd set abstract ( is abstract ) ; bd set lazy init ( lazy init ) ; bd set constructor argument values ( cas ) ; bd set property values ( pvs ) ; get registry ( ) register bean definition ( bean name , bd ) ; } catch ( class not found exception ex ) { throw new cannot load bean class exception ( resource description , bean name , class name , ex ) ; } catch ( linkage error err ) { throw new cannot load bean class exception ( resource description , bean name , class name , err ) ; } }


assert the response status code is { @ code http status not extended } ( 510 )

public result matcher is not extended ( ) { return matcher ( http status not extended ) ; }


delete user { username } : delete user this can only be done by the logged in user

response entity < void > delete user ( @ api param ( value = " the name that needs to be deleted " , required = true ) @ path variable ( " username " ) string username ) ;


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


atomically creates a new directory somewhere beneath the system ' s temporary directory ( as defined by the { @ code java io tmpdir } system property ) , and returns its name use this method instead of { @ link file # create temp file ( string , string ) } when you wish to create a directory , not a regular file a common pitfall is to call { @ code create temp file } , delete the file and create a directory in its place , but this leads a race condition which can be exploited to create security vulnerabilities , especially when executable files are to be written into the directory depending on the environmment that this code is run in , the system temporary directory ( and thus the directory this method creates ) may be more visible that a program would like - files written to this directory may be read or overwritten by hostile programs running on the same machine this method assumes that the temporary volume is writable , has free inodes and free blocks , and that it will not be called thousands of times per second < b > { @ link java nio file path } equivalent : < b > { @ link java nio file files # create temp directory }

public static file create temp dir ( ) { file base dir = new file ( system get property ( " java io tmpdir " ) ) ; @ suppress warnings ( " good time " ) / / reading system time without time source string base name = system current time millis ( ) + " - " ; for ( int counter = 0 ; counter < temp dir attempts ; counter + + ) { file temp dir = new file ( base dir , base name + counter ) ; if ( temp dir mkdir ( ) ) { return temp dir ; } } throw new illegal state exception ( " failed to create directory within " + temp dir attempts + " attempts ( tried " + base name + " 0 to " + base name + ( temp dir attempts - 1 ) + ' ) ' ) ; }


get the defaultassumed stack depth change for this language

private static int get default stack depth change ( program depth program , int depth ) { prototype model default model = depth program get compiler spec ( ) get default calling convention ( ) ; int call stack mod = default model get extrapop ( ) ; int call stack shift = default model get stackshift ( ) ; if ( call stack mod ! = prototype model unknown extrapop & & call stack shift > = 0 ) { return call stack shift - call stack mod ; } return depth ; }


public long get next pointer ( ) { return internals get next pointer ( ) ; }


configure the default { @ code mime type } for payload data if the { @ code setup } frame did not specify one by default this is set to { @ code " messagex rsocket composite - metadata v 0 " }

public void set default metadata mime type ( mime type mime type ) { assert not null ( mime type , " ' metadata mime type ' is required " ) ; this default metadata mime type = mime type ; }


sets the encapsulated value to another value

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


show the toast for a short period of time

public final void show ( @ string res final int res id ) { show ( utils bridge get string ( res id ) , get duration ( ) , this ) ; }


public float first ( ) { if ( size = = 0 ) throw new illegal state exception ( " array is empty " ) ; return items [ 0 ] ; }


checks to see if this abbreviation has any die children

public boolean has children ( ) { return this has children ; }


handle the block exception and provide fallback result

result handle ( invoker < ? > invoker , invocation invocation , block exception ex ) ;


returns a name from the name table pertaining to the byte - offset in the block of names for the table

public string get name string from offset ( int offset ) { if ( names by offset = = null ) { return null ; } return names by offset get ( offset ) ; }


public void read instance ( string base 6 4 string ) throws i o exception { byte [ ] bytes = base 6 4 decode base 6 4 ( base 6 4 string ) ; message msg = get builder ( ) merge from ( bytes ) build ( ) ; this proto = ( p ) msg ; }


returns the { @ link tool bar data } to be used to put this action in a toolbar the tool bar data will be null if the action in not set to be in a toolbar

public tool bar data get tool bar data ( ) ;


from an s3 bucket name , build an arn to refer to it

public static list < statement > allow s 3 operations ( string bucket , boolean write ) { / / add the bucket operations for the specific bucket arn array list < statement > statements = lists new array list ( statement ( true , bucket to arn ( bucket ) , s3 get bucket location , s3 bucket all list ) ) ; / / then add the statements for objects in the buckets if ( write ) { statements add ( statement ( true , bucket objects to arn ( bucket ) , s3 root rw operations ) ) ; } else { statements add ( statement ( true , bucket objects to arn ( bucket ) , s3 root read operations list ) ) ; } return statements ; }


test to verify that resource requests recovery back to the right app - attempt after a container gets killed at acquired state : yarn - 4502

public void test resource request recovery to the right app attempt ( ) throws exception { yarn configuration conf = get conf ( ) ; mock r m rm = new mock r m ( conf ) ; try { rm start ( ) ; mock r m app submission data data = mock r m app submission data builder create with memory ( 200 , rm ) with app name ( " name " ) with user ( " user " ) with acls ( new hash map < application access type , string > ( ) ) with unmanaged a m ( false ) with queue ( " default " ) with max app attempts ( - 1 ) with credentials ( null ) with app type ( " test " ) with wait for app accepted state ( false ) with keep containers ( true ) build ( ) ; r m app rm app = mock r m app submitter submit ( rm , data ) ; mock n m node = new mock n m ( " 127 0 0 1 : 1234 " , 10240 , rm get resource tracker service ( ) ) ; node register node ( ) ; mock a m am 1 = mock r m launch and register a m ( rm app , rm , node ) ; application attempt id application attempt one i d = am 1 get application attempt id ( ) ; container id am 1 container i d = container id new container id ( application attempt one i d , 1 ) ; / / allocate num containers containers am 1 allocate ( " 127 0 0 1 " , 1024 , 1 , new array list < container id > ( ) ) ; node node heartbeat ( true ) ; / / wait for containers to be allocated list < container > containers = am 1 allocate ( new array list < resource request > ( ) , new array list < container id > ( ) ) get allocated containers ( ) ; while ( containers size ( ) ! = 1 ) { node node heartbeat ( true ) ; containers add all ( am 1 allocate ( new array list < resource request > ( ) , new array list < container id > ( ) ) get allocated containers ( ) ) ; thread sleep ( 200 ) ; } / / launch a 2nd container , for testing running - containers transfer node node heartbeat ( application attempt one i d , 2 , container state running ) ; container id running container i d = container id new container id ( application attempt one i d , 2 ) ; rm wait for state ( node , running container i d , r m container state running ) ; / / 3rd container is in allocated state int allocated container priority = 1047 ; am 1 allocate ( " 127 0 0 1 " , 1024 , 1 , allocated container priority , new array list < container id > ( ) , null ) ; node node heartbeat ( true ) ; container id allocated container i d = container id new container id ( application attempt one i d , 3 ) ; rm wait for state ( node , allocated container i d , r m container state allocated ) ; r m container allocated container = rm get resource scheduler ( ) get r m container ( allocated container i d ) ; / / capture scheduler app - attempt before am crash scheduler application attempt first scheduler app attempt = ( ( abstract yarn scheduler < scheduler application attempt , scheduler node > ) rm get resource scheduler ( ) ) get application attempt ( application attempt one i d ) ; / / am crashes , and a new app - attempt gets created node node heartbeat ( application attempt one i d , 1 , container state complete ) ; rm drain events ( ) ; r m app attempt rm app attempt 2 = mock r m wait for attempt scheduled ( rm app , rm ) ; application attempt id application attempt two i d = rm app attempt 2 get app attempt id ( ) ; assert assert equals ( 2 , application attempt two i d get attempt id ( ) ) ; / / all outstanding allocated containers will be killed ( irrespective of / / keep - alive of container across app - attempts ) assert assert equals ( r m container state killed , allocated container get state ( ) ) ; / / the core part of this test / / the killed containers ' resource requests are recovered back to the / / original app - attempt , not the new one for ( scheduler request key key : first scheduler app attempt get scheduler keys ( ) ) { if ( key get priority ( ) get priority ( ) = = 0 ) { assert assert equals ( 0 , first scheduler app attempt get outstanding asks count ( key ) ) ; } else if ( key get priority ( ) get priority ( ) = = allocated container priority ) { assert assert equals ( 1 , first scheduler app attempt get outstanding asks count ( key ) ) ; } } / / also , only one running container should be transferred after am / / launches mock r m launch a m ( rm app , rm , node ) ; list < container > transferred containers = rm get resource scheduler ( ) get transferred containers ( application attempt two i d ) ; assert assert equals ( 1 , transferred containers size ( ) ) ; assert assert equals ( running container i d , transferred containers get ( 0 ) get id ( ) ) ; } finally { rm stop ( ) ; } }


public boolean get bool item ( ) { return bool item ; }


parse the maximum heap size from the java opts as specified by the - xmx option format : - xmx & lt ; size & gt ; [ g | g | m | m | k | k ]

public static int parse maximum heap size m b ( string java opts ) { / / find the last matching - xmx following word boundaries matcher m = java opts xmx pattern matcher ( java opts ) ; if ( m matches ( ) ) { long size = long parse long ( m group ( 1 ) ) ; if ( size < = 0 ) { return - 1 ; } if ( m group ( 2 ) is empty ( ) ) { / / - xmx specified in bytes return ( int ) ( size / ( 1024 * 1024 ) ) ; } char unit = m group ( 2 ) char at ( 0 ) ; switch ( unit ) { case ' g ' : case ' g ' : / / - xmx specified in gb return ( int ) ( size * 1024 ) ; case ' m ' : case ' m ' : / / - xmx specified in mb return ( int ) size ; case ' k ' : case ' k ' : / / - xmx specified in kb return ( int ) ( size / 1024 ) ; } } / / - xmx not specified return - 1 ; }


metrics can define a size of the search hits windows they want to retrieve by overwriting this method the default implementation returns an empty optional

default optional int forced search size ( ) { return optional int empty ( ) ; }


applies an aggregation that gives the maximum element of every window of the data stream by the given position if more elements have the same maximum value the operator returns the first by default

public single output stream operator < t > max by ( int position to max by ) { return this max by ( position to max by , true ) ; }


public boolean get ignore unlabeled ( ) { return ignore unlabeled ; }


return the name of the methodconstructor parameter

public string get parameter name ( ) { if ( this parameter index < 0 ) { return null ; } parameter name discoverer discoverer = this parameter name discoverer ; if ( discoverer ! = null ) { string [ ] parameter names = null ; if ( this executable instanceof method ) { parameter names = discoverer get parameter names ( ( method ) this executable ) ; } else if ( this executable instanceof constructor ) { parameter names = discoverer get parameter names ( ( constructor < ? > ) this executable ) ; } if ( parameter names ! = null ) { this parameter name = parameter names [ this parameter index ] ; } this parameter name discoverer = null ; } return this parameter name ; }


public constant get or null ( int n ) { try { return entries [ n ] ; } catch ( index out of bounds exception ex ) { / / translate the exception return throw invalid ( n ) ; } }


return the precedence of the given property source , { @ code - 1 } if not found

public int precedence of ( property source < ? > property source ) { return this property source list index of ( property source ) ; }


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

@ override public t visit builtin date time function ( sql base parser builtin date time function context ctx ) { return visit children ( ctx ) ; }


public void delete pet test ( ) { long pet id = null ; string api key = null ; api delete pet ( pet id , api key ) ; / / todo : test validations }


a variant of { @ link # set allowed origins ( collection ) } that accepts flexible domain patterns , e g { @ code " https : domain 1 com " } furthermore it always sets the { @ code access - control - allow - origin } response header to the matched origin and never to { @ code " " } , nor to any other pattern

public void set allowed origin patterns ( collection < string > allowed origin patterns ) { assert not null ( allowed origin patterns , " allowed origin patterns collection must not be null " ) ; this cors configuration set allowed origin patterns ( new array list < > ( allowed origin patterns ) ) ; }


extract some value of the type supported by the interface ( i e , by a concrete , non - generic implementation of the interface )

public static < t > t extract value from ( my interface type < t > my interface type ) { return null ; }


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


called when the timeline of a media item has changed and a new timeline that reflects the current playlist state needs to be created by calling { @ link # create timeline ( ) } called on the playback thread


{ @ link build config # version code } may not be the actual version due to abi split code adding a postfix after build config is generated however , in most cases you want to use { @ link build config # canonical version code } via { @ link # get canonical version code ( ) }

public static int get manifest apk version ( context context ) { try { return context get package manager ( ) get package info ( context get package name ( ) , 0 ) version code ; } catch ( package manager name not found exception e ) { throw new assertion error ( e ) ; } }


private static font get widget font ( ) { final graphics environment e = graphics environment get local graphics environment ( ) ; final font [ ] fonts = e get all fonts ( ) ; for ( final font font : fonts ) { if ( objects equals ( font get font name ( ) , m t ui utils material font ) ) { final map < text attribute , object > attributes = new hash map < > ( 10 ) ; attributes put ( text attribute weight , text attribute weight bold ) ; attributes put ( text attribute size , jbui scale ( default font size ) ) ; return font derive font ( attributes ) ; } } return jbui fonts create ( font dialog , 12 ) ; }


get a reference to the atomic instance providing the value for a specific maximum this is useful if the value is passed around

public atomic long get maximum reference ( string key ) { return lookup ( maximum map , key ) ; }


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


a factory of path package locators from a list of path elements elements may contain " % workspace % " , indicating the workspace if any of the paths given do not exist , an exception will be thrown

public static path package locator create ( path output base , list < string > path elements , event handler event handler , path workspace , path client working directory , list < build file name > build files by priority ) { return create internal ( output base , path elements , event handler , workspace , client working directory , build files by priority , true ) ; }


throw { @ code out of memory error } inside thread and check { @ code yarn uncaught exception handler } instance used { @ code exit util } class to avoid jvm exit through { @ code runtime get runtime ( ) halt ( - 1 ) }

public void test uncaught exception handler with out of memory error ( ) throws interrupted exception { exit util disable system halt ( ) ; final yarn uncaught exception handler spy oom handler = spy ( ex handler ) ; final out of memory error oom error = new out of memory error ( " out - of - memory - error " ) ; final thread oom thread = new thread ( new runnable ( ) { @ override public void run ( ) { throw oom error ; } } ) ; oom thread set uncaught exception handler ( spy oom handler ) ; assert same ( spy oom handler , oom thread get uncaught exception handler ( ) ) ; oom thread start ( ) ; oom thread join ( ) ; verify ( spy oom handler ) uncaught exception ( oom thread , oom error ) ; }


rejects the pending slot request by failing the request future with a { @ link slot allocation exception }

private void reject pending slot request ( pending slot request pending slot request , exception cause ) { completable future < acknowledge > request = pending slot request get request future ( ) ; if ( null ! = request ) { request complete exceptionally ( new slot allocation exception ( cause ) ) ; } else { log debug ( " cannot reject pending slot request { } , since no request has been sent " , pending slot request get allocation id ( ) ) ; } }


create physical directory for block pools on the data node

public void make block pool dir ( string block pool i d , configuration conf ) throws i o exception { if ( conf = = null ) { conf = new hdfs configuration ( ) ; } if ( storage type = = storage type provided ) { / / skip creation if the storage type is provided storage log info ( " skipping creating directory for block pool " + block pool i d + " for provided storage location " + this ) ; return ; } local file system local f s = file system get local ( conf ) ; fs permission permission = new fs permission ( conf get ( d f s config keys dfs datanode data dir permission key , d f s config keys dfs datanode data dir permission default ) ) ; file data = new file ( get bp u r i ( block pool i d , storage storage dir current ) ) ; try { disk checker check dir ( local f s , new path ( data to u r i ( ) ) , permission ) ; } catch ( i o exception e ) { data storage log warn ( " invalid directory in : " + data get canonical path ( ) + " : " + e get message ( ) ) ; } }


public final double get ( ) { return long bits to double ( value ) ; }


static hystrix dynamic properties create archaius dynamic properties ( ) { if ( is archaius v 1 available ( ) ) { load cascaded properties from resources ( " hystrix - plugins " ) ; try { class < ? > default properties = class for name ( " com netflix hystrix strategy properties archaius " + " hystrix dynamic properties archaius " ) ; return ( hystrix dynamic properties ) default properties new instance ( ) ; } catch ( class not found exception e ) { throw new runtime exception ( e ) ; } catch ( instantiation exception e ) { throw new runtime exception ( e ) ; } catch ( illegal access exception e ) { throw new runtime exception ( e ) ; } } / / fallback to system properties return null ; }


public string get response body ( ) { return response body ; }


public j s o n writer array end ( ) throws i o exception { m writer write ( json rsquare ) ; m state = m stack pop ( ) ; return this ; }


public void write ( short [ ] data ) { for ( short unit : data ) { write ( unit ) ; } }


initialize the output stream for logging , opening the first log segment

synchronized void open for write ( int layout version ) throws i o exception { preconditions check state ( state = = state between log segments , " bad state : % s " , state ) ; long segment tx id = get last written tx id ( ) + 1 ; / / safety check : we should never start a segment if there are / / newer txids readable list < edit log input stream > streams = new array list < edit log input stream > ( ) ; journal set select input streams ( streams , segment tx id , true , false ) ; if ( ! streams is empty ( ) ) { string error = string format ( " cannot start writing at txid % s " + " when there is a stream available for read : % s " , segment tx id , streams get ( 0 ) ) ; i o utils cleanup with logger ( log , streams to array ( new edit log input stream [ 0 ] ) ) ; throw new illegal state exception ( error ) ; } start log segment and write header txn ( segment tx id , layout version ) ; assert state = = state in segment : " bad state : " + 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 " ) ; }


verify the snapshot formatter by running it on a known file

public void test snapshot formatter ( ) throws exception { file snap dir = new file ( test data , " invalidsnap " ) ; file snapfile = new file ( new file ( snap dir , " version - 2 " ) , " snapshot 272 " ) ; string [ ] args = { snapfile get canonical file ( ) to string ( ) } ; snapshot formatter main ( args ) ; }


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


return the set of active profiles as explicitly set through { @ link # set active profiles } or if the current set of active profiles is empty , check for the presence of the { @ value # active profiles property name } property and assign its value to the set of active profiles

protected set < string > do get active profiles ( ) { synchronized ( this active profiles ) { if ( this active profiles is empty ( ) ) { string profiles = get property ( active profiles property name ) ; if ( string utils has text ( profiles ) ) { set active profiles ( string utils comma delimited list to string array ( string utils trim all whitespace ( profiles ) ) ) ; } } return this active profiles ; } }


public api gateway response builder status code ( integer status code ) { this status code = status code ; return this ; }


blocks the calling thread , waiting for the task to vanish from the task manager

public void wait for task completion ( task task , long until in nanos ) { while ( system nano time ( ) - until in nanos < 0 ) { if ( get task ( task get id ( ) ) = = null ) { return ; } try { thread sleep ( wait for completion poll millis ( ) ) ; } catch ( interrupted exception e ) { throw new elasticsearch exception ( " interrupted waiting for completion of [ { } ] " , e , task ) ; } } throw new elasticsearch timeout exception ( " timed out waiting for completion of [ { } ] " , task ) ; }


public void clear patterns ( ) { patterns clear ( ) ; }


add rename record to edit log the destination should be the file name , not the destination directory

void log rename ( string src , string dst , long timestamp , boolean to log rpc ids , options rename options ) { rename op op = rename op get instance ( cache get ( ) ) set source ( src ) set destination ( dst ) set timestamp ( timestamp ) set options ( options ) ; log rpc ids ( op , to log rpc ids ) ; log edit ( op ) ; }


creates a new accumulator with the given initial value


set the list of java classes to be recognized by a newly created j a x b context setting either this property , { @ link # set context path " context path " } or { @ link # set packages to scan " packages to scan " } is required

public void set classes to be bound ( @ nullable class < ? > classes to be bound ) { this classes to be bound = classes to be bound ; }


creates a proxy object that executes the callee in the context that impersonates this executor useful to export an object to a remote channel

public < t > t new impersonating proxy ( class < t > type , t core ) { return new intercepting proxy ( ) { protected object call ( object o , method m , object [ ] args ) throws throwable { final executor old = impersonation get ( ) ; impersonation set ( executor this ) ; try { return m invoke ( o , args ) ; } finally { impersonation set ( old ) ; } } } wrap ( type , core ) ; }


private < t > int fast max ( t [ ] items , comparator < t > comp , int size ) { int highest idx = 0 ; for ( int i = 1 ; i < size ; i + + ) { int comparison = comp compare ( items [ i ] , items [ highest idx ] ) ; if ( comparison > 0 ) { highest idx = i ; } } return highest idx ; }


creates a { @ link x 5 0 9 extended trust manager } based on the trust material in the provided { @ link key store }

public static x 5 0 9 extended trust manager trust manager ( key store key store , string algorithm ) throws no such algorithm exception , key store exception { trust manager factory tmf = trust manager factory get instance ( algorithm ) ; tmf init ( key store ) ; trust manager [ ] trust managers = tmf get trust managers ( ) ; for ( trust manager trust manager : trust managers ) { if ( trust manager instanceof x 5 0 9 extended trust manager ) { return ( x 5 0 9 extended trust manager ) trust manager ; } } throw new illegal state exception ( " failed to find a x 5 0 9 extended trust manager " ) ; }


static long long multiplication ( final long long r , final long a , final long b ) { / * final long x 0 = a & lower mask ; final long x 1 = ( a & upper mask ) > > mid ; final long y 0 = b & lower mask ; final long y 1 = ( b & upper mask ) > > mid ; final long t = ( x 0 + x 1 ) * ( y 0 + y 1 ) ; final long u = ( x 0 - x 1 ) * ( y 0 - y 1 ) ; final long v = x 1 * y 1 ; final long tmp = ( t - u ) > > > 1 ; result d 0 = ( ( t + u ) > > > 1 ) - v + ( ( tmp < < mid ) & full mask ) ; ; result d 1 = v + ( tmp > > mid ) ; return result ; * / final long a lower = a & lower mask ; final long a upper = ( a & upper mask ) > > mid ; final long b lower = b & lower mask ; final long b upper = ( b & upper mask ) > > mid ; final long tmp = a lower * b upper + a upper * b lower ; r d 0 = a lower * b lower + ( ( tmp < < mid ) & full mask ) ; r d 1 = a upper * b upper + ( tmp > > mid ) ; return r ; }


moves the program location to the given address and returns the instruction at that location

private instruction change location to address ( string address string ) throws exception { code browser plugin cbp = env get plugin ( code browser plugin class ) ; final address address = program get address factory ( ) get address ( address string ) ; final go to service go to service = tool get service ( go to service class ) ; run swing ( ( ) - > go to service go to ( new address field location ( program , address ) ) ) ; wait for posted swing runnables ( ) ; cbp update now ( ) ; listing action context context = ( listing action context ) cbp get provider ( ) get action context ( null ) ; return ( instruction ) invoke instance method ( " get instruction for context " , plugin , new class [ ] { listing action context class } , new object [ ] { context } ) ; }


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


sets the text size based on { @ link captioning manager # get font scale ( ) } if { @ link captioning manager } is available and enabled otherwise ( and always before api level 19 ) uses a default font scale of 1 0

public void set user default text size ( ) { set fractional text size ( default text size fraction * get user caption font scale ( ) ) ; }


public offset date time get date time ( ) { return date time ; }


return the request attribute value if present

default optional < object > attribute ( string name ) { return optional of nullable ( attributes ( ) get ( name ) ) ; }


public void test get local host ( ) { assert that ( net util get local host ( ) ) is not null ( ) ; }


set the view class that should be used to create views

public void set view class ( @ nullable class < ? > view class ) { if ( view class ! = null & & ! required view class ( ) is assignable from ( view class ) ) { string name = view class get name ( ) ; throw new illegal argument exception ( " given view class [ " + name + " ] " + " is not of type [ " + required view class ( ) get name ( ) + " ] " ) ; } this view class = view class ; }


assert there is arecord in the store , then return it

private path metadata verify record ( metadata store ms , string path ) throws i o exception { final path metadata md = lookup ( ms , path ) ; assertions assert that ( md ) described as ( " metastore entry for % s " , path ) is not null ( ) ; return md ; }


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

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


returns a { @ link scheduler } to restart the service when requirements allowing downloads to take place are met if { @ code null } , the service will only be restarted if the process is still in memory when the requirements are met this method is not called for services whose { @ code foreground notification id } is set to { @ link # foreground notification id none } such services will only be restarted if the process is still in memory and considered non - idle , meaning that it ' s either in the foreground or was backgrounded within the last few minutes

protected abstract scheduler get scheduler ( ) ;


adds an element considering the values in the same order as the current channels in the array the n th value must have the same type and stride of the given channel at position n

public void add element ( object values ) { / * fixme make it grow * / if ( size = = capacity ) throw new gdx runtime exception ( " capacity reached , cannot add other elements " ) ; int k = 0 ; for ( channel stride array : arrays ) { stride array add ( k , values ) ; k + = stride array stride size ; } + + size ; }


consumes a snapshot and makes sure that its operations have all seqno between min seq no ( inclusive ) and max seq no ( inclusive )

public static matcher < translog snapshot > contains seq no range ( long min seq no , long max seq no ) { return new containing seq no range matcher ( min seq no , max seq no ) ; }


returns the name of this service { @ link abstract idle service } may include the name in debugging output

protected string service name ( ) { return get class ( ) get simple name ( ) ; }


currently , this method is mainly customized to facilitate the thread model on consumer side 1 use threadless executor , aka , delegate callback directly to the thread initiating the call 2 use shared executor to execute the callback

public executor service get preferred executor service ( object msg ) { if ( msg instanceof response ) { response response = ( response ) msg ; default future response future = default future get future ( response get id ( ) ) ; / / a typical scenario is the response returned after timeout , the timeout response may has completed the future if ( response future = = null ) { return get shared executor service ( ) ; } else { executor service executor = response future get executor ( ) ; if ( executor = = null | | executor is shutdown ( ) ) { executor = get shared executor service ( ) ; } return executor ; } } else { return get shared executor service ( ) ; } }


tests that the initial job registration registers a timeout which will call { @ link job leader id actions # notify job timeout ( job i d , uuid ) } when executed

public void test initial job timeout ( ) throws exception { final job i d job id = new job i d ( ) ; testing high availability services high availability services = new testing high availability services ( ) ; settable leader retrieval service leader retrieval service = new settable leader retrieval service ( null , null ) ; high availability services set job master leader retriever ( job id , leader retrieval service ) ; scheduled executor scheduled executor = mock ( scheduled executor class ) ; time timeout = time milliseconds ( 5000l ) ; job leader id actions job leader id actions = mock ( job leader id actions class ) ; job leader id service job leader id service = new job leader id service ( high availability services , scheduled executor , timeout ) ; job leader id service start ( job leader id actions ) ; job leader id service add job ( job id ) ; assert true ( job leader id service contains job ( job id ) ) ; argument captor < runnable > runnable argument captor = argument captor for class ( runnable class ) ; verify ( scheduled executor ) schedule ( runnable argument captor capture ( ) , any long ( ) , any ( time unit class ) ) ; runnable timeout runnable = runnable argument captor get value ( ) ; timeout runnable run ( ) ; argument captor < uuid > timeout id argument captor = argument captor for class ( uuid class ) ; verify ( job leader id actions , times ( 1 ) ) notify job timeout ( eq ( job id ) , timeout id argument captor capture ( ) ) ; assert true ( job leader id service is valid timeout ( job id , timeout id argument captor get value ( ) ) ) ; }


returns the type of the nal unit in { @ code data } that starts at { @ code offset }

public static int get nal unit type ( byte [ ] data , int offset ) { return data [ offset + 3 ] & 0x 1 f ; }


method that gets the local dirs path handler for this auxiliary service

public auxiliary local path handler get auxiliary local path handler ( ) { return this auxiliary local path handler ; }


returns the incompatible dependencies that caused this provider to be present this may be null if it is null , then { @ code get constraints responsible for incompatibility ( ) } is guaranteed to be non - null it will have at least one element in it if it is not null

public abstract immutable list < configured target > targets responsible for incompatibility ( ) ;


variant of { @ link # multipart data ( multi value map ) } that does the same but only for a subset of the actual values

public request matcher multipart data contains ( map < string , ? > expected map ) { multi value map < string , object > map = new linked multi value map < > ( expected map size ( ) ) ; expected map for each ( map : : add ) ; return multipart data ( map , false ) ; }


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


determine preferred constructors to use for default construction , if any constructor arguments will be autowired if necessary

public constructor < ? > [ ] get preferred constructors ( ) { return null ; }


finds the result type of a decimal addition operation

public static decimal type find addition decimal type ( int precision 1 , int scale 1 , int precision 2 , int scale 2 ) { / / adopted from calcite final int scale = math max ( scale 1 , scale 2 ) ; int precision = math max ( precision 1 - scale 1 , precision 2 - scale 2 ) + scale + 1 ; precision = math min ( precision , decimal type max precision ) ; return new decimal type ( false , precision , scale ) ; }


should the contents of the directory be shown or just the directory ?

boolean is dir recurse ( ) { return this dir recurse ; }


backward compatible license type parsing for older license models

public static license type resolve ( license license ) { if ( license version = = version start ) { / / in 1 x : the acceptable values for ' subscription type ' : none | dev | silver | gold | platinum return resolve ( license subscription type ) ; } else { / / in 2 x : the acceptable values for ' type ' : trial | basic | silver | dev | gold | platinum / / in 5 x : the acceptable values for ' type ' : trial | basic | standard | dev | gold | platinum / / in 6 x : the acceptable values for ' type ' : trial | basic | standard | dev | gold | platinum / / in 7 x : the acceptable values for ' type ' : trial | basic | standard | dev | gold | platinum | enterprise return resolve ( license type ) ; } }


test that replication of under - replicated blocks is detected and basically works

public void test basic replication ( ) throws exception { add nodes ( nodes ) ; for ( int i = 0 ; i < num test iters ; i + + ) { do basic test ( i ) ; } }


permanently close the real ( underlying ) connection ( eat any exception )

void close connection ( final pool entry pool entry , final string closure reason ) { if ( connection bag remove ( pool entry ) ) { final connection connection = pool entry close ( ) ; close connection executor execute ( ( ) - > { quietly close connection ( connection , closure reason ) ; if ( pool state = = pool normal ) { fill pool ( ) ; } } ) ; } }


extract the login details from a uri , logging a warning if the uri contains these

public static login extract login details with warnings ( final uri name ) { login login = extract login details ( name ) ; if ( login has login ( ) ) { log warn ( login warning ) ; } return login ; }


if the next token is a { @ linkplain token # name property name } that ' s in { @ code options } , this consumes it and returns its index otherwise this returns - 1 and no name is consumed

public abstract int select name ( options options ) throws i o exception ;


create a single input file in the input directory

private void create input file ( path dir path , int id , int num records ) throws i o exception { final string message = " this is a line in a file : " ; path file path = new path ( dir path , " " + id ) ; configuration conf = new configuration ( ) ; file system fs = file system get local ( conf ) ; output stream os = fs create ( file path ) ; buffered writer w = new buffered writer ( new output stream writer ( os ) ) ; for ( int i = 0 ; i < num records ; i + + ) { w write ( message + id + " " + i + " \ n " ) ; } w close ( ) ; }


this method marks the task as failed , but will make no attempt to remove task execution from the task manager it is intended for cases where the task is known not to be running , or then the task manager reports failure ( in which case it has already removed the task )

void mark failed ( throwable t ) { process fail ( t , false ) ; }


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 : / / fields return fields ; case 2 : / / shuffle return shuffle ; case 3 : / / all return all ; case 4 : / / none return none ; case 5 : / / direct return direct ; case 6 : / / custom object return custom object ; case 7 : / / custom serialized return custom serialized ; case 8 : / / local or shuffle return local or shuffle ; default : return null ; } }


set the encoding to use for requests this encoding will be passed into a { @ link javax servlet http http servlet request # set character encoding } call whether this encoding will override existing request encodings ( and whether it will be applied as default response encoding as well ) depends on the { @ link # set force encoding " force encoding " } flag

public void set encoding ( @ nullable string encoding ) { this encoding = encoding ; }


public void property class test ( ) { / / todo : test property class }


when set to { @ code false } , use thread - local { @ link script engine } instances instead of one single shared instance this flag should be set to { @ code false } for those using non thread - safe script engines with templating libraries not designed for concurrency , like handlebars or react running on nashorn for example when this flag is set to { @ code false } , the script engine must be specified using { @ link # set engine name ( string ) } or { @ link # set engine supplier ( supplier ) } using { @ link # set engine ( script engine ) } is not possible because multiple instances of the script engine need to be created lazily ( one per thread )

public void set shared engine ( @ nullable boolean shared engine ) { this shared engine = shared engine ; }


returns the expected number of distinct elements given the specified elements the number of distinct elements is only computed if { @ code elements } is an instance of { @ code multiset } ; otherwise the default value of 11 is returned

static int infer distinct elements ( iterable < ? > elements ) { if ( elements instanceof multiset ) { return ( ( multiset < ? > ) elements ) element set ( ) size ( ) ; } return 11 ; / / initial capacity will be rounded up to 16 }


gets a unique name in the indicated namespace by appending an integer number if necessary and ignoring any conflicts with existing parameters

private static string get unique name ignoring current parameters ( symbol table symbol table , namespace namespace , string base name , set < string > names not to be used ) { string name = base name ; if ( name ! = null ) { / / establish unique name int cnt = 0 ; list < symbol > symbols = symbol table get symbols ( name , namespace ) ; while ( ! symbols is empty ( ) ) { if ( names not to be used contains ( name ) ) { continue ; } if ( are all paramaters ( symbols ) ) { return name ; } name = base name + " " + ( + + cnt ) ; symbols = symbol table get symbols ( name , namespace ) ; } } return name ; }


returns the currently assigned node , or { @ code null } if the shard is unassigned

public discovery node get current node ( ) { return current node ; }


set the current page number page numbering starts with 0

public void set page ( int page ) { this page = page ; this new page set = true ; }


set the misfire instruction via the name of the corresponding constant in the { @ link org quartz cron trigger } class default is { @ code misfire instruction smart policy }

public void set misfire instruction name ( string constant name ) { this misfire instruction = constants as number ( constant name ) int value ( ) ; }


tests that struct definitions ( ref ' d via a pointer ) overwrite a previous empty decl only die cu1 : ptr = > struct 1 { empty } cu2 : ptr - > struct 1 { field 1 } this is necessary because data type equiv checking doesn ' t traverse pointers and the resolve logic in the data type manager was choosing the existing ptr data type instance which pointed to the empty struct instead of descending into what the pointer pointed to and comparing the contents of the struct to determine equiv the fix isn ' t to change the resolve logic or equiv logic , but to ensure that the direct struct datatype die is also submitted to the dtm to be resolved , instead of relying on the result that came out of the dtm when resolving the ptr die

public void test struct decl via ptr ( ) throws cancelled exception , i o exception , d w a r f exception { / / cu1 add fwd ptr ( cu , 1 ) ; / / points to the die created in the next line even though it doesn ' t exist yet new decl struct ( " mystruct " ) create ( cu ) ; / / cu2 debug info entry int d i e = add int ( cu 2 ) ; debug info entry float d i e = add float ( cu 2 ) ; add fwd ptr ( cu 2 , 1 ) ; / / fwd points to struct d i e even though it doesn ' t exist yet debug info entry struct d i e = new struct ( " mystruct " , 100 ) create ( cu 2 ) ; new member ( struct d i e , " f 1 " , int d i e , 0 ) create ( cu 2 ) ; new member ( struct d i e , " f 2 " , float d i e , 10 ) create ( cu 2 ) ; import all data types ( ) ; data type structdt = data mgr get data type ( root c p , " mystruct " ) ; assert equals ( 100 , structdt get length ( ) ) ; }


create a { @ link connection builder } for the given uri the default implementation creates a builder with the configured { @ link # get xnio worker ( ) xnio worker } and { @ link # get byte buffer pool ( ) byte buffer pool } and then passes it to the { @ link # get connection builder consumer ( ) consumer } provided at construction time

protected connection builder create connection builder ( uri url ) { connection builder builder = io undertow websockets client web socket client connection builder ( get xnio worker ( ) , get byte buffer pool ( ) , url ) ; this builder consumer accept ( builder ) ; return builder ; }


returns the null value singleton instance

public static null value get instance ( ) { return instance ; }


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

public boolean is set id ( ) { return org apache thrift encoding utils test bit ( isset bitfield , id isset id ) ; }


connectivity state is changed to the specified value will trigger some notifications that have been registered earlier by { @ link managed channel # notify when state changed }

void goto state ( @ nonnull connectivity state new state ) { check not null ( new state , " new state " ) ; if ( state ! = new state & & state ! = connectivity state shutdown ) { state = new state ; if ( listeners is empty ( ) ) { return ; } / / swap out callback list before calling them , because a callback may register new callbacks , / / if run in direct executor , can cause concurrent modification exception array list < listener > saved listeners = listeners ; listeners = new array list < > ( ) ; for ( listener listener : saved listeners ) { listener run in executor ( ) ; } } }


returns archives arising from j 2objc transpilation after dead code removal

private iterable < artifact > compute and strip pruned j 2 objc archives ( j 2 objc entry class provider j 2 objc entry class provider , j 2 objc mapping file provider j 2 objc mapping file provider , objc provider objc provider ) { iterable < artifact > pruned j 2 objc archives = immutable list < artifact > of ( ) ; if ( strip j 2 objc dead code ( j 2 objc entry class provider ) ) { register j 2 objc dead code removal actions ( objc provider , j 2 objc mapping file provider , j 2 objc entry class provider ) ; pruned j 2 objc archives = j 2objc pruned libraries ( objc provider ) ; } return pruned j 2 objc archives ; }


public static void connect ( string path , route route , response transformer transformer ) { get instance ( ) connect ( path , route , transformer ) ; }


converts a relative virtual address ( rva ) into a pointer

public int rva to pointer ( int rva ) { return ( int ) rva to pointer ( rva & conv int mask ) ; }


model tests for additional properties object

public void test additional properties object ( ) { / / todo : test additional properties object }


called during setup for this class to register its options with the given { @ link options } object

public void register options ( options options ) ;


returns " this " instance if the request matches all param expressions ; or { @ code null } otherwise

public params request condition get matching condition ( http servlet request request ) { for ( param expression expression : this expressions ) { if ( ! expression match ( request ) ) { return null ; } } return this ; }


< code > optional int 3 2 blah = 1 ; < code >


set a global default to use as the item spacing for all carousels set to 0 for no item spacing

public static void set default item spacing dp ( @ dimension ( unit = dimension dp ) int dp ) { default spacing between items dp = dp ; }


creates a first admin user account this can be run by anyone , but only to create the very first user account

public void do create first account ( stapler request req , stapler response rsp ) throws i o exception , servlet exception { if ( has some user ( ) ) { rsp send error ( sc unauthorized , " first user was already created " ) ; return ; } user u = create account ( req , rsp , false , " first user jelly " ) ; if ( u ! = null ) { try to make admin ( u ) ; login and take back ( req , rsp , u ) ; } }


add a " stale - if - error " directive this directive indicates that when an error is encountered , a cached stale response may be used to satisfy the request , regardless of other freshness information

public cache control stale if error ( duration stale if error ) { this stale if error = stale if error ; return this ; }


the attributes of this element < code > repeated aapt pb xml attribute attribute = 4 ; < code >

public builder add attribute ( com android aapt resources xml attribute value ) { copy on write ( ) ; instance add attribute ( value ) ; return this ; }


returns an array of all edges with the given vertex as both the from and to

public edge [ ] self edges ( vertex v ) { int n = num loops ( v ) ; edge [ ] answer = new edge [ n ] ; edge e = vertices get first outgoing edge ( v ) ; int i = 0 ; while ( e ! = null ) { if ( v equals ( e to ( ) ) ) { answer [ i + + ] = e ; } e = edges get next edge with same from ( e ) ; } return answer ; }


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


creates a new logger instance with the name of the specified class

public static internal logger get instance ( class < ? > clazz ) { return get instance ( clazz get name ( ) ) ; }


creates a copy of this class using the same mapper but with a different mapped delegate

public column constraint < t > copy ( column constraint < m > new delegate ) { return new mapped column constraint < > ( mapper , new delegate ) ; }


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


public static route impl create ( final string path , string accept type , final route route ) { if ( accept type = = null ) { accept type = default accept type ; } return new route impl ( path , accept type , route ) { @ override public object handle ( request request , response response ) throws exception { return route handle ( request , response ) ; } } ; }


tests that none is not specifiable for a key ' s value

public void none value in setting ( ) throws exception { check error ( " foo " , " none " , " error / workspace / foo / build : 1 : 15 : / / foo : none : " + " expected value of type ' string ' for dict value element , but got none ( none type ) " , " config setting ( " , " name = ' none ' , " , " values = { \ " none value \ " : none } ) " ) ; }


checks that the threads do not terminate within the given millisecond delay

void assert threads stay alive ( long millis , thread threads ) { try { / / no need to optimize the failing case via thread join delay ( millis ) ; for ( thread thread : threads ) assert true ( thread is alive ( ) ) ; } catch ( interrupted exception ie ) { fail ( " unexpected interrupted exception " ) ; } }


protected static boolean locate matching attribute value ( final string attr name , final string attr value , final map < string , list < object > > attributes ) { return locate matching attribute value ( attr name , attr value , attributes , true ) ; }


checks if the current user ( for which we are processing the current request ) has the admin access

public static boolean is admin ( ) { return jenkins get ( ) get a c l ( ) has permission ( administer ) ; }