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

public void test add operation to group for root resource and use tags true ( ) { codegen operation codegen operation = new codegen operation ( ) ; codegen operation operation id = " find primaryresource " ; codegen operation path = " / " ; operation operation = new operation ( ) ; map < string , list < codegen operation > > operation list = new hash map < > ( ) ; codegen set use tags ( true ) ; codegen add operation to group ( " primaryresource " , " / " , operation , codegen operation , operation list ) ; assert assert equals ( operation list size ( ) , 1 ) ; assert assert true ( operation list contains key ( " primaryresource " ) ) ; assert assert equals ( codegen operation base name , " primaryresource " ) ; }


will remove the current message , mark its { @ link channel promise } as failure using the given { @ link throwable } and return { @ code true } if no flushed message exists at the time this method is called it will return { @ code false } to signal that no more messages are ready to be handled

public boolean remove ( throwable cause ) { return remove 0 ( cause , true ) ; }


convert a string to an arithmetic progression

static arithmetic progression value of ( final string s ) { int i = 2 ; int j = s index of ( " , delta = " ) ; final long value = util parse long variable ( " value " , s substring ( 2 , j ) ) ; i = j + 1 ; j = s index of ( " , limit = " ) ; final long delta = util parse long variable ( " delta " , s substring ( i , j ) ) ; i = j + 1 ; final long limit = util parse long variable ( " limit " , s substring ( i ) ) ; return new arithmetic progression ( s char at ( 0 ) , value , delta , limit ) ; }


the bean seata data source bean post processor

public seata data source bean post processor seata data source bean post processor ( seata properties seata properties ) { return new seata data source bean post processor ( seata properties get excludes for auto proxying ( ) , seata properties get data source proxy mode ( ) ) ; }


public string [ ] snapshots ( ) { return this snapshots ; }


returns the factory field for the given object at index index

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


called to perform a window update for this stream ( or connection ) updates the window size back to the size of the initial window and sends a window update frame to the remote endpoint

private void write window update ( ) throws http 2 exception { / / expand the window for this stream back to the size of the initial window int delta window size = initial stream window size - processed window ; try { increment flow control windows ( delta window size ) ; } catch ( throwable t ) { throw connection error ( internal error , t , " attempting to return too many bytes for stream % d " , stream id ( ) ) ; } / / send a window update for the stream / connection frame writer write window update ( ctx , stream id ( ) , delta window size , ctx new promise ( ) ) ; }


encode " - pph - " i don ' t know why the greek poet ' s name is transliterated this way

boolean encode pph ( ) { / / ' sappho ' if ( ( char at ( m current + 1 ) = = ' p ' ) & & ( ( m current + 2 ) < m length ) & & ( char at ( m current + 2 ) = = ' h ' ) ) { metaph add ( " f " ) ; m current + = 3 ; return true ; } return false ; }


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


gets the { @ link job property descriptor } by name primarily used for making them web - visible

public job property descriptor get job property ( string short class name ) { / / combining these two lines triggers javac bug see issue # 610 descriptor d = find descriptor ( short class name , job property descriptor all ( ) ) ; return ( job property descriptor ) d ; }


given all of the thread pool configuration , what is the actual maximum size applied to the thread pool cases : 1 ) allow maximum size to diverge from core size = = false : maximum size is set to core size 2 ) allow maximum size to diverge from core size = = true , maximum size > = core size : thread pool has different coremax sizes , so return the configured max 3 ) allow maximum size to diverge from core size = = true , maximum size < core size : threadpool incorrectly configured , use core size for max size

public int get actual maximum size ( ) { return this actual maximum size ; }


creates a table environment that is the entry point and central context for creating table and sql api programs it is unified both on a language level for all jvm - based languages ( i e there is no distinction between scala and java api ) and for bounded and unbounded data processing a table environment is responsible for : connecting to external systems registering and retrieving { @ link table } s and other meta objects from a catalog executing sql statements offering further configuration options note : this environment is meant for pure table programs if you would like to convert from or to other flink a p is , it might be necessary to use one of the available language - specific table environments in the corresponding bridging modules

static table environment create ( environment settings settings ) { return table environment impl create ( settings ) ; }


test that default replication values can be retrieved on the client side

public void test get default replication ( ) throws i o exception , u r i syntax exception { try { vfs get default replication ( not in mountpoint path ) ; fail ( " get default replication on view fs did not throw excetion ! " ) ; } catch ( not in mountpoint exception e ) { assert equals ( vfs get default replication ( test file path ) , dfs replication default + 1 ) ; } }


returns a list of section executions in a postorder representation of the tree

public section execution create section executions ( session session , streaming plan section section , exchange locations consumer locations consumer , optional < int [ ] > bucket to partition , output buffers output buffers , boolean summarize task info , remote task factory remote task factory , split source factory split source factory , int attempt id ) { / / only fetch a distribution once per section to ensure all stages see the same machine assignments map < partitioning handle , node partition map > partitioning cache = new hash map < > ( ) ; table write info table write info = create table write info ( section get plan ( ) , metadata , session ) ; list < stage execution and scheduler > section stages = create streaming linked stage executions ( session , locations consumer , section get plan ( ) with bucket to partition ( bucket to partition ) , partitioning handle - > partitioning cache compute if absent ( partitioning handle , handle - > node partitioning manager get node partitioning map ( session , handle ) ) , table write info , optional empty ( ) , summarize task info , remote task factory , split source factory , attempt id ) ; stage execution and scheduler root stage = get last ( section stages ) ; root stage get stage execution ( ) set output buffers ( output buffers ) ; return new section execution ( root stage , section stages ) ; }


is the store guarded non - authoritatively on the test path ?

public boolean is non auth ( ) { return is non auth ; }


abort all incomplete batches ( whether they have been sent or not )

void abort batches ( final runtime exception reason ) { for ( producer batch batch : incomplete copy all ( ) ) { deque < producer batch > dq = get deque ( batch topic partition ) ; synchronized ( dq ) { batch abort record appends ( ) ; dq remove ( batch ) ; } batch abort ( reason ) ; deallocate ( batch ) ; } }


add the requisite security principal settings to the given configuration , returning a copy

public static configuration add security configuration ( configuration conf ) { / / make a copy so we don ' t mutate it also use an hdfs configuration to / / force loading of hdfs - site xml conf = new hdfs configuration ( conf ) ; string name node principal = conf get ( d f s config keys dfs namenode kerberos principal key , " " ) ; if ( log is debug enabled ( ) ) { log debug ( " using nn principal : " + name node principal ) ; } conf set ( common configuration keys hadoop security service user name key , name node principal ) ; return conf ; }


total time recoveries waited due to throttling

public time value throttle time ( ) { return time value time value nanos ( throttle time in nanos get ( ) ) ; }


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


store the transform configuration in the internal index

void put transform configuration ( transform config transform config , action listener < boolean > listener ) ;


returns additional failure exception details if exists

public exception get failure ( ) { return failure ; }


get the appropriate string to use as the label prefix for an array , taking into account the actual data at the memory location see also { @ link # get default label prefix ( ) }

default public string get array default label prefix ( mem buffer buf , settings settings , int len , data type display options options ) { array stringable stringable element type = array stringable get array stringable ( get data type ( ) ) ; string prefix = ( stringable element type ! = null ) ? stringable element type get array default label prefix ( buf , settings , len , options ) : null ; return ( prefix ! = null ) ? prefix : get default label prefix ( ) ; }


the { @ link x content type } that was parsed from the { @ code content - type } header this value will be { @ code null } in the case of a request without a valid { @ code content - type } header , a request without content ( { @ link # has content ( ) } , or a plain text request

public final x content type get x content type ( ) { return x content type get ( ) ; }


the credential name stands for a unique identifier that can be used to identify the server certificate and the private key the credential name appended with suffix " - cacert " is used to identify the ca certificates associated with this server gateway workloads capable of fetching credentials from a remote credential store such as kubernetes secrets , will be configured to retrieve the server certificate and the private key using credential name , instead of using the file system paths specified above if using mutual tls , gateway workload instances will retrieve the ca certificates using credential name - cacert the semantics of the name are platform dependent in kubernetes , the default istio supplied credential server expects the credential name to match the name of the kubernetes secret that holds the server certificate , the private key , and the ca certificate ( if using mutual tls ) set the ` istio meta user sds ` metadata variable in the gateway ' s proxy to enable the dynamic credential fetching feature < code > string credential name = 10 ; < code >

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


write to one file , then kill one datanode in the pipeline and then close the file

private void simple test ( int datanode to kill ) throws i o exception { configuration conf = new hdfs configuration ( ) ; conf set int ( d f s config keys dfs namenode heartbeat recheck interval key , 2000 ) ; conf set int ( d f s config keys dfs heartbeat interval key , 1 ) ; conf set int ( d f s config keys dfs namenode reconstruction pending timeout sec key , 2 ) ; conf set int ( hdfs client config keys dfs client socket timeout key , 5000 ) ; int my max nodes = 5 ; system out println ( " simple test starting with data node to kill " + datanode to kill ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( my max nodes ) build ( ) ; cluster wait active ( ) ; file system fs = cluster get file system ( ) ; short repl = 3 ; path filename = new path ( " simpletest dat " ) ; try { / / create a file and write one block of data system out println ( " simple test creating file " + filename ) ; f s data output stream stm = create file ( fs , filename , repl ) ; d f s output stream dfstream = ( d f s output stream ) ( stm get wrapped stream ( ) ) ; / / these are test settings dfstream set chunks per packet ( 5 ) ; final long myseed = append test util next long ( ) ; byte [ ] buffer = append test util random bytes ( myseed , file size ) ; int mid = file size / 4 ; stm write ( buffer , 0 , mid ) ; datanode info [ ] targets = dfstream get pipeline ( ) ; int count = 5 ; while ( count - - > 0 & & targets = = null ) { try { system out println ( " simple test : waiting for pipeline to be created " ) ; thread sleep ( 1000 ) ; } catch ( interrupted exception e ) { } targets = dfstream get pipeline ( ) ; } if ( targets = = null ) { int victim = append test util next int ( my max nodes ) ; system out println ( " simple test stopping datanode random " + victim ) ; cluster stop data node ( victim ) ; } else { int victim = datanode to kill ; system out println ( " simple test stopping datanode " + targets [ victim ] ) ; cluster stop data node ( targets [ victim ] get xfer addr ( ) ) ; } system out println ( " simple test stopping datanode complete " ) ; / / write some more data to file , close and verify stm write ( buffer , mid , file size - mid ) ; stm close ( ) ; check file ( fs , filename , repl , num blocks , file size , myseed ) ; } catch ( throwable e ) { system out println ( " simple workload exception " + e ) ; e print stack trace ( ) ; assert true ( e to string ( ) , false ) ; } finally { fs close ( ) ; cluster shutdown ( ) ; } }


creates a { @ link mesos worker store } which is used to persist mesos worker in high availability mode

mesos worker store create mesos worker store ( configuration configuration ) throws exception ;


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

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


asserts that this { @ code test observer } { @ code test subscriber } received exactly one { @ code on next } value for which the provided predicate returns { @ code true }

public final u assert value ( @ non null predicate < t > value predicate ) { assert value at ( 0 , value predicate ) ; if ( values size ( ) > 1 ) { throw fail ( " the first value passed the predicate but this consumer received more than one value " ) ; } return ( u ) this ; }


to test the collection format in query parameters

void test query parameter collection format ( @ param ( " pipe " ) list < string > pipe , @ param ( " ioutil " ) list < string > ioutil , @ param ( " http " ) list < string > http , @ param ( " url " ) list < string > url , @ param ( " context " ) list < string > context ) ;


creates a trigger that fires when the processing time passes the end of the window

public static < w extends window > after end of window < w > after end of window ( ) { return new after end of window < > ( ) ; }


returns the correctly typed version of the builder

protected final t this t ( ) { @ suppress warnings ( " unchecked " ) t this t = ( t ) this ; return this t ; }


allows to retrieve the { @ link process instance history log } for one process instance

process instance history log query create process instance history log query ( string process instance id ) ;


reads all bytes from a url into a byte array

public static byte [ ] to byte array ( url url ) throws i o exception { return as byte source ( url ) read ( ) ; }


returns the index of { @ code chars } after the first occurrence of " has include " or - 1 if no such occurrence exists also requires that there be at least 5 characters after the " has include " , corresponding to a pair of parentheses and angle bracketsquotes and a filename this code runs on every line that starts with " # " , so it should be as fast as possible

private static int skip through has include ( byte [ ] chars , int pos , int end ) { int last pos = end - necessary has include length ; while ( pos < = last pos ) { int cur pos = 0 ; while ( cur pos < has include length & & ( chars [ pos + cur pos ] & 0xff ) = = has include char at ( cur pos ) ) { cur pos + + ; } if ( cur pos = = has include length ) { return pos + cur pos ; } / / we ' re looking for " has include " as a preprocessing token , which means that it cannot / / start in the middle of any characters we ' ve already processed , nor at the mismatching / / character pos + = cur pos + 1 ; } return - 1 ; }


public void update ascii stream ( string column label , input stream x , long length ) throws s q l exception { }


computes a hash value for the given record the hash value should include all fields in the record relevant to the comparison the hash code is typically not used as it is in hash tables and for partitioning , but it is further scrambled to make sure that a projection of the hash values to a lower cardinality space is as results in a rather uniform value distribution however , any collisions produced by this method cannot be undone while it is not important to create hash codes that cover the full spectrum of bits in the integer , it is important to avoid collisions when combining two value as much as possible


private static boolean delete dir ( final file dir ) { if ( dir = = null ) return false ; / / dir doesn ' t exist then return true if ( ! dir exists ( ) ) return true ; / / dir isn ' t a directory then return false if ( ! dir is directory ( ) ) return false ; file [ ] files = dir list files ( ) ; if ( files ! = null & & files length > 0 ) { for ( file file : files ) { if ( file is file ( ) ) { if ( ! file delete ( ) ) return false ; } else if ( file is directory ( ) ) { if ( ! delete dir ( file ) ) return false ; } } } return dir delete ( ) ; }


private mono < object > get default value ( named value info named value info , method parameter parameter , binding context binding context , model model , server web exchange exchange ) { return mono from supplier ( ( ) - > { object value = null ; if ( named value info default value ! = null ) { value = resolve embedded values and expressions ( named value info default value ) ; } else if ( named value info required & & ! parameter is optional ( ) ) { handle missing value ( named value info name , parameter , exchange ) ; } value = handle null value ( named value info name , value , parameter get nested parameter type ( ) ) ; value = apply conversion ( value , named value info , parameter , binding context , exchange ) ; handle resolved value ( value , named value info name , parameter , model , exchange ) ; return value ; } ) ; }


delete a snapshot of a snapshottable directory

public void delete snapshot ( string snapshot root , string snapshot name ) throws i o exception { check open ( ) ; try ( trace scope ignored = tracer new scope ( " delete snapshot " ) ) { namenode delete snapshot ( snapshot root , snapshot name ) ; } catch ( remote exception re ) { throw re unwrap remote exception ( ) ; } }


sets the progress message the string is lazily evaluated

public builder set progress message ( @ format string string progress message , object subject 0 , object subject 1 , object subject 2 ) { return set progress message ( new lazy string ( ) { @ override public string to string ( ) { return string format ( progress message , subject 0 , subject 1 , subject 2 ) ; } } ) ; }


add update the under construction feature

public void convert to block under construction ( block u c state s , datanode storage info [ ] targets ) { if ( is complete ( ) ) { uc = new block under construction feature ( this , s , targets , this get block type ( ) ) ; } else { / / the block is already under construction uc set block u c state ( s ) ; uc set expected locations ( this , targets , this get block type ( ) ) ; } }


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


specify the maximum number of messages to load into a session ( a kind of batch size )

public void set prefetch size ( int prefetch size ) { this prefetch size = prefetch size ; }


update last update and last update monotonic with some offset

public static void reset last updates with offset ( datanode info dn , long offset ) { dn set last update ( time now ( ) + offset ) ; dn set last update monotonic ( time monotonic now ( ) + offset ) ; }


returns a function that cast the incoming values via a class object

public static < t , u > function < t , u > cast function ( @ non null class < u > target ) { return new cast to class < > ( target ) ; }


public int get client socket rcv buf size ( ) { return client socket rcv buf size ; }


public long get pet id ( ) { return pet id ; }


gets the fully processed data from this class registers an action to run r class generation , the last step needed in resource processing returns the fully processed data , including validated resources , wrapped in a resource apk

public resource apk generate r class ( android data context data context ) throws interrupted exception { return new r class generator action builder ( ) with dependencies ( resource deps ) set class jar out ( data context create output artifact ( android rule classes android resources class jar ) ) build ( data context , this ) ; }


returns whether the given target is a test target if this returns true , then { @ link # is rule } must also return true for the target


handle odd addresses which may occur when jumpingreturning indirectly to thumb mode it is assumed that language will properly handle context changes during the flow of execution , we need only fix the current program counter

public void post execute callback ( emulate emulate , address last execute address , pcode op [ ] last execute pcode , int last pcode index , address current address ) throws lowlevel error { if ( t mode reg = = null ) { return ; } if ( last pcode index < 0 ) { / / ignore fall - through condition return ; } int last op = last execute pcode [ last pcode index ] get opcode ( ) ; if ( last op ! = pcode op branch & & last op ! = pcode op cbranch & & last op ! = pcode op branchind & & last op ! = pcode op call & & last op ! = pcode op callind & & last op ! = pcode op return ) { / / only concerned with branch , call or return ops return ; } long tb value = emu get memory state ( ) get value ( t breg ) ; if ( tb value = = 1 ) { / / thumb mode emu set context register value ( t mode ) ; / / change context to be consistent with tb value if ( ( current address get offset ( ) & 0x 1 ) = = 1 ) { emulate set execute address ( current address previous ( ) ) ; } } else if ( tb value = = 0 ) { if ( ( current address get offset ( ) & 0x 1 ) = = 1 ) { throw new lowlevel error ( " flow to odd address occurred without setting tb register ( thumb mode ) " ) ; } / / arm mode emu set context register value ( a mode ) ; / / change context to be consistent with tb value } }


eclipse hack disablesenabled all key bindings in specified site ' s part works only if host editor is extender of abstract text editor uses reflection because set action activation is private method todo : find better way to disable key bindings or prioritize event handling to widgets

public static void enable host editor key bindings ( i workbench part site part site , boolean enable ) { i workbench part part = part site get part ( ) ; if ( part instanceof abstract text editor ) { abstract text editor host editor = ( abstract text editor ) part ; control widget = host editor get adapter ( control class ) ; if ( widget = = null | | widget is disposed ( ) ) { return ; } try { method activator method = abstract text editor class get declared method ( " set action activation " , boolean type ) ; activator method set accessible ( true ) ; activator method invoke ( host editor , enable ) ; } catch ( throwable e ) { if ( e instanceof invocation target exception ) { e = ( ( invocation target exception ) e ) get target exception ( ) ; } log warn ( " can ' t disable text editor action activations " , e ) ; } / / host editor get editor site ( ) get action bar contributor ( ) set active editor ( host editor ) ; } }


reset state so the cell can be reused , setting all constraints to their { @ link # defaults ( ) default } values

public void reset ( ) { actor = null ; table = null ; end row = false ; cell above index = - 1 ; set ( defaults ( ) ) ; }


remove any values from the test bucket and the base values too

public static void remove base and bucket overrides ( final configuration conf , final string options ) { for ( string option : options ) { conf unset ( option ) ; } remove base and bucket overrides ( get test bucket name ( conf ) , conf , options ) ; }


tests that we throw report no transaction isolation and throw sensible errors if you ask for any

public void test transaction isolation ( ) throws s q l exception { try ( connection c = es jdbc ( ) ) { assert equals ( connection transaction none , c get transaction isolation ( ) ) ; s q l exception e = expect throws ( s q l exception class , ( ) - > c set transaction isolation ( connection transaction serializable ) ) ; assert equals ( " transactions not supported " , e get message ( ) ) ; assert equals ( connection transaction none , c get transaction isolation ( ) ) ; } }


visit the triangle tree with the provided visitor

protected void visit ( triangle tree reader visitor visitor ) { extent extent = get extent ( ) ; int this max x = extent max x ( ) ; int this min x = extent min x ( ) ; int this max y = extent max y ( ) ; int this min y = extent min y ( ) ; if ( visitor push ( this min x , this min y , this max x , this max y ) ) { triangle tree reader visit ( input , visitor , this max x , this max y ) ; } }


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


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


public array create array of ( string type name , object [ ] elements ) throws s q l exception { return null ; }


public abstract response on apply ( write request log ) ;


void do checkpoint ( ) throws i o exception { backup image bn image = get f s image ( ) ; n n storage bn storage = bn image get storage ( ) ; long start time = monotonic now ( ) ; bn image freeze namespace at next roll ( ) ; namenode command cmd = get remote namenode proxy ( ) start checkpoint ( backup node get registration ( ) ) ; checkpoint command cp cmd = null ; switch ( cmd get action ( ) ) { case namenode protocol act shutdown : shutdown ( ) ; throw new i o exception ( " name - node " + backup node nn rpc address + " requested shutdown " ) ; case namenode protocol act checkpoint : cp cmd = ( checkpoint command ) cmd ; break ; default : throw new i o exception ( " unsupported namenode command : " + cmd get action ( ) ) ; } bn image wait until namespace frozen ( ) ; checkpoint signature sig = cp cmd get signature ( ) ; / / make sure we ' re talking to the same nn ! sig validate storage info ( bn image ) ; long last applied = bn image get last applied tx id ( ) ; log debug ( " doing checkpoint last applied : " + last applied ) ; remote edit log manifest manifest = get remote namenode proxy ( ) get edit log manifest ( bn image get last applied tx id ( ) + 1 ) ; boolean need reload image = false ; if ( ! manifest get logs ( ) is empty ( ) ) { remote edit log first remote log = manifest get logs ( ) get ( 0 ) ; / / we don ' t have enough logs to roll forward using only logs need / / to download and load the image if ( first remote log get start tx id ( ) > last applied + 1 ) { log info ( " unable to roll forward using only logs downloading " + " image with txid " + sig most recent checkpoint tx id ) ; m d 5 hash downloaded hash = transfer fs image download image to storage ( backup node nn http address , sig most recent checkpoint tx id , bn storage , true , false ) ; bn image save digest and rename checkpoint image ( name node file image , sig most recent checkpoint tx id , downloaded hash ) ; last applied = sig most recent checkpoint tx id ; need reload image = true ; } if ( first remote log get start tx id ( ) > last applied + 1 ) { throw new i o exception ( " no logs to roll forward from " + last applied ) ; } / / get edits files for ( remote edit log log : manifest get logs ( ) ) { transfer fs image download edits to storage ( backup node nn http address , log , bn storage ) ; } if ( need reload image ) { log info ( " loading image with txid " + sig most recent checkpoint tx id ) ; file file = bn storage find image file ( name node file image , sig most recent checkpoint tx id ) ; bn image reload from image file ( file , backup node get namesystem ( ) ) ; } roll forward by applying logs ( manifest , bn image , backup node get namesystem ( ) ) ; } long txid = bn image get last applied tx id ( ) ; backup node namesystem write lock ( ) ; try { backup node namesystem set image loaded ( ) ; if ( backup node namesystem get blocks total ( ) > 0 ) { long complete blocks total = backup node namesystem get complete blocks total ( ) ; backup node namesystem get block manager ( ) set block total ( complete blocks total ) ; } bn image save f s image in all dirs ( backup node get namesystem ( ) , txid ) ; if ( ! backup node namenode is rolling upgrade ( ) ) { bn image update storage version ( ) ; } } finally { backup node namesystem write unlock ( " do checkpoint " ) ; } if ( cp cmd need to return image ( ) ) { transfer fs image upload image from storage ( backup node nn http address , conf , bn storage , name node file image , txid ) ; } get remote namenode proxy ( ) end checkpoint ( backup node get registration ( ) , sig ) ; if ( backup node get role ( ) = = namenode role backup ) { bn image converge journal spool ( ) ; } backup node set registration ( ) ; / / keep registration up to date long image size = bn image get storage ( ) get fs image name ( txid ) length ( ) ; log info ( " checkpoint completed in " + ( monotonic now ( ) - start time ) / 1000 + " seconds " + " new image size : " + image size ) ; }


public float get float ( ) { return float ; }


unblocks all threads and runs all listeners

private static void complete ( abstract future < ? > future ) { listener next = null ; outer : while ( true ) { future release waiters ( ) ; / / we call this before the listeners in order to avoid needing to manage a separate stack data / / structure for them also , some implementations rely on this running prior to listeners / / so that the cleanup work is visible to listeners / / after done ( ) should be generally fast and only used for cleanup work but in theory can / / also be recursive and create stack overflow errors future after done ( ) ; / / push the current set of listeners onto next next = future clear listeners ( next ) ; future = null ; while ( next ! = null ) { listener curr = next ; next = next next ; runnable task = curr task ; if ( task instanceof set future ) { set future < ? > set future = ( set future < ? > ) task ; / / we unwind set future specifically to avoid stack overflow errors in the case of long / / chains of set futures / / handling this special case is important because there is no way to pass an executor to / / set future , so a user couldn ' t break the chain by doing this themselves it is also / / potentially common if someone writes a recursive futures transform async transformer future = set future owner ; if ( future value = = set future ) { object value to set = get future value ( set future future ) ; if ( atomic helper cas value ( future , set future , value to set ) ) { continue outer ; } } / / other wise the future we were trying to set is already done } else { execute listener ( task , curr executor ) ; } } break ; } }


reset a daemon thread to the callback client thread pool so that the callback server can be terminated when gate way server is shutting down we need to shut down the none - daemon thread firstly , then set a new thread created in a daemon thread to the executor service

private static void reset callback client executor service ( gateway server gateway server ) throws no such field exception , illegal access exception , no such method exception , invocation target exception { callback client callback client = ( callback client ) gateway server get callback client ( ) ; / / the java api of py 4j does not provide approach to set " daemonize connections " parameter / / use reflect to daemonize the connection thread field executor = callback client class get declared field ( " executor " ) ; executor set accessible ( true ) ; ( ( scheduled executor service ) executor get ( callback client ) ) shutdown ( ) ; executor set ( callback client , executors new scheduled thread pool ( 1 , thread : : new ) ) ; method setup cleaner = callback client class get declared method ( " setup cleaner " ) ; setup cleaner set accessible ( true ) ; setup cleaner invoke ( callback client ) ; }


adds a string argument to the command line if the value is null , neither the arg nor the value is added

public builder add ( @ compile time constant string arg , @ nullable string value ) { return add object internal ( arg , value ) ; }


returns the path of the main workspace file or null when a skyframe restart is required should also return null when the workspace file is not present , but then some tests break , so then it lies and returns the rooted path corresponding to the last package path entry

public rooted path find workspace file ( environment env ) throws interrupted exception { path package locator package locator = precomputed value path package locator get ( env ) ; immutable list < root > package path = package locator get path entries ( ) ; for ( root candidate root : package path ) { for ( build file name workspace file : workspace files by priority ) { rooted path path = check workspace file ( env , candidate root , workspace file get filename fragment ( ) ) ; if ( env values missing ( ) ) { return null ; } if ( path ! = null ) { return path ; } } } / / todo ( lberki ) : technically , this means that the workspace file was not found i ' d love to not / / have this here , but a lot of tests break without it because they rely on bazel kinda working / / even if the workspace file is not present return rooted path to rooted path ( iterables get last ( package path ) , build file name workspace get filename fragment ( ) ) ; }


test case for https : github comgoogle exo playerissues 6 7 7 4 the sample file contains an mdat atom whose size indicates that it extends 8 bytes beyond the end of the file

public void mp 4 sample with mdat too long ( ) throws exception { extractor asserts assert behavior ( mp 4 extractor : : new , " media / mp 4 / sample mdat too long mp 4 " , simulation config ) ; }


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


generate a bean name for the given bean definition

string generate bean name ( bean definition definition , bean definition registry registry ) ;


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


get the original function info and save it off in the undo map ; set the function info using the new info object

private void set function ( listing listing , address addr , code unit info info ) { function function = listing get function at ( addr ) ; if ( function = = null ) { return ; } string fn name = info get function name ( ) ; if ( fn name ! = null ) { try { function set name ( fn name , info get primary symbol source ( ) ) ; } catch ( duplicate name exception e ) { messages append ( " could not set function name - - duplicate name : " + fn name ) append ( ' \ n ' ) ; } catch ( invalid input exception e ) { / / shouldn ' t happen } } / / string [ ] function comments = info get function comments ( ) ; / / if ( function comments ! = null ) { / / string buffer sb = new string buffer ( ) ; / / for ( int i = 0 ; i < function comments length ; i + + ) { / / sb append ( function comments [ i ] ) ; / / if ( i < function comments length - 1 ) { / / sb append ( " \ n " ) ; / / } / / } / / string comment = sb to string ( ) ; / / string old comment = function get comment ( ) ; / / if ( old comment ! = null & & old comment length ( ) ! = 0 ) { / / comment = old comment + " \ n " + comment ; / / } / / function set comment ( comment ) ; / / } string [ ] stack var names = info get stack variable names ( ) ; if ( stack var names length ! = 0 ) { string [ ] stack var comments = info get stack variable comments ( ) ; source type [ ] stack var sources = info get stack variable sources ( ) ; int [ ] stack offsets = info get stack offsets ( ) ; int [ ] stack var first use offsets = info get stack var first use offsets ( ) ; variable [ ] stack vars = function get variables ( variable filter stack variable filter ) ; for ( int i = 0 ; i < stack offsets length ; i + + ) { variable var = find stack var ( stack vars , stack offsets [ i ] , stack var first use offsets [ i ] ) ; if ( var ! = null ) { try { var set name ( stack var names [ i ] , stack var sources [ i ] ) ; } catch ( duplicate name exception e ) { messages append ( " could not set stack variable name - - duplicate name : " + fn name ) append ( ' \ n ' ) ; } catch ( invalid input exception e ) { / / shouldn ' t happen } if ( stack var comments [ i ] ! = null ) { var set comment ( stack var comments [ i ] ) ; } } } } string [ ] var names = info get variable names ( ) ; if ( var names length ! = 0 ) { string [ ] var comments = info get variable comments ( ) ; source type [ ] var sources = info get variable sources ( ) ; address [ ] var addrs = info get var addresses ( ) ; int [ ] reg var first use offsets = info get var first use offsets ( ) ; variable [ ] vars = function get all variables ( ) ; for ( int i = 0 ; i < var addrs length ; i + + ) { variable var = find var ( vars , var addrs [ i ] , reg var first use offsets [ i ] ) ; if ( var ! = null ) { try { var set name ( var names [ i ] , var sources [ i ] ) ; } catch ( duplicate name exception e ) { messages append ( " could not set variable name - - duplicate name : " + fn name ) append ( ' \ n ' ) ; } catch ( invalid input exception e ) { / / shouldn ' t happen } if ( var comments [ i ] ! = null ) { var set comment ( var comments [ i ] ) ; } } } } }


copies the bytes to one program from another for the specified address range

public static void copy bytes in ranges ( program to program , program from program , address min addr , address max addr ) throws memory access exception { memory to mem = to program get memory ( ) ; memory from mem = from program get memory ( ) ; address range range = new address range impl ( min addr , max addr ) ; copy byte range ( to mem , from mem , range ) ; }


assert the response status code is { @ code http status request uri too long } ( 414 )

public result matcher is request uri too long ( ) { return matcher ( http status request uri too long ) ; }


return whether the two maps have the same keys and values

public static < k , v > boolean are maps equal ( @ nullable map < k , v > prev , @ nullable map < k , v > next ) { if ( prev = = next ) { return true ; } if ( prev = = null | | next = = null ) { return false ; } if ( prev size ( ) ! = next size ( ) ) { return false ; } for ( map entry < k , v > entry : prev entry set ( ) ) { if ( ! common utils equals ( entry get value ( ) , next get ( entry get key ( ) ) ) ) { return false ; } } return true ; }


public i node file attributes load i node file attributes ( data input in ) throws i o exception { final int layout version = get layout version ( ) ; if ( ! name node layout version supports ( layout version feature optimize snapshot inodes , layout version ) ) { return load i node with local name ( true , in , false ) as file ( ) ; } final byte [ ] name = f s image serialization read local name ( in ) ; final permission status permissions = permission status read ( in ) ; final long modification time = in read long ( ) ; final long access time = in read long ( ) ; final short replication = namesystem get block manager ( ) adjust replication ( in read short ( ) ) ; final long preferred block size = in read long ( ) ; return new i node file attributes snapshot copy ( name , permissions , null , modification time , access time , replication , null , preferred block size , ( byte ) 0 , null , block type contiguous ) ; }


response entity < void > update pet ( pet body ) ;


validates that we properly split fields using the word delimiter filter in query string

public void test custom word delimiter query string ( ) { assert acked ( client ( ) admin ( ) indices ( ) prepare create ( " test " ) set settings ( settings builder ( ) put ( " analysis analyzer my analyzer type " , " custom " ) put ( " analysis analyzer my analyzer tokenizer " , " whitespace " ) put ( " analysis analyzer my analyzer filter " , " custom word delimiter " ) put ( " analysis filter custom word delimiter type " , " word delimiter " ) put ( " analysis filter custom word delimiter generate word parts " , " true " ) put ( " analysis filter custom word delimiter generate number parts " , " false " ) put ( " analysis filter custom word delimiter catenate numbers " , " true " ) put ( " analysis filter custom word delimiter catenate words " , " false " ) put ( " analysis filter custom word delimiter split on case change " , " false " ) put ( " analysis filter custom word delimiter split on numerics " , " false " ) put ( " analysis filter custom word delimiter stem english possessive " , " false " ) ) set mapping ( " field 1 " , " type = text , analyzer = my analyzer " , " field 2 " , " type = text , analyzer = my analyzer " ) ) ; client ( ) prepare index ( " test " ) set id ( " 1 " ) set source ( " field 1 " , " foo bar baz " , " field 2 " , " not needed " ) get ( ) ; refresh ( ) ; search response response = client ( ) prepare search ( " test " ) set query ( query string query ( " foo baz " ) default operator ( operator and ) field ( " field 1 " ) field ( " field 2 " ) ) get ( ) ; assert hit count ( response , 1l ) ; }


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


parses all pre " - - " residue for starlark options

public void parse ( extended event handler event handler ) throws options parsing exception { immutable list builder < string > residue = new immutable list builder < > ( ) ; / / map of < option name ( label ) , < unparsed option value , loaded option > > multimap < string , pair < string , target > > unparsed options = linked list multimap create ( ) ; / / sort the old residue into starlark flags and legitimate residue for ( string arg : native options parser get pre double dash residue ( ) ) { / / todo ( bazel - team ) : support single dash options ? if ( ! arg starts with ( " - - " ) ) { residue add ( arg ) ; continue ; } parse arg ( arg , unparsed options , event handler ) ; } list < string > post double dash residue = native options parser get post double dash residue ( ) ; residue add all ( post double dash residue ) ; native options parser set residue ( residue build ( ) , post double dash residue ) ; if ( unparsed options is empty ( ) ) { return ; } / / map of flag label as a string to its loaded target and set value after parsing hash map < string , pair < target , object > > build setting with target and value = new hash map < > ( ) ; for ( map entry < string , pair < string , target > > option : unparsed options entries ( ) ) { string loaded flag = option get key ( ) ; string unparsed value = option get value ( ) first ; target build setting target = option get value ( ) second ; build setting build setting = build setting target get associated rule ( ) get rule class object ( ) get build setting ( ) ; / / do not recognize internal options , which are treated as if they did not exist if ( ! build setting is flag ( ) ) { throw new options parsing exception ( string format ( " unrecognized option : % s = % s " , loaded flag , unparsed value ) ) ; } type < ? > type = build setting get type ( ) ; converter < ? > converter = build setting converters get ( type ) ; object value ; try { value = converter convert ( unparsed value ) ; } catch ( options parsing exception e ) { throw new options parsing exception ( string format ( " while parsing option % s = % s : ' % s ' is not a % s " , loaded flag , unparsed value , unparsed value , type ) , e ) ; } if ( build setting allows multiple ( ) ) { list < object > new value ; if ( build setting with target and value contains key ( loaded flag ) ) { new value = new array list < > ( ( collection < ? > ) build setting with target and value get ( loaded flag ) get second ( ) ) ; } else { new value = new array list < > ( ) ; } new value add ( value ) ; value = new value ; } build setting with target and value put ( loaded flag , pair of ( build setting target , value ) ) ; } map < string , object > parsed options = new hash map < > ( ) ; for ( string build setting : build setting with target and value key set ( ) ) { pair < target , object > build setting and final value = build setting with target and value get ( build setting ) ; target build setting target = build setting and final value get first ( ) ; boolean allows multiple = build setting target get associated rule ( ) get rule class object ( ) get build setting ( ) allows multiple ( ) ; object value = build setting and final value get second ( ) ; if ( allows multiple ) { list < ? > default value = immutable list of ( objects require non null ( build setting target get associated rule ( ) get attr ( starlark build setting default attr name ) ) ) ; list < ? > new value = ( list < ? > ) value ; if ( ! new value equals ( default value ) ) { parsed options put ( build setting , value ) ; } } else { if ( ! value equals ( build setting target get associated rule ( ) get attr ( starlark build setting default attr name ) ) ) { parsed options put ( build setting , build setting and final value get second ( ) ) ; } } } native options parser set starlark options ( immutable map copy of ( parsed options ) ) ; }


return a sequential { @ link stream } containing the property values

default stream < property value > stream ( ) { return stream support stream ( spliterator ( ) , false ) ; }


close the filesystem this shuts down all transfers

public void close ( ) throws i o exception { if ( closed get and set ( true ) ) { / / already closed return ; } is closed = true ; log debug ( " filesystem { } is closed " , uri ) ; try { super close ( ) ; } finally { stop all services ( ) ; } }


get the reservation to which the job is submitted to , if any

public reservation id get reservation id ( ) { return reservation id ; }


use the natural weight of each edge the metric assumes every edge is a { @ link g weighted edge } if not , you will likely encounter a { @ link class cast exception }

public static < v , e extends g edge < v > > g edge weight metric < e > natural metric ( ) { return ( g edge weight metric < e > ) natural metric ; }


perform a check of the application component

protected abstract result check ( ) throws exception ;


the maximum number of refresh listeners allows on this shard

public int get max refresh listeners ( ) { return max refresh listeners ; }


ensures that an object reference passed as a parameter to the calling method is not null

private static < t > t check not null ( t reference ) throws swift internal state exception { return check not null ( reference , " null reference " ) ; }


public static string get string ( @ non null final string key ) { return get string ( key , get default cache disk utils ( ) ) ; }


public static int get max inactive channel check ( ) { return max inactive channel check ; }


adds to the file types to use as filters only contents in the filter zip files with these extensions will be filtered out

public zip filter builder add file type to filter ( string filter file type ) { this filter file types builder add ( filter file type ) ; return this ; }


returns the index of the last appearance of the value { @ code target } in { @ code array } note that this always returns { @ code - 1 } when { @ code target } is { @ code na n }

public static int last index of ( double [ ] array , double target ) { return last index of ( array , target , 0 , array length ) ; }


invokes a client protocol method determines the target nameservice using the block pool id re - throws exceptions generated by the remote rpc call as either remote exception or i o exception

public object invoke single block pool ( final string bp id , remote method method ) throws i o exception { string ns id = get nameservice for block pool id ( bp id ) ; return invoke single ( ns id , method ) ; }


this implementation converts a text message back to a string , a byte message back to a byte array , a map message back to a map , and an object message back to a serializable object returns the plain message object in case of an unknown message type

public object from message ( message message ) throws j m s exception , message conversion exception { if ( message instanceof text message ) { return extract string from message ( ( text message ) message ) ; } else if ( message instanceof bytes message ) { return extract byte array from message ( ( bytes message ) message ) ; } else if ( message instanceof map message ) { return extract map from message ( ( map message ) message ) ; } else if ( message instanceof object message ) { return extract serializable from message ( ( object message ) message ) ; } else { return message ; } }


return the mime message helper that this mime mail message is based on

public final mime message helper get mime message helper ( ) { return this helper ; }


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


blocks until the value is { @ link # set ( object ) } by another thread and returns the value

public synchronized @ check for null t get ( ) { try { while ( ! set ) wait ( ) ; return value ; } catch ( interrupted exception e ) { / / assume the loading failed , but make sure we process interruption properly later thread current thread ( ) interrupt ( ) ; return null ; } }


specify the { @ link event loop group } which is used for the parent ( acceptor ) and the child ( client )

public server bootstrap group ( event loop group group ) { return group ( group , group ) ; }


validate configuration properties related to amazon aws service

public static void validate aws configuration ( properties config ) { if ( config contains key ( a w s config constants aws credentials provider ) ) { string credentials provider type = config get property ( a w s config constants aws credentials provider ) ; / / value specified for a w s config constants aws credentials provider needs to be / / recognizable credential provider provider type ; try { provider type = credential provider value of ( credentials provider type ) ; } catch ( illegal argument exception e ) { string builder sb = new string builder ( ) ; for ( credential provider type : credential provider values ( ) ) { sb append ( type to string ( ) ) append ( " , " ) ; } throw new illegal argument exception ( " invalid aws credential provider type set in config valid values are : " + sb to string ( ) ) ; } / / if basic type is used , also check that the access key id and secret key is supplied if ( provider type = = credential provider basic ) { if ( ! config contains key ( a w s config constants aws access key id ) | | ! config contains key ( a w s config constants aws secret access key ) ) { throw new illegal argument exception ( " please set values for aws access key id ( ' " + a w s config constants aws access key id + " ' ) " + " and secret key ( ' " + a w s config constants aws secret access key + " ' ) when using the basic aws credential provider type " ) ; } } } if ( config contains key ( a w s config constants aws region ) ) { / / specified aws region name must be recognizable if ( ! a w s util is valid region ( config get property ( a w s config constants aws region ) ) ) { string builder sb = new string builder ( ) ; for ( regions region : regions values ( ) ) { sb append ( region get name ( ) ) append ( " , " ) ; } throw new illegal argument exception ( " invalid aws region set in config valid values are : " + sb to string ( ) ) ; } } }


writes the timers snapshot to the output view

void write timers snapshot ( data output view out ) throws i o exception ;


encrypt the field value with targeted algorithm

protected object encrypt value ( string algorithm , object field value ) { if ( algorithm ! = null & & field value ! = null ) { if ( lite pal support aes equals ignore case ( algorithm ) ) { field value = cipher util aes encrypt ( ( string ) field value ) ; } else if ( lite pal support md5 equals ignore case ( algorithm ) ) { field value = cipher util md 5 encrypt ( ( string ) field value ) ; } } return field value ; }


public synchronized static language service get language service ( ) { return default language service get language service ( ) ; }


returns the strategies applying to the given spawn , in priority order which strategies are returned is based on the precedence as documented on the construction methods of { @ linkplain builder this registry ' s builder } if the reason for selecting the context is worth mentioning to the user , logs a message using the given { @ link reporter }

public list < ? extends spawn strategy > get strategies ( spawn spawn , event handler reporter ) { / / don ' t override test strategies by - - strategy regexp for backwards compatibility if ( spawn get resource owner ( ) ! = null & & ! " test runner " equals ( spawn get mnemonic ( ) ) ) { string description = spawn get resource owner ( ) get progress message ( ) ; if ( description ! = null ) { for ( map entry < regex filter , collection < spawn strategy > > filter strategies : filter to strategies as map ( ) entry set ( ) ) { if ( filter strategies get key ( ) is included ( description ) ) { / / todo ( schmitt ) : why is this done here and not after running can exec ? reporter handle ( event progress ( description + " with context " + filter strategies get value ( ) ) ) ; return immutable list copy of ( filter strategies get value ( ) ) ; } } } } if ( mnemonic to strategies contains key ( spawn get mnemonic ( ) ) ) { return mnemonic to strategies get ( spawn get mnemonic ( ) ) ; } return default strategies ; }


helper method to retrieve the specific file system statistics value by name basically , the { @ link file system storage statistics } should do this internally in a similar approach

private long get statistics value ( string name ) { switch ( name ) { case " bytes read " : return statistics get bytes read ( ) ; case " bytes written " : return statistics get bytes written ( ) ; case " read ops " : return statistics get read ops ( ) ; case " large read ops " : return statistics get large read ops ( ) ; case " write ops " : return statistics get write ops ( ) ; case " bytes read local host " : return statistics get bytes read by distance ( 0 ) ; case " bytes read distance of one or two " : return statistics get bytes read by distance ( 1 ) ; case " bytes read distance of three or four " : return statistics get bytes read by distance ( 3 ) ; case " bytes read distance of five or larger " : return statistics get bytes read by distance ( 5 ) ; case " bytes read erasure coded " : return statistics get bytes read erasure coded ( ) ; default : return 0 ; } }


public long read long ( ) throws i o exception { return ( ( ( long ) read int ( ) ) < < 32 ) | ( read int ( ) & 0x f f f f f f f f l ) ; }


gets the directory for temporary files , as returned by the jvm system property " java io tmpdir "

public static string get temporary file directory ( ) { return system get property ( " java io tmpdir " ) ; }


register a custom , serializable user configuration object

public void set global job parameters ( global job parameters global job parameters ) { preconditions check not null ( global job parameters , " global job parameters shouldn ' t be null " ) ; this global job parameters = global job parameters ; }


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


generate the next name for the given name , i e append " 2 " to the base name if not ending with a number , otherwise increase the number by 1 for example : status = > status 2 status 2 = > status 3 my name 1 0 0 = > my name 1 0 1

private static string generate next name ( string name ) { pattern pattern = pattern compile ( " \ \ d + \ \ z " ) ; matcher matcher = pattern matcher ( name ) ; if ( matcher find ( ) ) { string num str = matcher group ( ) ; int num = integer parse int ( num str ) + 1 ; return name substring ( 0 , name length ( ) - num str length ( ) ) + num ; } else { return name + " 2 " ; } }


returns { @ code true } if dns server can handle recursive queries


returns a new { @ link byte sequence length filter } based on the values in the minimum length filed and the index field

public byte sequence length filter get value ( ) { int index = index box get int value ( ) ; int min length = min length box get int value ( ) ; if ( index > min length ) { return null ; } try { return new byte sequence length filter ( index , min length ) ; } catch ( illegal argument exception e ) { return null ; } }


returns the field element at the given screen location

public field element get field element ( int screen row , int screen column ) ;


public record writer < k , v > get record writer ( file system filesystem , job conf job , string name , progressable progress ) throws i o exception { org apache hadoop mapreduce record writer < k , v > w = super get record writer ( new task attempt context impl ( job , task attempt i d for name ( job get ( m r job config task attempt id ) ) ) ) ; org apache hadoop mapreduce lib db d b output format d b record writer writer = ( org apache hadoop mapreduce lib db d b output format d b record writer ) w ; try { return new d b record writer ( writer get connection ( ) , writer get statement ( ) ) ; } catch ( s q l exception se ) { throw new i o exception ( se ) ; } }


gets a url for the internet connection check

public string get connection check url ( ) { data dt = get data ( ) ; if ( dt = = null ) return " http : / / www google com / " ; return dt connection check url ; }


writes an { @ code int } as specified by { @ link data output stream # write int ( int ) } , except using little - endian byte order

public void write int ( int v ) throws i o exception { out write ( 0x f f & v ) ; out write ( 0x f f & ( v > > 8 ) ) ; out write ( 0x f f & ( v > > 16 ) ) ; out write ( 0x f f & ( v > > 24 ) ) ; }


public void add ( int value ) { indexer put ( value ) ; }


returns a { @ code collector } expecting the specified number of insertions , and yielding a { @ link bloom filter } with false positive probability 3 % note that if the { @ code collector } receives significantly more elements than specified , the resulting { @ code bloom filter } will suffer a sharp deterioration of its false positive probability the constructed { @ code bloom filter } will be serializable if the provided { @ code funnel < t > } is it is recommended that the funnel be implemented as a java enum this has the benefit of ensuring proper serialization and deserialization , which is important since { @ link # equals } also relies on object identity of funnels

public static < t > collector < t , ? , bloom filter < t > > to bloom filter ( funnel < ? super t > funnel , long expected insertions ) { return to bloom filter ( funnel , expected insertions , 0 03 ) ; }


returns the folder item path within the repository

public string get path name ( ) { return folder path + file system separator + item name ; }


catches the issue where the user could not move a label within a namespace under the global namespace to directly under the global namespace see tracker id 901

public void test move current label to global namespace ( ) { symbol s = get unique symbol ( program , " entry " , null ) ; address entry address = s get address ( ) ; add label ( entry address ) ; set text ( " label 1 " ) ; press ok ( ) ; assert true ( " encountered a problem adding a label to the global " + " namespace " , ! dialog is visible ( ) ) ; / / move the label to a new namespace s = get unique symbol ( program , " label 1 " , null ) ; edit label ( s ) ; set text ( " namespace 1 : : label 1 " ) ; press ok ( ) ; / / make sure there were no problems assert true ( " encountered a problem changing a symbol ' s namespace " + " while editing the symbol " , ! dialog is visible ( ) ) ; / / now move that label to the global namespace s = st get symbols ( " label 1 " ) next ( ) ; edit label ( s ) ; set text ( " global : : label 1 " ) ; press ok ( ) ; assert true ( " encountered a problem changing a symbol ' s namespace to " + " the global namespace while editing the symbol " , ! dialog is visible ( ) ) ; }


return a path with the link resolved with the target

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


set the schema language default is the w3c xml schema : { @ code http : www w 3 org 2 0 0 1 x m l schema " }

public void set schema language ( string schema language ) { this schema language = schema language ; }


loads settings from a stream that represents them using { @ link # from x content ( x content parser ) }

public builder load from stream ( string resource name , input stream is , boolean accept null values ) throws i o exception { final x content type x content type ; if ( resource name ends with ( " json " ) ) { x content type = x content type json ; } else if ( resource name ends with ( " yml " ) | | resource name ends with ( " yaml " ) ) { x content type = x content type yaml ; } else { throw new illegal argument exception ( " unable to detect content type from resource name [ " + resource name + " ] " ) ; } / / from x content doesn ' t use named xcontent or deprecation try ( x content parser parser = x content factory x content ( x content type ) create parser ( named x content registry empty , deprecation handler throw unsupported operation , is ) ) { if ( parser current token ( ) = = null ) { if ( parser next token ( ) = = null ) { return this ; / / empty file } } put ( from x content ( parser , accept null values , true ) ) ; } catch ( elasticsearch parse exception e ) { throw e ; } catch ( exception e ) { throw new settings exception ( " failed to load settings from [ " + resource name + " ] " , e ) ; } finally { i o utils close ( is ) ; } return this ; }


if the string contains a single variable , return the expansion of that variable otherwise , return null

public static string expand single variable ( string expression , template context context ) throws expansion exception { string var = new template expander ( expression ) get single variable ( ) ; return ( var ! = null ) ? context lookup variable ( var ) : null ; }


analyze backup storage directories for consistency < br > recover from incomplete checkpoints if required < br > read version and fstime files if exist < br > do not load image or edits

void recover create read ( ) throws i o exception { for ( iterator < storage directory > it = storage dir iterator ( ) ; it has next ( ) ; ) { storage directory sd = it next ( ) ; storage state cur state ; try { cur state = sd analyze storage ( hdfs server constants startup option regular , storage ) ; / / sd is locked but not opened switch ( cur state ) { case non existent : / / fail if any of the configured storage dirs are inaccessible throw new inconsistent f s state exception ( sd get root ( ) , " checkpoint directory does not exist or is not accessible " ) ; case not formatted : / / for backup node all directories may be unformatted initially log info ( " storage directory " + sd get root ( ) + " is not formatted " ) ; log info ( " formatting " ) ; sd clear directory ( ) ; / / create empty current break ; case normal : break ; default : / / recovery is possible sd do recover ( cur state ) ; } if ( cur state ! = storage state not formatted ) { / / read and verify consistency with other directories storage read properties ( sd ) ; } } catch ( i o exception ioe ) { sd unlock ( ) ; throw ioe ; } } }


public m t config get state ( ) { return this ; }


returns a string containing all non - matching characters of a character sequence , in order for example : { @ code char matcher is ( ' a ' ) remove from ( " bazaar " ) } returns { @ code " bzr " }

public string remove from ( char sequence sequence ) { string string = sequence to string ( ) ; int pos = index in ( string ) ; if ( pos = = - 1 ) { return string ; } char [ ] chars = string to char array ( ) ; int spread = 1 ; / / this unusual loop comes from extensive benchmarking out : while ( true ) { pos + + ; while ( true ) { if ( pos = = chars length ) { break out ; } if ( matches ( chars [ pos ] ) ) { break ; } chars [ pos - spread ] = chars [ pos ] ; pos + + ; } spread + + ; } return new string ( chars , 0 , pos - spread ) ; }


this assumes the client limits metadata size to grpc util default max header list size

public void client checks inbound metadata size trailer ( ) throws exception { server start ( server listener ) ; client = new client transport ( server ) ; start transport ( client , mock client transport listener ) ; mock server transport listener server transport listener = server listener take listener or fail ( timeout ms , time unit milliseconds ) ; server transport = server transport listener transport ; metadata key < string > tell tale key = metadata key of ( " tell - tale " , metadata ascii string marshaller ) ; metadata too large metadata = new metadata ( ) ; too large metadata put ( tell tale key , " true " ) ; too large metadata put ( metadata key of ( " foo - bin " , metadata binary byte marshaller ) , new byte [ grpc util default max header list size ] ) ; client stream client stream = client new stream ( method descriptor , new metadata ( ) , call options ) ; client stream listener base client stream listener = new client stream listener base ( ) ; client stream start ( client stream listener ) ; client stream write message ( method descriptor stream request ( " foo " ) ) ; client stream half close ( ) ; client stream request ( 1 ) ; stream creation server stream creation = server transport listener take stream or fail ( timeout ms , time unit milliseconds ) ; server stream creation stream request ( 1 ) ; server stream creation stream write headers ( new metadata ( ) ) ; server stream creation stream write message ( method descriptor stream response ( " response " ) ) ; server stream creation stream close ( status ok , too large metadata ) ; status status = client stream listener status get ( timeout ms , time unit milliseconds ) ; list < status code > code options = arrays as list ( status code unknown , status code resource exhausted , status code internal ) ; if ( ! code options contains ( status get code ( ) ) ) { fail ( " status code was not expected : " + status ) ; } metadata metadata = client stream listener trailers get ( timeout ms , time unit milliseconds ) ; assert null ( metadata get ( tell tale key ) ) ; }


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


gets the command line string of vm arguments to use for the launch for the current { @ link platform platform }

public string get vm args ( ) { string builder sb = new string builder ( ) ; list < string > vmarg list = property map get ( vmargs ) ; if ( vmarg list ! = null ) { for ( string arg : vmarg list ) { sb append ( arg ) ; sb append ( " " ) ; } } list < string > vmarg platform list = property map get ( vmargs platform ) ; if ( vmarg platform list ! = null ) { for ( string arg : vmarg platform list ) { sb append ( arg ) ; sb append ( " " ) ; } } return sb to string ( ) ; }


return a target given its label and a set of package values we know to contain the target this method assumes { @ code setting } is a valid build setting target or an alias of a build setting target based on checking done in { @ code # verify build settings and get aliases }

private static target get build setting target ( map < package value key , package value > build setting packages , label setting ) { package build setting package = build setting packages get ( package value key ( setting get package identifier ( ) ) ) get package ( ) ; preconditions check not null ( build setting package , " reading build setting for which we don ' t have a package " ) ; target build setting target ; try { build setting target = build setting package get target ( setting get name ( ) ) ; } catch ( no such target exception e ) { / / this should never happen , see javadoc throw new illegal state exception ( e ) ; } return build setting target ; }


map of string keys and values that can be used by source and sink to communicate arbitrary metadata about this resource < code > map & lt ; string , string & gt ; annotations = 5 ; < code >

public builder put annotations ( java lang string key , java lang string value ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } if ( value = = null ) { throw new java lang null pointer exception ( ) ; } internal get mutable annotations ( ) get mutable map ( ) put ( key , value ) ; return this ; }


check that an unknown logging config is rejected

public void test 1 2 3 cannot use unknown logging config ( ) { final result result = run container expecting failure ( distribution ( ) , builder ( ) env vars ( map of ( " es log style " , " unknown " ) ) ) ; assert that ( result stderr , contains string ( " error : es log style set to [ unknown ] expected [ console ] or [ file ] " ) ) ; }


returns the current age of the response , in milliseconds the calculation is specified by rfc 2616 , 13 2 3 age calculations

private long compute age ( long now millis ) { long apparent received age = served date ! = null ? math max ( 0 , received response millis - served date get time ( ) ) : 0 ; long received age = age seconds ! = - 1 ? math max ( apparent received age , time unit seconds to millis ( age seconds ) ) : apparent received age ; long response duration = received response millis - sent request millis ; long resident duration = now millis - received response millis ; return received age + response duration + resident duration ; }


public base adapter helper set text color res ( int view id , int text color res ) { text view view = retrieve view ( view id ) ; view set text color ( context get resources ( ) get color ( text color res ) ) ; return this ; }


returns the byte order used by this buffer when converting doubles fromto bytes if this buffer is not based on a byte buffer , then this always returns the platform ' s native byte order


this test ensures the { @ link error type # unrecognized assoc option } warning is produced as described in the documentation

@ test public void test unrecognized assoc option ( ) { string grammar = " grammar a ; \ n " + " x : ' x ' \ n " + " | x ' + ' < assoc = right > x / / warning 157 \ n " + " | < assoc = right > x ' * ' x / / ok \ n " + " ; \ n " ; string expected = " warning ( " + error type unrecognized assoc option code + " ) : a g 4 : 3 : 10 : rule x contains an assoc terminal option in an unrecognized location \ n " ; string [ ] pair = new string [ ] { grammar , expected } ; super test errors ( pair , true ) ; }


return true if this additional properties boolean object is equal to o

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


returns the weighted out - degree of this vertex the out - degree is the sum of weights of all enges entering this vertex

public double out degree ( vertex v ) { double degree = 0 0 ; edge [ ] edges = this outgoing edges ( v ) ; int length = edges length ; for ( int i = 0 ; i < length ; i + + ) { try { degree + = weights ( ) get value ( edges [ i ] ) ; } catch ( no value exception exc ) { degree + = default value ; } } return degree ; }


return the jdbc password to use for connecting through the driver

public string get password ( ) { return this password ; }


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


tests that extra slots are kept by the { @ link slot pool impl }

public void test extra slots are kept ( ) throws exception { final completable future < allocation i d > allocation id future = new completable future < > ( ) ; testing resource manager gateway resource manager gateway = new testing resource manager gateway ( ) ; resource manager gateway set request slot consumer ( ( slot request slot request ) - > allocation id future complete ( slot request get allocation id ( ) ) ) ; try ( testing slot pool impl pool = new slot pool builder ( test main thread executor get main thread executor ( ) ) set resource manager gateway ( resource manager gateway ) build ( ) ) { final completable future < slot request id > slot request timeout future = new completable future < > ( ) ; pool set timeout pending slot request consumer ( slot request timeout future : : complete ) ; final completable future < physical slot > future = test main thread executor execute ( ( ) - > pool request new allocated slot ( new slot request id ( ) , resource profile unknown , fast timeout ) ) ; try { future get ( ) ; fail ( " we expected a timeout exception " ) ; } catch ( execution exception e ) { assert true ( exception utils strip execution exception ( e ) instanceof timeout exception ) ; } / / wait until we have timed out the slot request slot request timeout future get ( ) ; assert equals ( 0l , pool get number of pending requests ( ) ) ; allocation i d allocation id = allocation id future get ( ) ; final slot offer slot offer = new slot offer ( allocation id , 0 , resource profile any ) ; final task manager location task manager location = new local task manager location ( ) ; final task manager gateway task manager gateway = new simple acking task manager gateway ( ) ; test main thread executor execute ( ( ) - > pool register task manager ( task manager location get resource i d ( ) ) ) ; assert true ( test main thread executor execute ( ( ) - > pool offer slot ( task manager location , task manager gateway , slot offer ) ) ) ; assert true ( pool contains available slot ( allocation id ) ) ; } }


creates list of users with given input array

public void create users with array input ( @ valid list < user > body ) ;


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


test serialization of outer number types

public single < big decimal > rx fake outer number serialize ( big decimal body , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate fake outer number serialize ( body , auth info , fut ) ) ) ; }


switch the using database to default with configuration by litepal xml

public static void use default ( ) { operator use default ( ) ; }


the src files is on the local disk add it to filesystem at the given dst name , removing the source afterwards

public void move from local file ( path [ ] srcs , path dst ) throws i o exception { copy from local file ( true , true , srcs , dst ) ; }


test serialization of object with outer number type

public outer composite fake outer composite serialize ( outer composite body ) throws api exception { object local var post body = body ; / / create path and map variables string local var path = " / fake / outer / composite " ; / / query params list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " * / * " } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; generic type < outer composite > local var return type = new generic type < outer composite > ( ) { } ; return api client invoke a p i ( local var path , " post " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , local var return type ) ; }


actually do the work the security context will be that in effect when the web request was made { @ link stapler # get current request } will also be similar to that in effect when the web request was made ; at least , { @ link ancestor } s and basic request properties ( uri , locale , and so on ) will be available

protected abstract void compute ( ) throws exception ;


returns the original source file only for blacklisting protos !

artifact get original source file ( ) { return original source file ; }


convert this { @ link status } to a { @ link runtime exception } use { @ link # from throwable } to recover this { @ link status } instance when the returned exception is in the causal chain

public status runtime exception as runtime exception ( ) { return new status runtime exception ( this ) ; }


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public generate default layout method parent layout $ with layout on visibility changed ( on model visibility changed listener < generate default layout method parent layout $ with layout , object > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


return true if undefined data exists at the given address ; return false if code unit exists , thus editing is not allowed

private boolean edit allowed ( address addr , long length ) { listing listing = program get listing ( ) ; address a = addr ; for ( int i = 0 ; i < length ; i + + ) { try { a = a add no wrap ( i ) ; } catch ( address overflow exception e ) { return false ; } code unit cu = listing get code unit containing ( a ) ; if ( cu instanceof data ) { continue ; } return false ; } return true ; }


returns finalizer class or null if this loader shouldn ' t or can ' t load it


returns a range that contains all values less than or equal to { @ code endpoint }

public static < c extends comparable < ? > > range < c > at most ( c endpoint ) { return create ( cut < c > below all ( ) , cut above value ( endpoint ) ) ; }


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

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


create named { @ link bind markers } using identifiers to bind parameters named bind markers support { @ link bind markers # next ( string ) name hints } if no { @ link bind markers # next ( string ) hint } is given , named bind markers can use a counter or a random value source to generate unique bind markers

static bind markers factory named ( string prefix , string name prefix , int max length , function < string , string > hint filter function ) { assert not null ( prefix , " prefix must not be null " ) ; assert not null ( name prefix , " index prefix must not be null " ) ; assert not null ( hint filter function , " hint filter function must not be null " ) ; return ( ) - > new named bind markers ( prefix , name prefix , max length , hint filter function ) ; }


creates a null pointer exception with a composed message via { @ link # null warning ( string ) }

public static null pointer exception create null pointer exception ( string prefix ) { return new null pointer exception ( null warning ( prefix ) ) ; }


set the default parent for views defined in the { @ code resource bundle } this avoids repeated " yyy 1 ( parent ) = xxx " , " yyy 2 ( parent ) = xxx " definitions in the bundle , especially if all defined views share the same parent the parent will typically define the view class and common attributes concrete views might simply consist of a url definition then : a la " yyy 1 url = my jsp " , " yyy 2 url = your jsp " view definitions that define their own parent or carry their own class can still override this strictly speaking , the rule that a default parent setting does not apply to a bean definition that carries a class is there for backwards compatibility reasons it still matches the typical use case

public void set default parent view ( string default parent view ) { this default parent view = default parent view ; }


returns the string value for the given key if the key does not exist it will return null

public string get ( string key ) { add to defaults ( key , null ) ; unrequested parameters remove ( key ) ; return data get ( key ) ; }


create the wrapped committer this includes customizing its options , and setting up the destination directory

protected file output committer create wrapped committer ( job context context , configuration conf ) throws i o exception { / / explicitly choose commit algorithm init file output committer options ( context ) ; commits directory = paths get multipart upload commits directory ( conf , get u u i d ( ) ) ; return new file output committer ( commits directory , context ) ; }


returns pet inventories by status returns a map of status codes to quantities

public void get inventory test ( ) { / / map < string , integer > response = api get inventory ( ) ; / / assert not null ( response ) ; / / todo : test validations }


get a { @ link marshaller } for the given { @ link channel handler context }

marshaller get marshaller ( channel handler context ctx ) throws exception ;


this method attempts to find a grok pattern that will match all of the sample messages in their entirety it will also update mappings and field stats if they are non - < code > null < code >

public tuple < string , string > find full line grok pattern ( string timestamp field ) { for ( full match grok pattern candidate candidate : full match grok patterns ) { if ( timestamp field = = null | | timestamp field equals ( candidate get time field ( ) ) ) { if ( candidate matches all ( sample messages , timeout checker ) ) { return candidate process match ( explanation , sample messages , mappings , field stats , timeout checker ) ; } } } return null ; }


dynamically create a new ssl context based on the current state of the configuration because the { @ link # get key config ( ) key config } and { @ link # get trust config ( ) trust config } may change based on the contents of their referenced files ( see { @ link # get dependent files ( ) } , consecutive calls to this method may return ssl - contexts with different configurations

public s s l context create ssl context ( ) { final x 5 0 9 extended key manager key manager = key config create key manager ( ) ; final x 5 0 9 extended trust manager trust manager = trust config create trust manager ( ) ; try { s s l context ssl context = s s l context get instance ( context protocol ( ) ) ; ssl context init ( new x 5 0 9 extended key manager [ ] { key manager } , new x 5 0 9 extended trust manager [ ] { trust manager } , null ) ; return ssl context ; } catch ( general security exception e ) { throw new ssl config exception ( " cannot create ssl context " , e ) ; } }


convenience method to dispatch to converters for individual message types

private object convert to object ( message message , java type target java type ) throws j m s exception , i o exception { if ( message instanceof text message ) { return convert from text message ( ( text message ) message , target java type ) ; } else if ( message instanceof bytes message ) { return convert from bytes message ( ( bytes message ) message , target java type ) ; } else { return convert from message ( message , target java type ) ; } }


returns all the { @ link view property descriptor } s that can be potentially configured on this view returns both { @ link view property descriptor } s visible and invisible for user , see { @ link view # get visible property descriptors } to filter invisible one

public list < view property descriptor > get applicable property descriptors ( ) { list < view property descriptor > r = new array list < > ( ) ; for ( view property descriptor pd : view property all ( ) ) { if ( pd is enabled for ( this ) ) r add ( pd ) ; } return r ; }


test that when there are no outliers , we get back nothing

public void test with no outliers ( ) throws exception { data node peer metrics peer metrics = new data node peer metrics ( " peer metrics - for - test " , conf ) ; metrics test helper replace rolling averages scheduler ( peer metrics get send packet downstream rolling averages ( ) , rolling average windows , window interval seconds , time unit seconds ) ; inject fast nodes samples ( peer metrics ) ; / / trigger a snapshot peer metrics dump send packet downstream avg info as json ( ) ; / / ensure that we get back the outlier assert true ( peer metrics get outliers ( ) is empty ( ) ) ; }


static byte [ ] to bytes ( list < x attr > x attrs ) { if ( x attrs = = null | | x attrs is empty ( ) ) { return null ; } byte array output stream out = new byte array output stream ( ) ; try { for ( x attr a : x attrs ) { / / big - endian int v = x attr format to int ( a ) ; out write ( ints to byte array ( v ) ) ; int vlen = a get value ( ) = = null ? 0 : a get value ( ) length ; preconditions check argument ( vlen < xattr value len max , " the length of x attr values is too long " ) ; out write ( ( byte ) ( vlen > > 8 ) ) ; out write ( ( byte ) ( vlen ) ) ; if ( vlen > 0 ) { out write ( a get value ( ) ) ; } } } catch ( i o exception e ) { / / in fact , no exception } return out to byte array ( ) ; }


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

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


returns the internal element type of a given internal array type

public static string internal type from array type ( string internal array type ) { int index = internal array type last index of ( class constants type array ) ; return internal array type substring ( index + 1 ) ; }


public void test big cat ( ) { / / todo : test big cat }


public put index template request source ( map < string , object > template source ) { map < string , object > source = template source ; for ( map entry < string , object > entry : source entry set ( ) ) { string name = entry get key ( ) ; if ( name equals ( " index patterns " ) ) { if ( entry get value ( ) instanceof string ) { patterns ( collections singleton list ( ( string ) entry get value ( ) ) ) ; } else if ( entry get value ( ) instanceof list ) { list < string > elements = ( ( list < ? > ) entry get value ( ) ) stream ( ) map ( object : : to string ) collect ( collectors to list ( ) ) ; patterns ( elements ) ; } else { throw new illegal argument exception ( " malformed [ index patterns ] value , should be a string or a list of strings " ) ; } } else if ( name equals ( " order " ) ) { order ( x content map values node integer value ( entry get value ( ) , order ( ) ) ) ; } else if ( " version " equals ( name ) ) { if ( ( entry get value ( ) instanceof integer ) = = false ) { throw new illegal argument exception ( " malformed [ version ] value , should be an integer " ) ; } version ( ( integer ) entry get value ( ) ) ; } else if ( name equals ( " settings " ) ) { if ( ( entry get value ( ) instanceof map ) = = false ) { throw new illegal argument exception ( " malformed [ settings ] section , should include an inner object " ) ; } settings ( ( map < string , object > ) entry get value ( ) ) ; } else if ( name equals ( " mappings " ) ) { map < string , object > mappings = ( map < string , object > ) entry get value ( ) ; for ( map entry < string , object > entry 1 : mappings entry set ( ) ) { if ( ! ( entry 1 get value ( ) instanceof map ) ) { throw new illegal argument exception ( " malformed [ mappings ] section for type [ " + entry 1 get key ( ) + " ] , should include an inner object describing the mapping " ) ; } mapping ( ( map < string , object > ) entry 1 get value ( ) ) ; } } else if ( name equals ( " aliases " ) ) { aliases ( ( map < string , object > ) entry get value ( ) ) ; } else { throw new elasticsearch parse exception ( " unknown key [ { } ] in the template " , name ) ; } } return this ; }


accepts a collection of possibly - null entries if { @ code same comparator } , then it is assumed that they do not need to be sorted or checked for dupes

private static < k , v > immutable sorted map < k , v > from entries ( comparator < ? super k > comparator , boolean same comparator , iterable < ? extends entry < ? extends k , ? extends v > > entries ) { / / " adding " type params to an array of a raw type should be safe as / / long as no one can ever cast that same array instance back to a / / raw type @ suppress warnings ( " unchecked " ) entry < k , v > [ ] entry array = ( entry [ ] ) iterables to array ( entries , empty entry array ) ; return from entries ( comparator , same comparator , entry array , entry array length ) ; }


" overrides " the static method in { @ link managed channel builder }

public static google default channel builder for address ( string name , int port ) { return for target ( grpc util authority from host and port ( name , port ) ) ; }


get the previous long value in this iterator


returns the sum of this double value and the given specific double value

public double value add ( specific double value other ) { return add ( ( double value ) other ) ; }


public file get snap dir ( ) { return snap dir ; }


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

public com android aapt resources xml node or builder get child or builder ( int index ) { return child get ( index ) ; }


enabledisable the option to allow another symbol be set to primary when the existing primary symbol is a mangled symbol , regardless of the symbol source type this is typically used when we can get better data type information from the pdb record than we can from the demangler

public void set allow demote primary mangled symbols ( boolean enable ) { this allow demote primary mangled symbols = enable ; }


returns a { @ link request builder } for a given item on which { @ link request builder # load ( object ) } } has been called or { @ code null } if no valid load can be started for the preloader to be effective , the { @ link request builder } returned here must use exactly the same size and set of options as the { @ link request builder } used when the ` ` view ` ` is bound you may need to specify a size in both places to ensure that the width and height match exactly if so , you can use { @ link com bumptech glide request request options # override ( int , int ) } to do so the target and context will be provided by the preloader if { @ link request builder # load ( object ) } is not called by this method , the preloader will trigger a { @ link runtime exception } if you don ' t want to load a particular item or position , filter it from the list returned by { @ link # get preload items ( int ) }

request builder < ? > get preload request builder ( @ non null u item ) ;


construct a random action graph , and initialize the file system so that all of the input files exist and none of the output files exist

public list < counter > build random action graph ( int action graph number ) throws i o exception { list < counter > counters = new array list < > ( num artifacts ) ; artifacts = new artifact [ num artifacts ] ; for ( int i = 0 ; i < num artifacts ; i + + ) { artifacts [ i ] = create derived artifact ( " file " + action graph number + " - " + i ) ; } int num outputs ; for ( int i = 0 ; i < artifacts length ; i + = num outputs ) { int num inputs = random next int ( 3 ) ; num outputs = 1 + random next int ( 2 ) ; if ( i + num outputs > = artifacts length ) { num outputs = artifacts length - i ; } nested set builder < artifact > inputs = nested set builder stable order ( ) ; for ( int j = 0 ; j < num inputs ; j + + ) { if ( i ! = 0 ) { int input num = random next int ( i ) ; inputs add ( artifacts [ input num ] ) ; } } collection < artifact > outputs = new array list < > ( num outputs ) ; for ( int j = 0 ; j < num outputs ; j + + ) { outputs add ( artifacts [ i + j ] ) ; } counters add ( create action counter ( inputs build ( ) , immutable set copy of ( outputs ) ) ) ; if ( inputs is empty ( ) ) { / / source files - - create them for ( artifact output : outputs ) { blaze test utils make empty file ( output get path ( ) ) ; } } else { / / generated files - - delete them for ( artifact output : outputs ) { try { output get path ( ) delete ( ) ; } catch ( file not found exception e ) { / / ok } } } } return counters ; }


returns the transform for this group ' s coordinate system

protected matrix 4 compute transform ( ) { affine 2 world transform = this world transform ; float origin x = this origin x , origin y = this origin y ; world transform set to trn rot scl ( x + origin x , y + origin y , rotation , scale x , scale y ) ; if ( origin x ! = 0 | | origin y ! = 0 ) world transform translate ( - origin x , - origin y ) ; / / find the first parent that transforms group parent group = parent ; while ( parent group ! = null ) { if ( parent group transform ) break ; parent group = parent group parent ; } if ( parent group ! = null ) world transform pre mul ( parent group world transform ) ; computed transform set ( world transform ) ; return computed transform ; }


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


returns this module ' s additional predeclared bindings ( excludes { @ link starlark # universe } ) the map reflects any semantics - based filtering of flag guarded values done by { @ link # with predeclared } : enabled flag guarded values are replaced by their underlying value

public immutable map < string , object > get predeclared bindings ( ) { return predeclared ; }


return id of user which created this agent

public string get user id ( ) { return user id ; }


protected void spawn particles ( string particle type , int count ) { logger info ( " spawn " + count + " particle with type " + particle type ) ; }


clones the given writable using the { @ link i o readable writable serialization }

public static < t extends i o readable writable > t create copy writable ( t original ) throws i o exception { if ( original = = null ) { return null ; } final byte array output stream baos = new byte array output stream ( ) ; try ( data output view stream wrapper out = new data output view stream wrapper ( baos ) ) { original write ( out ) ; } final byte array input stream bais = new byte array input stream ( baos to byte array ( ) ) ; try ( data input view stream wrapper in = new data input view stream wrapper ( bais ) ) { @ suppress warnings ( " unchecked " ) t copy = ( t ) instantiate ( original get class ( ) ) ; copy read ( in ) ; return copy ; } }