test ensuring that the producer is not dropping buffered records ; we set a timeout because the test will not finish if the logic is broken

public void test at least once producer ( ) throws throwable { final dummy flink kafka producer < string > producer = new dummy flink kafka producer < > ( fake standard producer config get ( ) , new keyed serialization schema wrapper < > ( new simple string schema ( ) ) , null ) ; producer set flush on checkpoint ( true ) ; final kafka producer < ? , ? > mock producer = producer get mock kafka producer ( ) ; final one input stream operator test harness < string , object > test harness = new one input stream operator test harness < > ( new stream sink < > ( producer ) ) ; test harness open ( ) ; test harness process element ( new stream record < > ( " msg - 1 " ) ) ; test harness process element ( new stream record < > ( " msg - 2 " ) ) ; test harness process element ( new stream record < > ( " msg - 3 " ) ) ; verify ( mock producer , times ( 3 ) ) send ( any ( producer record class ) , any ( callback class ) ) ; assert assert equals ( 3 , producer get pending size ( ) ) ; / / start a thread to perform checkpointing checked thread snapshot thread = new checked thread ( ) { @ override public void go ( ) throws exception { / / this should block until all records are flushed ; / / if the snapshot implementation returns before pending records are / / flushed , test harness snapshot ( 123l , 123l ) ; } } ; snapshot thread start ( ) ; / / before proceeding , make sure that flushing has started and that the snapshot is still / / blocked ; / / this would block forever if the snapshot didn ' t perform a flush producer wait until flush started ( ) ; assert assert true ( " snapshot returned before all records were flushed " , snapshot thread is alive ( ) ) ; / / now , complete the callbacks producer get pending callbacks ( ) get ( 0 ) on completion ( null , null ) ; assert assert true ( " snapshot returned before all records were flushed " , snapshot thread is alive ( ) ) ; assert assert equals ( 2 , producer get pending size ( ) ) ; producer get pending callbacks ( ) get ( 1 ) on completion ( null , null ) ; assert assert true ( " snapshot returned before all records were flushed " , snapshot thread is alive ( ) ) ; assert assert equals ( 1 , producer get pending size ( ) ) ; producer get pending callbacks ( ) get ( 2 ) on completion ( null , null ) ; assert assert equals ( 0 , producer get pending size ( ) ) ; / / this would fail with an exception if flushing wasn ' t completed before the snapshot method / / returned snapshot thread sync ( ) ; test harness close ( ) ; }


protected void on progress update impl ( float progress ) { }


initializes the spark server should just be used when using the websockets functionality

public static void init ( ) { get instance ( ) init ( ) ; }


tests that : - previous pojo serializer did not have registrations , and created cached serializers for subclasses - on restore , it had those subclasses registered in this case , after reconfiguration , the cache should be repopulated , and registrations should also exist for the subclasses note : the cache still needs to be repopulated because previous data of those subclasses were written with the cached serializers in this case , the repopulated cache has reconfigured serializers for the subclasses so that previous written data can be read , but the registered serializers for the subclasses do not necessarily need to be reconfigured since they will only be used to write new data

public void test reconfigure with previously nonregistered subclasses ( ) throws exception { / / don ' t register any subclasses at first pojo serializer < test user class > pojo serializer = ( pojo serializer < test user class > ) type create serializer ( new execution config ( ) ) ; / / create cached serializers for sub test user class a and sub test user class b pojo serializer get subclass serializer ( sub test user class a class ) ; pojo serializer get subclass serializer ( sub test user class b class ) ; / / make sure serializers are in cache assert equals ( 2 , pojo serializer get subclass serializer cache ( ) size ( ) ) ; assert true ( pojo serializer get subclass serializer cache ( ) contains key ( sub test user class a class ) ) ; assert true ( pojo serializer get subclass serializer cache ( ) contains key ( sub test user class b class ) ) ; / / make sure that registrations are empty assert true ( pojo serializer get registered classes ( ) is empty ( ) ) ; assert equals ( 0 , pojo serializer get registered serializers ( ) length ) ; / / snapshot configuration and serialize to bytes type serializer snapshot pojo serializer config snapshot = pojo serializer snapshot configuration ( ) ; byte [ ] serialized config ; try ( byte array output stream out = new byte array output stream ( ) ) { type serializer snapshot serialization util write serializer snapshot ( new data output view stream wrapper ( out ) , pojo serializer config snapshot , pojo serializer ) ; serialized config = out to byte array ( ) ; } / / instantiate new pojo serializer , with new execution config that has the subclass / / registrations execution config new execution config = new execution config ( ) ; new execution config register pojo type ( sub test user class a class ) ; new execution config register pojo type ( sub test user class b class ) ; pojo serializer = ( pojo serializer < test user class > ) type create serializer ( new execution config ) ; / / read configuration from bytes try ( byte array input stream in = new byte array input stream ( serialized config ) ) { pojo serializer config snapshot = type serializer snapshot serialization util read serializer snapshot ( new data input view stream wrapper ( in ) , thread current thread ( ) get context class loader ( ) , pojo serializer ) ; } / / reconfigure - check reconfiguration result and that / / 1 ) subclass serializer cache is repopulated / / 2 ) registrations also contain the now registered subclasses @ suppress warnings ( " unchecked " ) type serializer schema compatibility < test user class > compat result = pojo serializer config snapshot resolve schema compatibility ( pojo serializer ) ; assert true ( compat result is compatible with reconfigured serializer ( ) ) ; assert true ( compat result get reconfigured serializer ( ) instanceof pojo serializer ) ; pojo serializer < test user class > reconfigured pojo serializer = ( pojo serializer < test user class > ) compat result get reconfigured serializer ( ) ; assert equals ( 2 , reconfigured pojo serializer get subclass serializer cache ( ) size ( ) ) ; assert true ( reconfigured pojo serializer get subclass serializer cache ( ) contains key ( sub test user class a class ) ) ; assert true ( reconfigured pojo serializer get subclass serializer cache ( ) contains key ( sub test user class b class ) ) ; assert equals ( 2 , reconfigured pojo serializer get registered classes ( ) size ( ) ) ; assert true ( reconfigured pojo serializer get registered classes ( ) contains key ( sub test user class a class ) ) ; assert true ( reconfigured pojo serializer get registered classes ( ) contains key ( sub test user class b class ) ) ; }


build redirect action for the client dynamically and configure the cas client accordingly based on the properties of the web context

optional < redirection action > build ( cas client cas client , web context context ) ;


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


allocate a buffer of the given size this method blocks if there is not enough memory and the buffer pool is configured with blocking mode

public byte buffer allocate ( int size , long max time to block ms ) throws interrupted exception { if ( size > this total memory ) throw new illegal argument exception ( " attempt to allocate " + size + " bytes , but there is a hard limit of " + this total memory + " on memory allocations " ) ; byte buffer buffer = null ; this lock lock ( ) ; if ( this closed ) { this lock unlock ( ) ; throw new kafka exception ( " producer closed while allocating memory " ) ; } try { / / check if we have a free buffer of the right size pooled if ( size = = poolable size & & ! this free is empty ( ) ) return this free poll first ( ) ; / / now check if the request is immediately satisfiable with the / / memory on hand or if we need to block int free list size = free size ( ) * this poolable size ; if ( this non pooled available memory + free list size > = size ) { / / we have enough unallocated or pooled memory to immediately / / satisfy the request , but need to allocate the buffer free up ( size ) ; this non pooled available memory - = size ; } else { / / we are out of memory and will have to block int accumulated = 0 ; condition more memory = this lock new condition ( ) ; try { long remaining time to block ns = time unit milliseconds to nanos ( max time to block ms ) ; this waiters add last ( more memory ) ; / / loop over and over until we have a buffer or have reserved / / enough memory to allocate one while ( accumulated < size ) { long start wait ns = time nanoseconds ( ) ; long time ns ; boolean waiting time elapsed ; try { waiting time elapsed = ! more memory await ( remaining time to block ns , time unit nanoseconds ) ; } finally { long end wait ns = time nanoseconds ( ) ; time ns = math max ( 0l , end wait ns - start wait ns ) ; record wait time ( time ns ) ; } if ( this closed ) throw new kafka exception ( " producer closed while allocating memory " ) ; if ( waiting time elapsed ) { this metrics sensor ( " buffer - exhausted - records " ) record ( ) ; throw new buffer exhausted exception ( " failed to allocate memory within the configured max blocking time " + max time to block ms + " ms " ) ; } remaining time to block ns - = time ns ; / / check if we can satisfy this request from the free list , / / otherwise allocate memory if ( accumulated = = 0 & & size = = this poolable size & & ! this free is empty ( ) ) { / / just grab a buffer from the free list buffer = this free poll first ( ) ; accumulated = size ; } else { / / we ' ll need to allocate memory , but we may only get / / part of what we need on this iteration free up ( size - accumulated ) ; int got = ( int ) math min ( size - accumulated , this non pooled available memory ) ; this non pooled available memory - = got ; accumulated + = got ; } } / / don ' t reclaim memory on throwable since nothing was thrown accumulated = 0 ; } finally { / / when this loop was not able to successfully terminate don ' t loose available memory this non pooled available memory + = accumulated ; this waiters remove ( more memory ) ; } } } finally { / / signal any additional waiters if there is more memory left / / over for them try { if ( ! ( this non pooled available memory = = 0 & & this free is empty ( ) ) & & ! this waiters is empty ( ) ) this waiters peek first ( ) signal ( ) ; } finally { / / another finally otherwise find bugs complains lock unlock ( ) ; } } if ( buffer = = null ) return safe allocate byte buffer ( size ) ; else return buffer ; }


returns true if this service has been loaded

public static synchronized boolean is initialized ( ) { return instance ! = null ; }


create a single image source for a given image uri

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


public void close ( ) throws i o exception { try { if ( null ! = results ) { results close ( ) ; } if ( null ! = statement ) { statement close ( ) ; } if ( null ! = connection ) { connection commit ( ) ; connection close ( ) ; } } catch ( s q l exception e ) { throw new i o exception ( e get message ( ) ) ; } }


returns whether the value is between min and max

public static int value in range ( final int value , final int min , final int max ) { return integer min ( max , integer max ( value , min ) ) ; }


sets the second input to the union of the given operators

public void set second input ( operator < in2 > inputs ) { this input 2 = operator create union cascade ( inputs ) ; }


converts this { @ link decimal data } into an instance of { @ link big decimal }

public big decimal to big decimal ( ) { big decimal bd = decimal val ; if ( bd = = null ) { decimal val = bd = big decimal value of ( long val , scale ) ; } return bd ; }


returns true if n is a strong probable prime relative to the specified base

private boolean test witness ( long base , long n ) { int r = long number of trailing zeros ( n - 1 ) ; long d = ( n - 1 ) > > r ; base % = n ; if ( base = = 0 ) { return true ; } / / calculate a : = base ^ d mod n long a = pow mod ( base , d , n ) ; / / n passes this test if / / base ^ d = 1 ( mod n ) / / or base ^ ( 2 ^ j * d ) = - 1 ( mod n ) for some 0 < = j < r if ( a = = 1 ) { return true ; } int j = 0 ; while ( a ! = n - 1 ) { if ( + + j = = r ) { return false ; } a = square mod ( a , n ) ; } return true ; }


set the destroy method for this definition

public bean definition builder set destroy method name ( @ nullable string method name ) { this bean definition set destroy method name ( method name ) ; return this ; }


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


public void unimplemented call ( io grpc testing integration empty protos empty request , io grpc stub stream observer < io grpc testing integration empty protos empty > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get unimplemented call method ( ) , get call options ( ) ) , request , response observer ) ; }


get metadata about partitions for all topics that the user is authorized to view this method will issue a remote call to the server

public map < string , list < partition info > > list topics ( ) { return list topics ( duration of millis ( default api timeout ms ) ) ; }


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


sets an level setting with the provided setting key and level instance

public builder put ( string key , level level ) { return put ( key , level to string ( ) ) ; }


returns < code > true < code > if this setting is deprecated , otherwise < code > false < code >

public boolean is deprecated ( ) { return properties contains ( property deprecated ) ; }


read the global session by transaction id

private global session read session by transaction id ( string transaction id , boolean with branch sessions ) { string global key = build global key by transaction id ( transaction id ) ; string xid = null ; try ( jedis jedis = jedis pooled factory get jedis instance ( ) ) { map < string , string > map = jedis hget all ( global key ) ; if ( collection utils is empty ( map ) ) { return null ; } global transaction d o global transaction d o = ( global transaction d o ) bean utils map to object ( map , global transaction d o class ) ; if ( global transaction d o ! = null ) { xid = global transaction d o get xid ( ) ; } list < branch transaction d o > branch transaction d os = new array list < > ( ) ; if ( with branch sessions ) { branch transaction d os = this read branch session by xid ( jedis , xid ) ; } return get global session ( global transaction d o , branch transaction d os ) ; } }


compute the lag for each stateful task , including tasks this client did not previously have

public void compute task lags ( final uuid uuid , final map < task id , long > all task end offset sums ) { if ( ! task lag totals is empty ( ) ) { throw new illegal state exception ( " already computed task lags for this client " ) ; } for ( final map entry < task id , long > task entry : all task end offset sums entry set ( ) ) { final task id task = task entry get key ( ) ; final long end offset sum = task entry get value ( ) ; final long offset sum = task offset sums get or default ( task , 0l ) ; if ( offset sum = = task latest offset ) { task lag totals put ( task , task latest offset ) ; } else if ( offset sum = = unknown offset sum ) { task lag totals put ( task , unknown offset sum ) ; } else if ( end offset sum < offset sum ) { log warn ( " task " + task + " had end offset sum = " + end offset sum + " smaller than offset sum = " + offset sum + " on member " + uuid + " this probably means the task is corrupted , " + " which in turn indicates that it will need to restore from scratch if it gets assigned " + " the assignor will de - prioritize returning this task to this member in the hopes that " + " some other member may be able to re - use its state " ) ; task lag totals put ( task , end offset sum ) ; } else { task lag totals put ( task , end offset sum - offset sum ) ; } } }


strategy for a named function signature of explicitly defined types like { @ code f ( s string , i int ) } implicit casts will be inserted if possible this is equivalent to using { @ link # sequence ( string [ ] , argument type strategy [ ] ) } and { @ link # explicit ( data type ) }

public static input type strategy explicit sequence ( string [ ] argument names , data type [ ] expected data types ) { final list < argument type strategy > strategies = arrays stream ( expected data types ) map ( input type strategies : : explicit ) collect ( collectors to list ( ) ) ; return new sequence input type strategy ( strategies , arrays as list ( argument names ) ) ; }


right after visiting the given referred { @ link i node }

default void post visit referred ( i node referred ) { }


returns true if it ' s ever possible that { @ link # execute unconditionally } could evaluate to true during the lifetime of this instance , false otherwise


should be removed as part of kafka - 10217

public static streams metrics impl get metrics impl ( final state store context context ) { return ( streams metrics impl ) context metrics ( ) ; }


public string get capital snake ( ) { return capital snake ; }


returns a handle to the child with the specified name @ throw gdx runtime exception if this file handle is a { @ link file type # classpath } or { @ link file type # internal } and the child doesn ' t exist

public file wrapper child ( string name ) { if ( file get path ( ) length ( ) = = 0 ) return new file wrapper ( new file ( name ) , type ) ; return new file wrapper ( new file ( file , name ) , type ) ; }


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

public java lang string get comment ( ) { return comment ; }


public static void main ( string [ ] args ) { string ip values = null ; if ( args length ! = 3 | | ( ! args [ 0 ] equals ( " ip " ) & & ! args [ 0 ] equals ( " range " ) ) ) { system out println ( " invalid invocation the right syntax is ip / range < numberof ips / cidr > < test range > " ) ; } else { if ( args [ 0 ] equals ( " ip " ) ) { int number of ips = integer parse int ( args [ 1 ] ) ; string builder sb = new string builder ( ) ; for ( int i = 0 ; i < number of ips ; i + + ) { sb append ( " 1 2 3 " + i + " , " ) ; } ip values = sb to string ( ) ; } else if ( args [ 0 ] equals ( " range " ) ) { ip values = args [ 1 ] ; } int test range = integer parse int ( args [ 2 ] ) ; load test ( ip values , test range ) ; } }


get number of units in a group a group may represent multiple units shown as one entity this format does not support groups

public int get group size ( ) { return 0 ; }


look up a method by its fully qualified name

public server method definition < ? , ? > get method ( string method name ) { return methods get ( method name ) ; }


add a factory that to decorate the handler used to process web socket messages this may be useful for some advanced use cases , for example to allow spring security to forcibly close the web socket session when the corresponding http session expires

public web socket transport registration add decorator factory ( web socket handler decorator factory factory ) { this decorator factories add ( factory ) ; return this ; }


given the id of a categorizer state document it extracts the job id

public static final string extract job id ( string doc id ) { int suffix index = doc id last index of ( " " + type ) ; return suffix index < = 0 ? null : doc id substring ( 0 , suffix index ) ; }


gets the first program being compared by the program diff

public program get program one ( ) { return program 1 ; }


tests that suspends keeps all checkpoints ( so that they can be recovered later by the zoo keeper store ) furthermore , suspending a job should release all locks

public void test suspend keeps checkpoints ( ) throws exception { curator framework client = zookeeper get client ( ) ; shared state registry shared state registry = new shared state registry ( ) ; completed checkpoint store store = create completed checkpoints ( 1 ) ; test completed checkpoint checkpoint = create checkpoint ( 0 , shared state registry ) ; store add checkpoint ( checkpoint , new checkpoints cleaner ( ) , ( ) - > { } ) ; assert equals ( 1 , store get number of retained checkpoints ( ) ) ; assert not null ( client check exists ( ) for path ( checkpoint path + checkpoint store util checkpoint i d to name ( checkpoint get checkpoint i d ( ) ) ) ) ; store shutdown ( job status suspended , new checkpoints cleaner ( ) , ( ) - > { } ) ; assert equals ( 0 , store get number of retained checkpoints ( ) ) ; final string checkpoint path = checkpoint path + checkpoint store util checkpoint i d to name ( checkpoint get checkpoint i d ( ) ) ; stat stat = client check exists ( ) for path ( checkpoint path ) ; assert not null ( " the checkpoint node should exist " , stat ) ; assert equals ( " the checkpoint node should not be locked " , 0 , stat get num children ( ) ) ; / / recover again shared state registry close ( ) ; store recover ( ) ; completed checkpoint recovered = store get latest checkpoint ( false ) ; assert equals ( checkpoint , recovered ) ; }


waits until the given weak reference is cleared , invoking the garbage collector as necessary to try to ensure that this will happen this is a convenience method , equivalent to : { @ code await done ( new finalization predicate ( ) { public boolean is done ( ) { return ref get ( ) = = null ; } } ) ; }

public static void await clear ( final weak reference < ? > ref ) { await done ( new finalization predicate ( ) { @ override public boolean is done ( ) { return ref get ( ) = = null ; } } ) ; }


abstract authentication policy execution result is satisfied by internal ( authentication authn ) ;


override to control how sessions are created

public builder session factory ( session factory session factory ) { if ( session factory = = null ) throw new null pointer exception ( " session factory = = null " ) ; this session factory = session factory ; return this ; }


sets the zip filter to be represented in this dialog

public void set zip filter ( list filter ) { zip filter text field set text ( filter ! = null ? list util comma separated string ( filter , true ) : default zip filter ) ; }


returns the { @ code short } value of a header with the specified name if there is more than one value for the specified name , the first value in insertion order is returned


sets an integer attribute ( like cc binary linkstatic ) for this target

public scratch attribute writer set ( string name , int value ) { new integer attribute ( name , value ) append line ( this build string ) ; return this ; }


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


after system ota , we will try to load dex with interpret mode

public void on load interpret ( int type , throwable e ) { share tinker log i ( tag , " patch load reporter on load interpret : type : % d , throwable : % s " , type , e ) ; switch ( type ) { case share constants type interpret get instruction set error : share tinker log e ( tag , " patch load reporter on load interpret fail , can get instruction set from existed oat file " ) ; break ; case share constants type interpret command error : share tinker log e ( tag , " patch load reporter on load interpret fail , command line to interpret return error " ) ; break ; case share constants type interpret ok : share tinker log i ( tag , " patch load reporter on load interpret ok " ) ; break ; default : break ; } retry patch ( ) ; }


returns the { @ link type information } for the type of this data set

public type information < t > get type ( ) { if ( type instanceof missing type info ) { missing type info type info = ( missing type info ) type ; throw new invalid types exception ( " the return type of function ' " + type info get function name ( ) + " ' could not be determined automatically , due to type erasure " + " you can give type information hints by using the returns ( ) method on the result of " + " the transformation call , or by letting your function implement the ' result type queryable ' " + " interface " , type info get type exception ( ) ) ; } type used = true ; return this type ; }


returns always non - null { @ link sasl extensions } consisting of the extension names and values that are sent by the client to the server in the initial client sasl authentication message the default value is { @ link sasl extensions # no sasl extensions } so that if this callback is unhandled the client will see a non - null value

public sasl extensions extensions ( ) { return extensions ; }


set the time zone to normalize the date values into , if any

public void set time zone ( time zone time zone ) { this time zone = time zone ; }


set the debug script to run when the reduce tasks fail the debug script can aid debugging of failed reduce tasks the script is given task ' s stdout , stderr , syslog , jobconf files as arguments the debug command , run on the node where the map failed , is : < blockquote > $ script $ stdout $ stderr $ syslog $ jobconf < blockquote > the script file is distributed through { @ link distributed cache } a p is the script file needs to be symlinked here is an example on how to submit a script < blockquote > job set reduce debug script ( " myscript " ) ; distributed cache create symlink ( job ) ; distributed cache add cache file ( " debugscriptsmyscript # myscript " ) ; < blockquote >

public void set reduce debug script ( string r dbg script ) { set ( job context reduce debug script , r dbg script ) ; }


register all relevant annotation post processors in the given registry

public static set < bean definition holder > register annotation config processors ( bean definition registry registry , @ nullable object source ) { default listable bean factory bean factory = unwrap default listable bean factory ( registry ) ; if ( bean factory ! = null ) { if ( ! ( bean factory get dependency comparator ( ) instanceof annotation aware order comparator ) ) { bean factory set dependency comparator ( annotation aware order comparator instance ) ; } if ( ! ( bean factory get autowire candidate resolver ( ) instanceof context annotation autowire candidate resolver ) ) { bean factory set autowire candidate resolver ( new context annotation autowire candidate resolver ( ) ) ; } } set < bean definition holder > bean defs = new linked hash set < > ( 8 ) ; if ( ! registry contains bean definition ( configuration annotation processor bean name ) ) { root bean definition def = new root bean definition ( configuration class post processor class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , configuration annotation processor bean name ) ) ; } if ( ! registry contains bean definition ( autowired annotation processor bean name ) ) { root bean definition def = new root bean definition ( autowired annotation bean post processor class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , autowired annotation processor bean name ) ) ; } / / check for jsr - 250 support , and if present add the common annotation bean post processor if ( jsr 2 5 0 present & & ! registry contains bean definition ( common annotation processor bean name ) ) { root bean definition def = new root bean definition ( common annotation bean post processor class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , common annotation processor bean name ) ) ; } / / check for jpa support , and if present add the persistence annotation bean post processor if ( jpa present & & ! registry contains bean definition ( persistence annotation processor bean name ) ) { root bean definition def = new root bean definition ( ) ; try { def set bean class ( class utils for name ( persistence annotation processor class name , annotation config utils class get class loader ( ) ) ) ; } catch ( class not found exception ex ) { throw new illegal state exception ( " cannot load optional framework class : " + persistence annotation processor class name , ex ) ; } def set source ( source ) ; bean defs add ( register post processor ( registry , def , persistence annotation processor bean name ) ) ; } if ( ! registry contains bean definition ( event listener processor bean name ) ) { root bean definition def = new root bean definition ( event listener method processor class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , event listener processor bean name ) ) ; } if ( ! registry contains bean definition ( event listener factory bean name ) ) { root bean definition def = new root bean definition ( default event listener factory class ) ; def set source ( source ) ; bean defs add ( register post processor ( registry , def , event listener factory bean name ) ) ; } return bean defs ; }


reads all bytes from a url into a byte array

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


test proctime temporal join when set idle state retention

public void test proc time temporal join with state retention ( ) throws exception { final int min retention time = 10 ; final int max retention time = min retention time * 3 / 2 ; temporal process time join operator join operator = new temporal process time join operator ( row type , join condition , min retention time , max retention time , false ) ; keyed two input stream operator test harness < row data , row data , row data , row data > test harness = create test harness ( join operator ) ; test harness open ( ) ; test harness set processing time ( 1 ) ; test harness process element 1 ( insert record ( 1l , " 1a 1 " ) ) ; test harness set processing time ( 2 ) ; test harness process element 2 ( insert record ( 2l , " 2a 2 " ) ) ; test harness set processing time ( 3 ) ; test harness process element 1 ( insert record ( 2l , " 2a 3 " ) ) ; test harness set processing time ( 3 + max retention time ) ; test harness process element 1 ( insert record ( 2l , " 1a 5 " ) ) ; list < object > expected output = new array list < > ( ) ; expected output add ( insert record ( 2l , " 2a 3 " , 2l , " 2a 2 " ) ) ; assertor assert output equals ( " output wrong " , expected output , test harness get output ( ) ) ; test harness close ( ) ; }


sets the { @ link reducer } class to the chain job the key and values are passed from one element of the chain to the next , by value for the added reducer the configuration given for it , < code > reducer conf < code > , have precedence over the job ' s configuration this precedence is in effect when the task is running important : there is no need to specify the output keyvalue classes for the chain reducer , this is done by the set reducer or the add mapper for the last element in the chain

public static void set reducer ( job job , class < ? extends reducer > klass , class < ? > input key class , class < ? > input value class , class < ? > output key class , class < ? > output value class , configuration reducer conf ) { job set reducer class ( chain reducer class ) ; job set output key class ( output key class ) ; job set output value class ( output value class ) ; chain set reducer ( job , klass , input key class , input value class , output key class , output value class , reducer conf ) ; }


copies the selected contents of this text field to the { @ link clipboard } implementation set on this text field , then removes it

public void cut ( ) { cut ( programmatic change events ) ; }


{ @ inherit doc } this implementation returns { @ code true } if { @ code object } is a multiset of the same size and if , for each element , the two multisets have the same count

public final boolean equals ( @ nullable object object ) { return multisets equals impl ( this , object ) ; }


get the underlying raw value for the field without accounting for default values

public object get without default ( string field name ) { field field = lookup field ( field name ) ; return values [ field index ( ) ] ; } / / note that all getters have to have boxed return types since the fields might be optional


invokes a specified runnable , timing out after the specified time limit if the target method run finishes before the limit is reached , this method returns or a wrapped exception is propagated if , on the other hand , the time limit is reached , we attempt to abort the run , and throw a { @ link timeout exception } to the caller

void run with timeout ( runnable runnable , long timeout duration , time unit timeout unit ) throws timeout exception , interrupted exception ;


start a timer to periodically write name node metrics to the log file this behavior can be disabled by configuration

protected void start metrics logger ( configuration conf ) { long metrics logger period sec = conf get int ( dfs namenode metrics logger period seconds key , dfs namenode metrics logger period seconds default ) ; if ( metrics logger period sec < = 0 ) { return ; } metrics logger task make metrics logger async ( metrics log ) ; / / schedule the periodic logging metrics logger timer = new scheduled thread pool executor ( 1 ) ; metrics logger timer set execute existing delayed tasks after shutdown policy ( false ) ; metrics logger timer schedule with fixed delay ( new metrics logger task ( metrics log , " name node " , ( short ) 128 ) , metrics logger period sec , metrics logger period sec , time unit seconds ) ; }


the server provides an ocsp staple and the client rejects it

private static void test client rejecting ocsp staple ( ssl provider ssl provider ) throws exception { final atomic reference < throwable > cause ref = new atomic reference < throwable > ( ) ; final count down latch latch = new count down latch ( 1 ) ; channel inbound handler adapter client handler = new channel inbound handler adapter ( ) { @ override public void exception caught ( channel handler context ctx , throwable cause ) throws exception { try { cause ref set ( cause ) ; } finally { latch count down ( ) ; } } } ; byte [ ] response = new ocsp response ( ) ; test client ocsp context callback = new test client ocsp context ( false ) ; handshake ( ssl provider , latch , null , response , client handler , callback ) ; byte [ ] actual = callback response ( ) ; assert not null ( actual ) ; assert not same ( response , actual ) ; assert array equals ( response , actual ) ; throwable cause = cause ref get ( ) ; assert true ( " " + cause , cause instanceof s s l handshake exception ) ; }


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


used for testing returns all traces unconditionally

public synchronized list < list < span > > get traces ( ) { list < list < span > > result = new array list < list < span > > ( ) ; for ( string low trace id : trace id to trace id timestamps key set ( ) ) { list < span > same trace id = spans by trace id ( low trace id ) ; if ( strict trace id ) { result add all ( strict by trace id ( same trace id ) ) ; } else { result add ( same trace id ) ; } } return result ; }


helper method for tests to check if a queue is starved for fairshare

private boolean is starved for fair share ( ) { for ( f s app attempt app : runnable apps ) { if ( app is starved for fair share ( ) ) { return true ; } } return false ; }


check if identity is allowed to insert into the specified table in this catalog

default void check can insert into table ( connector transaction handle transaction handle , connector identity identity , access control context context , schema table name table name ) { deny insert table ( table name to string ( ) ) ; }


shutdown the data source and its associated pool

public void close ( ) { if ( is shutdown get and set ( true ) ) { return ; } hikari pool p = pool ; if ( p ! = null ) { try { logger info ( " { } - shutdown initiated " , get pool name ( ) ) ; p shutdown ( ) ; logger info ( " { } - shutdown completed " , get pool name ( ) ) ; } catch ( interrupted exception e ) { logger warn ( " { } - interrupted during closing " , get pool name ( ) , e ) ; thread current thread ( ) interrupt ( ) ; } } }


executes this { @ code split zip } , reading content from the configured input locations , creating the specified number of archives , in the configured output directory

public split zip run ( ) throws i o exception { verbose ( " split zip : splitting in : " + outputs size ( ) ) ; verbose ( " split zip : with filter : " + filter file ) ; check config ( ) ; / / prepare output files zip outs = outputs to array ( new zip out [ outputs size ( ) ] ) ; if ( resource file ! = null ) { resource out = new zip out ( new file output stream ( resource file , false ) get channel ( ) , resource file ) ; } else if ( resource out = = null ) { / / may have been set for testing resource out = zip outs [ 0 ] ; } / / read directories of input files for ( zip in zip : inputs ) { zip end of central directory ( ) ; central directories put ( zip get filename ( ) , zip central directory ( ) ) ; zip central directory ( ) ; } / / assign input entries to output files split ( ) ; / / copy entries to the assigned output files for ( zip in zip : inputs ) { zip scan entries ( this ) ; } return this ; }


public abstract response on apply ( write request log ) ;


update storage type quota of specified mount table

private boolean update storage type quota ( string mount , long [ ] type quota ) throws i o exception { / / get existing entry mount table manager mount table = client get mount table manager ( ) ; get mount table entries request get request = get mount table entries request new instance ( mount ) ; get mount table entries response get response = mount table get mount table entries ( get request ) ; list < mount table > results = get response get entries ( ) ; mount table existing entry = null ; for ( mount table result : results ) { if ( mount equals ( result get source path ( ) ) ) { existing entry = result ; break ; } } if ( existing entry = = null ) { throw new i o exception ( mount + " doesn ' t exist in mount table " ) ; } else { final router quota usage quota usage = existing entry get quota ( ) ; long [ ] type count = new long [ storage type values ( ) length ] ; each by storage type ( t - > type count [ t ordinal ( ) ] = quota usage get type quota ( t ) ) ; / / if all storage type quota were reset , clear the storage type quota if ( and by storage type ( t - > type quota [ t ordinal ( ) ] = = hdfs constants quota reset ) ) { each by storage type ( t - > type count [ t ordinal ( ) ] = router quota usage quota usage count default ) ; } else { / / if ns quota or ss quota was unset , use the value in mount table each by storage type ( t - > { if ( type quota [ t ordinal ( ) ] = = hdfs constants quota dont set ) { type quota [ t ordinal ( ) ] = quota usage get type quota ( t ) ; } } ) ; } router quota usage updated quota = new router quota usage builder ( ) type quota ( type quota ) type consumed ( type count ) build ( ) ; existing entry set quota ( updated quota ) ; } update mount table entry request update request = update mount table entry request new instance ( existing entry ) ; update mount table entry response update response = mount table update mount table entry ( update request ) ; return update response get status ( ) ; }


void expand node ( program node node ) { expand path ( node get tree path ( ) ) ; int nchild = node get child count ( ) ; for ( int i = 0 ; i < nchild ; i + + ) { program node child = ( program node ) node get child at ( i ) ; if ( child equals ( node ) | | child is leaf ( ) ) { continue ; } expand node ( child ) ; } }


clears the weak value reference held by the entry should be used when the entry ' s value is overwritten


return matches for the given url path not thread - safe

public list < t > get mappings by direct path ( server web exchange exchange ) { string path = exchange get request ( ) get path ( ) path within application ( ) value ( ) ; return this path lookup get ( path ) ; }


initializes the value queues for the provided keys by calling the fill method with " num init values " values

public void initialize queues for keys ( string key names ) throws execution exception { for ( string key name : key names ) { key queues get ( key name ) ; } }


if the returned map contains any entries it will be mutable if it is empty it might be immutable

public map < string , object > read map ( ) throws i o exception { return ( map < string , object > ) read generic value ( ) ; }


gets all the elements found in the list , or blocks until at least one element was added if the queue is empty when this method is called , it blocks until at least one element is added this method always returns a list with at least one element the method throws an { @ code illegal state exception } if the queue is closed checking whether the queue is open and removing the next element is one atomic operation

public list < e > get batch blocking ( ) throws interrupted exception { lock lock ( ) ; try { while ( open & & elements is empty ( ) ) { non empty await ( ) ; } if ( open ) { array list < e > result = new array list < > ( elements ) ; elements clear ( ) ; return result ; } else { throw new illegal state exception ( " queue is closed " ) ; } } finally { lock unlock ( ) ; } }


10 : bral 200 ( error on flow to non - existing memory ) test flow into non - existing memory

public void test disassembler no memory ( ) throws exception { program builder add bytes branch ( 10 , 0xffffffe 0 l ) ; address set view dis addrs = disassembler disassemble ( addr ( 10 ) , null ) ; assert equals ( addrset ( range ( 10 , 11 ) ) , dis addrs ) ; verify instruction presence ( ) ; verify error bookmark ( addr ( 10 ) , " non - existing memory " ) ; } / / public void test disassembler non initialized memory ( ) throws exception { / / / / todo : currently we ignore attempts to disassemble into non - intialized memory / / }


generates a decorated collection that remains consistent with the values in the multimap for the provided key changes to the multimap may alter the returned collection , and vice versa

collection < v > wrap collection ( @ nullable k key , collection < v > collection ) { return new wrapped collection ( key , collection , null ) ; }


assert that the first label and the second label are both generated by the same command

protected void assert same generating action ( string label a , string label b ) throws exception { assert with message ( " action for " + label a + " did not match " + label b ) that ( get generating action for label ( label b ) ) is same instance as ( get generating action for label ( label a ) ) ; }


creates a file write action to write contents to the resulting artifact file name in the genfiles root underneath the package path

public static artifact create file ( rule context rule context , string file name , char sequence contents , boolean executable ) { artifact script file artifact = rule context get package relative artifact ( file name , rule context get genfiles directory ( ) ) ; rule context register action ( file write action create ( rule context , script file artifact , contents , executable ) ) ; return script file artifact ; }


this method returns a hash code for the specified object


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


this is a regression test for https : github comantlrantlr 4issues 1 8 1 5 " null ptr exception in sql base g 4 "

@ test public void test double quote in two string literals ( ) { string grammar = " lexer grammar a ; \ n " + " string : ' \ \ \ " ' ' \ \ \ " ' ' x ' ; " ; string expected = " warning ( " + error type invalid escape sequence code + " ) : a g 4 : 2 : 10 : invalid escape sequence \ \ \ " \ n " + " warning ( " + error type invalid escape sequence code + " ) : a g 4 : 2 : 15 : invalid escape sequence \ \ \ " \ n " ; string [ ] pair = new string [ ] { grammar , expected } ; super test errors ( pair , true ) ; }


resource definitions corresponding to an android package < code > repeated aapt pb package package = 2 ; < code >

public java util list < com android aapt resources package > get package list ( ) { return java util collections unmodifiable list ( instance get package list ( ) ) ; }


returns the option classes needed to create a fragment

public static immutable set < class < ? extends fragment options > > required options ( class < ? extends fragment > fragment class ) { return fragment class is annotation present ( requires options class ) ? immutable set copy of ( fragment class get annotation ( requires options class ) options ( ) ) : immutable set of ( ) ; }


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


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

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


the path of temporary folder used to store downloaded files from endpoints with file response the default value is < code > null < code > , i e using the system ' s default tempopary folder

public string get temp folder path ( ) { return temp folder path ; }


public final cluster client cluster ( ) { return cluster client ; }


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

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


create a new { @ link avg } aggregation with the given name

public static avg aggregation builder avg ( string name ) { return new avg aggregation builder ( name ) ; }


get petfind by tags : finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

default response entity < set < pet > > find pets by tags ( @ not null @ api param ( value = " tags to filter by " , required = true ) @ valid @ request param ( value = " tags " , required = true ) set < string > tags ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " photo urls \ " : [ \ " photo urls \ " , \ " photo urls \ " ] , \ " name \ " : \ " doggie \ " , \ " id \ " : 0 , \ " category \ " : { \ " name \ " : \ " default - name \ " , \ " id \ " : 6 } , \ " tags \ " : [ { \ " name \ " : \ " name \ " , \ " id \ " : 1 } , { \ " name \ " : \ " name \ " , \ " id \ " : 1 } ] , \ " status \ " : \ " available \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < pet > < id > 123456789 < / id > < name > doggie < / name > < photo urls > < photo urls > aeiou < / photo urls > < / photo urls > < tags > < / tags > < status > aeiou < / status > < / pet > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


returns true if the decompilation producing these results completed without aborting if it was aborted , there will be no real results in this object , and an error message should be available via get error message

public boolean decompile completed ( ) { return ( ( hfunc ! = null ) | | ( hparamid ! = null ) ) ; }


return the bytes of rc4 encryptiondecryption

public static byte [ ] rc 4 ( byte [ ] data , byte [ ] key ) { if ( data = = null | | data length = = 0 | | key = = null ) return null ; if ( key length < 1 | | key length > 256 ) { throw new illegal argument exception ( " key must be between 1 and 256 bytes " ) ; } final byte [ ] i s = new byte [ 256 ] ; final byte [ ] i k = new byte [ 256 ] ; int key len = key length ; for ( int i = 0 ; i < 256 ; i + + ) { i s [ i ] = ( byte ) i ; i k [ i ] = key [ i % key len ] ; } int j = 0 ; byte tmp ; for ( int i = 0 ; i < 256 ; i + + ) { j = ( j + i s [ i ] + i k [ i ] ) & 0x f f ; tmp = i s [ j ] ; i s [ j ] = i s [ i ] ; i s [ i ] = tmp ; } final byte [ ] ret = new byte [ data length ] ; int i = 0 , k , t ; for ( int counter = 0 ; counter < data length ; counter + + ) { i = ( i + 1 ) & 0x f f ; j = ( j + i s [ i ] ) & 0x f f ; tmp = i s [ j ] ; i s [ j ] = i s [ i ] ; i s [ i ] = tmp ; t = ( i s [ i ] + i s [ j ] ) & 0x f f ; k = i s [ t ] ; ret [ counter ] = ( byte ) ( data [ counter ] ^ k ) ; } return ret ; }


a convenience method for reading a value directly from a register rather than querying for the offset and space

public final big integer get big integer ( register reg ) { address addr = reg get address ( ) ; return get big integer ( addr get address space ( ) , addr get offset ( ) , reg get minimum byte size ( ) , false ) ; }


applies the given window function to each window the window function is called for each evaluation of the window for each key individually the output of the window function is interpreted as a regular non - windowed stream arriving data is incrementally aggregated using the given aggregate function this means that the window function typically has only a single value to process when called

public < acc , v , r > bootstrap transformation < t > aggregate ( aggregate function < t , acc , v > agg function , window function < v , r , k , w > window function ) { check not null ( agg function , " agg function " ) ; check not null ( window function , " window function " ) ; type information < acc > accumulator type = type extractor get aggregate function accumulator type ( agg function , input get type ( ) , null , false ) ; return aggregate ( agg function , window function , accumulator type ) ; }


purges the snapshot and logs keeping the last num snapshots and the corresponding logs if logs are rolling or a new snapshot is created during this process , these newest n snapshots or any data logs will be excluded from current purging cycle

public static void purge ( file data dir , file snap dir , int num ) throws i o exception { if ( num < 3 ) { throw new illegal argument exception ( count err msg ) ; } file txn snap log txn log = new file txn snap log ( data dir , snap dir ) ; list < file > snaps = txn log find n valid snapshots ( num ) ; int num snaps = snaps size ( ) ; if ( num snaps > 0 ) { purge older snapshots ( txn log , snaps get ( num snaps - 1 ) ) ; } }


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


public iterable < group entry > get imports ( ) { for ( deferred import selector holder deferred import : this deferred imports ) { this group process ( deferred import get configuration class ( ) get metadata ( ) , deferred import get import selector ( ) ) ; } return this group select imports ( ) ; }


tells whether the target was compiled with link - time code generation

public boolean is compiled with link time code generation ( ) { return compiled with link time code generation ; }


judge if the table name 1 equals { @ link org litepal tablemanager model associations model # get table name ( ) } and table name 2 equals { @ link org litepal tablemanager model associations model # get associated table name ( ) }

private boolean is relation correct ( associations model association model , string table name 1 , string table name 2 ) { return association model get table name ( ) equals ignore case ( table name 1 ) & & association model get associated table name ( ) equals ignore case ( table name 2 ) ; }


returns true if this key has annotation attributes

boolean has attributes ( ) { return annotation strategy has attributes ( ) ; }


returns the local checkpoint of the safe commit this value is used to calculate the min required generation for recovery

public synchronized long get local checkpoint of safe commit ( ) { return local checkpoint of safe commit ; }


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

public put index template request aliases ( string source ) { return aliases ( new bytes array ( source ) ) ; }


for the given string , returns the number of utf - 8 bytes required to encode the string

public static int utf 8 length ( string string ) { character iterator iter = new string character iterator ( string ) ; char ch = iter first ( ) ; int size = 0 ; while ( ch ! = character iterator done ) { if ( ( ch > = 0x d 8 0 0 ) & & ( ch < 0x d c 0 0 ) ) { / / surrogate pair ? char trail = iter next ( ) ; if ( ( trail > 0x d b f f ) & & ( trail < 0x e 0 0 0 ) ) { / / valid pair size + = 4 ; } else { / / invalid pair size + = 3 ; iter previous ( ) ; / / rewind one } } else if ( ch < 0x 8 0 ) { size + + ; } else if ( ch < 0x 8 0 0 ) { size + = 2 ; } else { / / ch < 0x 1 0 0 0 0 , that is , the largest char value size + = 3 ; } ch = iter next ( ) ; } return size ; }


this implementation return this instance ' s current exhaustion flag

public final boolean is batch exhausted ( int i ) { return this exhausted ; }


transforms the value in < code > slot < code > to a { @ link comparable } object

abstract t to comparable ( int slot ) throws i o exception ;


map of string keys and values that can be used to organize and categorize resources within a collection < code > map & lt ; string , string & gt ; labels = 4 ; < code >

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


finds a descriptor from a collection by the class name of the { @ link descriptor } this is useless as of the introduction of { @ link # get id } and so only very old compatibility code needs it

private static @ check for null < t extends descriptor > t find by class name ( collection < ? extends t > list , string class name ) { for ( t d : list ) { if ( d get class ( ) get name ( ) equals ( class name ) ) return d ; } return null ; }


compute an optimal configuration for the cluster

public voting configuration reconfigure ( set < discovery node > live nodes , set < string > retired node ids , discovery node current master , voting configuration current config ) { assert live nodes contains ( current master ) : " live nodes = " + live nodes + " master = " + current master ; logger trace ( " { } reconfiguring { } based on live nodes = { } , retired node ids = { } , current master = { } " , this , current config , live nodes , retired node ids , current master ) ; final set < string > live node ids = live nodes stream ( ) filter ( discovery node : : is master node ) map ( discovery node : : get id ) collect ( collectors to set ( ) ) ; final set < string > current config node ids = current config get node ids ( ) ; final set < voting config node > ordered candidate nodes = new tree set < > ( ) ; live nodes stream ( ) filter ( discovery node : : is master node ) filter ( n - > retired node ids contains ( n get id ( ) ) = = false ) for each ( n - > ordered candidate nodes add ( new voting config node ( n get id ( ) , true , n get id ( ) equals ( current master get id ( ) ) , current config node ids contains ( n get id ( ) ) ) ) ) ; current config node ids stream ( ) filter ( nid - > live node ids contains ( nid ) = = false ) filter ( nid - > retired node ids contains ( nid ) = = false ) for each ( nid - > ordered candidate nodes add ( new voting config node ( nid , false , false , true ) ) ) ; / * * now we work out how many nodes should be in the configuration : * / final int non retired config size = math to int exact ( ordered candidate nodes stream ( ) filter ( n - > n in current config ) count ( ) ) ; final int minimum config enforced size = auto shrink voting configuration ? ( non retired config size < 3 ? 1 : 3 ) : non retired config size ; final int non retired live node count = math to int exact ( ordered candidate nodes stream ( ) filter ( n - > n live ) count ( ) ) ; final int target size = math max ( round down to odd ( non retired live node count ) , minimum config enforced size ) ; final voting configuration new config = new voting configuration ( ordered candidate nodes stream ( ) limit ( target size ) map ( n - > n id ) collect ( collectors to set ( ) ) ) ; / / new configuration should have a quorum if ( new config has quorum ( live node ids ) ) { return new config ; } else { / / if there are not enough live nodes to form a quorum in the newly - proposed configuration , it ' s better to do nothing return current config ; } }


specify the hessian serializer factory to use this will typically be passed in as an inner bean definition of type { @ code com caucho hessian io serializer factory } , with custom bean property values applied

public void set serializer factory ( serializer factory serializer factory ) { this proxy factory set serializer factory ( serializer factory ) ; }


public void set columns ( list < list view column > columns ) throws i o exception { this columns replace by ( columns ) ; }


called before the azure storage sdk sends a request client - side throttling uses this to suspend the request , if necessary , to minimize errors and maximize throughput

public static void sending request ( sending request event event ) { blob operation descriptor operation type operation type = blob operation descriptor get operation type ( ( http u r l connection ) event get connection object ( ) ) ; switch ( operation type ) { case get blob : singleton read throttler suspend if necessary ( ) ; break ; case append block : case put block : case put page : singleton write throttler suspend if necessary ( ) ; break ; default : break ; } }


creates a { @ link data value file } from a { @ link serialize format # data value }

public static data value file from ( path source ) { return of ( source ) ; }


the last character position this span applies to , in utf - 16 offset < code > optional uint 3 2 last char = 3 ; < code >

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


public static < t > byte [ ] to bytes ( serialization context context , object codec < t > codec , t value ) throws i o exception , serialization exception { byte array output stream bytes = new byte array output stream ( ) ; coded output stream coded out = coded output stream new instance ( bytes ) ; codec serialize ( context , value , coded out ) ; coded out flush ( ) ; return bytes to byte array ( ) ; }


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


converts a text size to a css px value first converts to android px using { @ link subtitle view utils # resolve text size ( int , float , int , int ) } then divides by { @ link display metrics # density } to convert from android px to dp because web view treats one css px as one android dp

private string convert text size to css ( @ cue text size type int type , float size ) { float size px = subtitle view utils resolve text size ( type , size , get height ( ) , get height ( ) - get padding top ( ) - get padding bottom ( ) ) ; if ( size px = = cue dimen unset ) { return " unset " ; } float size dp = size px / get context ( ) get resources ( ) get display metrics ( ) density ; return util format invariant ( " % 2fpx " , size dp ) ; }


returns the string up to but not including { @ code quote } , unescaping any character escape sequences encountered along the way the opening quote should have already been read this consumes the closing quote , but does not include it in the returned string

private string next quoted value ( char quote ) throws i o exception { / / like next non whitespace , this uses locals ' p ' and ' l ' to save inner - loop field access char [ ] buffer = this buffer ; string builder builder = null ; while ( true ) { int p = pos ; int l = limit ; / * the index of the first character not yet appended to the builder * / int start = p ; while ( p < l ) { int c = buffer [ p + + ] ; if ( c = = quote ) { pos = p ; int len = p - start - 1 ; if ( builder = = null ) { return new string ( buffer , start , len ) ; } else { builder append ( buffer , start , len ) ; return builder to string ( ) ; } } else if ( c = = ' \ \ ' ) { pos = p ; int len = p - start - 1 ; if ( builder = = null ) { int estimated length = ( len + 1 ) * 2 ; builder = new string builder ( math max ( estimated length , 16 ) ) ; } builder append ( buffer , start , len ) ; builder append ( read escape character ( ) ) ; p = pos ; l = limit ; start = p ; } else if ( c = = ' \ n ' ) { line number + + ; line start = p ; } } if ( builder = = null ) { int estimated length = ( p - start ) * 2 ; builder = new string builder ( math max ( estimated length , 16 ) ) ; } builder append ( buffer , start , p - start ) ; pos = p ; if ( ! fill buffer ( 1 ) ) { throw syntax error ( " unterminated string " ) ; } } }


public data node [ ] create d ns for test ( int num date node ) throws i o exception { configuration conf = new hdfs configuration ( ) ; conf set ( d f s config keys dfs datanode data dir key , data dir ) ; conf set ( d f s config keys dfs datanode address key , " 0 0 0 0 : 0 " ) ; conf set ( d f s config keys dfs datanode http address key , " 0 0 0 0 : 0 " ) ; conf set ( d f s config keys dfs datanode ipc address key , " 0 0 0 0 : 0 " ) ; conf set int ( common configuration keys ipc client connect max retries key , 0 ) ; data node [ ] result = new data node [ num date node ] ; for ( int i = 0 ; i < num date node ; i + + ) { result [ i ] = internal data node test utils start d n with mock n n ( conf , nn addr , data dir ) ; } return result ; }


invoked from { @ link abstract project # build dependency graph ( dependency graph ) }

void build dependency graph ( abstract project owner , dependency graph graph ) ;


tests a scenario when channel is closed while the handshake is in progress validates that the handshake future is notified in such cases

public void test handshake future is notified on channel close ( ) throws exception { embedded channel client channel = create client channel ( null ) ; embedded channel server channel = create server channel ( null ) ; try { / / start handshake from client to server but don ' t complete the handshake for the purpose of this test transfer all data with merge ( client channel , server channel ) ; final web socket client protocol handler client ws handler = client channel pipeline ( ) get ( web socket client protocol handler class ) ; final web socket client protocol handshake handler client ws handshake handler = client channel pipeline ( ) get ( web socket client protocol handshake handler class ) ; final channel handler context ctx = client channel pipeline ( ) context ( web socket client protocol handler class ) ; / / close the channel while the handshake is in progress the channel could be closed before the handshake is / / complete due to a number of varied reasons to reproduce the test scenario for this test case , / / we would manually close the channel client ws handler close ( ctx , ctx new promise ( ) ) ; / / at this stage handshake is incomplete but the handshake future should be completed exceptionally since / / channel is closed assert true ( client ws handshake handler get handshake future ( ) is done ( ) ) ; } finally { server channel finish and release all ( ) ; client channel finish and release all ( ) ; } }


tests that removed partitions will be removed from subscribed partitions even if it ' s still in restored partitions ( filter restored partitions with discovered is active )

public void test set filter restored paritions with removed topic ( ) throws exception { check filter restored partitions with disovered ( arrays as list ( new string [ ] { " kafka topic 1 " , " kafka topic 2 " } ) , arrays as list ( new string [ ] { " kafka topic 1 " } ) , arrays as list ( new string [ ] { " kafka topic 1 " } ) , false ) ; }


renders output buffer to the given surface must only be called when in { @ link c # video output mode surface yuv } mode

public void render to surface ( video decoder output buffer output buffer , surface surface ) throws gav 1 decoder exception { if ( output buffer mode ! = c video output mode surface yuv ) { throw new gav 1 decoder exception ( " invalid output mode " ) ; } if ( gav 1 render frame ( gav 1 decoder context , surface , output buffer ) = = gav1 error ) { throw new gav 1 decoder exception ( " buffer render error : " + gav 1 get error message ( gav 1 decoder context ) ) ; } }


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


public matrix 4 tra ( ) { float m 0 1 = val [ m01 ] ; float m 0 2 = val [ m02 ] ; float m 0 3 = val [ m03 ] ; float m 1 2 = val [ m12 ] ; float m 1 3 = val [ m13 ] ; float m 2 3 = val [ m23 ] ; val [ m01 ] = val [ m10 ] ; val [ m02 ] = val [ m20 ] ; val [ m03 ] = val [ m30 ] ; val [ m10 ] = m 0 1 ; val [ m12 ] = val [ m21 ] ; val [ m13 ] = val [ m31 ] ; val [ m20 ] = m 0 2 ; val [ m21 ] = m 1 2 ; val [ m23 ] = val [ m32 ] ; val [ m30 ] = m 0 3 ; val [ m31 ] = m 1 3 ; val [ m32 ] = m 2 3 ; return this ; }


set the finished time and then update the statistics if the operation failed then the key + failures counter will be incremented by one the operation minmeanmax values will be updated with the duration ; on a failure these will all be the failures metrics

public void close ( ) { finished ( ) ; string name = key ; if ( failed ) { / / failure : name = key + store statistic names suffix failures ; iostats increment counter ( name ) ; } iostats add timed operation ( name , as duration ( ) ) ; }


quick validation on the input to check some obvious fail conditions ( fail fast ) check if the provided { @ link add application home sub cluster request } for adding a new application is valid or not

public static void validate ( add application home sub cluster request request ) throws federation state store invalid input exception { if ( request = = null ) { string message = " missing add application home sub cluster request " + " please try again by specifying " + " an add application home sub cluster information " ; log warn ( message ) ; throw new federation state store invalid input exception ( message ) ; } / / validate application home sub cluster info check application home sub cluster ( request get application home sub cluster ( ) ) ; }


informs if the invocation participates in verify - no - more - invocations or verification in order

boolean is ignored for verification ( ) ;


add the specified range to this builder adjacent ranges are permitted and will be merged , but overlapping ranges will cause an exception when { @ link # build ( ) } is called

public builder < c > add ( range < c > range ) { check argument ( ! range is empty ( ) , " range must not be empty , but was % s " , range ) ; ranges add ( range ) ; return this ; }


if the action might read directories as inputs in a way that is unsound wrt dependency checking , this method must be called

protected void check inputs for directories ( event handler event handler , metadata provider metadata provider ) throws exec exception { / / report " directory dependency checking " warning only for non - generated directories ( generated / / ones will be reported earlier ) for ( artifact input : get mandatory inputs ( ) to list ( ) ) { / / assume that if the file did not exist , we would not have gotten here try { if ( input is source artifact ( ) & & metadata provider get metadata ( input ) get type ( ) is directory ( ) ) { / / todo ( ulfjack ) : what about dependency checking of special files ? event handler handle ( event warn ( get owner ( ) get location ( ) , string format ( " input ' % s ' to % s is a directory ; " + " dependency checking of directories is unsound " , input pretty print ( ) , get owner ( ) get label ( ) ) ) ) ; } } catch ( i o exception e ) { throw new environmental exec exception ( e , code input directory check io exception ) ; } } }


sets all the provided settings including secure settings

public builder put ( settings settings ) { return put ( settings , true ) ; }


second re - authentication must fail if it is sooner than one second after the first

public void test cannot reauthenticate again faster than one second ( ) throws exception { string node = " 0 " ; time = new mock time ( ) ; security protocol security protocol = security protocol sasl ssl ; configure mechanisms ( o auth bearer login module oauthbearer mechanism , arrays as list ( o auth bearer login module oauthbearer mechanism ) ) ; server = create echo server ( security protocol ) ; try { create client connection ( security protocol , node ) ; check client connection ( node ) ; server verify authentication metrics ( 1 , 0 ) ; server verify reauthentication metrics ( 0 , 0 ) ; / * * now sleep long enough so that the next write will cause re - authentication , * which we expect to succeed * / time sleep ( ( long ) ( connections max reauth ms value * 1 1 ) ) ; check client connection ( node ) ; server verify authentication metrics ( 1 , 0 ) ; server verify reauthentication metrics ( 1 , 0 ) ; / * * now sleep long enough so that the next write will cause re - authentication , * but this time we expect re - authentication to not occur since it has been too * soon the check client connection ( ) call should return an error saying it * expected the one byte - plus - node response but got the sasl handshake request * instead * / time sleep ( ( long ) ( connections max reauth ms value * 1 1 ) ) ; assertion failed error exception = assert throws ( assertion failed error class , ( ) - > network test utils check client connection ( selector , node , 1 , 1 ) ) ; string expected response text regex = " \ \ w - " + node ; string received response text regex = " * " + o auth bearer login module oauthbearer mechanism ; assert true ( exception get message ( ) matches ( " * < " + expected response text regex + " > * < " + received response text regex + " * ? > " ) , " should have received the sasl handshake request bytes back since we re - authenticated too quickly , " + " but instead we got our generated message echoed back , implying re - auth succeeded when it should not have : " + exception ) ; server verify reauthentication metrics ( 1 , 0 ) ; / / unchanged } finally { selector close ( ) ; selector = null ; } }


creates list of users with given input array

public void create users with array input ( list < user > user , final response listener < string > response listener , final response error listener error listener ) { object post body = user ; / / verify the required parameter ' user ' is set if ( user = = null ) { volley error error = new volley error ( " missing the required parameter ' user ' when calling create users with array input " , new api exception ( 400 , " missing the required parameter ' user ' when calling create users with array input " ) ) ; } / / create path and map variables string path = " / user / create with array " replace all ( " \ \ { format \ \ } " , " json " ) ; / / query params list < pair > query params = new array list < pair > ( ) ; / / header params map < string , string > header params = new hash map < string , string > ( ) ; / / form params map < string , string > form params = new hash map < string , string > ( ) ; string [ ] content types = { } ; string content type = content types length > 0 ? content types [ 0 ] : " application / json " ; if ( content type starts with ( " multipart / form - data " ) ) { / / file uploading multipart entity builder local var builder = multipart entity builder create ( ) ; http entity http entity = local var builder build ( ) ; post body = http entity ; } else { / / normal form params } string [ ] auth names = new string [ ] { } ; try { api invoker invoke a p i ( base path , path , " post " , query params , post body , header params , form params , content type , auth names , new response listener < string > ( ) { @ override public void on response ( string local var response ) { response listener on response ( local var response ) ; } } , new response error listener ( ) { @ override public void on error response ( volley error error ) { error listener on error response ( error ) ; } } ) ; } catch ( api exception ex ) { error listener on error response ( new volley error ( ex ) ) ; } }


retrieves the min delta progress required to log the task attempt current progress

public static double get task progress min delta threshold ( ) { if ( progress min delta threshold = = null ) { return progress min delta factor * m r job config task log progress delta threshold default ; } return progress min delta threshold double value ( ) ; }


this method is not efficient and is intended for testing

public int hash code ( ) { return objects hash code ( attributes , security ) ; }


check the db name is default database or not if it ' s same as db name in litepal xml , then it is default database

private static boolean is default database ( string db name ) { if ( base utility is lite pal x m l exists ( ) ) { if ( ! db name ends with ( const config db name suffix ) ) { db name = db name + const config db name suffix ; } lite pal config config = lite pal parser parse lite pal configuration ( ) ; string default db name = config get db name ( ) ; if ( ! default db name ends with ( const config db name suffix ) ) { default db name = default db name + const config db name suffix ; } return db name equals ignore case ( default db name ) ; } return false ; }


return the jdbc data source that the jpa persistence provider is supposed to use for accessing the database if none has been specified in { @ code persistence xml }

public data source get default data source ( ) { return this default data source ; }


public void shutdown ( ) { if ( purge task status started = = purge task status ) { log info ( " shutting down purge task " ) ; timer cancel ( ) ; purge task status = purge task status completed ; } else { log warn ( " purge task not started ignoring shutdown ! " ) ; } }


exposes this buffer ' s readable bytes as an nio { @ link byte buffer } the returned buffer either share or contains the copied content of this buffer , while changing the position and limit of the returned nio buffer does not affect the indexes and marks of this buffer this method is identical to { @ code buf nio buffer ( buf reader index ( ) , buf readable bytes ( ) ) } this method does not modify { @ code reader index } or { @ code writer index } of this buffer please note that the returned nio buffer will not see the changes of this buffer if this buffer is a dynamic buffer and it adjusted its capacity

public abstract byte buffer nio buffer ( ) ;


removes the entry with the specified key


sets the geo point of the context this is a required field

public builder set geo point ( geo point geo point ) { objects require non null ( geo point , " geo point must not be null " ) ; this geo point = geo point ; return this ; }


specifies the name of the default database in the initial catalog to be created when instantiating a { @ link table environment } the database will be used to store all non - serializable objects such as tables and functions registered via e g { @ link table environment # register table sink ( string , table sink ) } or { @ link table environment # register function ( string , scalar function ) } it will also be the initial value for the current database which can be altered via { @ link table environment # use database ( string ) } default : " default database "

public builder with built in database name ( string built in database name ) { this built in database name = built in database name ; return this ; }


run distributed checkup for the specified directory

public void test f s blocks ( string root name ) throws exception { create input file ( root name ) ; run distributed f s check ( ) ; cleanup ( ) ; / / clean up after all to restore the system state }


specify the name used for the return value of the function

public void set function return name ( string function return name ) { this actual function return name = function return name ; }


return the prefix that gets prepended to view names when building a url

protected string get prefix ( ) { return this prefix ; }


test that creates new sort from a random test sort and checks both for equality

public void test from x content ( ) throws i o exception { for ( int runs = 0 ; runs < number of testbuilders ; runs + + ) { t test item = create test item ( ) ; x content builder builder = x content factory content builder ( random from ( x content type values ( ) ) ) ; if ( random boolean ( ) ) { builder pretty print ( ) ; } test item to x content ( builder , to x content empty params ) ; x content builder shuffled = shuffle x content ( builder ) ; try ( x content parser item parser = create parser ( shuffled ) ) { item parser next token ( ) ; / * * filter out name of sort , or field name to sort on for element field sort * / item parser next token ( ) ; string element name = item parser current name ( ) ; item parser next token ( ) ; t parsed item = from x content ( item parser , element name ) ; assert not same ( test item , parsed item ) ; assert equals ( test item , parsed item ) ; assert equals ( test item hash code ( ) , parsed item hash code ( ) ) ; assert warnings ( test item ) ; } } }


applies a supplemental hash function to a given hash code , which defends against poor quality hash functions this is critical when the concurrent hash map uses power - of - two length hash tables , that otherwise encounter collisions for hash codes that do not differ in lower or upper bits

static int rehash ( int h ) { / / spread bits to regularize both segment and index locations , / / using variant of single - word wang / jenkins hash / / todo ( kevinb ) : use hashing / move this to hashing ? h + = ( h < < 15 ) ^ 0xffffcd 7d ; h ^ = ( h > > > 10 ) ; h + = ( h < < 3 ) ; h ^ = ( h > > > 6 ) ; h + = ( h < < 2 ) + ( h < < 14 ) ; return h ^ ( h > > > 16 ) ; }


public void execute ( ) throws i o exception { this run ( ) ; }


check the leases beginning from the oldest

synchronized boolean check leases ( ) { return check leases ( get expired candidate leases ( ) ) ; }


creates a time - and size - bounded replay subject in this setting , the { @ code replay subject } internally tags each received item with a timestamp value supplied by the { @ link scheduler } and holds at most { @ code size } items in its internal buffer it evicts items from the start of the buffer if their age becomes less - than or equal to the supplied age in milliseconds or the buffer reaches its { @ code size } limit when observers subscribe to a terminated { @ code replay subject } , they observe the items that remained in the buffer after the terminal notification , regardless of their age , but at most { @ code size } items if an observer subscribes while the { @ code replay subject } is active , it will observe only those items from within the buffer that have age less than the specified time and each subsequent item , even if the buffer evicts items due to the time constraint in the mean time in other words , once an observer subscribes , it observes items without gaps in the sequence except for the outdated items at the beginning of the sequence note that terminal notifications ( { @ code on error } and { @ code on complete } ) trigger eviction as well for example , with a max age of 5 , the first item is observed at t = 0 , then an { @ code on complete } notification arrives at t = 10 if an observer subscribes at t = 11 , it will find an empty { @ code replay subject } with just an { @ code on complete } notification

public static < t > replay subject < t > create with time and size ( long max age , @ non null time unit unit , @ non null scheduler scheduler , int max size ) { object helper verify positive ( max size , " max size " ) ; object helper verify positive ( max age , " max age " ) ; objects require non null ( unit , " unit is null " ) ; objects require non null ( scheduler , " scheduler is null " ) ; return new replay subject < > ( new size and time bound replay buffer < > ( max size , max age , unit , scheduler ) ) ; }


when this response will expired as a timestamp in milliseconds since epoch

public long get expiration time ( ) { return expiration time millis ; }


public void test outer composite ( ) { / / todo : test outer composite }


test convert non - nullable avro schema to data type then converts back


to test enum parameters ( asynchronously ) to test enum parameters

public okhttp 3 call test enum parameters async ( list < string > enum header string array , string enum header string , list < string > enum query string array , string enum query string , integer enum query integer , double enum query double , list < string > enum form string array , string enum form string , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = test enum parameters validate before call ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


resolve a value for the { @ link parameter } in the supplied { @ link parameter context } by retrieving the corresponding dependency from the test ' s { @ link application context } delegates to { @ link parameter resolution delegate # resolve dependency }

public object resolve parameter ( parameter context parameter context , extension context extension context ) { parameter parameter = parameter context get parameter ( ) ; int index = parameter context get index ( ) ; class < ? > test class = extension context get required test class ( ) ; application context application context = get application context ( extension context ) ; return parameter resolution delegate resolve dependency ( parameter , index , test class , application context get autowire capable bean factory ( ) ) ; }


for the given znode path , removes the specified watcher of given watcher type watcher shouldn ' t be null a successful call guarantees that , the removed watcher won ' t be triggered

public void remove watches ( string path , watcher watcher , watcher type watcher type , boolean local ) throws interrupted exception , keeper exception { validate watcher ( watcher ) ; remove watches ( zoo defs op code check watches , path , watcher , watcher type , local ) ; }


litho handles addingremoving views automatically using mountunmount calls manually adding removing views will mess up litho ' s bookkeeping of added views and cause weird crashes down the line

public void add view ( view child , int index ) { throw new unsupported operation exception ( " adding views manually within litho views is not supported " ) ; }


whether has one of the specified border styles

public boolean has ( int border array ) { if ( null = = border array ) { return false ; } for ( int b : border array ) { if ( ( this borders & b ) = = b ) { return true ; } } return false ; }


appends a { @ link channel handler } at the last position of this pipeline

channel pipeline add last ( event executor group group , string name , channel handler handler ) ;


writes data for the current entry to the underlying stream

public void write ( byte [ ] buffer , int offset , int byte count ) throws i o exception { arrays check offset and count ( buffer length , offset , byte count ) ; if ( current entry = = null ) { throw new zip exception ( " no active entry " ) ; } / * final long total bytes = crc tbytes + byte count ; if ( ( total bytes > zip 6 4 max zip entry and archive size ) & & ! current entry needs zip 6 4 ) { throw new i o exception ( " zip entry size ( " + total bytes + " bytes ) cannot be represented in the zip format ( needs zip 6 4 ) " + " set the entry length using zip entry # set length to use zip 6 4 where necessary " ) ; } * / if ( current entry get method ( ) = = stored ) { out write ( buffer , offset , byte count ) ; } else { out write ( buffer , offset , byte count ) ; } / / crc update ( buffer , offset , byte count ) ; }


parse the given value into a hours { @ code bits cron field } , the third entry of a cron expression

public static bits cron field parse hours ( string value ) { return bits cron field parse field ( value , type hour ) ; }


void show comment history ( program program , address addr ) { text pane set text ( " " ) ; comment history [ ] history items = program get listing ( ) get comment history ( addr , comment type ) ; try { if ( history items length = = 0 ) { doc insert string ( 0 , no history , null ) ; doc set character attributes ( 0 , no history length ( ) , text attr set , true ) ; return ; } for ( comment history history item : history items ) { format history ( history item ) ; } } catch ( bad location exception e ) { / / shouldn ' t happen msg debug ( this , " error setting comment text field text " , e ) ; } text pane set caret position ( 0 ) ; }


public void init ( job conf conf ) throws i o exception { set conf ( conf ) ; cluster = new cluster ( conf ) ; client ugi = user group information get current user ( ) ; max retry = conf get int ( m r job config mr client job max retries , m r job config default mr client job max retries ) ; retry interval = conf get long ( m r job config mr client job retry interval , m r job config default mr client job retry interval ) ; }


returns true if dragging is enabled for the chart , false if not

public boolean is drag enabled ( ) { return m drag x enabled | | m drag y enabled ; }


if states is set , only groups in these states will be returned by list consumer groups ( ) otherwise , all groups are returned this operation is supported by brokers with version 2 6 0 or later

public list consumer groups options in states ( set < consumer group state > states ) { this states = ( states = = null ) ? collections empty set ( ) : new hash set < > ( states ) ; return this ; }


get the < b > signed < b > value from the given byte array using the specified integer size , returned as a long values with a size less than sizeof ( long ) will have their sign bit extended

default long get signed value ( byte [ ] b , int offset , int size ) { long val = get value ( b , offset , size ) ; int shift bits = ( 8 / * sizeof ( long ) * / - size ) * 8 ; / / this little bit of magic will sign - extend the value val = val < < shift bits ; val = val > > shift bits ; return val ; }


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


waits for all results to be delivered the client is responsible for processing the results and handling any exceptions that may have occurred

public collection < q result < i , r > > wait for results ( ) throws interrupted exception { try { return queue wait for results ( ) ; } finally { queue dispose ( ) ; } }


public image get image ( ) { return image ; }


set the sql query string to use for validation

public void set validation query ( string validation query ) { this validation query = validation query ; }


specify the { @ link cache control } which should be used by the resource handler

public resource handler registration set cache control ( cache control cache control ) { this cache control = cache control ; return this ; }


set the { @ link stream thread state listener } to be notified when state changes note this api is internal to kafka streams and is not intended to be used by an external application

public void set state listener ( final stream thread state listener listener ) { state listener = listener ; }


test for the case when the scheduler minimum - allocation - vcores = = 0

public void test validate v cores invalid min v core ( ) { map < string , string > configs = new hash map ( ) ; configs put ( yarn configuration rm scheduler minimum allocation vcores , " 0 " ) ; configuration config = capacity scheduler config generator for test create configuration ( configs ) ; capacity scheduler config validator validate v cores ( config ) ; fail ( yarn configuration rm scheduler minimum allocation vcores + " should be > 0 " ) ; }


allow retaining diffs for unit test and analysis defaults to false ( off )

public void set retain diffs ( boolean b ) { retain diffs = b ; }


reads a registered table and returns the resulting { @ link table } a table to scan must be registered in the { @ link table environment } see the documentation of { @ link table environment # use database ( string ) } or { @ link table environment # use catalog ( string ) } for the rules on the path resolution examples : reading a table from default catalog and database { @ code table tab = table env from ( " table name " ) ; } reading a table from a registered catalog { @ code table tab = table env from ( " catalog name db name table name " ) ; } reading a table from a registered catalog with escaping dots in e g a database name must be escaped { @ code table tab = table env from ( " catalog name ` db name ` table " ) ; }


restart an application @ api group app detail controller @ api name restart app @ api { post } app detailsrestart { id } restart one instance of application @ api param { string } id application id to restart @ api success { string } text give deployment status @ api error bad request requested application does not restart

public response restart app ( @ path param ( " id " ) string id ) { app catalog solr client sc = new app catalog solr client ( ) ; app entry app = sc find app entry ( id ) ; service yarn app = app get yarnfile ( ) ; yarn app set state ( service state started ) ; try { yarn service client yc = new yarn service client ( ) ; yc restart app ( yarn app ) ; } catch ( json processing exception e ) { return response status ( status bad request ) build ( ) ; } return response ok ( ) build ( ) ; }


add a search request to execute note , the order is important , the search response will be returned in the same order as the search requests if ignore indices has been set on the search request , then the indices options of the multi search request will not be used ( if set )

public multi search request builder add ( search request request ) { if ( request indices options ( ) = = indices options strict expand open and forbid closed ( ) & & request ( ) indices options ( ) ! = indices options strict expand open and forbid closed ( ) ) { request indices options ( request ( ) indices options ( ) ) ; } super request add ( request ) ; return this ; }


see { @ link file status # is snapshot enabled ( ) }


lay down the specified data type on a function return , parameter or local variable based upon the program action context pointer conversion will be handled by merging the existing data type with the specified data type

public boolean create data ( data type dt , listing action context program action context , boolean enable conflict handling ) { return create data ( dt , program action context , true , enable conflict handling ) ; }


called when the { @ link listenable future } completes with success note that exceptions raised by this method are ignored

void on success ( @ nullable t result ) ;


loads a text resource that is located in a directory on the java classpath that corresponds to the package of < code > relative to class < code > using utf8 encoding e g < code > load resource ( class for name ( " com google foo foo " , " bar txt " ) ) < code > will look for < code > comgooglefoobar txt < code > in the classpath

public static string load resource ( class < ? > relative to class , string resource name ) throws i o exception { try ( input stream stream = get resource as stream ( relative to class , resource name ) ) { if ( stream = = null ) { throw new i o exception ( resource name + " not found " ) ; } return new string ( byte streams to byte array ( stream ) , utf 8 ) ; } }


return true if disk space is available on at least one of the configured redundant volumes , and all of the configured required volumes

public boolean has available disk space ( ) { return name node resource policy are resources available ( volumes values ( ) , minimum redundant volumes ) ; }


default void view listing ( publishable pub ) { }


create a { @ link compression input stream } that will read from the given input stream and return a stream for uncompressed data

public compression input stream create input stream ( input stream in ) throws i o exception { return compression codec util create input stream with codec pool ( this , conf , in ) ; }


abstract record iterator iterate function records ( ) throws i o exception ;


read an xml document from the given string

public document read document from string ( string document content ) { input source is = new input source ( new string reader ( document content ) ) ; try { return this reader do load document ( is , get resource ( ) ) ; } catch ( exception ex ) { throw new bean definition store exception ( " failed to read xml document " , ex ) ; } }


executes { @ link file system # delete trees below } on { @ code top dir } and tries to race its execution by deleting { @ code file to delete } concurrently

private static void delete trees below race test ( path top dir , path file to delete ) throws exception { count down latch latch = new count down latch ( 2 ) ; atomic boolean won race = new atomic boolean ( false ) ; thread t = new thread ( ( ) - > { try { latch count down ( ) ; latch await ( ) ; won race compare and set ( false , file to delete delete ( ) ) ; } catch ( i o exception | interrupted exception e ) { / / don ' t care } } ) ; t start ( ) ; try { try { latch count down ( ) ; latch await ( ) ; top dir delete trees below ( ) ; } finally { t join ( ) ; } if ( ! won race get ( ) ) { assert that ( top dir exists ( ) ) is true ( ) ; } } catch ( i o exception e ) { if ( won race get ( ) ) { assert that ( e ) has message that ( ) contains ( file to delete to string ( ) ) ; assert that ( e ) has message that ( ) contains ( " no such file " ) ; } else { throw e ; } } }


returns the { @ link android graphics bitmap config } of the { @ link android graphics bitmap bitmaps }

bitmap config get config ( ) { return config ; }


register a listener to listen database create and upgrade events

public static void register database listener ( database listener listener ) { db listener = listener ; }


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


subclasses of compiled expression generated by spel compiler will provide an implementation of this method

public abstract object get value ( @ nullable object target , @ nullable evaluation context context ) throws evaluation exception ;


< code > required string method name = 1 ; < code > name of the rpc method

public builder clear method name ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 1 ) ; method name = get default instance ( ) get method name ( ) ; on changed ( ) ; return this ; }


public static bitmap screen shot ( @ non null final activity activity , boolean is delete status bar ) { view decor view = activity get window ( ) get decor view ( ) ; bitmap bmp = utils bridge view 2 bitmap ( decor view ) ; display metrics dm = new display metrics ( ) ; activity get window manager ( ) get default display ( ) get metrics ( dm ) ; if ( is delete status bar ) { int status bar height = utils bridge get status bar height ( ) ; return bitmap create bitmap ( bmp , 0 , status bar height , dm width pixels , dm height pixels - status bar height ) ; } else { return bitmap create bitmap ( bmp , 0 , 0 , dm width pixels , dm height pixels ) ; } }


flush the section got table to a new % got memory block

private void create got ( ) { if ( last section got entry address = = null ) { return ; } int size = ( int ) last section got entry address subtract ( section got address ) + 1 ; string section name = relocation table get section to be relocated ( ) get name as string ( ) ; string block name = get section got name ( ) ; try { memory block block = memory block utils create initialized block ( program , false , block name , section got address , size , " got for " + section name + " section " , " mips - elf loader " , true , false , false , load helper get log ( ) ) ; data converter converter = program get memory ( ) is big endian ( ) ? big endian data converter instance : little endian data converter instance ; for ( long symbol value : got map key set ( ) ) { address addr = got map get ( symbol value ) ; byte [ ] bytes ; if ( program get default pointer size ( ) = = 4 ) { bytes = converter get bytes ( ( int ) symbol value ) ; } else { bytes = converter get bytes ( symbol value ) ; } block put bytes ( addr , bytes ) ; load helper create data ( addr , pointer data type data type ) ; } } catch ( memory access exception e ) { throw new assert exception ( e ) ; / / unexpected } }


{ @ inherit doc } the inverse of an { @ code immutable bi map } is another { @ code immutable bi map }

public abstract immutable bi map < v , k > inverse ( ) ;


returns the die pointed to by a dw at containing type attribute

public d i e aggregate get containing type ref ( ) { return get ref ( d w a r f attribute dw at containing type ) ; }


causes rules of this type to require the specified toolchains be available via toolchain resolution when a target is configured

public builder add required toolchains ( label toolchain labels ) { return this add required toolchains ( lists new array list ( toolchain labels ) ) ; }


encodes " - ssio - " in contexts where it is pronounced either j or x ( " sh " )

boolean encode ssio ( ) { if ( string at ( ( m current + 1 ) , 4 , " sion " , " " ) ) { / / " abcission " if ( string at ( ( m current - 2 ) , 2 , " ci " , " " ) ) { metaph add ( " j " ) ; } / / ' mission ' else { if ( is vowel ( m current - 1 ) ) { metaph add ( " x " ) ; } } advance counter ( 4 , 2 ) ; return true ; } return false ; }


handle the block exception and provide fallback result

sofa response handle ( filter invoker invoker , sofa request request , block exception ex ) ;


creates a new { @ link hibernate validator configuration } with the base custom unwrappers registered

public static hibernate validator configuration new configuration ( ) { return validation by provider ( hibernate validator class ) configure ( ) add value extractor ( guava optional value extractor descriptor get value extractor ( ) ) ; }