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

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


regression test for hdfs - 3891 : select input streams should throw an exception when a majority of journalnodes have crashed

public void test select input streams majority down ( ) throws exception { / / shut down all of the j ns cluster shutdown ( ) ; list < edit log input stream > streams = lists new array list ( ) ; try { qjm select input streams ( streams , 0 , false ) ; fail ( " did not throw ioe " ) ; } catch ( quorum exception ioe ) { generic test utils assert exception contains ( " got too many exceptions " , ioe ) ; assert true ( streams is empty ( ) ) ; } }


public static void put ( @ non null final string key , final float value ) { put ( key , value , get default s p utils ( ) ) ; }


public void print usage ( ) { string usage = get usage ( null ) ; system out println ( usage ) ; }


private static void chmod ( file f , int mask ) throws i o exception { / / todo windows posix actually does something here ( windows lib c wchmod ) ; should we let it ? / / anyway the existing calls already skip this method if on windows if ( file path separator char = = ' ; ' ) return ; / / noop if ( util native chmod mode ) { posix a p i jnr ( ) chmod ( f get absolute path ( ) , mask ) ; } else { files set posix file permissions ( file to path ( f ) , util mode to permissions ( mask ) ) ; } }


deduces version information from data matrix dimensions

public static version get version for dimensions ( int num rows , int num columns ) throws format exception { if ( ( num rows & 0x 0 1 ) ! = 0 | | ( num columns & 0x 0 1 ) ! = 0 ) { throw format exception get format instance ( ) ; } for ( version version : versions ) { if ( version symbol size rows = = num rows & & version symbol size columns = = num columns ) { return version ; } } throw format exception get format instance ( ) ; }


private static r b node parent of ( r b node p ) { return ( p = = null ? null : p parent ) ; }


called whenever the composite ' s component data changes

protected void component data changed ( ) { notify ( model listeners , composite viewer model listener : : component data changed ) ; }


apply as many backfill records as possible each backfill record is resolved in turn , if the record cannot be resolved , it remains listed if the record can be resolved , but it conflicts , an error record is returned each time a record is resolved and combined successfully , all remaining records are tried again the result is the combined resolved backfills , with only the unresolved backfill records listed

public assembly resolution backfill ( recursive descent solver solver , map < string , long > vals ) { if ( ! has backfills ( ) ) { return this ; } assembly resolved constructor res = this ; loop : while ( true ) { for ( assembly resolved backfill bf : res backfills ) { assembly resolution ar = bf solve ( solver , vals , this ) ; if ( ar is error ( ) ) { continue ; } assembly resolved constructor rc = ( assembly resolved constructor ) ar ; assembly resolved constructor check = res combine less backfill ( rc , bf ) ; if ( check = = null ) { return assembly resolution error ( " conflict : backfill " + bf description , res ) ; } res = check ; continue loop ; } return res ; } }


writes the pixmap as a png with compression see { @ link png } to configure the compression level , more efficiently flip the pixmap vertically , and to write out multiple p n gs with minimal allocation

static public void write p n g ( file handle file , pixmap pixmap ) { write p n g ( file , pixmap , deflater default compression , false ) ; }


writes the instruction at the given offset in the given code attribute

public final void write ( code attribute code attribute , int offset ) { write ( code attribute code , offset ) ; }


when the request resources is the first in a stream , the initial resource versions must be populated otherwise , initial resource versions must be omitted the keys are the resources names of the mcp resources known to the mcp client the values in the map are the associated resource level version info < code > map & lt ; string , string & gt ; initial resource versions = 3 ; < code >

public builder put all initial resource versions ( java util map < java lang string , java lang string > values ) { internal get mutable initial resource versions ( ) get mutable map ( ) put all ( values ) ; return this ; }


protected blaze module get strategy module ( ) { return test strategy module get module ( ) ; }


public list < big decimal > get array number ( ) { return array number ; }


set relative position information of pcode ops within a basic block , may change as basic block is edited

public final void set order ( int ord ) { seqnum set order ( ord ) ; }


set the value of this attribute for the specified keyed object

public void set value ( keyed object o , long value ) { update ( ) ; values put ( o key ( ) , value ) ; }


where the attribute was defined within the & lt ; declare - styleable & gt ; block < 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 ; }


analyze the given string using its analyzer , constructing either a { @ code prefix query } or a { @ code boolean query } made up of { @ code term query } s and { @ code prefix query } s

private query new possibly analyzed query ( string field , string term str , analyzer analyzer ) { list < list < bytes ref > > tlist = new array list < > ( ) ; try ( token stream source = analyzer token stream ( field , term str ) ) { source reset ( ) ; list < bytes ref > current pos = new array list < > ( ) ; char term attribute term att = source add attribute ( char term attribute class ) ; position increment attribute pos att = source add attribute ( position increment attribute class ) ; try { boolean has more tokens = source increment token ( ) ; while ( has more tokens ) { if ( current pos is empty ( ) = = false & & pos att get position increment ( ) > 0 ) { tlist add ( current pos ) ; current pos = new array list < > ( ) ; } final bytes ref term = analyzer normalize ( field , term att to string ( ) ) ; current pos add ( term ) ; has more tokens = source increment token ( ) ; } if ( current pos is empty ( ) = = false ) { tlist add ( current pos ) ; } } catch ( i o exception e ) { / / ignore / / todo : we should not ignore the exception and return a prefix query with the original term ? } } catch ( i o exception e ) { / / bail on any exceptions , going with a regular prefix query return new prefix query ( new term ( field , term str ) ) ; } if ( tlist size ( ) = = 0 ) { return null ; } if ( tlist size ( ) = = 1 & & tlist get ( 0 ) size ( ) = = 1 ) { return new prefix query ( new term ( field , tlist get ( 0 ) get ( 0 ) ) ) ; } / / build a boolean query with prefix on the last position only boolean query builder builder = new boolean query builder ( ) ; for ( int pos = 0 ; pos < tlist size ( ) ; pos + + ) { list < bytes ref > plist = tlist get ( pos ) ; boolean is last pos = ( pos = = tlist size ( ) - 1 ) ; query pos query ; if ( plist size ( ) = = 1 ) { if ( is last pos ) { pos query = new prefix query ( new term ( field , plist get ( 0 ) ) ) ; } else { pos query = new term query ( new term ( field , plist get ( 0 ) ) , boost attribute default boost ) ; } } else if ( is last pos = = false ) { / / build a synonym query for terms in the same position term [ ] terms = new term [ plist size ( ) ] ; for ( int i = 0 ; i < plist size ( ) ; i + + ) { terms [ i ] = new term ( field , plist get ( i ) ) ; } pos query = new synonym query ( terms ) ; } else { boolean query builder inner builder = new boolean query builder ( ) ; for ( bytes ref token : plist ) { inner builder add ( new boolean clause ( new prefix query ( new term ( field , token ) ) , boolean clause occur should ) ) ; } pos query = inner builder build ( ) ; } builder add ( new boolean clause ( pos query , get default operator ( ) ) ) ; } return builder build ( ) ; }


start probe dead node and suspect node thread

void start probe scheduler ( ) { probe dead nodes scheduler thr = new thread ( new probe scheduler ( this , probe type check dead ) ) ; probe dead nodes scheduler thr set daemon ( true ) ; probe dead nodes scheduler thr start ( ) ; probe suspect nodes scheduler thr = new thread ( new probe scheduler ( this , probe type check suspect ) ) ; probe suspect nodes scheduler thr set daemon ( true ) ; probe suspect nodes scheduler thr start ( ) ; }


parse the new dfs datanode data dir value in the configuration to detect changed volumes

changed volumes parse changed volumes ( string new volumes ) throws i o exception { configuration conf = new configuration ( ) ; conf set ( dfs datanode data dir key , new volumes ) ; list < storage location > new storage locations = get storage locations ( conf ) ; if ( new storage locations is empty ( ) ) { throw new i o exception ( " no directory is specified " ) ; } / / use the existing storage locations from the current conf / / to detect new storage additions or removals map < string , storage location > existing storage locations = new hash map < > ( ) ; for ( storage location loc : get storage locations ( get conf ( ) ) ) { existing storage locations put ( loc get normalized uri ( ) to string ( ) , loc ) ; } changed volumes results = new changed volumes ( ) ; results new locations add all ( new storage locations ) ; for ( iterator < storage storage directory > it = storage dir iterator ( ) ; it has next ( ) ; ) { storage storage directory dir = it next ( ) ; boolean found = false ; for ( iterator < storage location > new location itr = results new locations iterator ( ) ; new location itr has next ( ) ; ) { storage location new location = new location itr next ( ) ; if ( new location matches storage directory ( dir ) ) { storage location old location = existing storage locations get ( new location get normalized uri ( ) to string ( ) ) ; if ( old location ! = null & & old location get storage type ( ) ! = new location get storage type ( ) ) { throw new i o exception ( " changing storage type is not allowed " ) ; } / / update the unchanged locations as this location / / from the new conf is really not a new one new location itr remove ( ) ; results unchanged locations add ( new location ) ; found = true ; break ; } } / / new conf doesn ' t have the storage location which available in / / the current storage locations add to the deactivate locations list if ( ! found ) { log info ( " deactivation request received for active volume : { } " , dir get root ( ) ) ; results deactivate locations add ( storage location parse ( dir get root ( ) to string ( ) ) ) ; } } / / use the failed storage locations from the current conf / / to detect removals in the new conf if ( get f s dataset ( ) get num failed volumes ( ) > 0 ) { for ( string failed storage location : get f s dataset ( ) get volume failure summary ( ) get failed storage locations ( ) ) { boolean found = false ; for ( iterator < storage location > new location itr = results new locations iterator ( ) ; new location itr has next ( ) ; ) { storage location new location = new location itr next ( ) ; if ( new location get normalized uri ( ) to string ( ) equals ( failed storage location ) ) { / / the failed storage is being re - added data node # refresh volumes ( ) / / will take care of re - assessing it found = true ; break ; } } / / new conf doesn ' t have this failed storage location / / add to the deactivate locations list if ( ! found ) { log info ( " deactivation request received for failed volume : { } " , failed storage location ) ; results deactivate locations add ( storage location parse ( failed storage location ) ) ; } } } return results ; }


format into the convention for computed field lookups

public static string format computed ( string field , string agg ) { return field + " " + agg ; }


sets the current drawable ( usually an animated drawable ) to display in the wrapped view

void set drawable ( drawable drawable ) ;


the " base 6 4 " base encoding specified by < a href = " http : tools ietf orghtmlrfc 4 6 4 8 # section - 4 " > rfc 4648 section 4 , base 64 encoding ( this is the same as the base 64 encoding from < a href = " http : tools ietf orghtmlrfc 3 5 4 8 # section - 3 " > rfc 3548 ) the character { @ code ' = ' } is used for padding , but can be { @ linkplain # omit padding ( ) omitted } or { @ linkplain # with pad char ( char ) replaced } no line feeds are added by default , as per < a href = " http : tools ietf orghtmlrfc 4 6 4 8 # section - 3 1 " > rfc 4648 section 3 1 , line feeds in encoded data line feeds may be added using { @ link # with separator ( string , int ) }

public static base encoding base 6 4 ( ) { return base64 ; }


public long get df used ( ) { return usage get used ( ) ; }


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


builds a { @ link launch info } from this builder this builder may be reused

public launch info build ( ) { return new launch info ( entries build ( ) ) ; }


convert { @ link string } into { @ link properties } , considering it as properties content

public void set as text ( @ nullable string text ) throws illegal argument exception { properties props = new properties ( ) ; if ( text ! = null ) { try { / / must use the iso - 8859 - 1 encoding because properties load ( stream ) expects it props load ( new byte array input stream ( text get bytes ( standard charsets iso 8859 1 ) ) ) ; } catch ( i o exception ex ) { / / should never happen throw new illegal argument exception ( " failed to parse [ " + text + " ] into properties " , ex ) ; } } set value ( props ) ; }


create a new { @ link cue } containing { @ code text } and with web v t t default values

/ * package * / static cue new cue for text ( char sequence text ) { webvtt cue info builder info builder = new webvtt cue info builder ( ) ; info builder text = text ; return info builder to cue builder ( ) build ( ) ; }


this method is just a " pass through " method for { @ link # invoke instance method ( string , object , class [ ] , object [ ] ) } so that callers do not need to pass null to that method when the underlying instance method does not have any parameters

public static object invoke instance method ( string method name , object owner instance ) throws runtime exception { return invoke instance method ( method name , owner instance , null , null ) ; }


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


ensures list encoding works : proto 3 list of spans

@ test void message with multiple spans proto 3 ( ) throws exception { message with multiple spans ( builder ( " multiple spans proto 3 " ) , span bytes encoder proto3 ) ; }


checks whether the previous serializer , represented by this snapshot , has non - registered subclasses

private static boolean previous serializer has non registered subclasses ( linked optional map < class < ? > , type serializer snapshot < ? > > non registered subclass serializer snapshots ) { return non registered subclass serializer snapshots size ( ) > 0 ; }


public void pop args ( frame frame , prototype prototype ) { std type list types = prototype get parameter types ( ) ; int size = types size ( ) ; / / use the above method to do the actual popping pop args ( frame , size ) ; / / and then verify the popped types for ( int i = 0 ; i < size ; i + + ) { if ( ! merger is possibly assignable from ( types get type ( i ) , args [ i ] ) ) { throw new sim exception ( " at stack depth " + ( size - 1 - i ) + " , expected type " + types get type ( i ) to human ( ) + " but found " + args [ i ] get type ( ) to human ( ) ) ; } } }


notifies each analyzer in the list that the analysis session has ended

public void notify analysis ended ( program program ) { iterator < analysis scheduler > iter = tasks iterator ( ) ; while ( iter has next ( ) ) { analysis scheduler scheduler = iter next ( ) ; scheduler get analyzer ( ) analysis ended ( program ) ; } }


tests that a java library exposes java processing info as expected when annotation processing is used

public void test java plugin ( ) throws exception { test annotation processing info is starlark accessible ( / * to be processed rule name = * / " java library " , / * extra load = * / " " ) ; }


configure one or more request header names ( e g " accept - language " ) to add to the " vary " response header to inform clients that the response is subject to content negotiation and variances based on the value of the given request headers the configured request header names are added only if not already present in the response " vary " header

public final void set vary by request headers ( @ nullable string vary by request headers ) { this vary by request headers = vary by request headers ; }


returns the path fragment that is either absolute or relative to the execution root that can be used to execute the given tool

static path fragment get tool path fragment ( immutable map < string , path fragment > tool paths , tool tool ) { return tool paths get ( tool get name part ( ) ) ; }


public void test execution success with multiple events ( ) { try { test command with multiple values command = new test command with multiple values ( ) ; assert equals ( arrays as list ( true , false , true ) , command observe ( ) to list ( ) to blocking ( ) single ( ) ) ; assert equals ( null , command get failed execution exception ( ) ) ; assert true ( command get execution time in milliseconds ( ) > - 1 ) ; assert true ( command is successful execution ( ) ) ; assert command execution events ( command , hystrix event type emit , hystrix event type emit , hystrix event type emit , hystrix event type success ) ; assert equals ( 0 , command metrics get current concurrent execution count ( ) ) ; assert sane hystrix request log ( 1 ) ; / / semaphore isolated assert false ( command is executed in thread ( ) ) ; } catch ( exception e ) { e print stack trace ( ) ; fail ( " we received an exception " ) ; } }


verify the snapshot formatter by running it on a known file with one null data

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


get the setting upgraders provided by this plugin

public list < setting upgrader < ? > > get setting upgraders ( ) { return collections empty list ( ) ; }


public final boolean exists ( get request get request , request options options ) throws i o exception { return perform request ( get request , request converters : : exists , options , rest high level client : : convert exists response , empty set ( ) ) ; }


return the login used for the shared " system " connection to the stomp broker

public string get system login ( ) { return this system login ; }


retrieves the repeat mode from { @ code remote media client } and maps it into a { @ link player repeat mode }

private static int fetch repeat mode ( remote media client remote media client ) { media status media status = remote media client get media status ( ) ; if ( media status = = null ) { / / no media session active , yet return repeat mode off ; } int cast repeat mode = media status get queue repeat mode ( ) ; switch ( cast repeat mode ) { case media status repeat mode repeat single : return repeat mode one ; case media status repeat mode repeat all : case media status repeat mode repeat all and shuffle : return repeat mode all ; case media status repeat mode repeat off : return repeat mode off ; default : throw new illegal state exception ( ) ; } }


extract token from authorization header and if it is valid { @ value # negotiate auth header prefix } then returns { @ link kerberos authentication token }

public static kerberos authentication token extract token ( final string authorization header ) { if ( strings is null or empty ( authorization header ) ) { return null ; } if ( authorization header region matches ( ignore case auth header match , 0 , negotiate auth header prefix , 0 , negotiate auth header prefix length ( ) ) = = false ) { return null ; } final string base 6 4 encoded token = authorization header substring ( negotiate auth header prefix length ( ) ) trim ( ) ; if ( strings is empty ( base 6 4 encoded token ) ) { throw unauthorized ( " invalid negotiate authentication header value , expected base 6 4 encoded token but value is empty " , null ) ; } byte [ ] decoded kerberos ticket = null ; try { decoded kerberos ticket = base 6 4 get decoder ( ) decode ( base 6 4 encoded token ) ; } catch ( illegal argument exception iae ) { throw unauthorized ( " invalid negotiate authentication header value , could not decode base 6 4 token { } " , iae , base 6 4 encoded token ) ; } return new kerberos authentication token ( decoded kerberos ticket ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void enter query ( sql base parser query context ctx ) { }


add anonymous parameters , specifying only their sql types as defined in the { @ code java sql types } class parameter ordering is significant this method is an alternative to the { @ link # declare parameter } method , which should normally be preferred

public void set types ( @ nullable int [ ] types ) throws invalid data access api usage exception { if ( is compiled ( ) ) { throw new invalid data access api usage exception ( " cannot add parameters once query is compiled " ) ; } if ( types ! = null ) { for ( int type : types ) { declare parameter ( new sql parameter ( type ) ) ; } } }


returns < code > true < code > iff the cache needs to be refreshed

protected boolean needs refresh ( ) { if ( refresh interval millis ( ) = = 0 ) { return true ; } final long current time = system current time millis ( ) ; return ( current time - last refresh timestamp ) > refresh interval millis ( ) ; }


immutable list < rule set > requires ( ) ;


public static void set e guardian user id ( final request context request context , final string eguardian user id ) { request context get flow scope ( ) put ( " eguardian user id " , eguardian user id ) ; }


set the following offset ( based on time or row - count intervals ) for over window

public over window partitioned ordered preceding following ( expression following ) { optional following = optional of ( following ) ; return this ; }


returns an initialized test harness for { @ link co process function } with two input streams

public static < in1 , in2 , out > two input stream operator test harness < in1 , in2 , out > for co process function ( final co process function < in1 , in2 , out > function ) throws exception { two input stream operator test harness < in1 , in2 , out > test harness = new two input stream operator test harness < > ( new co process operator < > ( preconditions check not null ( function ) ) , 1 , 1 , 0 ) ; test harness open ( ) ; return test harness ; }


incremental aggregated resources provides the ability to incrementally update the resources on the client this supports the goal of scalability of mcp resources

public io grpc stub stream observer < com alibaba nacos istio model mcp incremental mesh config request > incremental aggregated resources ( io grpc stub stream observer < com alibaba nacos istio model mcp incremental mesh config response > response observer ) { return async bidi streaming call ( get channel ( ) new call ( get incremental aggregated resources method ( ) , get call options ( ) ) , response observer ) ; }


returns the sum of the largest cells in size from each column

public long get max combined bytes per row ( ) { return max combined bytes per row ; }


returns the exit code of the subprocess if the subprocess was executed returns zero if { @ link # status } returns { @ link status # success } returns non - zero if { @ link # status } returns { @ link status # non zero exit } or { @ link status # out of memory } returns 128 + 14 ( corresponding to the unix signal sigalrm ) if { @ link # status } returns { @ link status # timeout } otherwise , the returned value is not meaningful


a entry is a file if it is not a directory by implementing it and not marking as an override this subclass builds and runs in both hadoop versions

public boolean is file ( ) { return ! this is directory ( ) ; }


get the precedence level for the top - most precedence rule

public final int get precedence ( ) { if ( precedence stack is empty ( ) ) { return - 1 ; } return precedence stack peek ( ) ; }


public boolean execute ( ) throws s q l exception { connection mark commit state dirty ( ) ; return ( ( prepared statement ) delegate ) execute ( ) ; }


creates an { @ link instruction metadata } object based on the given inputs no special processing is done here , it ' s just creating a data container for what is given

private instruction metadata create instruction metadata ( code unit code unit , byte [ ] mask , byte [ ] value , boolean instruction ) { mask container masks = new mask container ( mask , value ) ; instruction metadata instruction metadata = new instruction metadata ( masks ) ; instruction metadata set addr ( code unit get address ( ) ) ; instruction metadata set text rep ( code unit get mnemonic string ( ) ) ; instruction metadata set is instruction ( instruction ) ; return instruction metadata ; }


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


call < pet > get pet by id ( @ retrofit 2 http path ( " pet id " ) long pet id ) ;


stream access to value the value part of the key - value pair pointed by the current cursor is not cached and can only be examined once calling any of the following functions more than once without moving the cursor will result in exception : { @ link # get value ( byte [ ] ) } , { @ link # get value ( byte [ ] , int ) } , { @ link # get value stream }

public data input stream get value stream ( ) throws i o exception { if ( value checked = = true ) { throw new illegal state exception ( " attempt to examine value multiple times " ) ; } value checked = true ; return value data input stream ; }


returns an immutable list containing the given elements , in order

public static < e > immutable list < e > of ( e e 1 , e e 2 , e e 3 , e e 4 , e e 5 , e e 6 , e e 7 , e e 8 ) { return construct ( e 1 , e 2 , e 3 , e 4 , e 5 , e 6 , e 7 , e 8 ) ; }


returns the < tt > reader index < tt > of this buffer this is where readable ( unconsumed ) bytes start in the backing memory segment


returns index into state array for attr index , or - 1 if not found

private static int get state index ( byte [ ] state , int start , int attr index , int mask ) { / / binary search , treating values as unsigned bytes int lo = start ; int hi = state length - 1 ; while ( hi > = lo ) { int mid = ( lo + hi ) / 2 ; int mid attr index = state [ mid ] & mask ; if ( mid attr index = = attr index ) { return mid ; } else if ( mid attr index < attr index ) { lo = mid + 1 ; } else { hi = mid - 1 ; } } return - 1 ; }


public void add section ( string name , string login module name , final map < string , string > conf ) { app configuration entry [ ] entries = new app configuration entry [ 1 ] ; entries [ 0 ] = new app configuration entry ( login module name , login module control flag required , conf ) ; this sections put ( name , entries ) ; }


returns whether a frame with the specified parameters should be decoded

boolean evaluate ( int major version , int id 0 , int id 1 , int id 2 , int id 3 ) ;


return the property value if it ' s non - negative and throw an exception if it ' s not

private long get non negative ( string key , int default value ) { int flush offset interval millis = properties get int ( key , default value ) ; if ( flush offset interval millis < 0 ) { throw new metrics exception ( " the " + key + " property must be " + " non - negative value was " + flush offset interval millis ) ; } return flush offset interval millis ; }


show that if the service failed during an init operation , stop was called

public void test stop failing init and stop ( ) throws throwable { breakable service svc = new breakable service ( true , false , true ) ; svc register service listener ( new logging state change listener ( ) ) ; try { svc init ( new configuration ( ) ) ; fail ( " expected a failure , got " + svc ) ; } catch ( breakable service broken lifecycle event e ) { assert equals ( service state inited , e state ) ; } / / the service state is stopped assert service state stopped ( svc ) ; assert equals ( service state inited , svc get failure state ( ) ) ; throwable failure cause = svc get failure cause ( ) ; assert not null ( " null failure cause in " + svc , failure cause ) ; breakable service broken lifecycle event cause = ( breakable service broken lifecycle event ) failure cause ; assert not null ( " null state in " + cause + " raised by " + svc , cause state ) ; assert equals ( service state inited , cause state ) ; }


public postcard with options compat ( activity options compat compat ) { if ( null ! = compat ) { this options compat = compat to bundle ( ) ; } return this ; }


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


return the configured { @ code application context } , if any

public application context get application context ( ) { return this application context ; }


set the jms message listener for this endpoint this is a shortcut for configuring a dedicated jms message endpoint factory

public void set message listener ( message listener message listener ) { this endpoint factory set message listener ( message listener ) ; this message listener set = true ; }


post fake { pet id } upload image with required file : uploads an image ( required )

response entity < model api response > upload file with required file ( @ api param ( value = " id of pet to update " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " file to upload " ) @ valid @ request part ( value = " required file " , required = true ) multipart file required file , @ api param ( value = " additional data to pass to server " ) @ valid @ request part ( value = " additional metadata " , required = false ) string additional metadata ) ;


copy the property values of the given source bean into the given target bean , ignoring the given " ignore properties " note : the source and target classes do not have to match or even be derived from each other , as long as the properties match any bean properties that the source bean exposes but the target bean does not will silently be ignored this is just a convenience method for more complex transfer needs , consider using a full bean wrapper

public static void copy properties ( object source , object target , string ignore properties ) throws beans exception { copy properties ( source , target , null , ignore properties ) ; }


add a " stale - while - revalidate " directive this directive indicates that caches may serve the response in which it appears after it becomes stale , up to the indicated number of seconds if a cached response is served stale due to the presence of this extension , the cache should attempt to revalidate it while still serving stale responses ( i e without blocking )

public cache control stale while revalidate ( long stale while revalidate , time unit unit ) { return stale while revalidate ( duration of seconds ( unit to seconds ( stale while revalidate ) ) ) ; }


put faketest - query - paramters to test the collection format in query parameters

default response entity < void > test query parameter collection format ( @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " pipe " , required = true ) list < string > pipe , @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " ioutil " , required = true ) list < string > ioutil , @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " http " , required = true ) list < string > http , @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " url " , required = true ) list < string > url , @ not null @ api param ( value = " " , required = true ) @ valid @ request param ( value = " context " , required = true ) list < string > context ) { return new response entity < > ( http status not implemented ) ; }


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


this gets the vf table structure for the indicated program

private data type get data type ( program program ) { if ( program ! = last program ) { set is data type already based on count ( true ) ; last program = program ; last data type = null ; last element count = element count ; if ( last element count > 0 ) { data type manager data type manager = program get data type manager ( ) ; pointer data type pointer dt = new pointer data type ( data type manager ) ; / / create an array of pointers and return it array data type array data type = new array data type ( pointer dt , last element count , pointer dt get length ( ) , data type manager ) ; last data type = m s data type utils get matching data type ( program , array data type ) ; } else { last data type = null ; } } return last data type ; }


sets the group for the action in the menu bar actions in the same group will appear next to other actions in the same group and actions in different groups will be separated by menu dividers

public b menu group ( string group ) { menu group = group ; return self ( ) ; }


creates a ssl context provider used for retrieving a client - side ssl context

ssl context provider find or create client ssl context provider ( upstream tls context upstream tls context ) ;


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


read a variable - sized unsigned integer and return it as a java signed long

public static long read var sized u long ( binary reader reader , int pointer size ) throws i o exception { switch ( pointer size ) { case 1 : return reader read next unsigned byte ( ) ; case 2 : return reader read next unsigned short ( ) ; case 4 : return reader read next unsigned int ( ) ; case 8 : return reader read next long ( ) / * no unsigned long mask possible * / ; } throw new i o exception ( " unsupported variable - sized int : " + pointer size ) ; }


returns the list of fields allowed by this provider , or null if the provider is schemaless

public immutable list < string > get fields ( ) { return schema ; }


notification that the given data type was selected

void data type selected ( data type sync info sync info ) ;


returns true if this segment is writable when loaded

public boolean is write ( ) { return header get load adapter ( ) is segment writable ( this ) ; }


creates { @ link action } s for a view , using all registered { @ link transient view action factory } s

public static list < action > create all for ( view v ) { list < action > result = new array list < > ( ) ; for ( transient view action factory f : all ( ) ) { result add all ( f create for ( v ) ) ; } return result ; }


tests that a batch slot request does not react to { @ link slot pool # fail allocation ( allocation i d , exception ) } signals whose exception is not { @ link unfulfillable slot request exception }

public void test pending batch slot request does not fail if allocation fails ( ) throws exception { final testing resource manager gateway testing resource manager gateway = new testing resource manager gateway ( ) ; final completable future < allocation i d > allocation id future = new completable future < > ( ) ; testing resource manager gateway set request slot consumer ( slot request - > allocation id future complete ( slot request get allocation id ( ) ) ) ; final component main thread executor direct main thread executor = component main thread executor service adapter for main thread ( ) ; final time batch slot timeout = time milliseconds ( 1000l ) ; try ( final slot pool impl slot pool = create and set up slot pool ( direct main thread executor , testing resource manager gateway , batch slot timeout ) ) { final completable future < physical slot > slot future = slot pool utils request new allocated batch slot ( slot pool , direct main thread executor , resource profile ) ; slot pool utils fail allocation ( slot pool , direct main thread executor , allocation id future get ( ) , new flink exception ( " failed request " ) ) ; assert that ( slot future is done ( ) , is ( false ) ) ; } }


a server rst stream shouldn ' t prevent the client from consuming trailers

@ test public void server trailers rst stream ( ) throws exception { / / write the mocking script peer send frame ( ) settings ( new settings ( ) ) ; peer accept frame ( ) ; / / ack peer accept frame ( ) ; / / syn stream peer accept frame ( ) ; / / ping peer send frame ( ) headers ( false , 3 , header entries ( " a " , " android " ) ) ; peer send frame ( ) headers ( true , 3 , header entries ( " z " , " zebra " ) ) ; peer send frame ( ) rst stream ( 3 , error code no error ) ; peer send frame ( ) ping ( true , await ping , 0 ) ; / / pong peer play ( ) ; / / play it back http 2 connection connection = connect ( peer ) ; http 2 stream stream = connection new stream ( header entries ( ) , true ) ; connection write ping and await pong ( ) ; assert that ( stream take headers ( ) ) is equal to ( headers of ( " a " , " android " ) ) ; stream get sink ( ) close ( ) ; assert that ( stream trailers ( ) ) is equal to ( headers of ( " z " , " zebra " ) ) ; assert that ( connection open stream count ( ) ) is equal to ( 0 ) ; / / verify the peer received what was expected in frame syn stream = peer take frame ( ) ; assert that ( syn stream type ) is equal to ( http 2 type headers ) ; in frame ping = peer take frame ( ) ; assert that ( ping type ) is equal to ( http 2 type ping ) ; }


return the string representation of the object in the output format for description of the options ,

public string to string ( boolean q option , boolean h option , boolean x option ) { return to string ( q option , h option , false , x option , null ) ; }


adds the given element to the given array the array is extended if necessary

public static int [ ] add ( int [ ] array , int size , int element ) { array = extend array ( array , size + 1 ) ; array [ size ] = element ; return array ; }


public int get proxy count ( ) { return world get proxy count ( ) ; }


test snapshot diff report for snapshots with open files captures in them also verify if the diff report remains the same across name node restarts

public void test diff report with open files ( ) throws exception { / / construct the directory tree final path level 0 a = new path ( " / level 0 a " ) ; final path flume snap root dir = level 0 a ; final string flume file name = " flume log " ; final string flume snap 1 name = " flume snap 1 " ; final string flume snap 2 name = " flume snap 2 " ; / / create files and open a stream final path flume file = new path ( level 0 a , flume file name ) ; create file ( flume file ) ; f s data output stream flume output stream = hdfs append ( flume file ) ; / / create snapshot s1 final path flume s 1 dir = snapshot test helper create snapshot ( hdfs , flume snap root dir , flume snap 1 name ) ; final path flume s 1 path = new path ( flume s 1 dir , flume file name ) ; final long flume file length after s 1 = hdfs get file status ( flume file ) get len ( ) ; / / verify if snap s1 file length is same as the the live one assert assert equals ( flume file length after s 1 , hdfs get file status ( flume s 1 path ) get len ( ) ) ; verify diff report ( level 0 a , flume snap 1 name , " " , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) ) ; long flume file written data length = flume file length after s 1 ; int new write length = ( int ) ( blocksize * 1 5 ) ; byte [ ] buf = new byte [ new write length ] ; random random = new random ( ) ; random next bytes ( buf ) ; / / write more data to flume file flume file written data length + = write to stream ( flume output stream , buf ) ; / / create snapshot s2 final path flume s 2 dir = snapshot test helper create snapshot ( hdfs , flume snap root dir , flume snap 2 name ) ; final path flume s 2 path = new path ( flume s 2 dir , flume file name ) ; / / verify live files length is same as all data written till now final long flume file length after s 2 = hdfs get file status ( flume file ) get len ( ) ; assert assert equals ( flume file written data length , flume file length after s 2 ) ; / / verify if snap s2 file length is same as the live one assert assert equals ( flume file length after s 2 , hdfs get file status ( flume s 2 path ) get len ( ) ) ; verify diff report ( level 0 a , flume snap 1 name , " " , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( flume file name ) ) ) ; verify diff report ( level 0 a , flume snap 2 name , " " , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) ) ; verify diff report ( level 0 a , flume snap 1 name , flume snap 2 name , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( flume file name ) ) ) ; / / write more data to flume file flume file written data length + = write to stream ( flume output stream , buf ) ; / / verify old flume snapshots have point - in - time / frozen file lengths / / even after the live file have moved forward assert assert equals ( flume file length after s 1 , hdfs get file status ( flume s 1 path ) get len ( ) ) ; assert assert equals ( flume file length after s 2 , hdfs get file status ( flume s 2 path ) get len ( ) ) ; flume output stream close ( ) ; / / verify if snap s2 file length is same as the live one assert assert equals ( flume file written data length , hdfs get file status ( flume file ) get len ( ) ) ; / / verify old flume snapshots have point - in - time / frozen file lengths / / even after the live file have moved forward assert assert equals ( flume file length after s 1 , hdfs get file status ( flume s 1 path ) get len ( ) ) ; assert assert equals ( flume file length after s 2 , hdfs get file status ( flume s 2 path ) get len ( ) ) ; verify diff report ( level 0 a , flume snap 1 name , " " , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( flume file name ) ) ) ; verify diff report ( level 0 a , flume snap 2 name , " " , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( flume file name ) ) ) ; verify diff report ( level 0 a , flume snap 1 name , flume snap 2 name , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( flume file name ) ) ) ; restart name node ( ) ; verify diff report ( level 0 a , flume snap 1 name , flume snap 2 name , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( flume file name ) ) ) ; }


returns a copy of the specified subrange of the specified array that is literally an object [ ] , and not e g a { @ code string [ ] }

static object [ ] copy as object array ( object [ ] elements , int offset , int length ) { check position indexes ( offset , offset + length , elements length ) ; if ( length = = 0 ) { return new object [ 0 ] ; } object [ ] result = new object [ length ] ; system arraycopy ( elements , offset , result , 0 , length ) ; return result ; }


select process instances whose process definition name is process definition name

process instance query process definition name ( string process definition name ) ;


visit a parse tree produced by the { @ code integer literal } labeled alternative in { @ link eql base parser # number }

t visit integer literal ( eql base parser integer literal context ctx ) ;


perform an operation using the given field

void do with ( field field ) throws illegal argument exception , illegal access exception ;


determine whether the given url points to a resource in the file system , that is , has protocol " file " or " vfs "

public static boolean is file u r l ( url url ) { string protocol = url get protocol ( ) ; return ( url protocol file equals ( protocol ) ) ; }


formats bytes using sql standard format for binary string literal

public static string binary literal ( byte [ ] value ) { return " x ' " + base 1 6 ( ) encode ( value ) + " ' " ; }


a query that matches documents containing terms with a specified regular expression

public static regexp query builder regexp query ( string name , string regexp ) { return new regexp query builder ( name , regexp ) ; }


public boolean is directory ( ) { return false ; }


if you override this method , and the default behavior of checking 0 - 256 and mask values is desired , call super evaluate reference ( ) in your overriden method

public boolean evaluate reference ( varnode context context , instruction instr , int pcodeop , address address , int size , ref type ref type ) { / / unless this is a direct address copy , don ' t trust computed accesses below min store load offset / / external spaces can have low addresses so don ' t check them address space space = address get address space ( ) ; if ( space is external space ( ) ) { return true ; } long max addr offset = space get max address ( ) get addressable word offset ( ) ; long word offset = address get addressable word offset ( ) ; boolean is known reference = ! address is constant address ( ) ; if ( pcodeop ! = pcode op copy & & ( ( word offset > = 0 & & word offset < min store load offset ) | | ( math abs ( max addr offset - word offset ) < min store load offset ) ) ) { if ( ! is known reference ) { return false ; } pcode op [ ] pcode = instr get pcode ( ) ; if ( pcode length > 1 ) { / / for simple pcode , assume it is a good location return false ; } } return true ; }


set the content type of the response to the configured { @ link # set content type ( string ) content type } unless the { @ link view # selected content type } request attribute is present and set to a concrete media type

protected void set response content type ( http servlet request request , http servlet response response ) { media type media type = ( media type ) request get attribute ( view selected content type ) ; if ( media type ! = null & & media type is concrete ( ) ) { response set content type ( media type to string ( ) ) ; } else { response set content type ( get content type ( ) ) ; } }


returns the number distinct of document i ds associated with two or more values

public int get num multi values docs ( ) { return num multi valued docs ; }


convert all the statistics into a key - value pair map to be used for testing


public void date time test ( ) { / / todo : test date time }


retrieve the default value of the { @ code value } attribute of a single - element annotation , given an annotation instance

public static object get default value ( annotation annotation ) { return get default value ( annotation , value ) ; }


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


set the following offset ( based on time or row - count intervals ) for over window

public over window partitioned ordered preceding following ( string following ) { return this following ( expression parser parse expression ( following ) ) ; }


escapes non - ascii characters in url note that this methods only escapes non - ascii but leaves other url - unsafe characters , such as ' # ' { @ link # raw encode ( string ) } should generally be used instead , though be careful to pass only a single path component to that method ( it will encode , but this method does not )

public static string encode ( @ non null string s ) { try { boolean escaped = false ; string builder out = new string builder ( s length ( ) ) ; byte array output stream buf = new byte array output stream ( ) ; output stream writer w = new output stream writer ( buf , standard charsets utf 8 ) ; for ( int i = 0 ; i < s length ( ) ; i + + ) { int c = s char at ( i ) ; if ( c < 128 & & c ! = ' ' ) { out append ( ( char ) c ) ; } else { / / 1 char - > utf8 w write ( c ) ; w flush ( ) ; for ( byte b : buf to byte array ( ) ) { out append ( ' % ' ) ; out append ( to digit ( ( b > > 4 ) & 0x f ) ) ; out append ( to digit ( b & 0x f ) ) ; } buf reset ( ) ; escaped = true ; } } return escaped ? out to string ( ) : s ; } catch ( i o exception e ) { throw new error ( e ) ; / / impossible } }


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


returns a { @ link py runtime info } representing the runtime to use for this target , as retrieved from the resolved toolchain this may only be called for executable python rules ( rules defining the attribute " $ py toolchain type " , i e { @ code py binary } and { @ code py test } ) in addition , it may not be called if { @ link # should get runtime from toolchain ( ) } returns false if there was a problem retrieving the runtime information from the toolchain , null is returned an error would have already been reported on the rule context at { @ code py common } initialization time

public py runtime info get runtime from toolchain ( ) { preconditions check argument ( rule context attributes ( ) has ( " $ py toolchain type " , build type nodep label ) , " cannot retrieve python toolchain information for ' % s ' rule " , rule context get rule ( ) get rule class ( ) ) ; preconditions check argument ( should get runtime from toolchain ( ) , " access to the python toolchain is disabled by - - incompatible use python toolchains = false " ) ; return runtime from toolchain ; }


model api response upload file ( @ param ( " pet id " ) long pet id , @ param ( " additional metadata " ) string additional metadata , @ param ( " file " ) file file ) ;


is the byte sequences at { @ code offset } in the value at { @ code position } equal to the byte sequence at { @ code other offset } in { @ code other slice } this method must be implemented if @ { code get slice } is implemented

default boolean bytes equal ( int position , int offset , slice other slice , int other offset , int length ) { throw new unsupported operation exception ( get class ( ) get name ( ) ) ; }


executed once for every failed shard level request this method is invoked before the next replica is tried for the given shard target

public final void on shard failure ( final int shard index , search shard target shard target , exception e ) { if ( transport actions is shard not available exception ( e ) ) { / / groups shard not available exceptions under a generic exception that returns a service unavailable ( 503 ) / / temporary error e = new no shard available action exception ( shard target get shard id ( ) , e get message ( ) ) ; } / / we don ' t aggregate shard on failures due to the internal cancellation , / / but do keep the header counts right if ( ( request cancelled get ( ) & & is task cancelled exception ( e ) ) = = false ) { atomic array < shard search failure > shard failures = this shard failures get ( ) ; / / lazily create shard failures , so we can early build the empty shard failure list in most cases ( no failures ) if ( shard failures = = null ) { / / this is double checked locking but it ' s fine since set once uses a volatile read internally synchronized ( shard failures mutex ) { shard failures = this shard failures get ( ) ; / / read again otherwise somebody else has created it ? if ( shard failures = = null ) { / / still null so we are the first and create a new instance shard failures = new atomic array < > ( get num shards ( ) ) ; this shard failures set ( shard failures ) ; } } } shard search failure failure = shard failures get ( shard index ) ; if ( failure = = null ) { shard failures set ( shard index , new shard search failure ( e , shard target ) ) ; } else { / / the failure is already present , try and not override it with an exception that is less meaningless / / for example , getting illegal shard state if ( transport actions is read override exception ( e ) & & ( e instanceof search context missing exception = = false ) ) { shard failures set ( shard index , new shard search failure ( e , shard target ) ) ; } } if ( results has result ( shard index ) ) { assert failure = = null : " shard failed before but shouldn ' t : " + failure ; successful ops decrement and get ( ) ; / / if this shard was successful before ( initial phase ) we have to adjust the counter } } results consume shard failure ( shard index ) ; }


deserializes the additional substreams components

protected abstract void deserialize additional substreams ( task monitor monitor ) throws i o exception , pdb exception , cancelled exception ;


void write ( xml writer writer , address set view set , task monitor monitor ) throws cancelled exception { monitor set message ( " writing equates " ) ; writer start element ( " equates " ) ; writer start element ( " equate group " ) ; iterator < equate > iter = equate table get equates ( ) ; while ( iter has next ( ) ) { if ( monitor is cancelled ( ) ) { throw new cancelled exception ( ) ; } equate equate = iter next ( ) ; write equate ( writer , equate , set ) ; } writer end element ( " equate group " ) ; writer end element ( " equates " ) ; }


debug symbol file generated for an unstripped linked binary the name of the debug symbol file matches that of unstripped binary plus that of the debug symbol file extension ( dwarf )

public artifact dsym symbol for unstripped binary ( ) { return dsym symbol ( " bin unstripped " ) ; }


specify the set of profiles to be made active by default if no other profiles are explicitly made active through { @ link # set active profiles } calling this method removes overrides any reserved default profiles that may have been added during construction of the environment

public void set default profiles ( string profiles ) { assert not null ( profiles , " profile array must not be null " ) ; synchronized ( this default profiles ) { this default profiles clear ( ) ; for ( string profile : profiles ) { validate profile ( profile ) ; this default profiles add ( profile ) ; } } }


returns the drawable for the expand icon the default implementation returns { @ link tree style # plus over } or { @ link tree style # minus over } on the desktop if the node is the { @ link # get over node ( ) over node } , the mouse is left of < code > icon x < code > , and clicking would expand the node

protected drawable get expand icon ( n node , float icon x ) { boolean over = false ; if ( node = = over node / / & & gdx app get type ( ) = = application type desktop / / & & ( ! selection get multiple ( ) | | ( ! u i utils ctrl ( ) & & ! u i utils shift ( ) ) ) / / ) { float mouse x = screen to local coordinates ( tmp set ( gdx input get x ( ) , 0 ) ) x ; if ( mouse x > = 0 & & mouse x < icon x ) over = true ; } if ( over ) { drawable icon = node expanded ? style minus over : style plus over ; if ( icon ! = null ) return icon ; } return node expanded ? style minus : style plus ; }


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


public enum string required enum get enum string required ( ) { return enum string required ; }


returns the given output option keys for this transition the transition implementation function must return a dictionary where the options exactly match the elements of this list

public immutable list < string > get outputs ( ) { return outputs ; }


refresh superuser proxy groups mappings ( used in rbf )

boolean refresh super user groups configuration ( ) throws i o exception ;


the number of listeners currently pending for notification

synchronized int pending listeners ( ) { return listeners size ( ) ; }


creates a { @ link stream record } from this timestamped value

public stream record < t > get stream record ( ) { stream record < t > stream record = new stream record < > ( value ) ; if ( has timestamp ) { stream record set timestamp ( timestamp ) ; } return stream record ; }


as of 2 1 , there ' s no way for users to directly interact with the buffer , so this method is implemented solely to be called by streams ( which it will do based on the { @ code cache max bytes buffering } config it ' s currently a no - op

public store builder < in memory time ordered key value buffer < k , v > > with caching disabled ( ) { return this ; }


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


inserts the specified element at the end of this queue

public boolean offer ( e e ) { return add ( e ) ; }


returns the reshaped the state handles to include only those key - group states in the local key - group range and the operator states that would be assigned to the local subtask

public static operator subtask state repartition operator state ( final operator subtask state operator state handles , final int num key groups , final int old parallelism , final int new parallelism , final int subtask index ) { preconditions check not null ( operator state handles , " the previous operator state handles should not be null " ) ; / / create a new operator state handles that only contains the state for our key - groups list < key group range > key group partitions = state assignment operation create key group partitions ( num key groups , new parallelism ) ; key group range local key group range = key group partitions get ( subtask index ) ; list < keyed state handle > local managed key group state = new array list < > ( ) ; state assignment operation extract intersecting state ( operator state handles get managed keyed state ( ) , local key group range , local managed key group state ) ; list < keyed state handle > local raw key group state = new array list < > ( ) ; state assignment operation extract intersecting state ( operator state handles get raw keyed state ( ) , local key group range , local raw key group state ) ; state object collection < operator state handle > managed operator states = operator state handles get managed operator state ( ) ; collection < operator state handle > local managed operator state ; if ( ! managed operator states is empty ( ) ) { list < list < operator state handle > > managed operator state = managed operator states stream ( ) map ( collections : : singleton list ) collect ( collectors to list ( ) ) ; local managed operator state = operator state repartitioner repartition state ( managed operator state , old parallelism , new parallelism ) get ( subtask index ) ; } else { local managed operator state = collections empty list ( ) ; } state object collection < operator state handle > raw operator states = operator state handles get raw operator state ( ) ; collection < operator state handle > local raw operator state ; if ( ! raw operator states is empty ( ) ) { list < list < operator state handle > > raw operator state = raw operator states stream ( ) map ( collections : : singleton list ) collect ( collectors to list ( ) ) ; local raw operator state = operator state repartitioner repartition state ( raw operator state , old parallelism , new parallelism ) get ( subtask index ) ; } else { local raw operator state = collections empty list ( ) ; } return operator subtask state builder ( ) set managed operator state ( new state object collection < > ( null to empty collection ( local managed operator state ) ) ) set raw operator state ( new state object collection < > ( null to empty collection ( local raw operator state ) ) ) set managed keyed state ( new state object collection < > ( null to empty collection ( local managed key group state ) ) ) set raw keyed state ( new state object collection < > ( null to empty collection ( local raw key group state ) ) ) build ( ) ; }


recommend to use { @ link nacos property source repository # collect nacos property source }

public static void collect nacos property sources ( nacos property source nacos property source ) { nacos property source repository put if absent ( nacos property source get data id ( ) , nacos property source ) ; }


formats an { @ code int } as either a 2 - byte unsigned hex value ( if the value is small enough ) or a 4 - byte unsigned hex value ( if not )

public static string u 2or 4 ( int v ) { if ( v = = ( char ) v ) { return u 2 ( v ) ; } else { return u 4 ( v ) ; } }


returns all colors used across all data set objects this object represents

public int [ ] get colors ( ) { if ( m data sets = = null ) return null ; int clrcnt = 0 ; for ( int i = 0 ; i < m data sets size ( ) ; i + + ) { clrcnt + = m data sets get ( i ) get colors ( ) size ( ) ; } int [ ] colors = new int [ clrcnt ] ; int cnt = 0 ; for ( int i = 0 ; i < m data sets size ( ) ; i + + ) { list < integer > clrs = m data sets get ( i ) get colors ( ) ; for ( integer clr : clrs ) { colors [ cnt ] = clr ; cnt + + ; } } return colors ; }


these providers are those that appear in dialogs outside of the main frame

private static < t extends component provider > t get detached window provider ( final class < t > provider class , final docking window manager window manager ) { objects require non null ( window manager , " docking window manager cannot be null " ) ; atomic reference < t > ref = new atomic reference < > ( ) ; run swing ( ( ) - > { object root node = get instance field ( " root " , window manager ) ; list < ? > window node list = ( list < ? > ) invoke instance method ( " get detached windows " , root node ) ; for ( object window node : window node list ) { object child node = get instance field ( " child " , window node ) ; component provider provider = get component provider from node ( child node , provider class ) ; if ( provider ! = null ) { ref set ( provider class cast ( provider ) ) ; } } } ) ; return ref get ( ) ; }


see { @ link media session compat callback # on skip to next ( ) }

void on skip to next ( player player , control dispatcher control dispatcher ) ;


public string follower index u u i d ( ) { return follower index u u i d ; }


records a miss when the hot and cold set are full

private void on full miss ( node node ) { if ( node status = = status cold non res ) { on non resident full miss ( node ) ; } else if ( node status = = status out of clock ) { on out of clock full miss ( node ) ; } else { throw new illegal state exception ( ) ; } }


get a set of locations for the given file

public block location [ ] locations for ( file status stat , long start , long len ) throws i o exception { / / todo cache return fs get file block locations ( stat , start , len ) ; }


creates a server builder configured with the given { @ link socket address }

public static netty server builder for address ( socket address address ) { return new netty server builder ( address ) ; }


converts the given number of the current units into bytes

public long to bytes ( long l ) { return bytes convert ( l , this ) ; }


caches the resolved host : rack mappings the two list parameters must be of equal size

private void cache resolved hosts ( list < string > uncached hosts , list < string > resolved hosts ) { / / cache the result if ( resolved hosts ! = null ) { for ( int i = 0 ; i < uncached hosts size ( ) ; i + + ) { cache put ( uncached hosts get ( i ) , resolved hosts get ( i ) ) ; } } }


creates a session window the boundary of session windows are defined by intervals of inactivity , i e , a session window is closes if no event appears for a defined gap period

public static session with gap with gap ( expression gap ) { return new session with gap ( gap ) ; }


converts a big - endian byte array to a long value

public static long to long ( byte [ ] bytes , int offset ) { return longs from bytes ( bytes [ offset ] , bytes [ offset + 1 ] , bytes [ offset + 2 ] , bytes [ offset + 3 ] , bytes [ offset + 4 ] , bytes [ offset + 5 ] , bytes [ offset + 6 ] , bytes [ offset + 7 ] ) ; }


should the node indices stats be returned

public nodes stats request builder set indices ( common stats flags indices ) { request indices ( indices ) ; return this ; }


return the transaction timeout must return a number of seconds , or { @ link # timeout default } exclusively designed for use with { @ link # propagation required } or { @ link # propagation requires new } since it only applies to newly started transactions note that a transaction manager that does not support timeouts will throw an exception when given any other timeout than { @ link # timeout default } the default is { @ link # timeout default }

default int get timeout ( ) { return timeout default ; }


starts specifying how to combine { @ link closing future } s into a single pipeline

public static combiner when all complete ( closing future < ? > future 1 , closing future < ? > more futures ) { return when all complete ( as list ( future 1 , more futures ) ) ; }


public boolean equals ( object obj ) { if ( obj = = this ) return true ; if ( obj ! = null & & obj instanceof summation ) { final summation that = ( summation ) obj ; return this n equals ( that n ) & & this e equals ( that e ) ; } throw new illegal argument exception ( obj = = null ? " obj = = null " : " obj get class ( ) = " + obj get class ( ) ) ; }


public static synchronized @ non null map < string , object > get pending disk values ( ) { return new tree map < > ( parse stored config ( signal store remote config values ( ) get pending config ( ) ) ) ; }


test case to ensure token renewer threads are timed out by inducing artificial delay because of time out , retries would be attempted till it reaches max retry attempt and finally asserted using used threads count

public void test token thread timeout ( ) throws exception { configuration yarn conf = new yarn configuration ( ) ; yarn conf set boolean ( yarn configuration rm proxy user privileges enabled , true ) ; yarn conf set ( common configuration keys public hadoop security authentication , " kerberos " ) ; yarn conf set class ( yarn configuration rm store , memory r m state store class , r m state store class ) ; yarn conf set time duration ( yarn configuration rm dt renewer thread timeout , 5 , time unit seconds ) ; yarn conf set time duration ( yarn configuration rm dt renewer thread retry interval , 5 , time unit seconds ) ; yarn conf set int ( yarn configuration rm dt renewer thread retry max attempts , 3 ) ; user group information set configuration ( yarn conf ) ; text user text = new text ( " user 1 " ) ; delegation token identifier dt id = new delegation token identifier ( user text , new text ( " renewer 1 " ) , user text ) ; final token < delegation token identifier > original token = new token < > ( dt id get bytes ( ) , " password 1 " get bytes ( ) , dt id get kind ( ) , new text ( " service 1 " ) ) ; credentials credentials = new credentials ( ) ; credentials add token ( user text , original token ) ; atomic boolean renew delay = new atomic boolean ( false ) ; / / - 1 is because of thread allocated to pool tracker runnable tasks atomic integer thread counter = new atomic integer ( - 1 ) ; renew delay set ( true ) ; delegation token renewer renewer = create new delegation token renewer for timeout ( yarn conf , thread counter , renew delay ) ; mock r m rm = new test security mock r m ( yarn conf ) { @ override protected delegation token renewer create delegation token renewer ( ) { return renewer ; } } ; rm start ( ) ; mock r m app submitter submit ( rm , mock r m app submission data builder create with memory ( 200 , rm ) with app name ( " name " ) with user ( " user " ) with acls ( new hash map < application access type , string > ( ) ) with unmanaged a m ( false ) with queue ( " default " ) with max app attempts ( 1 ) with credentials ( credentials ) build ( ) ) ; int attempts = yarn conf get int ( yarn configuration rm dt renewer thread retry max attempts , yarn configuration default rm dt renewer thread retry max attempts ) ; generic test utils wait for ( ( ) - > thread counter get ( ) > = attempts , 2000 , 30000 ) ; / / ensure no of threads has been used in renewer service thread pool is / / higher than the configured max retry attempts assert true ( thread counter get ( ) > = attempts ) ; rm close ( ) ; }


checks to see whether or not this instance is immutable this is the same as calling { @ code ! is mutable ( ) }

public final boolean is immutable ( ) { return ! mutable ; }


apply a single animation to the { @ link model instance } and update the it to reflect the changes

protected void apply animation ( final animation animation , final float time ) { if ( applying ) throw new gdx runtime exception ( " call end ( ) first " ) ; apply animation ( null , null , 1 f , animation , time ) ; target calculate transforms ( ) ; }


encrypts provided < code > data < code > with < code > default pass phrase < code >

static byte [ ] encrypt ( byte [ ] data ) { return encrypt ( data , default pass phrase ) ; }


the response resources wrapped in the common mcp resource message these are typed resources that match the type url in the request resources message when ` incremental ` is true , this contains an array of resources to addupdate for the specified collection this modifies the existing collection at the sink when ` incremental ` is false , this contains the full set of resources for the specified collection this replaces any previously delivered resources < code > repeated istio mcp v 1alpha 1 resource resources = 3 ; < code >

public int get resources count ( ) { return resources size ( ) ; }


returns the id of the parent ' s inode , if mentioned in i node directory section , throws ignore snapshot exception otherwise

long get parent id ( long id ) throws i o exception ;


adds the path of a custom file required to run the job on a task manager

public void add user artifact ( string name , distributed cache distributed cache entry file ) { if ( file = = null ) { throw new illegal argument exception ( ) ; } user artifacts put if absent ( name , file ) ; }


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


resumes waiting " load & display " tasks

public void resume ( ) { if ( is inited ( ) ) { engine resume ( ) ; } else { l w ( " trying to resume not - initialized image loader " ) ; } }


public integer get int 3 2 ( ) { return int 3 2 ; }


find the meta annotation from the annotated element by meta annotation type

static < a extends annotation > a find meta annotation ( annotated element annotated element , string meta annotation class name ) { return find meta annotation ( annotated element , resolve annotation type ( annotated element , meta annotation class name ) ) ; }


an " map " of the first 8 ( by size ) unsigned integer data types , where the element at index < code > i < code > points to the datatype of size < code > i + 1 < code > , with additional types with no size restriction appended after the first 8

private static abstract integer data type [ ] get unsigned types ( ) { if ( unsigned types = = null ) { unsigned types = new abstract integer data type [ ] { byte data type data type , word data type data type , unsigned integer 3 data type data type , d word data type data type , unsigned integer 5 data type data type , unsigned integer 6 data type data type , unsigned integer 7 data type data type , q word data type data type , unsigned integer 1 6 data type data type } ; } return unsigned types ; }


returns a registered { @ link token filter factory } provider by { @ link index settings } or a registered { @ link token filter factory } provider by predefined name or < code > null < code > if the token filter was not registered

private analysis provider < token filter factory > get token filter provider ( string token filter , index settings index settings ) { return get provider ( component filter , token filter , index settings , " index analysis filter " , token filters , this : : get token filter provider ) ; }


if the mouse is over a picked vertex , drag all picked vertices with the mouse if the mouse is not over a vertex , draw the rectangle to select multiple vertices

public void mouse dragged ( mouse event e ) { if ( locked = = false ) { visualization viewer < v , e > vv = ( visualization viewer < v , e > ) e get source ( ) ; if ( vertex ! = null ) { point p = e get point ( ) ; point 2 d graph point = vv get render context ( ) get multi layer transformer ( ) inverse transform ( p ) ; point 2 d graph down = vv get render context ( ) get multi layer transformer ( ) inverse transform ( down ) ; layout < v , e > layout = vv get graph layout ( ) ; double dx = graph point get x ( ) - graph down get x ( ) ; double dy = graph point get y ( ) - graph down get y ( ) ; picked state < v > ps = vv get picked vertex state ( ) ; for ( v v : ps get picked ( ) ) { point 2 d vp = layout apply ( v ) ; vp set location ( vp get x ( ) + dx , vp get y ( ) + dy ) ; layout set location ( v , vp ) ; } down = p ; } else { point 2 d out = e get point ( ) ; if ( e get modifiers ex ( ) = = this add to selection modifiers | | e get modifiers ex ( ) = = modifiers ) { rect set frame from diagonal ( down , out ) ; } } if ( vertex ! = null ) { e consume ( ) ; } vv repaint ( ) ; } }


sets a property if it is currently unset

public synchronized void set if unset ( string name , string value ) { if ( get ( name ) = = null ) { set ( name , value ) ; } }


synchronous observable and semaphore isolation only [ main ] thread is involved in this

public void test rejection with fallback request context with semaphore isolated synchronous observable ( ) { request context test results results = test request context on rejection with fallback ( execution isolation strategy semaphore , schedulers immediate ( ) ) ; assert true ( results is context initialized get ( ) ) ; assert true ( results origin thread get ( ) equals ( thread current thread ( ) ) ) ; / / all synchronous assert true ( results is context initialized observe on get ( ) ) ; assert true ( results observe on thread get ( ) equals ( thread current thread ( ) ) ) ; / / all synchronous / / semaphore isolated assert false ( results command is executed in thread ( ) ) ; }


public float get radius ( ) { return jni get radius ( addr ) ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


returns a string representation of the { @ code unsigned long } value , in base 10

public string to string ( ) { return unsigned longs to string ( value ) ; }


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


executes the glob and returns the result

public list < path > glob interruptible ( ) throws i o exception , interrupted exception , bad pattern { return glob internal ( base , patterns , exclude directories , path filter , syscalls get ( ) , executor ) ; }


build an array of buckets for a particular ordinal these arrays are asigned to the value returned by { @ link # build top buckets per ord }

abstract b [ ] build buckets ( int size ) ;


generate repository change event following the movement of an item

public void item moved ( string parent path , string item name , string new parent path , string new name ) { repository change event event = new repository change event ( repository change event rep item moved , parent path , item name , new parent path , new name ) ; send change event ( event ) ; }


test that we don ' t have any regression with network host core settings such as network host : local

public void test network host core local ( ) throws i o exception { network service network service = new network service ( collections singleton list ( new ec 2 name resolver ( ) ) ) ; inet address [ ] addresses = network service resolve bind host addresses ( null ) ; assert that ( addresses , array containing ( network service resolve bind host addresses ( new string [ ] { " local " } ) ) ) ; }


attempts to write to the azure stream after it is closed will raise an i o exception

public void test filter f s write after close ( ) throws throwable { final azure blob file system fs = get file system ( ) ; path test path = new path ( test folder path , test child file ) ; f s data output stream out = fs create ( test path ) ; intercept ( file not found exception class , ( ) - > { try ( filter output stream fos = new filter output stream ( out ) ) { fos write ( ' a ' ) ; fos flush ( ) ; out hsync ( ) ; fs delete ( test path , false ) ; / / trigger the first failure throw intercept ( file not found exception class , ( ) - > { fos write ( ' b ' ) ; out hsync ( ) ; return " hsync didn ' t raise an ioe " ; } ) ; } } ) ; }


sets the maximum edit distance candidate suggestions can have in order to be considered as a suggestion can only be a value between 1 and 2 any other value result in an bad request error being thrown defaults to { @ code 2 }

public term suggestion builder max edits ( int max edits ) { if ( max edits < 1 | | max edits > 2 ) { throw new illegal argument exception ( " max edits must be between 1 and 2 " ) ; } this max edits = max edits ; return this ; }


returns a { @ link message digest } instance for sha - 256 digests ; note that the instance returned is thread local and must not be shared amongst threads

public static message digest sha 2 5 6 ( ) { return get ( sha 256 digest ) ; }


private void parse inputs ( final string [ ] args ) { / / if there are no command line arguments , exit if ( args length = = 0 ) { display usage ( ) ; throw new hadoop illegal argument exception ( " give valid inputs " ) ; } / / parse command line args for ( int i = 0 ; i < args length ; i + + ) { if ( args [ i ] equals ( " - operation " ) ) { operation = args [ + + i ] ; } else if ( args [ i ] equals ( " - maps " ) ) { check args ( i + 1 , args length ) ; number of maps = long parse long ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - reduces " ) ) { check args ( i + 1 , args length ) ; number of reduces = long parse long ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - start time " ) ) { check args ( i + 1 , args length ) ; start time = long parse long ( args [ + + i ] ) * 1000 ; } else if ( args [ i ] equals ( " - block size " ) ) { check args ( i + 1 , args length ) ; block size = long parse long ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - bytes to write " ) ) { check args ( i + 1 , args length ) ; bytes to write = integer parse int ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - bytes per checksum " ) ) { check args ( i + 1 , args length ) ; bytes per checksum = long parse long ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - number of files " ) ) { check args ( i + 1 , args length ) ; number of files = long parse long ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - replication factor per file " ) ) { check args ( i + 1 , args length ) ; replication factor per file = short parse short ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - base dir " ) ) { check args ( i + 1 , args length ) ; base dir = args [ + + i ] ; } else if ( args [ i ] equals ( " - read file after open " ) ) { check args ( i + 1 , args length ) ; read file after open = boolean parse boolean ( args [ + + i ] ) ; } else if ( args [ i ] equals ( " - help " ) ) { display usage ( ) ; is help message = true ; } } log info ( " test inputs : " ) ; log info ( " test operation : " + operation ) ; log info ( " start time : " + sdf format ( new date ( start time ) ) ) ; log info ( " number of maps : " + number of maps ) ; log info ( " number of reduces : " + number of reduces ) ; log info ( " block size : " + block size ) ; log info ( " bytes to write : " + bytes to write ) ; log info ( " bytes per checksum : " + bytes per checksum ) ; log info ( " number of files : " + number of files ) ; log info ( " replication factor : " + replication factor per file ) ; log info ( " base dir : " + base dir ) ; log info ( " read file after open : " + read file after open ) ; / / set user - defined parameters , so the map method can access the values get conf ( ) set ( " test nnbench operation " , operation ) ; get conf ( ) set long ( " test nnbench maps " , number of maps ) ; get conf ( ) set long ( " test nnbench reduces " , number of reduces ) ; get conf ( ) set long ( " test nnbench starttime " , start time ) ; get conf ( ) set long ( " test nnbench blocksize " , block size ) ; get conf ( ) set int ( " test nnbench bytestowrite " , bytes to write ) ; get conf ( ) set long ( " test nnbench bytesperchecksum " , bytes per checksum ) ; get conf ( ) set long ( " test nnbench numberoffiles " , number of files ) ; get conf ( ) set int ( " test nnbench replicationfactor " , ( int ) replication factor per file ) ; get conf ( ) set ( " test nnbench basedir " , base dir ) ; get conf ( ) set boolean ( " test nnbench read file after open " , read file after open ) ; get conf ( ) set ( " test nnbench datadir name " , data dir name ) ; get conf ( ) set ( " test nnbench outputdir name " , output dir name ) ; get conf ( ) set ( " test nnbench controldir name " , control dir name ) ; }


parses the scheme specific data from a pssh atom version 0 and 1 pssh atoms are supported the scheme specific data is only parsed if the data is a valid pssh atom matching the given uuid , or if the data is a valid pssh atom of any type in the case that the passed uuid is null

public static byte [ ] parse scheme specific data ( byte [ ] atom , uuid uuid ) { @ nullable pssh atom parsed atom = parse pssh atom ( atom ) ; if ( parsed atom = = null ) { return null ; } if ( uuid ! = null & & ! uuid equals ( parsed atom uuid ) ) { log w ( tag , " uuid mismatch expected : " + uuid + " , got : " + parsed atom uuid + " " ) ; return null ; } return parsed atom scheme data ; }


public static execution sequencer create ( ) { return new execution sequencer ( ) ; }


accept the containing { @ link bean factory } , registering corresponding hibernate { @ link org hibernate resource beans container spi bean container } integration for it if possible this requires a spring { @ link configurable listable bean factory } and hibernate 5 3 or higher on the classpath

public void set bean factory ( bean factory bean factory ) { if ( bean factory instanceof configurable listable bean factory & & class utils is present ( " org hibernate resource beans container spi bean container " , get class ( ) get class loader ( ) ) ) { this bean factory = ( configurable listable bean factory ) bean factory ; } }


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


public list < s q l undo log > get sql undo logs ( ) { return sql undo logs ; }


returns the given functions as a { @ link map } of a function ( source ) to a set of functions ( targets )

public static map < function , set < function > > get functions as map ( function source , function targets ) { set < function > target set = get functions as set ( targets ) ; map < function , set < function > > map = new hash map < > ( ) ; map put ( source , target set ) ; return map ; }


this is used to get all the resolutions that were added using { @ link net utils # add static resolution ( string , string ) } the return value is a list each element of which contains an array of string of the form string [ 0 ] = hostname , string [ 1 ] = resolved - hostname

public static list < string [ ] > get all static resolutions ( ) { synchronized ( host to resolved ) { set < entry < string , string > > entries = host to resolved entry set ( ) ; if ( entries size ( ) = = 0 ) { return null ; } list < string [ ] > l = new array list < string [ ] > ( entries size ( ) ) ; for ( entry < string , string > e : entries ) { l add ( new string [ ] { e get key ( ) , e get value ( ) } ) ; } return l ; } }


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

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


return the instantiation type of the property , especially for map and array

public string to instantiation type ( schema schema ) { if ( model utils is map schema ( schema ) ) { schema additional properties = get additional properties ( schema ) ; string inner = get schema type ( additional properties ) ; if ( model utils is map schema ( additional properties ) ) { inner = to instantiation type ( additional properties ) ; } return instantiation types get ( " map " ) + " < string , " + inner + " > " ; } else if ( model utils is array schema ( schema ) ) { array schema array schema = ( array schema ) schema ; string inner = get schema type ( array schema get items ( ) ) ; return instantiation types get ( " array " ) + " < " + inner + " > " ; } else { return null ; } }


regression test for hdfs - 8965 which verifies that f s edit log file input stream # scan op verifies op checksums

public void test scan corrupt edit log ( ) throws exception { configuration conf = new configuration ( ) ; file edit log = new file ( generic test utils get temp path ( " test corrupt edit log " ) ) ; log debug ( " creating test edit log file : " + edit log ) ; edit log file output stream elos = new edit log file output stream ( conf , edit log get absolute file ( ) , 8192 ) ; elos create ( name node layout version current layout version ) ; f s edit log op op instance cache cache = new f s edit log op op instance cache ( ) ; f s edit log op mkdir op mkdir op = f s edit log op mkdir op get instance ( cache ) ; mkdir op reset ( ) ; mkdir op set rpc call id ( 123 ) ; mkdir op set transaction id ( 1 ) ; mkdir op set inode id ( 789l ) ; mkdir op set path ( " / mydir " ) ; permission status perms = permission status create immutable ( " myuser " , " mygroup " , fs permission create immutable ( ( short ) 0777 ) ) ; mkdir op set permission status ( perms ) ; elos write ( mkdir op ) ; mkdir op reset ( ) ; mkdir op set rpc call id ( 456 ) ; mkdir op set transaction id ( 2 ) ; mkdir op set inode id ( 123l ) ; mkdir op set path ( " / mydir 2 " ) ; perms = permission status create immutable ( " myuser " , " mygroup " , fs permission create immutable ( ( short ) 0666 ) ) ; mkdir op set permission status ( perms ) ; elos write ( mkdir op ) ; elos set ready to flush ( ) ; elos flush and sync ( false ) ; elos close ( ) ; long file len = edit log length ( ) ; log debug ( " corrupting last 4 bytes of edit log file " + edit log + " , whose length is " + file len ) ; random access file rwf = new random access file ( edit log , " rw " ) ; rwf seek ( file len - 4 ) ; int b = rwf read int ( ) ; rwf seek ( file len - 4 ) ; rwf write int ( b + 1 ) ; rwf close ( ) ; edit log file input stream elis = new edit log file input stream ( edit log ) ; assert assert equals ( name node layout version current layout version , elis get version ( true ) ) ; assert assert equals ( 1 , elis scan next op ( ) ) ; log debug ( " read transaction 1 from " + edit log ) ; try { elis scan next op ( ) ; assert fail ( " expected scan next op to fail when op checksum was corrupt " ) ; } catch ( i o exception e ) { log debug ( " caught expected checksum error when reading corrupt " + " transaction 2 " , e ) ; generic test utils assert exception contains ( " transaction is corrupt " , e ) ; } elis close ( ) ; }


set the amount of bytes after which read bytes in the buffer should be discarded setting this lower gives lower memory usage but with the overhead of more memory copies use { @ code 0 } to disable it

public void set discard threshold ( int discard threshold ) { this discard threshold = check positive or zero ( discard threshold , " discard threshold " ) ; }


re - enables watcher after every test just in case any test disables it one does

public void reenable watcher ( ) throws exception { if ( is watcher test ( ) ) { assert busy ( ( ) - > { client yaml test response response = get admin execution context ( ) call api ( " watcher stats " , empty map ( ) , empty list ( ) , empty map ( ) ) ; string state = ( string ) response evaluate ( " stats 0 watcher state " ) ; switch ( state ) { case " stopped " : client yaml test response start response = get admin execution context ( ) call api ( " watcher start " , empty map ( ) , empty list ( ) , empty map ( ) ) ; boolean is acknowledged = ( boolean ) start response evaluate ( " acknowledged " ) ; assert that ( is acknowledged , is ( true ) ) ; throw new assertion error ( " waiting until stopped state reached started state " ) ; case " stopping " : throw new assertion error ( " waiting until stopping state reached stopped state to start again " ) ; case " starting " : throw new assertion error ( " waiting until starting state reached started state " ) ; case " started " : / / all good here , we are done break ; default : throw new assertion error ( " unknown state [ " + state + " ] " ) ; } } ) ; } }


returns the labels of all starlark options that caused a difference between the first and second options set

public set < label > get changed starlark options ( ) { return immutable set < label > builder ( ) add all ( starlark first key set ( ) ) add all ( starlark second key set ( ) ) add all ( extra starlark options first ) add all ( extra starlark options second key set ( ) ) build ( ) ; }


bind using single configured port if find port is true , we will try to bind after incrementing port till a free port is found

private void bind for single port ( server connector listener , int port ) throws exception { while ( true ) { try { bind listener ( listener ) ; break ; } catch ( i o exception ex ) { if ( port = = 0 | | ! find port ) { throw construct bind exception ( listener , ex ) ; } } / / try the next port number listener set port ( + + port ) ; thread sleep ( 100 ) ; } }


sent the recycler collection a request to refresh it ' s backing data if show spinner is true , then refresh spinner is shown

public void request refresh ( boolean show spinner ) { if ( m section tree ! = null ) { if ( show spinner ) { show refreshing ( ) ; } m section tree refresh ( ) ; } }


remove the { @ link open ssl engine } with the given { @ code ssl } address and return it

reference counted open ssl engine remove ( long ssl ) ;


public void clear ( ) { this prefix to namespace uri clear ( ) ; this namespace uri to prefixes clear ( ) ; }


starts all the threads that are used by this sorter

public void start threads ( ) { if ( this sort thread ! = null ) { this sort thread start ( ) ; } if ( this spill thread ! = null ) { this spill thread start ( ) ; } if ( this merge thread ! = null ) { this merge thread start ( ) ; } }


variant of { @ link # unmarshal ( hierarchical stream reader , object , data holder ) } that nulls out non - { @ code transient } instance fields not defined in the source when unmarshaling into an existing object typically useful when loading user - supplied xml files in place ( non - null { @ code root } ) where some reference - valued fields of the root object may have legitimate reasons for being null without this mode , it is impossible to clear such fields in an existing instance , since x stream has no notation for a null field value even for primitive - valued fields , it is useful to guarantee that unmarshaling will produce the same result as creating a new instance do not use in cases where the root objects defines fields ( typically { @ code final } ) which it expects to be { @ link non null } unless you are prepared to restore default values for those fields

public object unmarshal ( hierarchical stream reader reader , object root , data holder data holder , boolean null out ) { / / init ( ) is too early to do this / / defensive because some use of x stream happens before plugins are initialized jenkins h = jenkins get instance or null ( ) ; if ( h ! = null & & h plugin manager ! = null & & h plugin manager uber class loader ! = null ) { set class loader ( h plugin manager uber class loader ) ; } object o ; if ( root = = null | | ! null out ) { o = super unmarshal ( reader , root , data holder ) ; } else { set < string > top level fields = new hash set < > ( ) ; o = super unmarshal ( new reader wrapper ( reader ) { int depth ; @ override public void move up ( ) { if ( - - depth = = 0 ) { top level fields add ( get node name ( ) ) ; } super move up ( ) ; } @ override public void move down ( ) { try { super move down ( ) ; } finally { depth + + ; } } } , root , data holder ) ; if ( o = = root & & get converter lookup ( ) lookup converter for type ( o get class ( ) ) instanceof robust reflection converter ) { get reflection provider ( ) visit serializable fields ( o , ( string name , class type , class defined in , object value ) - > { if ( top level fields contains ( name ) ) { return ; } field f = fields find ( defined in , name ) ; object v ; if ( type is primitive ( ) ) { / / oddly not in com thoughtworks xstream core util primitives v = reflection utils get vm default value for primitive type ( type ) ; if ( v equals ( value ) ) { return ; } } else { if ( value = = null ) { return ; } v = null ; } logger log ( level fine , " jenkins - 21017 : nulling out { 0 } in { 1 } " , new object [ ] { f , o } ) ; fields write ( f , o , v ) ; } ) ; } } if ( old data get ( ) ! = null ) { old data remove ( ) ; if ( o instanceof saveable ) old data monitor report ( ( saveable ) o , " 1 106 " ) ; } return o ; }


public long get end pointer ( ) { return end pointer ; }


records the elements executed by { @ code modules }

public static list < element > get elements ( stage stage , iterable < ? extends module > modules ) { recording binder binder = new recording binder ( stage ) ; for ( module module : modules ) { binder install ( module ) ; } return collections unmodifiable list ( binder elements ) ; }


public file processor set recursive ( boolean recursive ) { this recursive = recursive ; return this ; }


returns property object class associated with this set

public class < ? > get object class ( ) { return object class ; }


returns a namespace for the given imported library

public namespace get namespace ( imported library library ) { return library namespace map get ( library ) ; }


public void test increment def ( ) { assert equals ( ( byte ) 0 , exec ( " def x = ( byte ) 0 ; return x + + ; " ) ) ; assert equals ( ( byte ) 0 , exec ( " def x = ( byte ) 0 ; return x - - ; " ) ) ; assert equals ( ( byte ) 1 , exec ( " def x = ( byte ) 0 ; return + + x ; " ) ) ; assert equals ( ( byte ) - 1 , exec ( " def x = ( byte ) 0 ; return - - x ; " ) ) ; assert equals ( ( char ) 0 , exec ( " def x = ( char ) 0 ; return x + + ; " ) ) ; assert equals ( ( char ) 1 , exec ( " def x = ( char ) 1 ; return x - - ; " ) ) ; assert equals ( ( char ) 1 , exec ( " def x = ( char ) 0 ; return + + x ; " ) ) ; assert equals ( ( short ) 0 , exec ( " def x = ( short ) 0 ; return x + + ; " ) ) ; assert equals ( ( short ) 0 , exec ( " def x = ( short ) 0 ; return x - - ; " ) ) ; assert equals ( ( short ) 1 , exec ( " def x = ( short ) 0 ; return + + x ; " ) ) ; assert equals ( ( short ) - 1 , exec ( " def x = ( short ) 0 ; return - - x ; " ) ) ; assert equals ( 0 , exec ( " def x = 0 ; return x + + ; " ) ) ; assert equals ( 0 , exec ( " def x = 0 ; return x - - ; " ) ) ; assert equals ( 1 , exec ( " def x = 0 ; return + + x ; " ) ) ; assert equals ( - 1 , exec ( " def x = 0 ; return - - x ; " ) ) ; assert equals ( 0l , exec ( " def x = 0l ; return x + + ; " ) ) ; assert equals ( 0l , exec ( " def x = 0l ; return x - - ; " ) ) ; assert equals ( 1l , exec ( " def x = 0l ; return + + x ; " ) ) ; assert equals ( - 1l , exec ( " def x = 0l ; return - - x ; " ) ) ; assert equals ( 0f , exec ( " def x = 0f ; return x + + ; " ) ) ; assert equals ( 0f , exec ( " def x = 0f ; return x - - ; " ) ) ; assert equals ( 1f , exec ( " def x = 0f ; return + + x ; " ) ) ; assert equals ( - 1f , exec ( " def x = 0f ; return - - x ; " ) ) ; assert equals ( 0d , exec ( " def x = 0 0 ; return x + + ; " ) ) ; assert equals ( 0d , exec ( " def x = 0 0 ; return x - - ; " ) ) ; assert equals ( 1d , exec ( " def x = 0 0 ; return + + x ; " ) ) ; assert equals ( - 1d , exec ( " def x = 0 0 ; return - - x ; " ) ) ; }


callback for access to the { @ link client http request } that in turn provides access to the native request of the underlying http library this could be useful for setting advanced , per - request options that exposed by the underlying library

s http request ( consumer < client http request > request consumer ) ;


this is an exact copy of org codehaus jettison json j s o n object quote method produce a string in double quotes with backslash sequences in all the right places a backslash will be inserted within < , allowing json text to be delivered in html in json text , a string cannot contain a control character or an unescaped quote or backslash

private string quote ( string string ) { if ( string = = null | | string length ( ) = = 0 ) { return " \ " \ " " ; } char c = 0 ; int i ; int len = string length ( ) ; string builder sb = new string builder ( len + 4 ) ; string t ; sb append ( ' " ' ) ; for ( i = 0 ; i < len ; i + = 1 ) { c = string char at ( i ) ; switch ( c ) { case ' \ \ ' : case ' " ' : sb append ( ' \ \ ' ) ; sb append ( c ) ; break ; case ' / ' : sb append ( ' \ \ ' ) ; sb append ( c ) ; break ; case ' \ b ' : sb append ( " \ \ b " ) ; break ; case ' \ t ' : sb append ( " \ \ t " ) ; break ; case ' \ n ' : sb append ( " \ \ n " ) ; break ; case ' \ f ' : sb append ( " \ \ f " ) ; break ; case ' \ r ' : sb append ( " \ \ r " ) ; break ; default : if ( c < ' ' ) { t = " 000 " + integer to hex string ( c ) ; sb append ( " \ \ u " + t substring ( t length ( ) - 4 ) ) ; } else { sb append ( c ) ; } } } sb append ( ' " ' ) ; return sb to string ( ) ; }