public void test term caps ( ) { / / backspace assert keys equals ( " \ u 0 0 7f " , key handler get code from termcap ( " kb " , false , false ) ) ; / / back tab assert keys equals ( " \ 033 [ z " , key handler get code from termcap ( " k b " , false , false ) ) ; / / arrow keys ( up / down / right / left ) : assert keys equals ( " \ 033 [ a " , key handler get code from termcap ( " ku " , false , false ) ) ; assert keys equals ( " \ 033 [ b " , key handler get code from termcap ( " kd " , false , false ) ) ; assert keys equals ( " \ 033 [ c " , key handler get code from termcap ( " kr " , false , false ) ) ; assert keys equals ( " \ 033 [ d " , key handler get code from termcap ( " kl " , false , false ) ) ; / / shifted : assert keys equals ( " \ 033 [ 1 ; 2a " , key handler get code from termcap ( " k u p " , false , false ) ) ; assert keys equals ( " \ 033 [ 1 ; 2b " , key handler get code from termcap ( " k d n " , false , false ) ) ; assert keys equals ( " \ 033 [ 1 ; 2c " , key handler get code from termcap ( " % i " , false , false ) ) ; assert keys equals ( " \ 033 [ 1 ; 2d " , key handler get code from termcap ( " # 4 " , false , false ) ) ; / / home / end keys : assert keys equals ( " \ 033 [ h " , key handler get code from termcap ( " kh " , false , false ) ) ; assert keys equals ( " \ 033 [ f " , key handler get code from termcap ( " @ 7 " , false , false ) ) ; / / shifted : assert keys equals ( " \ 033 [ 1 ; 2h " , key handler get code from termcap ( " # 2 " , false , false ) ) ; assert keys equals ( " \ 033 [ 1 ; 2f " , key handler get code from termcap ( " * 7 " , false , false ) ) ; / / the traditional keyboard keypad : / / [ insert ] [ home ] [ page up ] / / [ delete ] [ end ] [ page down ] / / / / termcap names ( with xterm response in parenthesis ) : / / k1 = upper left of keypad ( xterm sends same " < esc > [ h " = home ) / / k2 = center of keypad ( xterm sends invalid response ) / / k3 = upper right of keypad ( xterm sends " < esc > [ 5 ~ " = page up ) / / k4 = lower left of keypad ( xterm sends " < esc > [ f " = end key ) / / k5 = lower right of keypad ( xterm sends " < esc > [ 6 ~ " = page down ) / / / / vim / neovim ( runtime / doc / term txt ) : / / t k1 < k home > keypad home key / / t k3 < k page up > keypad page - up key / / t k4 < k end > keypad end key / / t k5 < k page down > keypad page - down key / / assert keys equals ( " \ 033 [ h " , key handler get code from termcap ( " k1 " , false , false ) ) ; assert keys equals ( " \ 033oh " , key handler get code from termcap ( " k1 " , true , false ) ) ; assert keys equals ( " \ 033 [ 5 ~ " , key handler get code from termcap ( " k3 " , false , false ) ) ; assert keys equals ( " \ 033 [ f " , key handler get code from termcap ( " k4 " , false , false ) ) ; assert keys equals ( " \ 033of " , key handler get code from termcap ( " k4 " , true , false ) ) ; assert keys equals ( " \ 033 [ 6 ~ " , key handler get code from termcap ( " k5 " , false , false ) ) ; / / function keys f1 - f12 : assert keys equals ( " \ 033op " , key handler get code from termcap ( " k 1 " , false , false ) ) ; assert keys equals ( " \ 033oq " , key handler get code from termcap ( " k 2 " , false , false ) ) ; assert keys equals ( " \ 033or " , key handler get code from termcap ( " k 3 " , false , false ) ) ; assert keys equals ( " \ 033os " , key handler get code from termcap ( " k 4 " , false , false ) ) ; assert keys equals ( " \ 033 [ 15 ~ " , key handler get code from termcap ( " k 5 " , false , false ) ) ; assert keys equals ( " \ 033 [ 17 ~ " , key handler get code from termcap ( " k 6 " , false , false ) ) ; assert keys equals ( " \ 033 [ 18 ~ " , key handler get code from termcap ( " k 7 " , false , false ) ) ; assert keys equals ( " \ 033 [ 19 ~ " , key handler get code from termcap ( " k 8 " , false , false ) ) ; assert keys equals ( " \ 033 [ 20 ~ " , key handler get code from termcap ( " k 9 " , false , false ) ) ; assert keys equals ( " \ 033 [ 21 ~ " , key handler get code from termcap ( " k ; " , false , false ) ) ; assert keys equals ( " \ 033 [ 23 ~ " , key handler get code from termcap ( " f1 " , false , false ) ) ; assert keys equals ( " \ 033 [ 24 ~ " , key handler get code from termcap ( " f2 " , false , false ) ) ; / / function keys f13 - f24 ( same as shifted f1 - f12 ) : assert keys equals ( " \ 033 [ 1 ; 2p " , key handler get code from termcap ( " f3 " , false , false ) ) ; assert keys equals ( " \ 033 [ 1 ; 2q " , key handler get code from termcap ( " f4 " , false , false ) ) ; assert keys equals ( " \ 033 [ 1 ; 2r " , key handler get code from termcap ( " f5 " , false , false ) ) ; assert keys equals ( " \ 033 [ 1 ; 2s " , key handler get code from termcap ( " f6 " , false , false ) ) ; assert keys equals ( " \ 033 [ 15 ; 2 ~ " , key handler get code from termcap ( " f7 " , false , false ) ) ; assert keys equals ( " \ 033 [ 17 ; 2 ~ " , key handler get code from termcap ( " f8 " , false , false ) ) ; assert keys equals ( " \ 033 [ 18 ; 2 ~ " , key handler get code from termcap ( " f9 " , false , false ) ) ; assert keys equals ( " \ 033 [ 19 ; 2 ~ " , key handler get code from termcap ( " fa " , false , false ) ) ; assert keys equals ( " \ 033 [ 20 ; 2 ~ " , key handler get code from termcap ( " fb " , false , false ) ) ; assert keys equals ( " \ 033 [ 21 ; 2 ~ " , key handler get code from termcap ( " fc " , false , false ) ) ; assert keys equals ( " \ 033 [ 23 ; 2 ~ " , key handler get code from termcap ( " fd " , false , false ) ) ; assert keys equals ( " \ 033 [ 24 ; 2 ~ " , key handler get code from termcap ( " fe " , false , false ) ) ; }


computes the total width , in register - units , of the parameters for this method

static int compute param width ( concrete method meth , boolean is static ) { return meth get effective descriptor ( ) get parameter types ( ) get word count ( ) ; }


use the { @ link # set database populator database populator } to set up the database

public void after properties set ( ) { execute ( this database populator ) ; }


concatenate list of suffix strings ' ' separated

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


public to with timestamp ( final long timestamp ) { this timestamp = timestamp ; return this ; }


sets the log formatter if unset , the class named by the " formatter " field in the jvm logging configuration for { @ link simple log handler } will be used ; and if that ' s unset , { @ link single line formatter } will be used

public builder set formatter ( formatter formatter ) { this formatter = formatter ; return this ; }


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


convert the given { @ linkplain router function router function } into a { @ link web handler } , using the given strategies

public static web handler to web handler ( router function < ? > router function , handler strategies strategies ) { assert not null ( router function , " router function must not be null " ) ; assert not null ( strategies , " handler strategies must not be null " ) ; return new router function web handler ( strategies , router function ) ; }


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

public void delete user test ( ) { string username = null ; / / api delete user ( username ) ; / / todo : test validations }


return a future which succeeds only if all the alter configs operations succeed

public kafka future < void > all ( ) { return kafka future all of ( futures values ( ) to array ( new kafka future [ 0 ] ) ) ; }


close all the proxy objects which have been opened over the lifetime of this proxy provider

public synchronized void close ( ) throws i o exception { for ( t proxy : proxies values ( ) ) { if ( proxy instanceof closeable ) { ( ( closeable ) proxy ) close ( ) ; } else { rpc stop proxy ( proxy ) ; } } }


close this interface to the resource calls on the interface are no longer value after this call


encode a barcode using the default settings

bit matrix encode ( string contents , barcode format format , int width , int height ) throws writer exception ;


public void incr ( long delta ) { value add and get ( delta ) ; set changed ( ) ; }


set the default api client , which would be used when creating api instances without providing an api client

public static void set default api client ( api client api client ) { default api client = api client ; }


establishes a swing update manager that is used to refresh the diff details

private void set up refresh details update manager ( ) { update manager = new swing update manager ( 100 , 4000 , ( ) - > do refresh details ( current location ) ) ; }


return the cached entries for the given hostname

list < ? extends dns cache entry > get ( string hostname , dns record [ ] additionals ) ;


this implementation delegates to { @ code servlet context get resource } , but throws a file not found exception if no resource found

public url get u r l ( ) throws i o exception { url url = this servlet context get resource ( this path ) ; if ( url = = null ) { throw new file not found exception ( get description ( ) + " cannot be resolved to url because it does not exist " ) ; } return url ; }


there ' s no read timeout when reading the first byte of a new frame but as soon as we start reading a frame we enable the read timeout in this test we have the server returning the first byte of a frame but no more frames

@ test public void read timeout applies within frames ( ) { web server set dispatcher ( new dispatcher ( ) { @ override public mock response dispatch ( recorded request request ) { return upgrade response ( request ) set body ( new buffer ( ) write ( byte string decode hex ( " 81 " ) ) ) / / truncated frame remove header ( " content - length " ) set socket policy ( socket policy keep open ) ; } } ) ; web socket web socket = new web socket ( ) ; client listener assert open ( ) ; client listener assert failure ( socket timeout exception class , " timeout " , " read timed out " ) ; assert that ( web socket close ( 1000 , null ) ) is false ( ) ; }


the current checkpoint which can be advanced by { @ link # mark seq no as processed ( long ) }

public long get processed checkpoint ( ) { return processed checkpoint get ( ) ; }


parses a given datetime string to milli seconds since 1970 - 01 - 01 00 : 00 : 00 utc using the default format " yyyy - mm - dd " or " yyyy - mm - dd hh : mm : ss " depends on the string length

private static long parse to time millis ( string date str , time zone tz ) { string format ; if ( date str length ( ) < = 10 ) { format = date format string ; } else { format = timestamp format string ; } return parse to time millis ( date str , format , tz ) + get millis ( date str ) ; }


returns the ascii name of the section a section name is not guaranteed to be null - terminated if you specify a section name longer than eight characters , the linker truncates it to eight characters in the executable a mechanism exists for allowing longer section names in obj files section names often start with a period , but this is not a requirement section names with a $ in the name get special treatment from the linker sections with identical names prior to the $ character are merged the characters following the $ provide an alphabetic ordering for how the merged sections appear in the final section there ' s quite a bit more to the subject of sections with $ in the name and how they ' re combined , but the details are outside the scope of this article

public string get name ( ) { return name ; }


let ' s pretend people use crappy data , but only on the first hop

@ test public void merges when missing endpoints ( ) { list < span > trace = as list ( span new builder ( ) trace id ( " a " ) id ( " a " ) put tag ( " service " , " frontend " ) put tag ( " span kind " , " server " ) build ( ) , span new builder ( ) trace id ( " a " ) parent id ( " a " ) id ( " b " ) put tag ( " service " , " frontend " ) put tag ( " span kind " , " client " ) timestamp ( 1l ) build ( ) , span ( " a " , " a " , " b " , kind server , " backend " , null , true ) , span new builder ( ) trace id ( " a " ) parent id ( " a " ) id ( " b " ) duration ( 10l ) build ( ) ) ; assert that ( trace merge ( trace ) ) using field by field element comparator ( ) contains exactly in any order ( span new builder ( ) trace id ( " a " ) id ( " a " ) put tag ( " service " , " frontend " ) put tag ( " span kind " , " server " ) build ( ) , span new builder ( ) trace id ( " a " ) parent id ( " a " ) id ( " b " ) put tag ( " service " , " frontend " ) put tag ( " span kind " , " client " ) timestamp ( 1l ) duration ( 10l ) build ( ) , span ( " a " , " a " , " b " , kind server , " backend " , null , true ) ) ; }


return the applicable { @ link network receive } instance , if any for the client side this may be a response that has been partially read , a non - null instance that has had no data read into it yet , or null ; if it is non - null then this is the instance that data should initially be read into during re - authentication for the server side this is mandatory and it must contain the { @ code sasl handshake request } that has been received on the server and that initiates re - authentication

public network receive network receive ( ) { return network receive ; }


register a custom version strategy to apply to resource u r ls that match the given path patterns

public version resource resolver add version strategy ( version strategy strategy , string path patterns ) { for ( string pattern : path patterns ) { get strategy map ( ) put ( pattern , strategy ) ; } return this ; }


returns true if the current build is likely stuck this is a heuristics based approach , but if the build is suspiciously taking for a long time , this method returns true

public boolean is likely stuck ( ) { lock read lock ( ) lock ( ) ; try { if ( executable = = null ) { return false ; } } finally { lock read lock ( ) unlock ( ) ; } long elapsed = get elapsed time ( ) ; long d = executable estimated duration ; if ( d > = 0 ) { / / if it ' s taking 10 times longer than eta , consider it stuck return d * 10 < elapsed ; } else { / / if no eta is available , a build taking longer than a day is considered stuck return time unit milliseconds to hours ( elapsed ) > 24 ; } }


public integer get snake case ( ) { return snake case ; }


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


pops the top reference value from the stack

public reference value apop ( ) { return pop ( ) reference value ( ) ; }


creates a new blocking - style stub that supports unary and streaming output calls on the service

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


resolve the given resource uri to a { @ code java io file } , i e to a file in the file system

public static file get file ( uri resource uri , string description ) throws file not found exception { assert not null ( resource uri , " resource uri must not be null " ) ; if ( ! url protocol file equals ( resource uri get scheme ( ) ) ) { throw new file not found exception ( description + " cannot be resolved to absolute file path " + " because it does not reside in the file system : " + resource uri ) ; } return new file ( resource uri get scheme specific part ( ) ) ; }


sets the number of tasks that a spawned task jvm should run before it exits

public void set num tasks to execute per jvm ( int num tasks ) { set int ( job context jvm numtasks torun , num tasks ) ; }


shard calls this on each indexingdelete op

public void bytes written ( int bytes ) { long total bytes = bytes written since check add and get ( bytes ) ; assert total bytes > = 0 ; while ( total bytes > indexing buffer get bytes ( ) / 30 ) { if ( run lock try lock ( ) ) { try { / / must pull this again because it may have changed since we first checked : total bytes = bytes written since check get ( ) ; if ( total bytes > indexing buffer get bytes ( ) / 30 ) { bytes written since check add and get ( - total bytes ) ; / / note : this is only an approximate check , because bytes written is to the translog , / / vs indexing memory buffer which is typically smaller but can be larger in extreme / / cases ( many unique terms ) this logic is here only as a safety against thread / / starvation or too infrequent checking , to ensure we are still checking periodically , / / in proportion to bytes processed by indexing : run unlocked ( ) ; } } finally { run lock unlock ( ) ; } / / must get it again since other threads could have increased it while we were in run unlocked total bytes = bytes written since check get ( ) ; } else { / / another thread beat us to it : let them do all the work , yay ! break ; } } }


postmultiplies the current transformation with a scale matrix represented by the given scale vector

public void scale ( vector 3 scale ) { scale ( scale x , scale y , scale z ) ; }


reserve at a lower priority and verify the lower priority request gets allocated

public void test reservation with multiple priorities ( ) throws i o exception { scheduler init ( conf ) ; scheduler start ( ) ; scheduler reinitialize ( conf , resource manager get r m context ( ) ) ; / / add a node r m node node 1 = mock nodes new node info ( 1 , resources create resource ( 2048 , 2 ) ) ; node added scheduler event node event 1 = new node added scheduler event ( node 1 ) ; scheduler handle ( node event 1 ) ; node update scheduler event update event = new node update scheduler event ( node 1 ) ; / / create first app and take up half resources so the second app that asks / / for the entire node won ' t have enough f s app attempt app 1 = scheduler get scheduler app ( create scheduling request ( 1024 , 1 , " queue " , " user " , 1 ) ) ; scheduler update ( ) ; scheduler handle ( update event ) ; assert equals ( " basic allocation failed " , 1 , app 1 get live containers ( ) size ( ) ) ; / / create another app and reserve at a lower priority first application attempt id att id = create scheduling request ( 2048 , 2 , " queue 1 " , " user 1 " , 1 , 2 ) ; f s app attempt app 2 = scheduler get scheduler app ( att id ) ; scheduler update ( ) ; scheduler handle ( update event ) ; assert equals ( " reservation at lower priority failed " , 1 , app 2 get reserved containers ( ) size ( ) ) ; / / request container on the second app at a higher priority create scheduling request existing application ( 2048 , 2 , 1 , att id ) ; / / complete the first container so we can trigger allocation for app 2 container id container id = app 1 get live containers ( ) iterator ( ) next ( ) get container id ( ) ; scheduler allocate ( app 1 get application attempt id ( ) , new array list < > ( ) , null , arrays as list ( container id ) , null , null , null update requests ) ; / / trigger allocation for app 2 scheduler handle ( update event ) ; / / reserved container ( at lower priority ) should be run collection < r m container > live containers = app 2 get live containers ( ) ; assert equals ( " allocation post completion failed " , 1 , live containers size ( ) ) ; assert equals ( " high prio container allocated against low prio reservation " , 2 , live containers iterator ( ) next ( ) get container ( ) get priority ( ) get priority ( ) ) ; }


stores a key - value pair in this multimap for each of { @ code values } , all using the same key , { @ code key } equivalent to ( but expected to be more efficient than ) : { @ code for ( v value : values ) { put ( key , value ) ; } } in particular , this is a no - op if { @ code values } is empty

boolean put all ( @ nullable decl k key , iterable < ? extends v > values ) ;


public multi match query builder type ( multi match query builder type type ) { if ( type = = null ) { throw new illegal argument exception ( " [ " + name + " ] requires type to be non - null " ) ; } this type = type ; return this ; }


extracts a specific value from the last saved response

public object response ( string path ) throws i o exception { return response evaluate ( path , stash ) ; }


remove the attribute of the given name , if it exists also removes the registered destruction callback for the specified attribute , if any however it does not execute the callback it is assumed the removed object will continue to be used and destroyed independently at the appropriate time

public void remove attribute ( string name ) { this attributes remove ( name ) ; remove destruction callback ( name ) ; }


get the memory requirement for the type of job corresponding to a specified persistent task name this method only works on the master node

public long get job memory requirement ( string task name , string id ) { if ( is master = = false ) { return null ; } map < string , long > memory requirement by job = memory requirement by task name get ( task name ) ; if ( memory requirement by job = = null ) { return null ; } return memory requirement by job get ( id ) ; }


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


sets a new handshaker service address for testing

public alts channel builder set handshaker address for testing ( string handshaker address ) { credentials builder set handshaker address for testing ( handshaker address ) ; return this ; }


return the content type of the response , or " applicationoctet - stream "

public media type get content type ( ) { return this content type ; }


public integer get integer ( ) { return integer ; }


public void parse qualifier element ( element ele , abstract bean definition bd ) { string type name = ele get attribute ( type attribute ) ; if ( ! string utils has length ( type name ) ) { error ( " tag ' qualifier ' must have a ' type ' attribute " , ele ) ; return ; } this parse state push ( new qualifier entry ( type name ) ) ; try { autowire candidate qualifier qualifier = new autowire candidate qualifier ( type name ) ; qualifier set source ( extract source ( ele ) ) ; string value = ele get attribute ( value attribute ) ; if ( string utils has length ( value ) ) { qualifier set attribute ( autowire candidate qualifier value key , value ) ; } node list nl = ele get child nodes ( ) ; for ( int i = 0 ; i < nl get length ( ) ; i + + ) { node node = nl item ( i ) ; if ( is candidate element ( node ) & & node name equals ( node , qualifier attribute element ) ) { element attribute ele = ( element ) node ; string attribute name = attribute ele get attribute ( key attribute ) ; string attribute value = attribute ele get attribute ( value attribute ) ; if ( string utils has length ( attribute name ) & & string utils has length ( attribute value ) ) { bean metadata attribute attribute = new bean metadata attribute ( attribute name , attribute value ) ; attribute set source ( extract source ( attribute ele ) ) ; qualifier add metadata attribute ( attribute ) ; } else { error ( " qualifier ' attribute ' tag must have a ' name ' and ' value ' " , attribute ele ) ; return ; } } } bd add qualifier ( qualifier ) ; } finally { this parse state pop ( ) ; } }


get the attempt id that took this task to completion

public task attempt i d get successful task attempt ( ) { return task attempt i d downgrade ( super get successful task attempt id ( ) ) ; }


return the uri that locates the http server

uri get server u r i ( ) { / / get http client scheme ( ) only returns https for https only policy this / / matches the behavior that the first connector is a https connector only / / for https only policy inet socket address addr = http server get connector address ( 0 ) ; return uri create ( d f s util get http client scheme ( conf ) + " : / / " + net utils get host port string ( addr ) ) ; }


get storeinventory : returns pet inventories by status returns a map of status codes to quantities

response entity < map < string , integer > > get inventory ( ) ;


indicates whether this domain is composed of two or more parts

public boolean has parent ( ) { return parts size ( ) > 1 ; }


exit a parse tree produced by { @ link eql base parser # join keys }

void exit join keys ( eql base parser join keys context ctx ) ;


sets the window size for this aggregation

public void set window ( int window ) { if ( window < = 0 ) { throw new illegal argument exception ( " [ " + window get preferred name ( ) + " ] must be a positive , non - zero integer " ) ; } this window = window ; }


flushes this writer implementations of this method should ensure that all buffered characters are written to the target

public abstract void flush ( ) throws i o exception ;


deselect all options that display text matching the argument that is , when given " bar " this would deselect an option like : & lt ; option value = " foo " & gt ; bar & lt ; option & gt ;

void deselect by visible text ( string text ) ;


any comments associated with the element < code > optional string comment = 2 ; < code >

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


number of buckets the rolling percentile window is broken into this is passed into { @ link hystrix rolling percentile } inside { @ link hystrix command metrics }

public hystrix property < integer > metrics rolling percentile window buckets ( ) { return metrics rolling percentile window buckets ; }


starts two namenodes and two secondary namenodes , verifies that secondary namenodes are configured correctly to talk to their respective namenodes and can do the checkpoint

public void test multiple secondary namenodes ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; string nameservice id 1 = " ns 1 " ; string nameservice id 2 = " ns 2 " ; conf set ( d f s config keys dfs nameservices , nameservice id 1 + " , " + nameservice id 2 ) ; mini d f s cluster cluster = null ; secondary name node secondary 1 = null ; secondary name node secondary 2 = null ; try { cluster = new mini d f s cluster builder ( conf ) nn topology ( mini d f s n n topology simple federated topology ( conf get ( d f s config keys dfs nameservices ) ) ) build ( ) ; configuration sn conf 1 = new hdfs configuration ( cluster get configuration ( 0 ) ) ; configuration sn conf 2 = new hdfs configuration ( cluster get configuration ( 1 ) ) ; inet socket address nn 1 rpc address = cluster get name node ( 0 ) get name node address ( ) ; inet socket address nn 2 rpc address = cluster get name node ( 1 ) get name node address ( ) ; string nn 1 = nn 1 rpc address get host name ( ) + " : " + nn 1 rpc address get port ( ) ; string nn 2 = nn 2 rpc address get host name ( ) + " : " + nn 2 rpc address get port ( ) ; / / set the service rpc address to empty to make sure the node specific / / setting works sn conf 1 set ( d f s config keys dfs namenode service rpc address key , " " ) ; sn conf 2 set ( d f s config keys dfs namenode service rpc address key , " " ) ; / / set the nameservice ids sn conf 1 set ( d f s util add key suffixes ( d f s config keys dfs namenode service rpc address key , nameservice id 1 ) , nn 1 ) ; sn conf 2 set ( d f s util add key suffixes ( d f s config keys dfs namenode service rpc address key , nameservice id 2 ) , nn 2 ) ; secondary 1 = start secondary name node ( sn conf 1 ) ; secondary 2 = start secondary name node ( sn conf 2 ) ; / / make sure the two secondary namenodes are talking to correct namenodes assert equals ( secondary 1 get name node address ( ) get port ( ) , nn 1 rpc address get port ( ) ) ; assert equals ( secondary 2 get name node address ( ) get port ( ) , nn 2 rpc address get port ( ) ) ; assert true ( secondary 1 get name node address ( ) get port ( ) ! = secondary 2 get name node address ( ) get port ( ) ) ; / / both should checkpoint secondary 1 do checkpoint ( ) ; secondary 2 do checkpoint ( ) ; } finally { cleanup ( secondary 1 ) ; secondary 1 = null ; cleanup ( secondary 2 ) ; secondary 2 = null ; cleanup ( cluster ) ; cluster = null ; } }


void log set permissions ( string src , fs permission permissions ) { set permissions op op = set permissions op get instance ( cache get ( ) ) set source ( src ) set permissions ( permissions ) ; log edit ( op ) ; }


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


test validates that the produced by abstract s 3 file system factory object will contains only first path from multiple paths in config

public void test multiple temp dirs config ( ) throws exception { final configuration conf = new configuration ( ) ; string dir 1 = " / tmp / dir 1 " ; string dir 2 = " / tmp / dir 2 " ; conf set string ( " io tmp dirs " , dir 1 + " , " + dir 2 ) ; test fs factory factory = new test fs factory ( ) ; factory configure ( conf ) ; flink s 3 file system fs = ( flink s 3 file system ) factory create ( new uri ( " s 3 : / / test " ) ) ; assert equals ( fs get local tmp dir ( ) , dir 1 ) ; }


determines if the supplied class object represents an abstract type

static public boolean is abstract ( class c ) { return modifier is abstract ( c get modifiers ( ) ) ; }


it is possible to retrieve the setting names even if the keystore is closed this allows { @ link secure setting } to correctly determine that a entry exists even though it cannot be read thus attempting to read a secure setting after the keystore is closed will generate a " keystore is closed " exception rather than using the fallback setting

public set < string > get setting names ( ) { assert entries get ( ) ! = null : " keystore is not loaded " ; return entries get ( ) key set ( ) ; }


returns a { @ link cache loader } that throws the given error for every request

static < k , v > cache loader < k , v > error loader ( final error e ) { check not null ( e ) ; return new cache loader < k , v > ( ) { @ override public v load ( k key ) { throw e ; } } ; }


visits a dependence of the current module

public void visit require ( final string module , final int access , final string version ) { if ( mv ! = null ) { mv visit require ( module , access , version ) ; } }


writes three code units to the given output destination , where the second and third are represented as single < code > int < code > and emitted in little - endian order

protected static void write ( annotated output out , short c 0 , int c 1c 2 ) { write ( out , c 0 , ( short ) c 1c 2 , ( short ) ( c 1c 2 > > 16 ) ) ; }


convert a { @ code collection } into a delimited { @ code string } ( e g csv ) useful for { @ code to string ( ) } implementations

public static string collection to delimited string ( @ nullable collection < ? > coll , string delim ) { return collection to delimited string ( coll , delim , " " , " " ) ; }


assert a flash attribute ' s value with the given hamcrest { @ link matcher }

public < t > result matcher attribute ( string name , matcher < ? super t > matcher ) { return result - > assert that ( " flash attribute ' " + name + " ' " , ( t ) result get flash map ( ) get ( name ) , matcher ) ; }


returns a mutable view of the underlying bytes for the given { @ code hash code } if it is a byte - based hashcode otherwise it returns { @ link hash code # as bytes } do not mutate this array or else you will break the immutability contract of { @ code hash code }

byte [ ] get bytes internal ( ) { return as bytes ( ) ; }


creates cpp pic compile action builder from the given builder by adding necessary copt and changing output and dotd file names

private cpp compile action builder copy as pic builder ( cpp compile action builder builder , string output name , artifact category output category ) throws rule error exception { cpp compile action builder pic builder = new cpp compile action builder ( builder ) ; pic builder set pic mode ( true ) set outputs ( action construction context , rule error consumer , label , output category , output name ) ; return pic builder ; }


private static string [ ] to resources ( final object [ ] args ) { val object = args [ 0 ] ; if ( object instanceof authentication transaction ) { val transaction = authentication transaction class cast ( object ) ; return new string [ ] { supplied credentials + transaction get credentials ( ) } ; } return new string [ ] { supplied credentials + collection utils wrap ( object ) } ; }


public string binding diagnostic details ( ) { return " connection = \ " " + connection description + " \ " " + " root = \ " " + registry root + " \ " " + " " + security connection diagnostics ; }


get usage statistics for the given shard

public query cache stats get stats ( shard id shard ) { final map < shard id , query cache stats > stats = new hash map < > ( ) ; for ( map entry < shard id , stats > entry : shard stats entry set ( ) ) { stats put ( entry get key ( ) , entry get value ( ) to query cache stats ( ) ) ; } query cache stats shard stats = new query cache stats ( ) ; query cache stats info = stats get ( shard ) ; if ( info = = null ) { info = new query cache stats ( ) ; } shard stats add ( info ) ; / / we also have some shared ram usage that we try to distribute to / / proportionally to their number of cache entries of each shard long total size = 0 ; for ( query cache stats s : stats values ( ) ) { total size + = s get cache size ( ) ; } final double weight = total size = = 0 ? 1d / stats size ( ) : ( ( double ) shard stats get cache size ( ) ) / total size ; final long additional ram bytes used = math round ( weight * shared ram bytes used ) ; shard stats add ( new query cache stats ( additional ram bytes used , 0 , 0 , 0 , 0 ) ) ; return shard stats ; }


protected boolean include aspect attribute ( attribute attr , collection < label > value ) { return true ; }


whether or not the memory at the indicated address appears to be a valid location for the indicated number of try block map entry data types

protected void validate model specific info ( ) throws invalid data type exception { / / does each try map entry have a valid catch handler ? int num entries = get count ( ) ; for ( int try block ordinal = 0 ; try block ordinal < num entries ; try block ordinal + + ) { if ( ! is valid map ( get catch handler count ( try block ordinal ) , get catch handler map address ( try block ordinal ) ) ) { throw new invalid data type exception ( get name ( ) + " data type at " + get address ( ) + " doesn ' t have a valid catch handler map " ) ; } } }


public void dispose ( ) { for ( int i = 0 ; i < panels length ; i + + ) { remove listeners ( panels [ i ] ) ; } panels = null ; }


see the edsl examples at { @ link binder }

< t > linked binding builder < t > bind ( key < t > key ) ;


always prefer a direct buffer when it ' s pooled , so that we reduce the number of memory copies in { @ link open ssl engine }

private byte buf allocate ( channel handler context ctx , int capacity ) { byte buf allocator alloc = ctx alloc ( ) ; if ( engine type wants direct buffer ) { return alloc direct buffer ( capacity ) ; } else { return alloc buffer ( capacity ) ; } }


enable or disable the recommendation check for the ' type ' attribute for more details , see { @ link rule configuration # is enable invalid type recommendation ( ) }

public void set enable invalid type recommendation ( boolean enable invalid type recommendation ) { this enable invalid type recommendation = enable invalid type recommendation ; }


if set , will enable scrolling of the search request

public search scroll request builder set scroll ( scroll scroll ) { request scroll ( scroll ) ; return this ; }


sets the < code > declawed < code > property

public cat all of declawed ( boolean declawed ) { this declawed = declawed ; return this ; }


marks the build as disabled the method will ignore the disable command if { @ link # supports make disabled ( ) } returns false the enable command will be executed in any case

default void make disabled ( boolean b ) throws i o exception { if ( is disabled ( ) = = b ) { return ; / / noop } if ( b & & ! supports make disabled ( ) ) { return ; / / do nothing if the disabling is unsupported } set disabled ( b ) ; if ( b ) { jenkins get ( ) get queue ( ) cancel ( this ) ; } save ( ) ; item listener fire on updated ( this ) ; }


a wrapper around { @ code private static final dalvik system dex path list # make dex elements }

private static object [ ] make dex elements ( object dex path list , array list < file > files , file optimized directory , array list < i o exception > suppressed exceptions ) throws illegal access exception , invocation target exception , no such method exception { method make dex elements = null ; try { make dex elements = share reflect util find method ( dex path list , " make dex elements " , array list class , file class , array list class ) ; } catch ( no such method exception e ) { share tinker log e ( tag , " no such method exception : make dex elements ( array list , file , array list ) failure " ) ; try { make dex elements = share reflect util find method ( dex path list , " make dex elements " , list class , file class , list class ) ; } catch ( no such method exception e 1 ) { share tinker log e ( tag , " no such method exception : make dex elements ( list , file , list ) failure " ) ; throw e 1 ; } } return ( object [ ] ) make dex elements invoke ( dex path list , files , optimized directory , suppressed exceptions ) ; }


helper method called by { @ link # to string ( ) } in order to convert a single map key into a string this is protected to allow subclasses to override the appearance of a given key

protected string key to string ( long key ) { return long to string ( key ) ; }


helper routine that instantiates a rule class with the given computed default and supporting attributes for the default to reference

private static rule class get rule class with computed default ( attribute computed default ) { return new rule class ( " rule class " , false , false , false , false , false , false , implicit outputs function from templates ( " empty " ) , null , dummy configured target factory , predicates with message < rule > always true ( ) , preferred dependency predicate , advertised provider set empty , null , immutable set < class < ? > > of ( ) , true , attr ( " condition " , boolean ) value ( false ) build ( ) , attr ( " declared 1 " , boolean ) value ( false ) build ( ) , attr ( " declared 2 " , boolean ) value ( false ) build ( ) , attr ( " nonconfigurable " , boolean ) nonconfigurable ( " test " ) value ( false ) build ( ) , computed default ) ; }


serializes and deserializes the specified object ( a no - op under gwt )

static < t > t reserialize ( t object ) { return check not null ( object ) ; }


returns an immutable array containing the given values , in order

public static immutable double array copy of ( collection < double > values ) { return values is empty ( ) ? empty : new immutable double array ( doubles to array ( values ) ) ; }


get the value of the ' { @ code id } ' attribute may be a runtime expression

protected string get for ( ) { return this for id ; }


return the { @ link jms listener endpoint registry } instance for this registrar , may be { @ code null }

public jms listener endpoint registry get endpoint registry ( ) { return this endpoint registry ; }


required one or more hosts exposed by this gateway while typically applicable to http services , it can also be used for tcp services using tls with sni a host is specified as a ` dns name ` with an optional ` namespace ` prefix the ` dns name ` should be specified using fqdn format , optionally including a wildcard character in the left - most component ( e g , ` prod & # 42 ; example com ` ) set the ` dns name ` to ` ` to select all ` virtual service ` hosts from the specified namespace ( e g , ` prod & # 42 ; ` ) the ` namespace ` can be set to ` ` or ` ` , representing any or the current namespace , respectively for example , ` & # 47 ; foo example com ` selects the service from any available namespace while ` foo example com ` only selects the service from the namespace of the sidecar the default , if no ` namespace ` is specified , is ` & # 47 ; ` , that is , select services from any namespace any associated ` destination rule ` in the selected namespace will also be used a ` virtual service ` must be bound to the gateway and must have one or more hosts that match the hosts specified in a server the match could be an exact match or a suffix match with the server ' s hosts for example , if the server ' s hosts specifies ` example com ` , a ` virtual service ` with hosts ` dev example com ` or ` prod example com ` will match however , a ` virtual service ` with host ` example com ` or ` newexample com ` will not match note : only virtual services exported to the gateway ' s namespace ( e g , ` export to ` value of ` ` ) can be referenced private configurations ( e g , ` export to ` set to ` ` ) will not be available refer to the ` export to ` setting in ` virtual service ` , ` destination rule ` , and ` service entry ` configurations for details < code > repeated string hosts = 2 ; < code >

public com google protobuf byte string get hosts bytes ( int index ) { return hosts get byte string ( index ) ; }


public int get num processors ( ) { return get conf ( ) get int ( num processors , - 1 ) ; }


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


callback method allowing a child interior node to request balancing of its content with its sibling nodes balancing is only done if the specified node is half - full or less

private var key node balance child ( var key interior node node ) throws i o exception { / / do nothing if node more than half full if ( node get free space ( ) < ( half key capacity * ( max key length + entry size ) ) ) { return get root ( ) ; } / / balance with right sibling except if node corresponds to the right - most / / key within this interior node - in that case balance with left sibling int index = get id index ( node get key field ( 0 ) ) ; if ( index = = ( key count - 1 ) ) { return balance child ( ( var key interior node ) node mgr get var key node ( get buffer id ( index - 1 ) ) , node ) ; } return balance child ( node , ( var key interior node ) node mgr get var key node ( get buffer id ( index + 1 ) ) ) ; }


the configured default locale , if any this method may be overridden in subclasses

public locale get default locale ( ) { return this default locale ; }


return the access key and secret for obs api use credentials may exist in configuration , within credential providers or indicated in the user info of the name uri param

static o b s login helper login get o b s access keys ( final uri name , final configuration conf ) throws i o exception { o b s login helper login login = o b s login helper extract login details with warnings ( name ) ; configuration c = provider utils exclude incompatible credential providers ( conf , o b s file system class ) ; string access key = get password ( c , o b s constants access key , login get user ( ) ) ; string secret key = get password ( c , o b s constants secret key , login get password ( ) ) ; string session token = get password ( c , o b s constants session token , login get token ( ) ) ; return new o b s login helper login ( access key , secret key , session token ) ; }


validates the entry throws an illegal argement exception if the data record is missing required information

public void validate ( ) { super validate ( ) ; if ( get nameservice id ( ) = = null | | get nameservice id ( ) length ( ) = = 0 ) { throw new illegal argument exception ( error msg no ns specified + this ) ; } if ( get web address ( ) = = null | | get web address ( ) length ( ) = = 0 ) { throw new illegal argument exception ( error msg no web addr specified + this ) ; } if ( get rpc address ( ) = = null | | get rpc address ( ) length ( ) = = 0 ) { throw new illegal argument exception ( error msg no rpc addr specified + this ) ; } if ( ! is bad state ( ) & & ( get block pool id ( ) is empty ( ) | | get block pool id ( ) length ( ) = = 0 ) ) { throw new illegal argument exception ( error msg no bp specified + this ) ; } }


default net provider get net ( ) { return new arc net provider ( ) ; }


get the set of values of the target expression

public set < string > get target values ( ) { return target values ; }


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

public static ssl context new server context ( file cert chain file , file key file , string key password , iterable < string > ciphers , iterable < string > next protocols , long session cache size , long session timeout ) throws s s l exception { return new server context ( null , cert chain file , key file , key password , ciphers , next protocols , session cache size , session timeout ) ; }


returns a buffered stream for reading this file as bytes @ throw gdx runtime exception if the file handle represents a directory , doesn ' t exist , or could not be read

public buffered input stream read ( int buffer size ) { return new buffered input stream ( read ( ) , buffer size ) ; }


public void deregister request ( ) { phaser arrive and deregister ( ) ; }


using deprecated hdfs admin # list open files ( enum set < > ) to verify open files

private void verify open files old ( hash set < path > closed files , hash map < path , f s data output stream > open file map ) throws i o exception { hdfs admin hdfs admin = new hdfs admin ( file system get default uri ( conf ) , conf ) ; hash set < path > open files = new hash set < > ( open file map key set ( ) ) ; remote iterator < open file entry > open files remote itr = hdfs admin list open files ( enum set of ( open files type all open files ) ) ; verify open files helper ( open files remote itr , closed files , open files ) ; assert true ( " not all open files are listed ! " , open files is empty ( ) ) ; }


returns the stack of starlark calls active at the moment of the error

public immutable list < starlark thread call stack entry > get call stack ( ) { return stack ; }


generate a text string containing the implementation type of this cache and its statistics the string returned by this method contains all information required for compliance with the contract for { @ link # log statistics ( ) }

public string to string ( ) { return new to string creator ( this ) append ( " size " , size ( ) ) append ( " max size " , get max size ( ) ) append ( " parent context count " , get parent context count ( ) ) append ( " hit count " , get hit count ( ) ) append ( " miss count " , get miss count ( ) ) to string ( ) ; }


convenience method for setting the children for this datanode

public synchronized void set children ( hash set < string > children ) { this children = children ; }


public static void main ( string [ ] args ) { pentomino model = new one sided pentomino ( 3 , 30 ) ; int solutions = model solve ( ) ; system out println ( solutions + " solutions found " ) ; }


removes the node from the table and adds the index to the free list

private void remove from table ( node [ ] table , node node ) { int last = table length - 1 ; table [ node index ] = table [ last ] ; table [ node index ] index = node index ; table [ last ] = null ; }


public void test bind multiple ( ) throws exception { default channel group channel group = new default channel group ( global event executor instance ) ; nio event loop group group = new nio event loop group ( ) ; try { for ( int i = 0 ; i < 100 ; i + + ) { bootstrap udp bootstrap = new bootstrap ( ) ; udp bootstrap group ( group ) channel ( nio datagram channel class ) option ( channel option so broadcast , true ) handler ( new channel inbound handler adapter ( ) { @ override public void channel read ( channel handler context ctx , object msg ) { / / discard reference count util release ( msg ) ; } } ) ; datagram channel datagram channel = ( datagram channel ) udp bootstrap bind ( new inet socket address ( 0 ) ) sync uninterruptibly ( ) channel ( ) ; channel group add ( datagram channel ) ; } assert assert equals ( 100 , channel group size ( ) ) ; } finally { channel group close ( ) sync ( ) ; group shutdown gracefully ( ) sync ( ) ; } }


groups all bar data set objects this data object holds together by modifying the x - value of their entries previously set x - values of entries will be overwritten leaves space between bars and groups as specified by the parameters do not forget to call notify data set changed ( ) on your bar chart object after calling this method

public void group bars ( float from x , float group space , float bar space ) { int set count = m data sets size ( ) ; if ( set count < = 1 ) { throw new runtime exception ( " bar data needs to hold at least 2 bar data sets to allow grouping " ) ; } i bar data set max = get max entry count set ( ) ; int max entry count = max get entry count ( ) ; float group space width half = group space / 2f ; float bar space half = bar space / 2f ; float bar width half = m bar width / 2f ; float interval = get group width ( group space , bar space ) ; for ( int i = 0 ; i < max entry count ; i + + ) { float start = from x ; from x + = group space width half ; for ( i bar data set set : m data sets ) { from x + = bar space half ; from x + = bar width half ; if ( i < set get entry count ( ) ) { bar entry entry = set get entry for index ( i ) ; if ( entry ! = null ) { entry set x ( from x ) ; } } from x + = bar width half ; from x + = bar space half ; } from x + = group space width half ; float end = from x ; float inner interval = end - start ; float diff = interval - inner interval ; / / correct rounding errors if ( diff > 0 | | diff < 0 ) { from x + = diff ; } } notify data changed ( ) ; }


retrieves the version information of netty artifacts using the specified { @ link class loader }

public static map < string , version > identify ( class loader class loader ) { if ( class loader = = null ) { class loader = platform dependent get context class loader ( ) ; } / / collect all properties properties props = new properties ( ) ; try { enumeration < url > resources = class loader get resources ( " meta - inf / io netty versions properties " ) ; while ( resources has more elements ( ) ) { url url = resources next element ( ) ; input stream in = url open stream ( ) ; try { props load ( in ) ; } finally { try { in close ( ) ; } catch ( exception ignore ) { / / ignore } } } } catch ( exception ignore ) { / / not critical just ignore } / / collect all artifact ids set < string > artifact ids = new hash set < string > ( ) ; for ( object o : props key set ( ) ) { string k = ( string ) o ; int dot index = k index of ( ' ' ) ; if ( dot index < = 0 ) { continue ; } string artifact id = k substring ( 0 , dot index ) ; / / skip the entries without required information if ( ! props contains key ( artifact id + prop version ) | | ! props contains key ( artifact id + prop build date ) | | ! props contains key ( artifact id + prop commit date ) | | ! props contains key ( artifact id + prop short commit hash ) | | ! props contains key ( artifact id + prop long commit hash ) | | ! props contains key ( artifact id + prop repo status ) ) { continue ; } artifact ids add ( artifact id ) ; } map < string , version > versions = new tree map < string , version > ( ) ; for ( string artifact id : artifact ids ) { versions put ( artifact id , new version ( artifact id , props get property ( artifact id + prop version ) , parse iso 8 6 0 1 ( props get property ( artifact id + prop build date ) ) , parse iso 8 6 0 1 ( props get property ( artifact id + prop commit date ) ) , props get property ( artifact id + prop short commit hash ) , props get property ( artifact id + prop long commit hash ) , props get property ( artifact id + prop repo status ) ) ) ; } return versions ; }


resolve the given media type to a list of file extensions

list < string > resolve file extensions ( media type media type ) ;


public static boolean zip files ( final collection < string > src file paths , final string zip file path , final string comment ) throws i o exception { if ( src file paths = = null | | zip file path = = null ) return false ; zip output stream zos = null ; try { zos = new zip output stream ( new file output stream ( zip file path ) ) ; for ( string src file : src file paths ) { if ( ! zip file ( utils bridge get file by path ( src file ) , " " , zos , comment ) ) return false ; } return true ; } finally { if ( zos ! = null ) { zos finish ( ) ; zos close ( ) ; } } }


returns the mapping version which is at least as up to date as the mapping version that the primary used to index the translog operations in this request if the mapping version on the replica is not older this version , we should not retry on { @ link org elasticsearch index mapper mapper exception } ; otherwise we should wait for a new mapping then retry

long mapping version on primary ( ) { return mapping version on primary ; }


return true if this array test 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 ; } array test array test = ( array test ) o ; return objects equals ( this array of string , array test array of string ) & & objects equals ( this array array of integer , array test array array of integer ) & & objects equals ( this array array of model , array test array array of model ) ; }


returns the result of a { @ link listenable future } if successful , or throws any checked { @ link exception } directly if it ' s an { @ link i o exception } or else wraps it in an { @ link i o exception } cancel the future on { @ link interrupted exception }

public static < t > t get from future ( listenable future < t > f ) throws i o exception , interrupted exception { return get from future ( f , / * cancel on interrupt * / true ) ; }


adds this columns filter configuration to the table column filter under construction

void add to table filter ( column based table filter < ? > table column filter ) { column condition set add to table filter ( table column filter , logic operation ) ; }


this method generate record instance by calling new intance using reflection , add register the generated value to type value cache

protected static object generate by new instance ( class clazz ) throws exception { object ret = type value cache get ( clazz ) ; if ( ret ! = null ) { return ret ; } method new instance = null ; type [ ] param types = new type [ 0 ] ; / / get new instance method with most parameters for ( method m : clazz get methods ( ) ) { int mod = m get modifiers ( ) ; if ( m get declaring class ( ) equals ( clazz ) & & modifier is public ( mod ) & & modifier is static ( mod ) & & m get name ( ) equals ( " new instance " ) ) { type [ ] pts = m get generic parameter types ( ) ; if ( new instance = = null | | ( pts length > param types length ) ) { new instance = m ; param types = pts ; } } } if ( new instance = = null ) { throw new illegal argument exception ( " type " + clazz get name ( ) + " does not have new instance method " ) ; } object [ ] args = new object [ param types length ] ; for ( int i = 0 ; i < args length ; i + + ) { args [ i ] = gen type value ( param types [ i ] ) ; } ret = new instance invoke ( null , args ) ; type value cache put ( clazz , ret ) ; return ret ; }


returns an instance which is the result of merging the two given instances , where one instance should have only type descriptors and the other only type signatures the merged result is identical to the one with descriptors , except that any element whose { name , index , start , length } matches an element in the signature list gets augmented with the corresponding signature the result is immutable

public static local variable list merge descriptors and signatures ( local variable list descriptor list , local variable list signature list ) { int descriptor size = descriptor list size ( ) ; local variable list result = new local variable list ( descriptor size ) ; for ( int i = 0 ; i < descriptor size ; i + + ) { item item = descriptor list get ( i ) ; item signature item = signature list item to local ( item ) ; if ( signature item ! = null ) { cst string signature = signature item get signature ( ) ; item = item with signature ( signature ) ; } result set ( i , item ) ; } result set immutable ( ) ; return result ; }


sanitize the given path uses the following rules : replace all " " by " "

private static string get sanitized path ( final string path ) { int index = path index of ( " / / " ) ; if ( index > = 0 ) { string builder sanitized = new string builder ( path ) ; while ( index ! = - 1 ) { sanitized delete char at ( index ) ; index = sanitized index of ( " / / " , index ) ; } return sanitized to string ( ) ; } return path ; }


suppress the default retry policy for the storage , useful in unit tests to test negative cases without waiting forever

void suppress retry policy ( ) { suppress retry policy = true ; }


read a script from the given resource , using " { @ code - - } " as the comment prefix and " { @ code ; } " as the statement separator , and build a string containing the lines

public static mono < string > read script ( encoded resource resource , data buffer factory data buffer factory ) { return read script ( resource , data buffer factory , default comment prefixes , default statement separator , default block comment end delimiter ) ; }


public void set savepoint restore settings ( savepoint restore settings settings ) { this savepoint restore settings = check not null ( settings , " savepoint restore settings " ) ; }


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


get the path to the { @ code container - executor } binary the path will be absolute

protected string get container executor executable path ( configuration conf ) { string yarn home env var = system getenv ( application constants environment hadoop yarn home key ( ) ) ; file hadoop bin = new file ( yarn home env var , " bin " ) ; string default path = new file ( hadoop bin , " container - executor " ) get absolute path ( ) ; return null = = conf ? default path : conf get ( yarn configuration nm linux container executor path , default path ) ; }


check plan for generic type info ' s and register the types at the serializers

private void register generic type info if configured ( plan plan ) { if ( ! config is auto type registration disabled ( ) ) { plan accept ( new visitor < operator < ? > > ( ) { private final set < class < ? > > registered types = new hash set < > ( ) ; private final set < org apache flink api common operators operator < ? > > visited operators = new hash set < > ( ) ; @ override public boolean pre visit ( org apache flink api common operators operator < ? > visitable ) { if ( ! visited operators add ( visitable ) ) { return false ; } operator information < ? > op info = visitable get operator info ( ) ; serializers recursively register type ( op info get output type ( ) , config , registered types ) ; return true ; } @ override public void post visit ( org apache flink api common operators operator < ? > visitable ) { } } ) ; } }


opens an f s data input stream at the indicated path

public f s data input stream open ( path f , int buffer size ) throws i o exception { file system fs ; input stream in ; if ( verify checksum ) { fs = this ; in = new checksum f s input checker ( this , f , buffer size ) ; } else { fs = get raw file system ( ) ; in = fs open ( f , buffer size ) ; } return new f s data bounded input stream ( fs , f , in ) ; }


update the flash map instances in the underlying storage

protected abstract void update flash maps ( list < flash map > flash maps , http servlet request request , http servlet response response ) ;


public void small snake test ( ) { / / todo : test small snake }


public long get start time ( ) { return start time ; }


returns the installation directory in an installation , there is only one application root and its parent is the installation directory if not an installation , then this call doesn ' t really make sense , but it will return the parent of the first installation root

public static resource file get installation directory ( ) { check app initialized ( ) ; return app layout get application installation dir ( ) ; }


public void remove ( ) { prev next = next ; next prev = prev ; next = prev = null ; }


validates an implementation method such as { @ code eval ( ) } or { @ code accumulate ( ) }

private static void validate implementation method ( class < ? extends user defined function > clazz , boolean reject static , boolean is optional , string method name options ) { final set < string > name set = new hash set < > ( arrays as list ( method name options ) ) ; final list < method > methods = get all declared methods ( clazz ) ; boolean found = false ; for ( method method : methods ) { if ( ! name set contains ( method get name ( ) ) ) { continue ; } found = true ; final int modifier = method get modifiers ( ) ; if ( ! modifier is public ( modifier ) ) { throw new validation exception ( string format ( " method ' % s ' of function class ' % s ' is not public " , method get name ( ) , clazz get name ( ) ) ) ; } if ( modifier is abstract ( modifier ) ) { throw new validation exception ( string format ( " method ' % s ' of function class ' % s ' must not be abstract " , method get name ( ) , clazz get name ( ) ) ) ; } if ( reject static & & modifier is static ( modifier ) ) { throw new validation exception ( string format ( " method ' % s ' of function class ' % s ' must not be static " , method get name ( ) , clazz get name ( ) ) ) ; } } if ( ! found & & ! is optional ) { throw new validation exception ( string format ( " function class ' % s ' does not implement a method named % s " , clazz get name ( ) , name set stream ( ) map ( s - > " ' " + s + " ' " ) collect ( collectors joining ( " or " ) ) ) ) ; } }


set the maximum number of compositions to keep cached in memory this must be { @ literal > } 0

public void resize ( int size ) { cache resize ( size ) ; }


browse selected messages in a jms queue the callback gives access to the jms session and queue browser in order to browse the queue and react to the contents

< t > t browse selected ( string message selector , browser callback < t > action ) throws jms exception ;


returns true if this { @ code resource completable observer } has been disposedcancelled

public final boolean is disposed ( ) { return disposable helper is disposed ( upstream get ( ) ) ; }


get average count for provided event per second

public double get avg ( metric event event ) { return get sum ( event ) / data get interval in second ( ) ; }


test the basic lock and unlock operation

public void test lock acquire release ( ) { auto closeable lock lock = new auto closeable lock ( ) ; auto closeable lock newlock = lock acquire ( ) ; / / ensure acquire the same lock object assert equals ( newlock , lock ) ; / / ensure it locked now assert true ( lock is locked ( ) ) ; lock release ( ) ; / / ensure it is unlocked now assert false ( lock is locked ( ) ) ; }


ensures that the current user can read the specified response without actually reading it

public void authorize response ( async execution id async execution id , boolean restore response headers , action listener < r > listener ) { get encoded response ( async execution id , restore response headers , action listener wrap ( ( t ) - > listener on response ( null ) , listener : : on failure ) ) ; }


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


returns whether the image is stored in the encoded memory cache

public boolean is in encoded memory cache ( final image request image request ) { if ( image request = = null ) { return false ; } final cache key cache key = m cache key factory get encoded cache key ( image request , null ) ; closeable reference < pooled byte buffer > ref = m encoded memory cache get ( cache key ) ; try { return closeable reference is valid ( ref ) ; } finally { closeable reference close safely ( ref ) ; } }


returns a json adapter equal to this json adapter , but that serializes nulls when encoding json

public final json adapter < t > serialize nulls ( ) { final json adapter < t > delegate = this ; return new json adapter < t > ( ) { @ override public @ nullable t from json ( json reader reader ) throws i o exception { return delegate from json ( reader ) ; } @ override public void to json ( json writer writer , @ nullable t value ) throws i o exception { boolean serialize nulls = writer get serialize nulls ( ) ; writer set serialize nulls ( true ) ; try { delegate to json ( writer , value ) ; } finally { writer set serialize nulls ( serialize nulls ) ; } } @ override boolean is lenient ( ) { return delegate is lenient ( ) ; } @ override public string to string ( ) { return delegate + " serialize nulls ( ) " ; } } ; }


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

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


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

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


returns the greatest value present in { @ code array } , treating values as unsigned

public static byte max ( byte array ) { check argument ( array length > 0 ) ; int max = to int ( array [ 0 ] ) ; for ( int i = 1 ; i < array length ; i + + ) { int next = to int ( array [ i ] ) ; if ( next > max ) { max = next ; } } return ( byte ) max ; }


returns the greatest value present in { @ code array }

public static byte max ( byte array ) { check argument ( array length > 0 ) ; byte max = array [ 0 ] ; for ( int i = 1 ; i < array length ; i + + ) { if ( array [ i ] > max ) { max = array [ i ] ; } } return max ; }


pause ( stop ) polling polling can be started again with < code > start < code > as long as < code > shutdown < code > is not called

public synchronized void pause ( ) { / / use compare and set to make sure it stops only once and when running if ( running compare and set ( true , false ) ) { logger debug ( " stopping the hystrix metrics poller " ) ; scheduled task cancel ( true ) ; } else { logger debug ( " attempted to pause a stopped poller " ) ; } }


save the i node state to the snapshot if it is not done already

void save snapshot copy ( a snapshot copy ) { preconditions check state ( snapshot i node = = null , " expected snapshot i node to be null " ) ; snapshot i node = snapshot copy ; }


shutdown the resources , such as thread pool

public void shutdown ( ) throws nacos exception ;


private boolean remove variable ( list < ? > list , variable d b var ) { int cnt = list size ( ) ; for ( int i = 0 ; i < cnt ; i + + ) { if ( var = = list get ( i ) ) { list remove ( i ) ; return true ; } } return false ; }


parses an integral msft numeric type from the pdb byte reader

public void parse ( pdb byte reader reader ) throws pdb exception { sub type index = reader parse unsigned short val ( ) ; / / todo : create these as intrinsic types and do proper parsing ? switch ( sub type index ) { / / for each case , parse bytes ( to move index forward ) and throw bytes away / / the number of bytes parsed is based on the size of the integral type / / represented by sub type index case 0x 8 0 0 0 : / / char object = little endian data converter instance get big integer ( reader parse bytes ( 1 ) , 1 , true ) ; break ; case 0x 8 0 0 1 : / / short object = little endian data converter instance get big integer ( reader parse bytes ( 2 ) , 2 , true ) ; break ; case 0x 8 0 0 2 : / / unsigned short object = little endian data converter instance get big integer ( reader parse bytes ( 2 ) , 2 , false ) ; break ; case 0x 8 0 0 3 : / / 32 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 4 ) , 4 , true ) ; break ; case 0x 8 0 0 4 : / / unsigned 32 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 4 ) , 4 , false ) ; break ; case 0x 8 0 0 5 : / / real 3 2 object = byte buffer wrap ( reader parse bytes ( 4 ) ) get float ( ) ; break ; case 0x 8 0 0 6 : / / real 6 4 object = byte buffer wrap ( reader parse bytes ( 8 ) ) get double ( ) ; break ; case 0x 8 0 0 7 : / / real 8 0 object = new real 8 0 ( reader ) ; break ; case 0x 8 0 0 8 : / / real 1 2 8 object = new real 1 2 8 ( reader ) ; break ; case 0x 8 0 0 9 : / / 64 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 8 ) , 8 , true ) ; break ; case 0x 8 0 0a : / / unsigned 64 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 8 ) , 8 , false ) ; break ; case 0x 8 0 0b : / / real 4 8 object = new real 4 8 ( reader ) ; break ; case 0x 8 0 0c : / / complex 3 2 object = new complex 3 2 ( reader ) ; break ; case 0x 8 0 0d : / / complex 6 4 object = new complex 6 4 ( reader ) ; break ; case 0x 8 0 0e : / / complex 8 0 object = new complex 8 0 ( reader ) ; break ; case 0x 8 0 0f : / / complex 1 2 8 object = new complex 1 2 8 ( reader ) ; break ; case 0x 8 0 1 7 : / / 128 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 16 ) , 16 , true ) ; break ; case 0x 8 0 1 8 : / / unsigned 128 - bit object = little endian data converter instance get big integer ( reader parse bytes ( 16 ) , 16 , false ) ; break ; case 0x 8 0 1 9 : / / decimal object = new decimal ( reader ) ; break ; case 0x 8 0 1a : / / date object = new date ( reader ) ; break ; case 0x 8 0 1b : / / real 1 6 object = new real 1 6 ( reader ) ; break ; default : if ( sub type index > = 0x 8 0 0 0 ) { throw new pdb exception ( string format ( " unknown numeric subtype : 0x % 0 4x " , sub type index ) ) ; } object = big integer value of ( sub type index ) ; break ; } } / / public byte [ ] get bytes ( ) { / / / / } / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / old code from pdb byte writer todo : evaluate to see if want to use any of it here / / ( expect that certain parts are wrong ) for outputting bytes of a numeric there were / / problems in the parse numeric ( ) code that was in the pdb byte reader / / note : as of this writing , the following code is still in the pdb byte writer as it is / / used by types test methods todo : if we get a suitable replacement here , then delete / / method in pdb byte writer and convert the tests to use this class / /


public boolean is awake ( ) { return body is awake ( ) ; }


return the time zone associated with the given user context , if any , or the system default time zone otherwise this is effectively a replacement for { @ link java util time zone # get default ( ) } , able to optionally respect a user - level time zone setting

public static time zone get time zone ( @ nullable locale context locale context ) { if ( locale context instanceof time zone aware locale context ) { time zone time zone = ( ( time zone aware locale context ) locale context ) get time zone ( ) ; if ( time zone ! = null ) { return time zone ; } } return ( default time zone ! = null ? default time zone : time zone get default ( ) ) ; }


{ @ inherit doc } looks for one of { @ link org openqa selenium support find by } , { @ link org openqa selenium support find bys } or { @ link org openqa selenium support find all } field annotations in case no annotations provided for field , uses field name as ' id ' or ' name '

public by build by ( ) { assert valid annotations ( ) ; by ans = null ; for ( annotation annotation : field get declared annotations ( ) ) { abstract find by builder builder = null ; if ( annotation annotation type ( ) is annotation present ( page factory finder class ) ) { try { builder = annotation annotation type ( ) get annotation ( page factory finder class ) value ( ) get declared constructor ( ) new instance ( ) ; } catch ( reflective operation exception e ) { / / fall through } } if ( builder ! = null ) { ans = builder build it ( annotation , field ) ; break ; } } if ( ans = = null ) { ans = build by from default ( ) ; } return ans ; }


generates { @ link vertex vertices } with sequential , numerical labels

public static data set < vertex < long value , null value > > vertex sequence ( execution environment env , int parallelism , long vertex count ) { preconditions check argument ( vertex count > = 0 , " vertex count must be non - negative " ) ; if ( vertex count = = 0 ) { return env from collection ( collections empty list ( ) , type information of ( new type hint < vertex < long value , null value > > ( ) { } ) ) set parallelism ( parallelism ) name ( " empty vertex set " ) ; } else { long value sequence iterator iterator = new long value sequence iterator ( 0 , vertex count - 1 ) ; data source < long value > vertex labels = env from parallel collection ( iterator , long value class ) set parallelism ( parallelism ) name ( " vertex indices " ) ; return vertex labels map ( new create vertex ( ) ) set parallelism ( parallelism ) name ( " vertex sequence " ) ; } }


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

default response entity < void > update pet with form ( @ api param ( value = " id of pet that needs to be updated " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " updated name of the pet " ) @ valid @ request part ( value = " name " , required = false ) string name , @ api param ( value = " updated status of the pet " ) @ valid @ request part ( value = " status " , required = false ) string status ) { return get delegate ( ) update pet with form ( pet id , name , status ) ; }


set this quaternion to the rotation between two vectors

public quaternion set from cross ( final vector 3 v 1 , final vector 3 v 2 ) { final float dot = math utils clamp ( v 1 dot ( v 2 ) , - 1f , 1f ) ; final float angle = ( float ) math acos ( dot ) ; return set from axis rad ( v 1 y * v 2 z - v 1 z * v 2 y , v 1 z * v 2 x - v 1 x * v 2 z , v 1 x * v 2 y - v 1 y * v 2 x , angle ) ; }


returns the union of classes from both files , sorted in order such that a class is always preceded by its supertype and implemented interfaces

private sortable type [ ] get sorted types ( ) { / / size is pessimistic ; doesn ' t include arrays sortable type [ ] sortable types = new sortable type [ contents out type ids size ] ; for ( int i = 0 ; i < dexes length ; i + + ) { read dex sortable types ( sortable types , dexes [ i ] , index maps [ i ] ) ; } / * * populate the depths of each sortable type this makes d iterations * through all n types , where ' d ' is the depth of the deepest type for * example , the deepest class in libcore is xalan ' s key iterator , which * is 11 types deep * / while ( true ) { boolean all done = true ; for ( sortable type sortable type : sortable types ) { if ( sortable type ! = null & & ! sortable type is depth assigned ( ) ) { all done & = sortable type try assign depth ( sortable types ) ; } } if ( all done ) { break ; } } arrays sort ( sortable types , new comparator < sortable type > ( ) { @ override public int compare ( sortable type o 1 , sortable type o 2 ) { if ( o 1 = = o 2 ) { return 0 ; } if ( o 2 = = null ) { return - 1 ; } if ( o 1 = = null ) { return 1 ; } if ( class def list contains ( o 1 get dex ( ) type names ( ) get ( o 1 get type index ( ) ) ) & & class def list contains ( o 1 get dex ( ) type names ( ) get ( o 2 get type index ( ) ) ) ) { return class def list index of ( o 1 get dex ( ) type names ( ) get ( o 1 get type index ( ) ) ) - class def list index of ( o 1 get dex ( ) type names ( ) get ( o 2 get type index ( ) ) ) ; } else if ( class def list contains ( o 1 get dex ( ) type names ( ) get ( o 1 get type index ( ) ) ) & & ! class def list contains ( o 1 get dex ( ) type names ( ) get ( o 2 get type index ( ) ) ) ) { return - 1 ; } else if ( ! class def list contains ( o 1 get dex ( ) type names ( ) get ( o 1 get type index ( ) ) ) & & class def list contains ( o 1 get dex ( ) type names ( ) get ( o 2 get type index ( ) ) ) ) { return 1 ; } else return o 1 get type index ( ) - ( o 2 get type index ( ) ) ; } } ) ; int first null = arrays as list ( sortable types ) index of ( null ) ; return arrays copy of range ( sortable types , 0 , first null ) ; }


obtain ( read - only ) collection of active applications

public collection < fi ca scheduler app > get applications ( ) { return collections unmodifiable collection ( ordering policy get schedulable entities ( ) ) ; }


guaranteed to throw an exception and leave the table unmodified

public final v put ( r row key , c column key , v value ) { throw new unsupported operation exception ( ) ; }


the payload is the part number repeated for the length of the part this makes checking the correctness of the upload straightforward

private byte [ ] generate payload ( int part number ) { return generate payload ( part number , part size in bytes ( ) ) ; }


update keyitem from the cache and overwrite

default distributed cache manager < k , v , i > update ( final k key , final v item , final boolean publish ) { return this ; }


asserts that a single { @ link data source # open ( data spec ) } call has been made to the upstream source , with the specified start ( inclusive ) and end ( exclusive ) positions

private void assert single open ( fake data source upstream source , int start , int end ) { data spec [ ] opened data specs = upstream source get and clear opened data specs ( ) ; assert that ( opened data specs ) has length ( 1 ) ; assert that ( opened data specs [ 0 ] position ) is equal to ( start ) ; assert that ( opened data specs [ 0 ] length ) is equal to ( end - start ) ; }


tries to coordinate async counting but it is flaky due to the low 1 0s of milliseconds

void ref count async actual ( ) { final atomic integer subscribe count = new atomic integer ( ) ; final atomic integer next count = new atomic integer ( ) ; flowable < long > r = flowable interval ( 0 , 20 , time unit milliseconds ) do on subscribe ( new consumer < subscription > ( ) { @ override public void accept ( subscription s ) { subscribe count increment and get ( ) ; } } ) do on next ( new consumer < long > ( ) { @ override public void accept ( long l ) { next count increment and get ( ) ; } } ) publish ( ) ref count ( ) ; final atomic integer received count = new atomic integer ( ) ; disposable d 1 = r subscribe ( new consumer < long > ( ) { @ override public void accept ( long l ) { received count increment and get ( ) ; } } ) ; disposable d 2 = r subscribe ( ) ; try { thread sleep ( 10 ) ; } catch ( interrupted exception e ) { } for ( ; ; ) { int a = next count get ( ) ; int b = received count get ( ) ; if ( a > 10 & & a < 20 & & a = = b ) { break ; } if ( a > = 20 ) { break ; } try { thread sleep ( 20 ) ; } catch ( interrupted exception e ) { } } / / give time to emit / / now unsubscribe d 2 dispose ( ) ; / / unsubscribe s 2 first as we ' re counting in 1 and there can be a race between unsubscribe and one subscriber getting a value but not the other d 1 dispose ( ) ; system out println ( " on next : " + next count get ( ) ) ; / / should emit once for both subscribers assert equals ( next count get ( ) , received count get ( ) ) ; / / only 1 subscribe assert equals ( 1 , subscribe count get ( ) ) ; }


gets the limit for reading bytes from the given memory segment this method must return the position of the byte after the last valid byte in the given memory segment when the position returned by this method is reached , the view will attempt to switch to the next memory segment

protected abstract int get limit for segment ( memory segment segment ) ;


< code > optional int 3 2 age = 3 ; < code >

public builder set age ( int value ) { bit field 0 | = 0x 0 0 0 0 0 0 0 4 ; age = value ; on changed ( ) ; return this ; }


builds a trace tree by merging and processing the input or returns an empty tree while the input can be incomplete or redundant , they must all be a part of the same trace ( e g all share the same { @ link span # trace id ( ) } )

public span node build ( list < span > spans ) { if ( spans is empty ( ) ) throw new illegal argument exception ( " spans were empty " ) ; clear ( ) ; / / in order to make a tree , we need clean data this will merge any duplicates so that we / / don ' t have redundant leaves on the tree list < span > cleaned = trace merge ( spans ) ; int length = cleaned size ( ) ; string trace id = cleaned get ( 0 ) trace id ( ) ; if ( logger is loggable ( fine ) ) logger fine ( " building trace tree : trace id = " + trace id ) ; / / next , index all the spans so that we can understand any relationships for ( int i = 0 ; i < length ; i + + ) { index ( cleaned get ( i ) ) ; } / / now that we ' ve index references to all spans , we can revise any parent - child relationships / / notably , by now , we can tell which is the root - most for ( int i = 0 ; i < length ; i + + ) { process ( cleaned get ( i ) ) ; } / / if we haven ' t found any root span , we can still make a tree using a synthetic node if ( root span = = null ) { if ( logger is loggable ( fine ) ) { logger fine ( " substituting dummy node for missing root span : trace id = " + trace id ) ; } root span = new span node ( null ) ; } / / at this point , we have the most reliable parent - child relationships and can allocate spans / / corresponding the the best place in the trace tree for ( map entry < object , object > entry : span to parent entry set ( ) ) { span node child = key to node get ( entry get key ( ) ) ; span node parent = key to node get ( entry get value ( ) ) ; if ( parent = = null ) { / / handle headless by attaching spans missing parents to root root span add child ( child ) ; } else { parent add child ( child ) ; } } sort tree by timestamp ( root span ) ; return root span ; }


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

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


public murmur hash reset ( ) { count = 0 ; hash = seed ; return this ; }


returns a new hash set using the smallest initial table size that can hold { @ code expected size } elements without resizing note that this is not what { @ link hash set # hash set ( int ) } does , but it is what most users want and expect it to do this behavior can ' t be broadly guaranteed , but has been tested with open j d k 1 7 and 1 8

public static < e > hash set < e > new hash set with expected size ( int expected size ) { return new hash set < e > ( maps capacity ( expected size ) ) ; }


register a listener that will be called when this model is bound to a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public base model view model on bind ( on model bound listener < base model view model , base model view > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


trying to post to config xml by a different job type should fail

public void config dot xml submission to different type ( ) throws exception { test plugin manager tpm = ( test plugin manager ) j jenkins plugin manager ; tpm install detached plugin ( " structs " ) ; tpm install detached plugin ( " workflow - step - api " ) ; tpm install detached plugin ( " scm - api " ) ; tpm install detached plugin ( " workflow - api " ) ; tpm install detached plugin ( " junit " ) ; tpm install detached plugin ( " matrix - project " ) ; j jenkins set crumb issuer ( null ) ; free style project p = j create free style project ( ) ; http u r l connection con = post config dot xml ( p , " < matrix - project / > " ) ; / / this should fail with a type mismatch error / / the error message should report both what was submitted and what was expected assert equals ( 500 , con get response code ( ) ) ; string msg = i o utils to string ( con get error stream ( ) , standard charsets utf 8 ) ; system out println ( msg ) ; assert that ( msg , all of ( contains string ( free style project class get name ( ) ) , contains string ( matrix project class get name ( ) ) ) ) ; / / control this should work con = post config dot xml ( p , " < project / > " ) ; assert equals ( 200 , con get response code ( ) ) ; }


returns the media subtype for example , { @ code " plain " } in { @ code " textplain " }

public string subtype ( ) { return subtype ; }


public chunk get ( int index ) { if ( index > = 0 & & index < chunks size ( ) ) { return chunks get ( index ) ; } return null ; }


we need to be aware of changes to the program that could result in scalars being addedremoved when this happens we want to update the appropriate providers

public void domain object changed ( domain object changed event ev ) { if ( ev contains event ( domain object do object restored ) | | ev contains event ( change manager docr code added ) | | ev contains event ( change manager docr code removed ) ) { reload update mgr update ( ) ; } }


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

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


use a numeric token from the date string

private static final void parse numeric token ( string date str , parser state state , int val ) throws calendar parser exception { / / puke if we ' ve already found 3 values if ( state is year set ( ) & & state is month set ( ) & & state is date set ( ) ) { if ( debug ) { system err println ( " * * * extra number " + val ) ; } throw new calendar parser exception ( " extra value \ " " + val + " \ " in date \ " " + date str + " \ " " ) ; } / / puke up on negative numbers if ( val < 0 ) { if ( debug ) { system err println ( " * * * negative number " + val ) ; } throw new calendar parser exception ( " found negative number in " + " date \ " " + date str + " \ " " ) ; } if ( val > 9999 ) { parse numeric blob ( date str , state , val ) ; return ; } / / deal with obvious years first if ( val > 31 ) { / / if no year yet , assign it and move on if ( ! state is year set ( ) ) { state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " ( " + val + " ) > 31 " ) ; } return ; } / / puke if the year value can ' t possibly be a day or month if ( state get year ( ) > 31 ) { if ( debug ) { system err println ( " * * * ambiguous year " + state get year ( ) + " vs " + val ) ; } string err msg = " couldn ' t decide on year number in date \ " " + date str + " \ " " ; throw new calendar parser exception ( err msg ) ; } / / if the year value can ' t be a month if ( state get year ( ) > 12 ) { / / if day isn ' t set , use old val as day and new val as year if ( ! state is date set ( ) ) { state set date ( state get year ( ) ) ; state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " , day = " + state get date ( ) + " ( " + val + " ) > 31 swap " ) ; } return ; } / / note : both day and year are set / / try using day value as month so we can move year / / value to day and use new value as year if ( state get date ( ) < = 12 ) { state set month ( state get date ( ) ) ; state set date ( state get year ( ) ) ; state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " , month = " + state get month ( ) + " , day = " + state get date ( ) + " ( " + val + " ) > 31 megaswap " ) ; } return ; } if ( debug ) { system err println ( " * * * unassignable year - like " + " number " + val ) ; } throw new calendar parser exception ( " bad number " + val + " found in date \ " " + date str + " \ " " ) ; } / / note : year < = 12 if ( ! state is date set ( ) & & ! state is month set ( ) ) { if ( state is month before day ( ) ) { state set month ( state get year ( ) ) ; state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " , month = " + state get month ( ) + " ( " + val + " ) > 31 swap " ) ; } } else { state set date ( state get year ( ) ) ; state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " , day = " + state get date ( ) + " ( " + val + " ) > 31 swap # 2 " ) ; } } return ; } if ( ! state is date set ( ) ) { state set date ( state get year ( ) ) ; state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " , day = " + state get date ( ) + " ( " + val + " ) > 31 day swap " ) ; } return ; } / / assume this was a mishandled month state set month ( state get year ( ) ) ; state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " , month = " + state get month ( ) + " ( " + val + " ) > 31 mon swap " ) ; } return ; } / / now deal with non - month values if ( val > 12 ) { / / if no year value yet if ( ! state is year set ( ) ) { / / if the day is set , or if we assign year before day if ( state is date set ( ) | | state is year before day ( ) ) { state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " ( " + val + " ) > 12 " ) ; } } else { state set date ( val ) ; if ( debug ) { system err println ( " day = " + state get date ( ) + " ( " + val + " ) > 12 " ) ; } } return ; } / / note : year is set / / if no day value yet , assign it and move on if ( ! state is date set ( ) ) { state set date ( val ) ; if ( debug ) { system err println ( " day = " + state get date ( ) + " ( " + val + " ) > 12 ! yr " ) ; } return ; } / / note : both year and day are set / / xxx see if we can shift things around if ( debug ) { system err println ( " * * * unassignable year / day number " + val ) ; } throw new calendar parser exception ( " bad number " + val + " found in date \ " " + date str + " \ " " ) ; } / / note : ambiguous value / / if year is set , this must be either the month or day if ( state is year set ( ) ) { if ( state is month set ( ) | | ( ! state is date set ( ) & & ! state is month before day ( ) ) ) { state set date ( val ) ; if ( debug ) { system err println ( " day = " + state get date ( ) + " ( " + val + " ) ambig ! yr " ) ; } } else { state set month ( val ) ; if ( debug ) { system err println ( " month = " + state get month ( ) + " ( " + val + " ) ambig ! yr " ) ; } } return ; } / / note : year not set / / if month is set , this must be either the year or day if ( state is month set ( ) ) { if ( state is date set ( ) | | state is year before day ( ) ) { state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " ( " + val + " ) ambig ! mo " ) ; } } else { state set date ( val ) ; if ( debug ) { system err println ( " day = " + state get date ( ) + " ( " + val + " ) ambig ! mo " ) ; } } return ; } / / note : neither year nor month is set / / if day is set , this must be either the year or month if ( state is date set ( ) ) { if ( state is year before month ( ) ) { state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " ( " + val + " ) ambig ! day " ) ; } } else { state set month ( val ) ; if ( debug ) { system err println ( " month = " + state get month ( ) + " ( " + val + " ) ambig ! day " ) ; } } return ; } / / note : no value set yet if ( state is year before month ( ) ) { if ( state is year before day ( ) ) { state set year ( val ) ; if ( debug ) { system err println ( " year = " + state get year ( ) + " ( " + val + " ) ym | yd " ) ; } } else { state set date ( val ) ; if ( debug ) { system err println ( " day = " + state get date ( ) + " ( " + val + " ) ym ! yd " ) ; } } } else if ( state is month before day ( ) ) { state set month ( val ) ; if ( debug ) { system err println ( " month = " + state get month ( ) + " ( " + val + " ) ! ym | md " ) ; } } else { state set date ( val ) ; if ( debug ) { system err println ( " day = " + state get date ( ) + " ( " + val + " ) ! ym ! md " ) ; } } }


rename , expecting an exception to be thrown

protected void rename to failure ( path src , path dst ) throws i o exception { try { get store ( ) rename ( src , dst ) ; fail ( " expected failure renaming " + src + " to " + dst + " - but got success " ) ; } catch ( swift operation failed exception e ) { log debug ( " rename failed ( expected ) : " + e ) ; } catch ( file not found exception e ) { log debug ( " rename failed ( expected ) : " + e ) ; } }


configure the filter by checking the configuration

public void set conf ( configuration conf ) { pf set conf ( conf ) ; }


public stats response stats ( stats request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , enrich request converters : : stats , options , stats response : : from x content , collections empty set ( ) ) ; }


gets the length of the slice value at { @ code internal position - get offset base ( ) } this method must be implemented if { @ code get slice unchecked } is implemented

default int get slice length unchecked ( int internal position ) { throw new unsupported operation exception ( get class ( ) get name ( ) ) ; }


this method is deprecated use get fills ( ) instead

public list < fill > get gradients ( ) { return m fills ; }


tests if the length of the file matches the expected value

public void check length ( ) { file [ ] files = this temp file is directory ( ) ? this temp file list files ( ) : new file [ ] { this temp file } ; arrays sort ( files ) ; for ( int file index = 0 ; file index < this parallelism ; file index + + ) { long last block length = this raw data sizes [ file index ] % ( this block size - get info size ( ) ) ; long expected length = ( this get expected block count ( file index ) - 1 ) * this block size + get info size ( ) + last block length ; assert assert equals ( expected length , files [ file index ] length ( ) ) ; } }


{ @ inherit doc } the default implementation does nothing

@ override public void enter sequence term ( eql base parser sequence term context ctx ) { }


skip bytes in the input buffer this skips bytes in the current entry ' s data , not the entire archive , and will stop at the end of the current entry ' s data if the number to skip extends beyond that point

public long skip ( long num to skip ) throws i o exception { / / review / / this is horribly inefficient , but it ensures that we / / properly skip over bytes via the tar buffer / / byte [ ] skip buf = new byte [ 8 * 1024 ] ; long skip = num to skip ; while ( skip > 0 ) { int real skip = ( int ) ( skip > skip buf length ? skip buf length : skip ) ; int num read = this read ( skip buf , 0 , real skip ) ; if ( num read = = - 1 ) { break ; } skip - = num read ; } return ( num to skip - skip ) ; }


public static global transaction create new ( ) { return new default global transaction ( ) ; }


disables reusing objects that flink internally uses for deserialization and passing data to user - code functions

public execution config disable object reuse ( ) { object reuse = false ; return this ; }


protected final void cancel ( ) { disposable upstream = this upstream ; this upstream = disposable helper disposed ; upstream dispose ( ) ; }


sets the current progress of the operation and notifies the listeners that implement { @ link generic progressive future listener }

progressive promise < v > set progress ( long progress , long total ) ;


mixin interface and delegates all class must be public

public static mixin mixin ( class < ? > [ ] ics , class < ? > dc ) { return mixin ( ics , new class [ ] { dc } ) ; }