utility function that rebuild a streaming plan section , re - create stage execution and scheduler for each of its stage , and finally update the stage executions map

private void update stage executions ( streaming plan section section , map < plan fragment , plan fragment > old to new fragment ) { streaming plan section new section = new streaming plan section ( rewrite streaming sub plan ( section get plan ( ) , old to new fragment ) , section get children ( ) ) ; plan fragment section root fragment = new section get plan ( ) get fragment ( ) ; optional < int [ ] > bucket to partition ; output buffers output buffers ; exchange locations consumer locations consumer ; if ( is root fragment ( section root fragment ) ) { bucket to partition = optional of ( new int [ 1 ] ) ; output buffers = create initial empty output buffers ( section root fragment get partitioning scheme ( ) get partitioning ( ) get handle ( ) ) with buffer ( new output buffer id ( 0 ) , broadcast partition id ) with no more buffer ids ( ) ; output buffer id root buffer id = get only element ( output buffers get buffers ( ) key set ( ) ) ; locations consumer = ( fragment id , tasks , no more exchange locations ) - > update query output locations ( query state machine , root buffer id , tasks , no more exchange locations ) ; } else { bucket to partition = optional empty ( ) ; output buffers = create discarding output buffers ( ) ; locations consumer = ( fragment id , tasks , no more exchange locations ) - > { } ; } section execution section execution = section execution factory create section executions ( session , new section , locations consumer , bucket to partition , output buffers , summarize task info , remote task factory , split source factory , 0 ) ; add state change listeners ( section execution ) ; map < stage id , stage execution and scheduler > updated stage executions = section execution get section stages ( ) stream ( ) collect ( to immutable map ( execution - > execution get stage execution ( ) get stage execution id ( ) get stage id ( ) , identity ( ) ) ) ; synchronized ( this ) { stage executions put all ( updated stage executions ) ; } }


returns a { @ code collector } that accumulates the input elements into a new { @ code immutable sorted set } , ordered by the specified comparator if the elements contain duplicates ( according to the comparator ) , only the first duplicate in encounter order will appear in the result

public static < e > collector < e , ? , immutable sorted set < e > > to immutable sorted set ( comparator < ? super e > comparator ) { return collect collectors to immutable sorted set ( comparator ) ; }


this is an interface method to handle the move tasks block moving info must contain the required info to move the block , that source location , destination location and storage types

void submit move task ( block moving info blk moving info ) throws i o exception ;


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


public static a m r m proxy metrics get metrics ( ) { synchronized ( a m r m proxy metrics class ) { if ( instance = = null ) { instance = default metrics system instance ( ) register ( " a m r m proxy metrics " , " metrics for the yarn a m r m proxy " , new a m r m proxy metrics ( ) ) ; } } return instance ; }


gets the id of the stream last successfully created by this endpoint


print string as a line this does not escapes the string for html

public void put without escape html ( object args ) { echo without escape html ( args ) ; writer ( ) println ( ) ; }


template method for obtaining a ( potentially cached ) session the default implementation always returns { @ code null } subclasses may override this for exposing specific session handles , possibly delegating to { @ link # create session } for the creation of raw session objects that will then get wrapped and returned from here

protected session get session ( connection con , integer mode ) throws j m s exception { return null ; }


get range start for the first integer range

public int get range start ( ) { if ( ranges = = null | | ranges is empty ( ) ) { return - 1 ; } range r = ranges get ( 0 ) ; return r start ; }


gets a marker margin or overview margin context object if the mouse event occurred on one of the gui components for the indicated listing panel ' s marker margin ( left edge of listing ) or overview margin ( right edge of listing )

public object get context object for margin panels ( listing panel lp , mouse event event ) { object source = event get source ( ) ; / / is event source a marker margin provider on the left side of the listing ? list < margin provider > margin providers = lp get margin providers ( ) ; for ( margin provider margin provider : margin providers ) { j component c = margin provider get component ( ) ; if ( c = = source ) { marker location loc = margin provider get marker location ( event get x ( ) , event get y ( ) ) ; if ( loc ! = null ) { return loc ; / / return the marker margin location that was clicked } return source ; / / return the margin provider that was clicked } } / / is event source an overview provider on the right side of the listing ? list < overview provider > overview providers = lp get overview providers ( ) ; for ( overview provider overview provider : overview providers ) { j component c = overview provider get component ( ) ; if ( c = = source ) { return source ; / / return the overview provider that was clicked } } return null ; / / not one of the listing panel ' s margin panels }


create a snapshot of the given path it is assumed that the caller will perform synchronization

public string create snapshot ( final lease manager lease manager , final i nodes in path iip , string snapshot root , string snapshot name , long mtime ) throws i o exception { i node directory src root = get snapshottable root ( iip ) ; if ( snapshot counter = = get max snapshot i d ( ) ) { / / we have reached the maximum allowable snapshot id and since we don ' t / / handle rollover we will fail all subsequent snapshot creation / / requests throw new snapshot exception ( " failed to create the snapshot the file system has run out of " + " snapshot i ds and id rollover is not supported " ) ; } int n = num snapshots get ( ) ; check file system snapshot limit ( n ) ; src root add snapshot ( this , snapshot name , lease manager , mtime ) ; / / create success , update id snapshot counter + + ; num snapshots get and increment ( ) ; return snapshot get snapshot path ( snapshot root , snapshot name ) ; }


approximate width of geohash tile for a specific precision in degrees

public static double lon width in degrees ( int precision ) { return precision to lon width [ precision ] ; }


using provided csr , returns a signed certificate that represents a gcp service account identity

public com google common util concurrent listenable future < com google security meshca v 1 mesh certificate response > create certificate ( com google security meshca v 1 mesh certificate request request ) { return io grpc stub client calls future unary call ( get channel ( ) new call ( get create certificate method ( ) , get call options ( ) ) , request ) ; }


convert the given masked long to a pattern block ( having offset 0 ) note : the result will be 8 bytes in length

public static assembly pattern block from masked long ( masked long ml ) { byte [ ] mask = new byte [ 8 ] ; byte [ ] vals = new byte [ 8 ] ; long lmask = ml get mask ( ) ; long value = ml long value ( ) ; for ( int i = vals length ; i > = 0 ; i - - ) { mask [ i ] = ( byte ) ( lmask & 0xff ) ; vals [ i ] = ( byte ) ( value & 0xff ) ; lmask > > = 8 ; value > > = 8 ; } assembly pattern block res = new assembly pattern block ( 0 , mask , vals ) ; return res ; }


draws a pixel data sub - block , as defined by etsi en 300 743 7 2 5 1 , into a canvas

private static void paint pixel data sub blocks ( object data object data , clut definition clut definition , int region depth , int horizontal address , int vertical address , @ nullable paint paint , canvas canvas ) { int [ ] clut entries ; if ( region depth = = region depth 8 bit ) { clut entries = clut definition clut entries 8 bit ; } else if ( region depth = = region depth 4 bit ) { clut entries = clut definition clut entries 4 bit ; } else { clut entries = clut definition clut entries 2 bit ; } paint pixel data sub block ( object data top field data , clut entries , region depth , horizontal address , vertical address , paint , canvas ) ; paint pixel data sub block ( object data bottom field data , clut entries , region depth , horizontal address , vertical address + 1 , paint , canvas ) ; }


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


return the same value as { @ link float # hash code ( float ) } }

public static int hash code ( float flt ) { return float hash code ( flt ) ; }


returns the level of support that the sink provides for a given { @ link format }

int get format support ( format format ) ;


{ @ code predicate } that applies to any handlers

public static handler type predicate for any handler type ( ) { return new handler type predicate ( collections empty set ( ) , collections empty list ( ) , collections empty list ( ) ) ; }


returns true if the task executed successfully < p > note : this method only makes sense if called after the task has executed if called before , it will always return false ;

public boolean was successfull ( ) { return success ; }


gets a snapshot of the request properties

public synchronized map < string , string > get snapshot ( ) { if ( request properties snapshot = = null ) { request properties snapshot = collections unmodifiable map ( new hash map < > ( request properties ) ) ; } return request properties snapshot ; }


returns a triangularly distributed random number between - 1 0 ( exclusive ) and 1 0 ( exclusive ) , where values around zero are more likely this is an optimized version of { @ link # random triangular ( float , float , float ) random triangular ( - 1 , 1 , 0 ) }

public static float random triangular ( ) { return random next float ( ) - random next float ( ) ; }


evicts entries from the window space into the main space while the window size exceeds a maximum

int evict from window ( ) { int candidates = 0 ; node < k , v > node = access order window deque ( ) peek ( ) ; while ( window weighted size ( ) > window maximum ( ) ) { / / the pending operations will adjust the size to reflect the correct weight if ( node = = null ) { break ; } node < k , v > next = node get next in access order ( ) ; if ( node get policy weight ( ) ! = 0 ) { node make main probation ( ) ; access order window deque ( ) remove ( node ) ; access order probation deque ( ) add ( node ) ; candidates + + ; set window weighted size ( window weighted size ( ) - node get policy weight ( ) ) ; } node = next ; } return candidates ; }


invoked after the web socket connection has been closed by either side , or after a transport error has occurred although the session may technically still be open , depending on the underlying implementation , sending messages at this point is discouraged and most likely will not succeed

void after connection closed ( web socket session session , close status close status ) throws exception ;


true if the children for this node have been loaded yet some g tree nodes are lazy in that they don ' t load their children until needed nodes that have the in progress node as it child is considered loaded if in the swing thread , otherwise they are considered not loaded

public synchronized boolean is loaded ( ) { if ( children = = null ) { return false ; } if ( swing is swing thread ( ) ) { return true ; } return ! is in progress ( children ) ; }


check that messages are rate - limited by their x - opaque - id value

public void test messages are rate limited by x opaque id ( ) { / / fill up the cache for ( int i = 0 ; i < 128 ; i + + ) { message message = deprecated message of ( " " , " id " + i , " msg " + i ) ; assert that ( " expected key " + i + " to be accepted " , filter filter ( message ) , equal to ( result accept ) ) ; } / / should be rate - limited because it ' s still in the cache message message = deprecated message of ( " " , " id 0 " , " msg 0 " ) ; assert that ( filter filter ( message ) , equal to ( result deny ) ) ; / / filter a message with a previously unseen key , in order to evict key 0 as it ' s the oldest message = deprecated message of ( " " , " id 129 " , " msg 129 " ) ; assert that ( filter filter ( message ) , equal to ( result accept ) ) ; / / should be allowed because key 0 was evicted from the cache message = deprecated message of ( " " , " id 0 " , " msg 0 " ) ; assert that ( filter filter ( message ) , equal to ( result accept ) ) ; }


public string get name ( ) { return name ; }


enables or disables the use of local thumbnails as previews

public image request builder set local thumbnail previews enabled ( boolean enabled ) { m local thumbnail previews enabled = enabled ; return this ; }


public outer enum get outer enum ( ) { return outer enum ; }


filter on methods returning the given type with generics

public builder < t > returning ( class < ? > return type , resolvable type generic , resolvable type generics ) { return returning ( to resolvable type ( return type , generic , generics ) ) ; }


releases an allocated or acquired workspace

private synchronized void release ( @ non null file path p ) { entry old = in use get ( p get remote ( ) ) ; if ( old = = null ) throw new assertion error ( " releasing unallocated workspace " + p ) ; if ( logger is loggable ( level fine ) ) { logger log ( level fine , " releasing " + p + " with lock count " + old lock count , new throwable ( " from " + this ) ) ; } old lock count - - ; if ( old lock count = = 0 ) in use remove ( p get remote ( ) ) ; notify all ( ) ; }


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

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


create a kerberos registry service client

public static registry operations create kerberos instance ( configuration conf , string jaas client entry , string principal , string keytab ) { preconditions check argument ( conf ! = null , " null configuration " ) ; conf set ( key registry client auth , registry client auth kerberos ) ; conf set ( key registry client jaas context , jaas client entry ) ; registry operations client operations = new registry operations client ( " kerberos registry operations " ) ; operations set kerberos principal and keytab ( principal , keytab ) ; operations init ( conf ) ; return operations ; }


the specification of this method matches that of { @ link file context # create symlink ( path , path , boolean ) } ;

public void create symlink ( final path target , final path link , final boolean create parent ) throws i o exception , unresolved link exception { throw new i o exception ( " file system does not support symlinks " ) ; }


public void map boolean test ( ) { / / todo : test map boolean }


get the current sub - process executing the given command

public process get process ( ) { return process ; }


builder < t > cookie ( cookie cookie ) ;


tests to check number of bytes failed to upload in { @ link abfs output stream }

public void test abfs output stream bytes failed ( ) { describe ( " testing number of bytes failed during upload in abfs output steam " ) ; abfs output stream statistics impl abfs output stream statistics = new abfs output stream statistics impl ( ) ; / / test for zero bytes uploaded assert equals ( " mismatch in number of bytes failed to upload " , 0 , abfs output stream statistics get bytes upload failed ( ) ) ; / / populating small random value for bytes failed int random bytes failed = new random ( ) next int ( low range for random value ) ; abfs output stream statistics upload failed ( random bytes failed ) ; / / test for bytes failed to upload assert equals ( " mismatch in number of bytes failed to upload " , random bytes failed , abfs output stream statistics get bytes upload failed ( ) ) ; / / reset statistics for the next test abfs output stream statistics = new abfs output stream statistics impl ( ) ; / * * entering multiple random values for bytes failed to check correct * summation of values * / int expected bytes failed = 0 ; for ( int i = 0 ; i < operations ; i + + ) { random bytes failed = new random ( ) next int ( high range for random value ) ; abfs output stream statistics upload failed ( random bytes failed ) ; expected bytes failed + = random bytes failed ; } / / test for bytes failed to upload assert equals ( " mismatch in number of bytes failed to upload " , expected bytes failed , abfs output stream statistics get bytes upload failed ( ) ) ; }


push a request to disable automatic sleep for hardware useful for making sure computers don ' t go to sleep during long builds must be matched with a { @ link # pop disable sleep } call

public static native int push disable sleep ( ) ;


visit a parse tree produced by { @ link sql base parser # select items }

t visit select items ( sql base parser select items context ctx ) ;


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

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


public void test body with query params ( string query , user body ) throws rest client exception { test body with query params with http info ( query , body ) ; }


assert that timestamps are converted correctly , ticket hadoop - 11182

public void test put metrics 3 ( ) { / / setup graphite sink graphite sink sink = new graphite sink ( ) ; final graphite sink graphite mock graphite = make graphite ( ) ; whitebox set internal state ( sink , " graphite " , mock graphite ) ; / / given two metrics records with timestamps 1000 milliseconds apart list < metrics tag > tags = collections empty list ( ) ; set < abstract metric > metrics = new hash set < abstract metric > ( ) ; metrics add ( make metric ( " foo 1 " , 1 ) ) ; metrics record record 1 = new metrics record impl ( ms info context , 1000000000000l , tags , metrics ) ; metrics record record 2 = new metrics record impl ( ms info context , 1000000001000l , tags , metrics ) ; sink put metrics ( record 1 ) ; sink put metrics ( record 2 ) ; sink flush ( ) ; try { sink close ( ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } / / then the timestamps in the graphite stream should differ by one second try { verify ( mock graphite ) write ( eq ( " null default context foo 1 1 1000000000 \ n " ) ) ; verify ( mock graphite ) write ( eq ( " null default context foo 1 1 1000000001 \ n " ) ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } }


fetch charset from content - type header value as a char sequence a lot of sitespossibly clients have charset = " charset " , for example charset = " utf - 8 " or " utf 8 " instead of " utf - 8 " this is not according to standard , but this method provide an ability to catch desired mistakes manually in code

public static char sequence get charset as sequence ( char sequence content type value ) { object util check not null ( content type value , " content type value " ) ; int index of charset = ascii string index of ignore case ascii ( content type value , charset equals , 0 ) ; if ( index of charset = = ascii string index not found ) { return null ; } int index of encoding = index of charset + charset equals length ( ) ; if ( index of encoding < content type value length ( ) ) { char sequence charset candidate = content type value sub sequence ( index of encoding , content type value length ( ) ) ; int index of semicolon = ascii string index of ignore case ascii ( charset candidate , semicolon , 0 ) ; if ( index of semicolon = = ascii string index not found ) { return charset candidate ; } return charset candidate sub sequence ( 0 , index of semicolon ) ; } return null ; }


applies the given visitor to all parameters

public void parameters accept ( clazz clazz , method method , parameter info visitor parameter info visitor ) { / / loop over all parameters for ( int index = 0 ; index < u 1parameters count ; index + + ) { / / we don ' t need double dispatching here , since there is only one / / type of parameter info parameter info visitor visit parameter info ( clazz , method , index , parameters [ index ] ) ; } }


updates the value used for replication streams hard limit , which is set by { @ code d f s config keys dfs namenode replication streams hard limit key } initially

public void set replication streams hard limit ( int new val ) { ensure positive int ( new val , d f s config keys dfs namenode replication streams hard limit key ) ; replication streams hard limit = new val ; }


sets the message displayed on the task monitor

void append log msg ( string message ) { log append msg ( message ) ; }


public void minus equal ( vector other ) { if ( other instanceof dense vector ) { blas axpy ( - 1 0 , ( dense vector ) other , this ) ; } else { blas axpy ( - 1 0 , ( sparse vector ) other , this ) ; } }


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


registers the action that will compile the generated code

protobuf support register compilation action ( ) throws rule error exception , interrupted exception { if ( ! has output protos ( ) ) { return this ; } list < path fragment > user header search paths = immutable list of ( get workspace relative output dir ( ) ) ; compilation artifacts compilation artifacts = new compilation artifacts builder ( ) set intermediate artifacts ( get unique intermediate artifacts for source compile ( ) ) add non arc srcs ( get generated proto outputs ( get output protos ( ) , source suffix ) ) add additional hdrs ( get generated proto outputs ( get all protos ( ) , header suffix ) ) add additional hdrs ( get protobuf headers ( ) ) build ( ) ; objc common common = get common ( get unique intermediate artifacts for source compile ( ) , compilation artifacts ) ; compilation support compilation support = new compilation support builder ( ) set rule context ( rule context ) set config ( build configuration ) set intermediate artifacts ( get unique intermediate artifacts for source compile ( ) ) set compilation attributes ( new compilation attributes builder ( ) build ( ) ) set toolchain provider ( toolchain ) do not use pch ( ) build ( ) ; compilation support register compile and archive actions ( common , user header search paths ) ; set objc provider ( compilation support get objc provider ( ) ) ; return this ; }


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


positions the listing panel to the given address

public boolean go to ( address addr ) { program p = get program ( ) ; if ( p ! = null ) { return go to ( new program location ( p , addr ) ) ; } return false ; }


decodes a bit of a url encoded by a browser this is equivalent to calling { @ link # decode component ( string , charset ) } with the utf - 8 charset ( recommended to comply with rfc 3986 , section 2 )

public static string decode component ( final string s ) { return decode component ( s , http constants default charset ) ; }


private void test restore committed log ( int total transactions , byte [ ] data , int min expected snapshots ) throws exception { file tmp dir = client base create tmp dir ( ) ; client base setup test env ( ) ; zoo keeper server zks = new zoo keeper server ( tmp dir , tmp dir , 3000 ) ; final int port = integer parse int ( hostport split ( " : " ) [ 1 ] ) ; server cnxn factory f = server cnxn factory create factory ( port , - 1 ) ; f startup ( zks ) ; assert true ( client base wait for server up ( hostport , connection timeout ) , " waiting for server being up " ) ; zoo keeper zk = client base create z k client ( hostport ) ; try { for ( int i = 0 ; i < total transactions ; i + + ) { zk create ( " / invalidsnap - " + i , data , ids open acl unsafe , create mode persistent ) ; } } finally { zk close ( ) ; } final int num snaps = zks get txn log factory ( ) find n recent snapshots ( 10 * min expected snapshots ) size ( ) ; log info ( " number of snapshots taken { } " , num snaps ) ; f shutdown ( ) ; zks shutdown ( ) ; assert true ( client base wait for server down ( hostport , connection timeout ) , " waiting for server to shutdown " ) ; assert true ( num snaps > min expected snapshots , " too few snapshot files " ) ; assert true ( num snaps < = min expected snapshots * 2 , " too many snapshot files " ) ; / / start server again zks = new zoo keeper server ( tmp dir , tmp dir , 3000 ) ; zks startdata ( ) ; collection < proposal > committed log = zks get z k database ( ) get committed log ( ) ; int logsize = committed log size ( ) ; log info ( " committed log size = { } " , logsize ) ; assert true ( ( logsize ! = 0 ) , " log size ! = 0 " ) ; zks shutdown ( ) ; }


the optinal style from which this style inherits attributes < code > optional aapt pb reference parent = 1 ; < code >

public builder clear parent ( ) { copy on write ( ) ; instance clear parent ( ) ; return this ; }


string get type name ( ) { if ( nested type definition applier = = null ) { return " " ; } return nested type definition applier get ms type ( ) get name ( ) ; }


sync the given { @ link file output stream }

public void sync ( @ nullable fs volume spi volume , file output stream fos ) throws i o exception { final long begin = profiling event hook before file io ( volume , sync , 0 ) ; try { fault injector event hook before file io ( volume , sync , 0 ) ; i o utils fsync ( fos get channel ( ) , false ) ; profiling event hook after file io ( volume , sync , begin , 0 ) ; } catch ( exception e ) { on failure ( volume , begin ) ; throw e ; } }


private static void print stack ( throwable e , string text , object args ) { err ( text , args ) ; e print stack trace ( stderr ) ; }


public boolean restart data node ( data node properties dnprop ) throws i o exception { return restart data node ( dnprop , false ) ; }


returns a snapshot of the checkpoint statistics or < code > null < code > if checkpointing is disabled

checkpoint stats snapshot get checkpoint stats snapshot ( ) ;


the default implementation delegates to { @ link # encode u r l } , returning the given url string as - is can be overridden in subclasses , appending a session id or the like in a redirect - specific fashion for general url encoding rules , override the common { @ link # encode u r l } method instead , applying to redirect u r ls as well as to general u r ls

public string encode redirect u r l ( string url ) { return encode u r l ( url ) ; }


verify boot fails with a metrics provider with fails to start

public void test faulty metrics provider on start ( ) throws exception { client base setup test env ( ) ; / / setup the logger to capture all logs byte array output stream os = new byte array output stream ( ) ; writer appender appender = get console appender ( os , level warn ) ; logger qlogger = logger get logger ( " org apache zookeeper server quorum " ) ; qlogger add appender ( appender ) ; try { final int client port qp1 = port assignment unique ( ) ; string quorum cfg section = " server 1 = 127 0 0 1 : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " ; " + client port qp1 + " \ n " + " server 2 = 127 0 0 1 : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " ; " + client port qp1 + " \ n " + " metrics provider class name = " + base test metrics provider metrics provider with error in start class get name ( ) + " \ n " ; main thread q 1 = new main thread ( 1 , client port qp1 , quorum cfg section ) ; q 1 start ( ) ; boolean isup = client base wait for server up ( " 127 0 0 1 : " + client port qp1 , 5000 ) ; assert false ( isup , " server never came up " ) ; q 1 shutdown ( ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port qp1 , client base connection timeout ) , " waiting for server 1 down " ) ; } finally { qlogger remove appender ( appender ) ; } line number reader r = new line number reader ( new string reader ( os to string ( ) ) ) ; string line ; boolean found = false ; pattern p = pattern compile ( " * metrics provider life cycle exception * " ) ; while ( ( line = r read line ( ) ) ! = null ) { found = p matcher ( line ) matches ( ) ; if ( found ) { break ; } } assert true ( found , " complains about metrics provider metrics provider life cycle exception " ) ; }


public void test model api response ( ) { / / todo : test model api response }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case initial status : return is set initial status ( ) ; } throw new illegal state exception ( ) ; }


returns a value that represents a fixed number of options all options are strings

static public value option value ( string name , final string current value , final string [ ] [ ] options , final string description ) { return new default value ( name , current value to string ( ) ) { public void show dialog ( ) { int selected index = - 1 ; default combo box model model = new default combo box model ( ) ; for ( int i = 0 ; i < options length ; i + + ) { model add element ( options [ i ] [ 0 ] ) ; if ( get value ( i ) equals ( current value ) ) selected index = i ; } j combo box combo box = new j combo box ( model ) ; combo box set selected index ( selected index ) ; if ( show value dialog ( combo box , description ) ) value = get value ( combo box get selected index ( ) ) ; } private string get value ( int i ) { if ( options [ i ] length = = 1 ) return options [ i ] [ 0 ] ; return options [ i ] [ 1 ] ; } public string to string ( ) { for ( int i = 0 ; i < options length ; i + + ) if ( get value ( i ) equals ( value ) ) return options [ i ] [ 0 ] to string ( ) ; return " " ; } public object get object ( ) { return value ; } } ; }


test to set and clear space quote when path is a file

public void test set and clear space quota path is file ( ) throws exception { final path parent = new path ( path utils get test dir ( get class ( ) ) get path ( ) , generic test utils get method name ( ) ) ; final path file = new path ( parent , " path - is - file " ) ; d f s test util create file ( dfs , file , 1024l , ( short ) 1l , 0 ) ; assert true ( dfs is file ( file ) ) ; / * set space quota * / test set and clear space quota path is file internal ( new string [ ] { " - set space quota " , " 1024 " , file to string ( ) } , file , - 1 , " set space quota " ) ; / * clear space quota * / test set and clear space quota path is file internal ( new string [ ] { " - clr space quota " , file to string ( ) } , file , - 1 , " clr space quota " ) ; }


set cookie parameters to the request builder , including default cookies

public void process cookie params ( map < string , string > cookie params , request builder req builder ) { for ( entry < string , string > param : cookie params entry set ( ) ) { req builder add header ( " cookie " , string format ( " % s = % s " , param get key ( ) , param get value ( ) ) ) ; } for ( entry < string , string > param : default cookie map entry set ( ) ) { if ( ! cookie params contains key ( param get key ( ) ) ) { req builder add header ( " cookie " , string format ( " % s = % s " , param get key ( ) , param get value ( ) ) ) ; } } }


invalidate the active keystore and key manager

static synchronized void invalidate trust managers ( ) { trust manager = null ; ca error = null ; }


public static parameter < map < string , string > > meta param ( ) { return new parameter < > ( " meta " , true , collections : : empty map , ( n , c , o ) - > type parsers parse meta ( n , o ) , m - > m field type ( ) meta ( ) ) ; }


create an application a record descriptor

protected void create a info ( service record record ) throws exception { a application record descriptor record info = new a application record descriptor ( get path ( ) , record ) ; register record descriptor ( type a , record info ) ; }


gets the bytecode offset ( exclusive ) of the end of this block


determine the charset to use for json input by default this is either the charset from the input { @ code media type } or otherwise falling back on { @ code utf - 8 } can be overridden in subclasses

protected charset get charset ( @ nullable media type content type ) { if ( content type ! = null & & content type get charset ( ) ! = null ) { return content type get charset ( ) ; } else { return standard charsets utf 8 ; } }


public upload file oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


returns a new { @ code path fragment } formed by replacing the extension of the last path segment of { @ code path } with { @ code new extension } null is returned iff { @ code path } has zero segments

public static path fragment replace extension ( path fragment path , string new extension ) { return path replace name ( remove extension ( path get base name ( ) ) + new extension ) ; }


set the config locations for this application context if not set , the implementation may use a default as appropriate

public void set config locations ( @ nullable string locations ) { if ( locations ! = null ) { assert no null elements ( locations , " config locations must not be null " ) ; this config locations = new string [ locations length ] ; for ( int i = 0 ; i < locations length ; i + + ) { this config locations [ i ] = resolve path ( locations [ i ] ) trim ( ) ; } } else { this config locations = null ; } }


create a single image source for a given image uri

public static image source for uri ( @ nullable uri uri ) { if ( uri = = null ) { return empty source ( ) ; } return get ( ) single uri ( uri ) ; }


return the error codes for the field or object , if any returns an empty array instead of null if none

public string [ ] get error codes ( ) { return this error codes ; }


public http method get method ( ) { return this method ; }


attempts to read the required bytes into next frame

private boolean read required bytes ( ) { int total bytes read = 0 ; int deflated bytes read = 0 ; try { if ( next frame = = null ) { next frame = new composite readable buffer ( ) ; } / / read until the buffer contains all the required bytes int missing bytes ; while ( ( missing bytes = required length - next frame readable bytes ( ) ) > 0 ) { if ( full stream decompressor ! = null ) { try { if ( inflated buffer = = null | | inflated index = = inflated buffer length ) { inflated buffer = new byte [ math min ( missing bytes , max buffer size ) ] ; inflated index = 0 ; } int bytes to read = math min ( missing bytes , inflated buffer length - inflated index ) ; int n = full stream decompressor inflate bytes ( inflated buffer , inflated index , bytes to read ) ; total bytes read + = full stream decompressor get and reset bytes consumed ( ) ; deflated bytes read + = full stream decompressor get and reset deflated bytes consumed ( ) ; if ( n = = 0 ) { / / no more inflated data is available return false ; } next frame add buffer ( readable buffers wrap ( inflated buffer , inflated index , n ) ) ; inflated index + = n ; } catch ( i o exception e ) { throw new runtime exception ( e ) ; } catch ( data format exception e ) { throw new runtime exception ( e ) ; } } else { if ( unprocessed readable bytes ( ) = = 0 ) { / / no more data is available return false ; } int to read = math min ( missing bytes , unprocessed readable bytes ( ) ) ; total bytes read + = to read ; next frame add buffer ( unprocessed read bytes ( to read ) ) ; } } return true ; } finally { if ( total bytes read > 0 ) { listener bytes read ( total bytes read ) ; if ( state = = state body ) { if ( full stream decompressor ! = null ) { / / with compressed streams , total bytes read can include gzip header and trailer metadata stats trace ctx inbound wire size ( deflated bytes read ) ; inbound body wire size + = deflated bytes read ; } else { stats trace ctx inbound wire size ( total bytes read ) ; inbound body wire size + = total bytes read ; } } } } }


creates a new security manager with a standard set of test packages being the only packages that can exit or halt the virtual machine the packages that can exit are : < code > org apache maven surefire booter < code > < code > com carrotsearch ant tasks junit 4 < code > < code > org eclipse internal junit runner < code > < code > com intellij rt execution junit < code >

public static secure s m create test secure s m ( ) { return new secure s m ( test runner packages ) ; }


applies an aggregation that gives the maximum value of every window of the data stream at the given position

public single output stream operator < t > max ( int position to max ) { return aggregate ( new comparable aggregator < > ( position to max , input get type ( ) , aggregation function aggregation type max , input get execution config ( ) ) ) ; }


returns the class that implements a copy strategy looks up the implementation for a particular strategy from distcp - default xml

public static class < ? extends input format > get strategy ( configuration conf , dist cp context context ) { string conf label = " distcp " + string utils to lower case ( context get copy strategy ( ) ) + " strategy " + " impl " ; return conf get class ( conf label , uniform size input format class , input format class ) ; }


returns true if this property type is applicable to the given target type the default implementation of this method checks if the given node type is assignable according to the parameterization , but subtypes can extend this to change this behavior

public boolean is applicable ( class < ? extends t > target type ) { class < ? extends t > applicable = functions get type parameter ( clazz , get p ( ) , 0 ) ; return applicable is assignable from ( target type ) ; }


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

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


void consume ( parsable byte array data , @ flags int flags ) throws parser exception ;


return the underlying { @ link javax cache annotation cache resolver } that this instance is using

protected javax cache annotation cache resolver get target ( ) { return this target ; }


an alternate form of { @ code put } that silently removes any existing entry with the value { @ code value } before proceeding with the { @ link # put } operation if the bimap previously contained the provided key - value mapping , this method has no effect note that a successful call to this method could cause the size of the bimap to increase by one , stay the same , or even decrease by one < b > warning : < b > if an existing entry with this value is removed , the key for that entry is discarded and not returned

v force put ( @ nullable decl k key , @ nullable decl v value ) ; / / bulk operations


keith now has a converter that supports string to x , if x has a ctor that takes a string in order for round tripping to work we need to string ( ) for x to return what it was constructed with this is a bit of a hack because a place of birth also encapsulates a country - but as it is just a test object , it is ok

public string to string ( ) { return city ; }


sets the component id value , used to identify the tool that this test integration belongs to this is optional

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


the instance of the discovered extension

public t get instance ( ) { return instance ; }


wait until final key - value mappings have been consumed

public static < k , v > list < key value timestamp < k , v > > wait until final key value timestamp records received ( final properties consumer config , final string topic , final list < key value timestamp < k , v > > expected records ) throws exception { return wait until final key value records received ( consumer config , topic , expected records , default timeout , true ) ; }


return the configured proxy class loader for this processor

protected class loader get proxy class loader ( ) { return this proxy class loader ; }


simple job : map - > reduce - > map - > reduce all functions preserve all fields ( hence all properties ) increases parallelism between 2nd map and 2nd reduce , so the hash partitioning from 1st reduce is not reusable expected to re - establish partitioning between map and reduce ( hash )

public void check property handling with increasing global parallelism 2 ( ) { final int p = default parallelism ; / / construct the plan execution environment env = execution environment get execution environment ( ) ; env set parallelism ( p ) ; data set < long > set 1 = env generate sequence ( 0 , 1 ) set parallelism ( p ) ; set 1 map ( new identity mapper < long > ( ) ) with forwarded fields ( " * " ) set parallelism ( p ) name ( " map 1 " ) group by ( " * " ) reduce group ( new identity group reducer < long > ( ) ) with forwarded fields ( " * " ) set parallelism ( p ) name ( " reduce 1 " ) map ( new identity mapper < long > ( ) ) with forwarded fields ( " * " ) set parallelism ( p ) name ( " map 2 " ) group by ( " * " ) reduce group ( new identity group reducer < long > ( ) ) with forwarded fields ( " * " ) set parallelism ( p * 2 ) name ( " reduce 2 " ) output ( new discarding output format < long > ( ) ) set parallelism ( p * 2 ) name ( " sink " ) ; plan plan = env create program plan ( ) ; / / submit the plan to the compiler optimized plan o plan = compile no stats ( plan ) ; / / check the optimized plan / / when reducer 1 distributes its data across the instances of map 2 , it needs to employ a / / local hash method , / / because map 2 has twice as many instances and key / value pairs with the same key need to be / / processed by the same / / mapper respectively reducer sink plan node sink node = o plan get data sinks ( ) iterator ( ) next ( ) ; single input plan node red 2 node = ( single input plan node ) sink node get predecessor ( ) ; single input plan node map 2 node = ( single input plan node ) red 2 node get predecessor ( ) ; ship strategy type map in = map 2 node get input ( ) get ship strategy ( ) ; ship strategy type reduce in = red 2 node get input ( ) get ship strategy ( ) ; assert assert equals ( " invalid ship strategy for an operator " , ship strategy type forward , map in ) ; assert assert equals ( " invalid ship strategy for an operator " , ship strategy type partition hash , reduce in ) ; }


helper to manually escape a 7 - bit ascii character

private string escape ascii ( char c ) { preconditions check argument ( c < 128 ) ; string hex = " 0123456789abcdef " ; return " % " + hex char at ( ( c > > 4 ) & 0xf ) + hex char at ( c & 0xf ) ; }


returns a key - group range with offsets which is the intersection of the internal key - group range with the given key - group range

public key group range offsets get intersection ( key group range key group range ) { preconditions check not null ( key group range ) ; key group range intersection = this key group range get intersection ( key group range ) ; long [ ] sub offsets = new long [ intersection get number of key groups ( ) ] ; if ( sub offsets length > 0 ) { system arraycopy ( offsets , compute key group index ( intersection get start key group ( ) ) , sub offsets , 0 , sub offsets length ) ; } return new key group range offsets ( intersection , sub offsets ) ; }


public static string get user ( ) { return yarn version info get user ( ) ; }


get the substring except base name from path

private string path without base name ( ) { return base name ! = null ? path replace ( " / " + base name to lower case ( locale root ) , " " ) : path ; }


{ @ inherit doc } creates an empty { @ code tree set } for a collection of values for one key

sorted set < v > create collection ( ) { return new tree set < v > ( value comparator ) ; }


where the entry was defined < code > optional aapt pb source source = 1 ; < code >

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


inserts the given element in the given array the array is extended if necessary

public static short [ ] insert ( short [ ] array , int size , int index , short element ) { array = extend array ( array , size + 1 ) ; / / move the last part system arraycopy ( array , index , array , index + 1 , size - index ) ; array [ index ] = element ; return array ; }


apply the selected theme ( on new pipe settings ) in the context with the default style ( see { @ link # set theme ( context , int ) } )

public static void set theme ( final context context ) { set theme ( context , - 1 ) ; }


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


returns the appropriate { @ code if - lt } rop for the given sources the result is a shared instance

public static rop op if lt ( type list types ) { return pick if ( types , if ltz int , null , if lt int , null ) ; }


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


set the target object on which the field is defined only necessary when the target field is not static ; else , a target class is sufficient

public void set target object ( @ nullable object target object ) { this target object = target object ; }


helper : checks a fieldinfo and throws exception if its definitely not a lat lon doc values field

static void check compatible ( field info field info ) { / / dv properties could be " unset " , if you e g used only stored field with this same name in the segment if ( field info get doc values type ( ) ! = doc values type none & & field info get doc values type ( ) ! = doc values type binary ) { throw new illegal argument exception ( " field = \ " " + field info name + " \ " was indexed with doc values type = " + field info get doc values type ( ) + " but this type has doc values type = " + doc values type binary + " , is the field really a geo - shape field ? " ) ; } }


namespaces defined on this element < code > repeated aapt pb xml namespace namespace declaration = 1 ; < code >

public builder clear namespace declaration ( ) { copy on write ( ) ; instance clear namespace declaration ( ) ; return this ; }


query given sql to create a prepared statement from sql and a list of arguments to bind to the query , mapping each row to a result object via a row mapper

< t > list < t > query ( string sql , @ nullable object [ ] args , row mapper < t > row mapper ) throws data access exception ;


find type info vftable by existing type info : : vftable symbol

private static address find type info vftable label ( program program ) { symbol table symbol table = program get symbol table ( ) ; namespace typeinfo namespace = symbol table get namespace ( type info namespace , program get global namespace ( ) ) ; symbol vftable symbol = symbol table get local variable symbol ( " vftable " , typeinfo namespace ) ; if ( vftable symbol ! = null ) { return vftable symbol get address ( ) ; } vftable symbol = symbol table get local variable symbol ( " ` vftable ' " , typeinfo namespace ) ; if ( vftable symbol ! = null ) { return vftable symbol get address ( ) ; } vftable symbol = symbol table get local variable symbol ( " type info " , typeinfo namespace ) ; if ( vftable symbol ! = null ) { return vftable symbol get address ( ) ; } return null ; }


verifies that a task executor hosting multiple partitions of a data set receives a release call if a subset of its partitions is lost

public void test report processing with partition loss on same task executor ( ) { test cluster partition releaser partition releaser = new test cluster partition releaser ( ) ; final resource manager partition tracker tracker = new resource manager partition tracker impl ( partition releaser ) ; report ( tracker , task executor id 1 , data set id , 2 , partition id 1 , partition id 2 ) ; report ( tracker , task executor id 1 , data set id , 2 , partition id 2 ) ; assert that ( partition releaser release calls , contains ( tuple 2 of ( task executor id 1 , collections singleton ( data set id ) ) ) ) ; }


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

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


return the optional ( but always non - empty if not null ) error code as per < a href = " https : tools ietf orghtmlrfc 6 7 4 9 # section - 5 2 " > rfc 6749 : the o auth 2 0 authorization framework

public string error code ( ) { return error code ; }


convenience shorthand for { @ link # add user identity link ( string , string , string ) } ; with type { @ link identity link type # candidate }

void add candidate user ( string task id , string user id ) ;


validate all given mail addresses the default implementation simply delegates to { @ link # validate address } for each address

protected void validate addresses ( internet address [ ] addresses ) throws address exception { for ( internet address address : addresses ) { validate address ( address ) ; } }


does the specified method support rest or not ?

protected abstract boolean supports ( processing environment processing env , type element service type , type element service interface type , executable element method ) ;


returns the operation code for gap - free dup operations with a single instruction support by their type sizes on stack top

public static int get type size aligned dup opcode ( immutable list < type > elements to dup ) { return get type size aligned dup opcode ( elements to dup , immutable list of ( ) ) ; }


returns a new factory that with default to { @ code fallback json adapter from json ( reader ) } upon decoding of unrecognized labels the { @ link json reader } instance will not be automatically consumed , so sure to consume it within your implementation of { @ link json adapter # from json ( json reader ) }

public polymorphic json adapter factory < t > with fallback json adapter ( @ nullable json adapter < object > fallback json adapter ) { return new polymorphic json adapter factory < > ( base type , label key , labels , subtypes , fallback json adapter ) ; }


returns the configuration - independent root where the build - data should be placed , given the { @ link blaze directories } of this server instance nothing else should be placed here

public artifact root get build data directory ( string workspace name ) { return artifact root as derived root ( get exec root ( workspace name ) , get relative output path ( product name ) ) ; }


returns the comparator that orders the keys , which is { @ link ordering # natural ( ) } when the natural ordering of the keys is used note that its behavior is not consistent with { @ link tree map # comparator ( ) } , which returns { @ code null } to indicate natural ordering

public comparator < ? super k > comparator ( ) { return key set ( ) comparator ( ) ; }


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


protected resource get metadata artifact ( final optional < saml registered service > result , final string artifact name ) { if ( result is present ( ) ) { val service directory = new file ( this metadata location , saml id p metadata generator get applies to for ( result ) ) ; logger trace ( " metadata directory location for [ { } ] is [ { } ] " , result get ( ) get name ( ) , service directory ) ; if ( service directory exists ( ) ) { val artifact = new file ( service directory , artifact name ) ; logger trace ( " artifact location for [ { } ] and [ { } ] is [ { } ] " , artifact name , result get ( ) get name ( ) , artifact ) ; if ( artifact exists ( ) ) { logger debug ( " using metadata artifact [ { } ] at [ { } ] " , artifact name , artifact ) ; return new file system resource ( artifact ) ; } } } initialize metadata directory ( ) ; return new file system resource ( new file ( this metadata location , artifact name ) ) ; }


public string to string ( ) { return sb to string ( ) ; }


returns the fixup debug information , or null if it does not exists

public debug fixup get debug fixup ( ) { return fixup debug ; }


stores an alternative method to instantiate the { @ link producer factory } this allows experimenting with overridden producers

public image pipeline config builder set producer factory method ( producer factory method producer factory method ) { m producer factory method = producer factory method ; return m config builder ; }


sets the aliases that will be associated with the index when it gets created

public create index request aliases ( string source , x content type content type ) { return aliases ( new bytes array ( source ) , content type ) ; }


sets the < code > map array integer < code > property

public additional properties class map array integer ( map < string , list < integer > > map array integer ) { this map array integer = map array integer ; return this ; }


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

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


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


gets the name of the client application in the header

public static string get app name ( http servlet request request ) { return request get header ( client appname header ) ; }


adds a data { @ link source } to the environment to get a { @ link data stream } the result will be either a bounded data stream ( that can be processed in a batch way ) or an unbounded data stream ( that must be processed in a streaming way ) , based on the boundedness property of the source , as defined by { @ link source # get boundedness ( ) } the result type ( that is used to create serializers for the produced data events ) will be automatically extracted this is useful for sources that describe the produced types already in their configuration , to avoid having to declare the type multiple times for example the file sources and kafka sources already define the produced byte their parsersserializersformats , and can forward that information

public < out > data stream source < out > from source ( source < out , ? , ? > source , watermark strategy < out > timestamps and watermarks , string source name ) { return from source ( source , timestamps and watermarks , source name , null ) ; }


will download an image from a url and put it in an image view it uses square ' s picasso library to download the image asynchronously and put the result into the image view picasso manages recycling of views in a list view if you need more control over the picasso settings , use { base adapter helper # set image builder }

public base adapter helper set image url ( int view id , string image url ) { image view view = retrieve view ( view id ) ; glide with ( context ) load ( image url ) into ( view ) ; return this ; }


returns the start position of the first occurrence of the specified { @ code target } within { @ code array } , or { @ code - 1 } if there is no such occurrence more formally , returns the lowest index { @ code i } such that { @ code arrays copy of range ( array , i , i + target length ) } contains exactly the same elements as { @ code target }

public static int index of ( long [ ] array , long [ ] target ) { check not null ( array , " array " ) ; check not null ( target , " target " ) ; if ( target length = = 0 ) { return 0 ; } outer : for ( int i = 0 ; i < array length - target length + 1 ; i + + ) { for ( int j = 0 ; j < target length ; j + + ) { if ( array [ i + j ] ! = target [ j ] ) { continue outer ; } } return i ; } return - 1 ; }


public builder put tag ( string key , string value ) { if ( tags = = null ) tags = new tree map < string , string > ( ) ; if ( key = = null ) throw new null pointer exception ( " key = = null " ) ; if ( value = = null ) throw new null pointer exception ( " value of " + key + " = = null " ) ; this tags put ( key , value ) ; return this ; }


public void route ( http method , string path spec , class < ? extends controller > cls , string action ) { list < string > res = parse route ( path spec ) ; router add ( method , res get ( r path ) , cls , action , res sub list ( r params , res size ( ) ) ) ; }


check on whether or not a parameter should be serialized

boolean check ( boolean include defaults , boolean is configured , t value ) ;


return the parameters identifying the target request , or an empty map

public multi value map < string , string > get target request params ( ) { return this target request params ; }


this test verifies that checkpoint barriers and barrier buffers work correctly with concurrent checkpoint barriers where one checkpoint is " overtaking " another checkpoint , i e some inputs receive barriers from an earlier checkpoint , thereby blocking , then all inputs receive barriers from a later checkpoint

public void test overtaking checkpoint barriers ( ) throws exception { final one input stream task test harness < string , string > test harness = new one input stream task test harness < > ( one input stream task : : new , 2 , 2 , basic type info string type info , basic type info string type info ) ; test harness setup output for singleton operator chain ( ) ; stream config stream config = test harness get stream config ( ) ; stream map < string , string > map operator = new stream map < > ( new identity map ( ) ) ; stream config set stream operator ( map operator ) ; stream config set operator i d ( new operator i d ( ) ) ; concurrent linked queue < object > expected output = new concurrent linked queue < > ( ) ; long initial time = 0l ; test harness invoke ( ) ; test harness wait for task running ( ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 0 , 0 ) ; / / these elements should be forwarded , since we did not yet receive a checkpoint barrier / / on that input , only add to same input , otherwise we would not know the ordering / / of the output since the task might read the inputs in any order test harness process element ( new stream record < > ( " hello - 1 - 1 " , initial time ) , 1 , 1 ) ; test harness process element ( new stream record < > ( " ciao - 1 - 1 " , initial time ) , 1 , 1 ) ; expected output add ( new stream record < > ( " hello - 1 - 1 " , initial time ) ) ; expected output add ( new stream record < > ( " ciao - 1 - 1 " , initial time ) ) ; test harness wait for input processing ( ) ; / / we should not yet see the barrier , only the two elements from non - blocked input test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; / / now give a later barrier to all inputs , this should unblock the first channel test harness process event ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) , 0 , 1 ) ; test harness process event ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) , 0 , 0 ) ; test harness process event ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) , 1 , 0 ) ; test harness process event ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) , 1 , 1 ) ; expected output add ( new cancel checkpoint marker ( 0 ) ) ; expected output add ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) ) ; test harness wait for input processing ( ) ; test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; / / then give the earlier barrier , these should be ignored test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 0 , 1 ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 1 , 0 ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 1 , 1 ) ; test harness wait for input processing ( ) ; test harness end input ( ) ; test harness wait for task completion ( ) ; test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; }


set the components of the dynamic structure all at once this does not add the components in , it replaces any existing ones

public void set components ( list < data type > components , list < string > component names , list < string > component descs ) { this components = new array list < data type > ( components ) ; this component names = new array list < string > ( component names ) ; this component descs = new array list < string > ( component descs ) ; }


return a description string for a root location called from a { @ link file description thread background thread } to avoid blocking the ui while waiting for slow file systems

protected string get root description string ( file root ) { / / special case the description of the root of a unix filesystem , otherwise it gets marked as removable if ( " / " equals ( root get absolute path ( ) ) ) { return " file system root ( / ) " ; } / / special case the description of floppies and removable disks , otherwise delegate to fs view ' s get system display name if ( fs view is floppy drive ( root ) ) { return string format ( " floppy ( % s ) " , root get absolute path ( ) ) ; } string fsv s t d = null ; try { fsv s t d = fs view get system type description ( root ) ; } catch ( exception e ) { / / windows expects the a drive to exist ; if it does not exist , an exception results ignore it } if ( fsv s t d = = null | | fsv s t d to lower case ( ) index of ( " removable " ) ! = - 1 ) { return " removable disk ( " + root get absolute path ( ) + " ) " ; } / / call the ( possibly slow ) fsv ' s get system display name return fs view get system display name ( root ) ; }


get the corresponding table name of current model

protected string get table name ( ) { return base utility change case ( d b utility get table name by class name ( get class name ( ) ) ) ; }


release all nodes held by this node manager this method must be invoked before a database transaction can be committed

int release nodes ( ) throws i o exception { for ( b tree node node : node table values ( ) ) { if ( node instanceof record node ) { leaf record cnt - = node get key count ( ) ; } buffer mgr release buffer ( node get buffer ( ) ) ; } node table = new hash map < > ( ) ; int result = - leaf record cnt ; leaf record cnt = 0 ; return result ; }


returns true if the edges in this graph are directed directed edges connect a { @ link endpoint pair # source ( ) source node } to a { @ link endpoint pair # target ( ) target node } , while undirected edges connect a pair of nodes to each other


tries to replay the buffer contents to all known observers

void replay final ( ) { @ suppress warnings ( " unchecked " ) inner disposable < t > [ ] a = observers get and set ( terminated ) ; for ( inner disposable < t > rp : a ) { buffer replay ( rp ) ; } }


returns a new { @ code cache stats } representing the difference between this { @ code cache stats } and { @ code other } negative values , which aren ' t supported by { @ code cache stats } will be rounded up to zero

public cache stats minus ( cache stats other ) { return new cache stats ( math max ( 0 , saturated subtract ( hit count , other hit count ) ) , math max ( 0 , saturated subtract ( miss count , other miss count ) ) , math max ( 0 , saturated subtract ( load success count , other load success count ) ) , math max ( 0 , saturated subtract ( load exception count , other load exception count ) ) , math max ( 0 , saturated subtract ( total load time , other total load time ) ) , math max ( 0 , saturated subtract ( eviction count , other eviction count ) ) ) ; }


outbound flow control where the initial window size is increased before a stream is started

public void outbound flow control big window size ( ) throws exception { init transport ( ) ; int initial outbound window size = 131070 ; / / 65535 * 2 set initial window size ( initial outbound window size ) ; frame handler ( ) window update ( 0 , 65535 ) ; mock stream listener listener = new mock stream listener ( ) ; ok http client stream stream = client transport new stream ( method , new metadata ( ) , call options default ) ; stream start ( listener ) ; int message length = 100000 ; / / the first message should be sent out input stream input = new byte array input stream ( new byte [ message length ] ) ; stream write message ( input ) ; stream flush ( ) ; verify ( frame writer , timeout ( time out ms ) ) data ( eq ( false ) , eq ( 3 ) , any ( buffer class ) , eq ( message length + header length ) ) ; / / the second message should be partially sent out input = new byte array input stream ( new byte [ message length ] ) ; stream write message ( input ) ; stream flush ( ) ; int partially sent size = initial outbound window size - message length - header length ; verify ( frame writer , timeout ( time out ms ) ) data ( eq ( false ) , eq ( 3 ) , any ( buffer class ) , eq ( partially sent size ) ) ; / / get more credit so the rest of the data should be sent out frame handler ( ) window update ( 0 , initial outbound window size ) ; frame handler ( ) window update ( 3 , initial outbound window size ) ; verify ( frame writer , timeout ( time out ms ) ) data ( eq ( false ) , eq ( 3 ) , any ( buffer class ) , eq ( message length + header length - partially sent size ) ) ; stream cancel ( status cancelled ) ; listener wait until stream closed ( ) ; shutdown and verify ( ) ; }


returns the index in the selection of the track with the specified format the format is located by identity so , for example , { @ code selection index of ( selection get format ( index ) ) = = index } even if multiple selected tracks have formats that contain the same values


returns a new path data with the given extension

public path data suffix ( string extension ) throws i o exception { return new path data ( fs , this + extension ) ; }


indicates whether this provider represents a store that is intended for transient use - such as the user provider is these providers are generally used to provide job access to passwords rather than for long term storage

public boolean is transient ( ) { return false ; }


close the { @ link channel } of the { @ link channel promise } and notify the { @ link channel promise } once the operation was complete

void close ( channel promise promise ) ;


find the level down to which to assign all nodes black this is the last ` full ' level of the complete binary tree produced by build tree the remaining nodes are colored red ( this makes a ` nice ' set of color assignments wrt future insertions ) this level number is computed by finding the number of splits needed to reach the zeroeth node ( the answer is ~ lg ( n ) , but in any case must be computed by same quick o ( lg ( n ) ) loop )

private static int compute red level ( int sz ) { int level = 0 ; for ( int m = sz - 1 ; m > = 0 ; m = m / 2 - 1 ) level + + ; return level ; }


set view type of current { @ link render info } if it was created through { @ link view render info # create ( ) } and a custom view type was not set , or otherwise it will throw { @ link unsupported operation exception }

public void set view type ( int view type ) { throw new unsupported operation exception ( ) ; }


creates a new accumulator with the given initial value


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

public boolean is disabled ( ) { return this disabled ; }


executes the given task , within a concurrency throttle if configured ( through the superclass ' s settings ) executes urgent tasks ( with ' immediate ' timeout ) directly , bypassing the concurrency throttle ( if active ) all other tasks are subject to throttling

public void execute ( runnable task , long start timeout ) { assert not null ( task , " runnable must not be null " ) ; runnable task to use = ( this task decorator ! = null ? this task decorator decorate ( task ) : task ) ; if ( is throttle active ( ) & & start timeout > timeout immediate ) { this concurrency throttle before access ( ) ; do execute ( new concurrency throttling runnable ( task to use ) ) ; } else { do execute ( task to use ) ; } }


configures silence in stdout of the driver server by unlogged messages

public builder with silent ( boolean silent ) { this silent = silent ; return this ; }


method to decide whether the element signals the end of the stream if true is returned the element won ' t be emitted

boolean is end of stream ( t next element ) ;


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


public string get rpc address ( ) { return this rpc address ; }


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

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


test releasing a node which has a long path to the terminal node ( the node without an out - going edge )

public void test release nodes with long path ( ) throws exception { shared buffer < event > shared buffer = test shared buffer create test buffer ( event create type serializer ( ) ) ; final int number events = 100000 ; event [ ] events = new event [ number events ] ; event id [ ] event ids = new event id [ number events ] ; node id [ ] node ids = new node id [ number events ] ; final long timestamp = 1l ; for ( int i = 0 ; i < number events ; i + + ) { events [ i ] = new event ( i + 1 , " e " + ( i + 1 ) , i ) ; event ids [ i ] = shared buffer register event ( events [ i ] , timestamp ) ; } try ( shared buffer accessor < event > shared buffer accessor = shared buffer get accessor ( ) ) { for ( int i = 0 ; i < number events ; i + + ) { node id prev id = i = = 0 ? null : node ids [ i - 1 ] ; node ids [ i ] = shared buffer accessor put ( " n " + i , event ids [ i ] , prev id , dewey number from string ( " 1 0 " ) ) ; } node id last node = node ids [ number events - 1 ] ; shared buffer accessor release node ( last node ) ; for ( int i = 0 ; i < number events ; i + + ) { shared buffer accessor release event ( event ids [ i ] ) ; } } assert true ( shared buffer is empty ( ) ) ; }


returns the scale of all types that define a scale implicitly or explicitly

public static int get scale ( logical type logical type ) { return logical type accept ( scale extractor ) ; }


returns the set of options related to the loading phase

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


create a { @ code char sequence encoder } that supports all mime types

public static char sequence encoder all mime types ( ) { return new char sequence encoder ( new mime type ( " text " , " plain " , default charset ) , mime type utils all ) ; }


parses the optional specified string as a decimal number , returning its integer value , or default value if the string is null

public static int parse optional bounded int ( string int str , int default value , int min value , int max value ) throws number format exception { if ( int str ! = null ) { long tmp = parse long ( int str ) ; if ( tmp < min value | | tmp > max value ) { throw new number format exception ( " integer value " + tmp + " out of range : [ " + min value + " " + max value + " ] " ) ; } return ( int ) tmp ; } return default value ; }


public static optional < json web key set > get json web key set ( final oidc registered service service , final resource loader resource loader ) { try { logger trace ( " loading json web key from [ { } ] " , service get jwks ( ) ) ; val resource = get json web key set resource ( service , resource loader ) ; if ( resource = = null ) { logger warn ( " no json web keys or keystore resource could be found for [ { } ] " , service ) ; return optional empty ( ) ; } val json web key set = build json web key set ( resource ) ; if ( json web key set = = null | | json web key set get json web keys ( ) is empty ( ) ) { logger warn ( " no json web keys could be found for [ { } ] " , service ) ; return optional empty ( ) ; } val bad keys count = json web key set get json web keys ( ) stream ( ) filter ( k - > string utils is blank ( k get algorithm ( ) ) & & string utils is blank ( k get key id ( ) ) & & string utils is blank ( k get key type ( ) ) ) count ( ) ; if ( bad keys count = = json web key set get json web keys ( ) size ( ) ) { logger warn ( " no valid json web keys could be found for [ { } ] " , service ) ; return optional empty ( ) ; } val web key = get json web key from json web key set ( json web key set ) ; if ( objects require non null ( web key ) get public key ( ) = = null ) { logger warn ( " json web key retrieved [ { } ] has no associated public key " , web key get key id ( ) ) ; return optional empty ( ) ; } return optional of ( json web key set ) ; } catch ( final exception e ) { logging utils error ( logger , e ) ; } return optional empty ( ) ; }


returns the x - position of the highlight in pixels

public float get x px ( ) { return m x px ; }


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


return in general how things flow out of this node this method exists for the simpleblock model since it doesn ' t make a great deal of sense to ask for this method in the case of subroutines , we return flow type unknown as long as the block exists if this block has no valid instructions , it can ' t flow , so flow type invalid is returned

public flow type get flow type ( code block block ) { if ( ! ( block get model ( ) instanceof mult ent sub model ) ) { throw new illegal argument exception ( ) ; } / * if there are multiple unique ways out of the node , then we should return flow type unknown ( or flow type multiflow ? ) possible considerations for the future which are particularly applicable to model - p subroutines : add flow type multicall if only calls out and flow type multijump if multiple jumps out ( as opposed to jumping within the subroutine ) might want to consider flow type multiterminal for multiple returns ? * / return ref type flow ; }


public order place order ( order body ) { / / todo : implement return null ; }


copies one resource directory tree into another ; skipping some files , replacing the contents of some , and passing everything else through unmodified

private static void filtered copy ( file source , path destination , set < file > skip , map < file , string > replace ) throws i o exception { file destination file = destination to file ( ) ; if ( source is directory ( ) ) { file [ ] children = source list files ( ) ; if ( children ! = null ) { if ( ! destination file exists ( ) ) { boolean success = destination file mkdirs ( ) ; if ( ! success ) { throw new i o exception ( " could not create " + destination ) ; } } for ( file child : children ) { filtered copy ( child , destination resolve ( child get name ( ) ) , skip , replace ) ; } } } else if ( ! skip contains ( source ) & & source is file ( ) ) { string contents = replace get ( source ) ; if ( contents ! = null ) { files write ( contents , destination file , utf 8 ) ; } else { files copy ( source , destination file ) ; } } }


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

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


the f s image contains a string table which maps strings to i ds this is a simple form of compression which takes advantage of the fact that the same strings tend to occur over and over again this function will return an id which we can use to represent the given string if the string already exists in the string table , we will use that id ; otherwise , we will allocate a new one

int register string id ( string str ) throws i o exception { integer id = string table get ( str ) ; if ( id ! = null ) { return id ; } int latest id = latest string id ; if ( latest id > = 0x 1ffffff ) { throw new i o exception ( " cannot have more than 2 * * 25 " + " strings in the fsimage , because of the limitation on " + " the size of string table i ds " ) ; } string table put ( str , latest id ) ; latest string id + + ; return latest id ; }


returns the future register value at the specified address if no future value is stored , it will return the value stored in the program the value returned may not have a complete value for the requested register use this method if keeping separate flows from different flow from addresses is not important

public register value get register value ( register register , address address ) { return get register value ( register , address no address , address ) ; }


return { @ link config def } from { @ code cls } , which is expected to be a non - null { @ code class < t > } , by instantiating it and invoking { @ link # config ( t ) }

config def get config def from config providing class ( string key , class < ? > cls ) { if ( cls = = null | | ! base class is assignable from ( cls ) ) { throw new config exception ( key , string value of ( cls ) , " not a " + base class get simple name ( ) ) ; } if ( modifier is abstract ( cls get modifiers ( ) ) ) { string child class names = stream of ( cls get classes ( ) ) filter ( cls : : is assignable from ) filter ( c - > ! modifier is abstract ( c get modifiers ( ) ) ) filter ( c - > modifier is public ( c get modifiers ( ) ) ) map ( class : : get name ) collect ( collectors joining ( " , " ) ) ; string message = child class names trim ( ) is empty ( ) ? alias kind + " is abstract and cannot be created " : alias kind + " is abstract and cannot be created did you mean " + child class names + " ? " ; throw new config exception ( key , string value of ( cls ) , message ) ; } t transformation ; try { transformation = utils new instance ( cls , base class ) ; } catch ( exception e ) { throw new config exception ( key , string value of ( cls ) , " error getting config definition from " + base class get simple name ( ) + " : " + e get message ( ) ) ; } config def config def = config ( transformation ) ; if ( null = = config def ) { throw new connect exception ( string format ( " % s config ( ) must return a config def that is not null " , cls get name ( ) ) ) ; } return config def ; }


gets the slot sharing group that this vertex is associated with different vertices in the same slot sharing group can run one subtask each in the same slot

public slot sharing group get slot sharing group ( ) { if ( slot sharing group = = null ) { / / create a new slot sharing group for this vertex if it was in no other slot sharing / / group / / this should only happen in testing cases at the moment because production code path / / will / / always set a value to it before used set slot sharing group ( new slot sharing group ( ) ) ; } return slot sharing group ; }


given an index in the range < code > 0 size ( ) - 1 < code > , sets a new value for the < code > index < code > th key - value mapping that this sparse array stores

public void set value at ( int index , e value ) { if ( m garbage ) { gc ( ) ; } m values [ index ] = value ; }


triggers the distributed execution of the streaming dataflow and returns an iterator over the elements of the given data stream the data stream application is executed in the regular distributed manner on the target environment , and the events from the stream are polled back to this application process and thread through flink ' s rest api

public static < out > iterator < out > collect ( data stream < out > stream , string execution job name ) { try { return stream execute and collect ( execution job name ) ; } catch ( exception e ) { / / this " wrap as unchecked " step is here only to preserve the exception signature / / backwards compatible throw new runtime exception ( " failed to execute data stream " , e ) ; } }


performs incremental mount on all { @ link litho view } s within the given view

public static void incrementally mount litho views ( view view ) { if ( view instanceof litho view & & ( ( litho view ) view ) is incremental mount enabled ( ) ) { ( ( litho view ) view ) notify visible bounds changed ( ) ; } else if ( view instanceof view group ) { for ( int i = 0 , size = ( ( view group ) view ) get child count ( ) ; i < size ; i + + ) { final view child = ( ( view group ) view ) get child at ( i ) ; incrementally mount litho views ( child ) ; } } }


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


void set allow nested snapshots ( boolean allow nested snapshots ) { this allow nested snapshots = allow nested snapshots ; }


set the cache operation source for this cache aspect

public void set cache operation source ( @ nullable cache operation source cache operation source ) { this cache operation source = cache operation source ; }


specify the content type to use for sending remote invocation responses default is " applicationx - java - serialized - object "

public void set content type ( string content type ) { assert not null ( content type , " ' content type ' must not be null " ) ; this content type = content type ; }


return the servlet path under which the servlet is deployed by checking the servlet registration from { @ link # init ( servlet config ) }

public string get servlet path ( ) { return this servlet path ; }


public boolean contains value ( object value ) { return false ; }


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


this method will return a borrowed object to the bag objects that are borrowed from the bag but never " requited " will result in a memory leak

public void requite ( final t bag entry ) { bag entry set state ( state not in use ) ; for ( int i = 0 ; waiters get ( ) > 0 ; i + + ) { if ( bag entry get state ( ) ! = state not in use | | handoff queue offer ( bag entry ) ) { return ; } else if ( ( i & 0xff ) = = 0xff ) { park nanos ( microseconds to nanos ( 10 ) ) ; } else { thread yield ( ) ; } } final list < object > thread local list = thread list get ( ) ; if ( thread local list size ( ) < 50 ) { thread local list add ( weak thread locals ? new weak reference < > ( bag entry ) : bag entry ) ; } }


void set current fallthrough ( address addr ) { if ( is user defined & & ! executing command ) { current fallthrough addr = addr ; listener state changed ( null ) ; } }


public synchronized void do clear error ( stapler request req , stapler response rsp ) throws i o exception , servlet exception { get a c l ( ) check permission ( get permission ( ) ) ; if ( worker thread ! = null & & ! worker thread is running ( ) ) worker thread = null ; rsp send redirect ( " " ) ; }


we want block group has every internal block , but we have redundant internal blocks ( which have the same index ) in this method , we delete the redundant internal blocks until only one left for each index the block placement policy will make sure that the left internal blocks are spread across racks and also try hard to pick one with least free space

private void choose excess redundancy striped ( block collection bc , final collection < datanode storage info > non excess , block info stored block , datanode descriptor del node hint ) { assert stored block instanceof block info striped ; block info striped sblk = ( block info striped ) stored block ; short group size = sblk get total block num ( ) ; / / find all duplicated indices bit set found = new bit set ( group size ) ; / / indices found bit set duplicated = new bit set ( group size ) ; / / indices found more than once hash map < datanode storage info , integer > storage 2index = new hash map < > ( ) ; for ( datanode storage info storage : non excess ) { int index = sblk get storage block index ( storage ) ; assert index > = 0 ; if ( found get ( index ) ) { duplicated set ( index ) ; } found set ( index ) ; storage 2index put ( storage , index ) ; } / / use del hint only if del hint is duplicated final datanode storage info del storage hint = datanode storage info get datanode storage info ( non excess , del node hint ) ; if ( del storage hint ! = null ) { integer index = storage 2index get ( del storage hint ) ; if ( index ! = null & & duplicated get ( index ) ) { process chosen excess redundancy ( non excess , del storage hint , stored block ) ; } } / / cardinality of found indicates the expected number of internal blocks final int num of target = found cardinality ( ) ; final block storage policy storage policy = storage policy suite get policy ( bc get storage policy i d ( ) ) ; final list < storage type > excess types = storage policy choose excess ( ( short ) num of target , datanode storage info to storage types ( non excess ) ) ; if ( excess types is empty ( ) ) { log warn ( " excess types chosen for block { } among storages { } is empty " , stored block , non excess ) ; return ; } block placement policy placement policy = placement policies get policy ( striped ) ; / / for each duplicated index , delete some replicas until only one left for ( int target index = duplicated next set bit ( 0 ) ; target index > = 0 ; target index = duplicated next set bit ( target index + 1 ) ) { list < datanode storage info > candidates = new array list < > ( ) ; for ( datanode storage info storage : non excess ) { int index = storage 2index get ( storage ) ; if ( index = = target index ) { candidates add ( storage ) ; } } if ( candidates size ( ) > 1 ) { list < datanode storage info > replicas to delete = placement policy choose replicas to delete ( non excess , candidates , ( short ) 1 , excess types , null , null ) ; for ( datanode storage info chosen : replicas to delete ) { process chosen excess redundancy ( non excess , chosen , stored block ) ; candidates remove ( chosen ) ; } } duplicated clear ( target index ) ; } }


convenience method for reading a token from a data input stream

public void read token storage stream ( data input stream in ) throws i o exception { byte [ ] magic = new byte [ token storage magic length ] ; in read fully ( magic ) ; if ( ! arrays equals ( magic , token storage magic ) ) { throw new i o exception ( " bad header found in token storage " ) ; } serialized format format ; try { format = serialized format value of ( in read byte ( ) ) ; } catch ( illegal argument exception e ) { throw new i o exception ( e ) ; } switch ( format ) { case writable : read fields ( in ) ; break ; case protobuf : read proto ( in ) ; break ; default : throw new i o exception ( " unsupported format " + format ) ; } }


public byte size value get heap used ( ) { return new byte size value ( heap used ) ; }


public abstract boolean interest ( string context ) ;


overridden to provide a web hdfs file system wrapper for the super - user

protected web hdfs file system create file system ( ) throws exception { return web hdfs test util get web hdfs file system ( conf , web hdfs constants webhdfs scheme ) ; }


update internal status the update method pattern invoke udpate method for each entity in the game

private void update ( ) { for ( var entity : entities ) { entity update ( ) ; } }


returns the wchar charset in use for pdb processing

public charset get wide char charset ( ) { return two byte charset ; }


release any resources held by this emitter


string login user ( @ param ( " username " ) string username , @ param ( " password " ) string password ) ;


specify a custom prefix to use for json output default is none

public void set json prefix ( string json prefix ) { this json prefix = json prefix ; }


tests region failover does not restart vertexes which are already in initial created state ( v 1 ) - - | - - > ( v 2 ) ^ | ( blocking ) component 1 : 1 ; component 2 : 2

public void test region failover does not restart created executions ( ) { testing scheduling topology topology = new testing scheduling topology ( ) ; testing scheduling execution vertex v 1 = topology new execution vertex ( execution state created ) ; testing scheduling execution vertex v 2 = topology new execution vertex ( execution state created ) ; topology connect ( v 1 , v 2 , result partition type blocking ) ; failover strategy strategy = new restart pipelined region failover strategy ( topology ) ; verify that failed execution ( strategy , v 2 ) restarts ( ) ; testing scheduling result partition v 1out = v 2 get consumed results ( ) iterator ( ) next ( ) ; verify that failed execution ( strategy , v 2 ) partition connection cause ( v 1out ) restarts ( ) ; }


returns the { @ link inet 6 address } representation of a { @ link char sequence } ip address the { @ code ipv 4 mapped } parameter specifies how i pv 4 addresses should be treated " i pv 4 mapped " format as defined in < a href = " https : tools ietf orghtmlrfc 4 2 9 1 # section - 2 5 5 " > rfc 4291 section 2 is supported

public static inet 6 address get by name ( char sequence ip , boolean ipv 4 mapped ) { byte [ ] bytes = get i pv 6 by name ( ip , ipv 4 mapped ) ; if ( bytes = = null ) { return null ; } try { return inet 6 address get by address ( null , bytes , - 1 ) ; } catch ( unknown host exception e ) { throw new runtime exception ( e ) ; / / should never happen } }


returns an immutable set containing the given elements , minus duplicates , in the order each was first specified that is , if multiple elements are { @ linkplain object # equals equal } , all except the first are ignored

public static < e > immutable set < e > of ( e e 1 , e e 2 , e e 3 , e e 4 ) { return construct ( 4 , e 1 , e 2 , e 3 , e 4 ) ; }


public void reload ( ) { / / do nothing by default ; override in subs if necessary }


return default iterator this iterator returns all entries in storage dirs

public iterator < storage directory > dir iterator ( ) { return dir iterator ( null ) ; }


checks an ast node denoting a class type against directtransitive dependencies

private void check type literal ( j c tree node , symbol sym ) { if ( sym = = null | | sym kind ! = kinds kind typ ) { return ; } path jar path = get jar path ( sym encl class ( ) , platform jars ) ; / / if this type symbol comes from a class file loaded from a jar , check / / whether that jar was a direct dependency and error out otherwise if ( jar path ! = null & & seen classes add ( sym encl class ( ) ) ) { collect explicit dependency ( jar path , node , sym ) ; } }


removes all actors and cells from the table ( same as { @ link # clear children ( ) } ) and additionally resets all table properties and cell , column , and row defaults

public void reset ( ) { clear children ( ) ; pad top = background top ; pad left = background left ; pad bottom = background bottom ; pad right = background right ; align = align center ; debug ( debug none ) ; cell defaults reset ( ) ; for ( int i = 0 , n = column defaults size ; i < n ; i + + ) { cell column cell = column defaults get ( i ) ; if ( column cell ! = null ) cell pool free ( column cell ) ; } column defaults clear ( ) ; }


test first and second derivative on the sing

public void test single valued field normalised ( ) throws i o exception { setup value counts ( ) ; query query = new match all docs query ( ) ; histogram aggregation builder agg builder = new histogram aggregation builder ( " histo " ) field ( single valued field name ) interval ( interval ) min doc count ( 0 ) ; agg builder sub aggregation ( new derivative pipeline aggregation builder ( " deriv " , " count " ) unit ( " 1ms " ) ) ; agg builder sub aggregation ( new derivative pipeline aggregation builder ( " 2nd deriv " , " deriv " ) unit ( " 1 0ms " ) ) ; execute test case ( query , agg builder , histogram - > { assert that ( histogram , not null value ( ) ) ; assert that ( histogram get name ( ) , equal to ( " histo " ) ) ; list < ? extends histogram bucket > buckets = ( ( histogram ) histogram ) get buckets ( ) ; assert that ( buckets size ( ) , equal to ( num value buckets ) ) ; for ( int i = 0 ; i < num value buckets ; + + i ) { histogram bucket bucket = buckets get ( i ) ; check bucket key and doc count ( " internal bucket " + i , bucket , i * interval , value counts [ i ] ) ; derivative doc count deriv = bucket get aggregations ( ) get ( " deriv " ) ; if ( i > 0 ) { assert that ( doc count deriv , not null value ( ) ) ; assert that ( doc count deriv value ( ) , close to ( ( first deriv value counts [ i - 1 ] ) , 0 00001 ) ) ; assert that ( doc count deriv normalized value ( ) , close to ( ( double ) ( first deriv value counts [ i - 1 ] ) / 5 , 0 00001 ) ) ; } else { assert that ( doc count deriv , null value ( ) ) ; } derivative doc count 2nd deriv = bucket get aggregations ( ) get ( " 2nd deriv " ) ; if ( i > 1 ) { assert that ( doc count 2nd deriv , not null value ( ) ) ; assert that ( doc count 2nd deriv value ( ) , close to ( ( second deriv value counts [ i - 2 ] ) , 0 00001 ) ) ; assert that ( doc count 2nd deriv normalized value ( ) , close to ( ( double ) ( second deriv value counts [ i - 2 ] ) * 2 , 0 00001 ) ) ; } else { assert that ( doc count 2nd deriv , null value ( ) ) ; } } } ) ; }


get the " name " of this production this is mostly just notional and for debugging the name is taken as the name of the lhs

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


gets the current database name that will be used when resolving table path

public string get current database ( ) { return current database name ; }


one request followed by one response the server returns the client payload as - is

public void unary call ( io grpc benchmarks proto messages simple request request , io grpc stub stream observer < io grpc benchmarks proto messages simple response > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get unary call method ( ) , get call options ( ) ) , request , response observer ) ; }


resets the references to { @ link material } s , { @ link mesh } es and { @ link mesh part } s within the model to the ones used within it ' s nodes this will make the model responsible for disposing all referenced meshes

public static void rebuild references ( final model model ) { model materials clear ( ) ; model meshes clear ( ) ; model mesh parts clear ( ) ; for ( final node node : model nodes ) rebuild references ( model , node ) ; }


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

public com google protobuf byte string get comment bytes ( ) { return com google protobuf byte string copy from utf 8 ( comment ) ; }


returns a { @ code thread } proto builder with information about the given thread

private static starlark debugging protos paused thread get paused thread proto ( paused thread state thread , pause reason pause reason , @ nullable error conditional breakpoint error ) { starlark debugging protos paused thread builder builder = starlark debugging protos paused thread new builder ( ) set id ( thread id ) set name ( thread name ) set pause reason ( pause reason ) set location ( debug event helper get location proto ( thread location ) ) ; if ( conditional breakpoint error ! = null ) { builder set conditional breakpoint error ( conditional breakpoint error ) ; } return builder build ( ) ; }


public static void main ( string [ ] args ) { var ram = new student ( 1 , " ram " , " street 9 , cupertino " ) ; var shyam = new student ( 2 , " shyam " , " z bridge , pune " ) ; var gopi = new student ( 3 , " gopi " , " street 10 , mumbai " ) ; var context = new hash map < string , list < student > > ( ) ; var student database = new student database ( ) ; var student repository = new student repository ( context , student database ) ; student repository register new ( ram ) ; student repository register modified ( shyam ) ; student repository register deleted ( gopi ) ; student repository commit ( ) ; }