positive test to check rename succeeds for hierarchy of files and folders under a src directory when destination folder already exists

public void test rename positive when destination folder exists ( ) throws throwable { path parent src dir = new path ( " / test rename positive for folder src " ) ; path src file path = new path ( parent src dir , " test 1 dat " ) ; path src folder path = new path ( parent src dir , " test folder " ) ; path dst dir = new path ( " / test rename positive for folder dst " ) ; path final dst dir = new path ( dst dir , " test rename positive for folder src " ) ; path dst file path = new path ( final dst dir , " test 1 dat " ) ; path dst folder path = new path ( final dst dir , " test folder " ) ; / * to create parent dirs * / authorizer add auth rule for owner ( " / " , write , true ) ; authorizer add auth rule for owner ( parent src dir to string ( ) , write , true ) ; authorizer add auth rule for owner ( dst dir to string ( ) , write , true ) ; / * required for assert path exists calls * / authorizer add auth rule for owner ( " / " , read , true ) ; authorizer add auth rule for owner ( parent src dir to string ( ) , read , true ) ; authorizer add auth rule for owner ( final dst dir to string ( ) , read , true ) ; fs update wasb authorizer ( authorizer ) ; try { touch ( fs , src file path ) ; assert path exists ( fs , " src file path does not exist " , src file path ) ; fs mkdirs ( src folder path ) ; assert is directory ( fs , src folder path ) ; fs mkdirs ( dst dir ) ; assert is directory ( fs , dst dir ) ; assert rename outcome ( fs , parent src dir , dst dir , true ) ; assert path does not exist ( fs , " parent src dir exists " , parent src dir ) ; assert path does not exist ( fs , " src file path exists " , src file path ) ; assert path does not exist ( fs , " src folder path exists " , src folder path ) ; assert path exists ( fs , " dest path does not exist " , dst dir ) ; assert path exists ( fs , " dst file path does not exist " , dst file path ) ; assert path exists ( fs , " dst folder path does not exist " , dst folder path ) ; } finally { recursive delete ( parent src dir ) ; recursive delete ( dst dir ) ; } }


specify a typed root object to resolve against default is none , expecting an object argument at evaluation time

public builder with typed root object ( object root object , type descriptor type descriptor ) { this root object = new typed value ( root object , type descriptor ) ; return this ; }


remove the lease for the specified holder and src

synchronized void remove lease ( string holder , i node file src ) { lease lease = get lease ( holder ) ; if ( lease ! = null ) { remove lease ( lease , src get id ( ) ) ; } else { log warn ( " removing non - existent lease ! holder = { } src = { } " , holder , src get full path name ( ) ) ; } }


this test checks that concurrent access is not detected by default , meaning that the thread concurrency checks are off by default

public void test with no concurrency check ( ) throws exception { / / this test will fail on debug log level : if we run the test with debug log level / / the kryo serializer concurrent access check will be enabled , causing a failure here assume false ( log is debug enabled ( ) ) ; boolean assertion error ; try { new kryo serializer concurrency test ( ) test concurrent use of serializer ( ) ; assertion error = false ; } catch ( assertion error e ) { assertion error = true ; } assert true ( " test concurrent use of serializer ( ) should have failed if " + " concurrency checks are off by default " , assertion error ) ; }


creates an ssl context builder with ciphers and apn appropriate for g r p c

public static ssl context builder for server ( input stream key cert chain , input stream key ) { return configure ( ssl context builder for server ( key cert chain , key ) ) ; }


get whether to include a bucket for documents not matching any filter

public boolean other bucket ( ) { return other bucket ; }


generates a fixed format of application tags given one or more of application name , version and description this allows subsequent query for an application with a name only , version only or description only or any combination of those as filters

public static final set < string > create application tags ( string app name , string app version , string app description ) { set < string > tags = new hash set < > ( ) ; tags add ( service utils create name tag ( app name ) ) ; if ( app version ! = null ) { tags add ( service utils create version tag ( app version ) ) ; } if ( app description ! = null ) { tags add ( service utils create description tag ( app description ) ) ; } return tags ; }


sets the < code > namespace array < code > property

public xml item namespace array ( list < integer > namespace array ) { this namespace array = namespace array ; return this ; }


tests concurrent increment and get calls from multiple threads and verifies that the numbers counts strictly increasing

public void test concurrent get and increment ( ) throws exception { / / config final int num threads = 8 ; / / setup final count down latch start latch = new count down latch ( 1 ) ; final checkpoint i d counter counter = create checkpoint id counter ( ) ; counter start ( ) ; executor service executor = null ; try { executor = executors new fixed thread pool ( num threads ) ; list < future < list < long > > > result futures = new array list < > ( num threads ) ; for ( int i = 0 ; i < num threads ; i + + ) { result futures add ( executor submit ( new incrementer ( start latch , counter ) ) ) ; } / / kick off the incrementing start latch count down ( ) ; final int expected total = num threads * incrementer num increments ; list < long > all = new array list < > ( expected total ) ; / / get the counts for ( future < list < long > > result : result futures ) { list < long > counts = result get ( ) ; all add all ( counts ) ; } / / verify collections sort ( all ) ; assert equals ( expected total , all size ( ) ) ; long current = 0 ; for ( long val : all ) { / / incrementing counts assert equals ( + + current , val ) ; } / / the final count assert equals ( expected total + 1 , counter get ( ) ) ; assert equals ( expected total + 1 , counter get and increment ( ) ) ; } finally { if ( executor ! = null ) { executor shutdown ( ) ; } counter shutdown ( job status finished ) ; } }


retrieves the data with the given keys at the given properties file

public config data get ( string path , set < string > keys ) { map < string , string > data = new hash map < > ( ) ; if ( path = = null | | path is empty ( ) ) { return new config data ( data ) ; } try ( reader reader = reader ( path ) ) { properties properties = new properties ( ) ; properties load ( reader ) ; for ( string key : keys ) { string value = properties get property ( key ) ; if ( value ! = null ) { data put ( key , value ) ; } } return new config data ( data ) ; } catch ( i o exception e ) { throw new config exception ( " could not read properties from file " + path ) ; } }


called whenever a markup item ' s status changes

public void markup item status changed ( v t markup item markup item ) ;


protected synchronized boolean enter closed state ( ) { if ( ! state equals ( closed ) ) { enter state ( null , closed ) ; return true ; } else { return false ; } }


dispatch the move to the proxy source & wait for the response

private void dispatch ( ) { socket sock = new socket ( ) ; data output stream out = null ; data input stream in = null ; try { if ( source is iteration over ( ) ) { log info ( " cancel moving " + this + " as iteration is already cancelled due to " + " dfs balancer max - iteration - time is passed " ) ; throw new i o exception ( " block move cancelled " ) ; } log info ( " start moving " + this ) ; assert ! ( reported block instanceof d block striped ) ; sock connect ( net utils create socket addr ( target get datanode info ( ) get xfer addr ( dispatcher this connect to dn via hostname ) ) , hdfs constants read timeout ) ; / / set read timeout so that it doesn ' t hang forever against / / unresponsive nodes datanode normally sends in progress response / / twice within the client read timeout period ( every 30 seconds by / / default ) here , we make it give up after 5 minutes of no response sock set so timeout ( hdfs constants read timeout * 5 ) ; sock set keep alive ( true ) ; output stream unbuf out = sock get output stream ( ) ; input stream unbuf in = sock get input stream ( ) ; extended block eb = new extended block ( nnc get blockpool i d ( ) , reported block get block ( ) ) ; final key manager km = nnc get key manager ( ) ; token < block token identifier > access token = km get access token ( eb , new storage type [ ] { target storage type } , new string [ 0 ] ) ; i o stream pair sasl streams = sasl client socket send ( sock , unbuf out , unbuf in , km , access token , target get datanode info ( ) ) ; unbuf out = sasl streams out ; unbuf in = sasl streams in ; out = new data output stream ( new buffered output stream ( unbuf out , io file buffer size ) ) ; in = new data input stream ( new buffered input stream ( unbuf in , io file buffer size ) ) ; send request ( out , eb , access token ) ; receive response ( in ) ; nnc add bytes moved ( reported block get num bytes ( ) ) ; target get d datanode ( ) set has success ( ) ; log info ( " successfully moved " + this ) ; } catch ( i o exception e ) { log warn ( " failed to move " + this , e ) ; target get d datanode ( ) set has failure ( ) ; / / check that the failure is due to block pinning errors if ( e instanceof block pinning exception ) { / / pinned block can ' t be moved add this block into failure list / / later in the next iteration mover will exclude these blocks from / / pending moves target get d datanode ( ) add block pinning failures ( this ) ; return ; } / / proxy or target may have some issues , delay before using these nodes / / further in order to avoid a potential storm of " threads quota / / exceeded " warnings when the dispatcher gets out of sync with work / / going on in datanodes proxy source activate delay ( delay after errors ) ; target get d datanode ( ) activate delay ( delay after errors ) ; } finally { i o utils close stream ( out ) ; i o utils close stream ( in ) ; i o utils close socket ( sock ) ; proxy source remove pending block ( this ) ; target get d datanode ( ) remove pending block ( this ) ; synchronized ( this ) { reset ( ) ; } synchronized ( dispatcher this ) { dispatcher this notify all ( ) ; } } }


handle the case where no { @ linkplain org springframework http converter http message converter message converters } were found that were acceptable for the client ( expressed via the { @ code accept } header the default implementation sends an http 406 error and returns an empty { @ code model and view } alternatively , a fallback view could be chosen , or the http media type not acceptable exception could be rethrown as - is

protected model and view handle http media type not acceptable ( http media type not acceptable exception ex , http servlet request request , http servlet response response , @ nullable object handler ) throws i o exception { response send error ( http servlet response sc not acceptable ) ; return new model and view ( ) ; }


tests forwarding of both { @ link read only sliced network buffer # recycle buffer ( ) } and { @ link read only sliced network buffer # is recycled ( ) }

public void test forwards recycle buffer 2 ( ) { read only sliced network buffer slice = buffer read only slice ( 1 , 2 ) ; assert false ( slice is recycled ( ) ) ; slice recycle buffer ( ) ; assert true ( slice is recycled ( ) ) ; assert true ( buffer is recycled ( ) ) ; }


public synchronized float get num v cores used ( ) { refresh if needed ( ) ; float ret = cpu usage ; if ( ret ! = - 1 ) { ret = ret / 100f ; } return ret ; }


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


builds a simple aac lc audio specific config , as defined in iso 14496 - 3 1 6 2 1

public static byte [ ] build aac lc audio specific config ( int sample rate , int channel count ) { int sample rate index = c index unset ; for ( int i = 0 ; i < audio specific config sampling rate table length ; + + i ) { if ( sample rate = = audio specific config sampling rate table [ i ] ) { sample rate index = i ; } } int channel config = c index unset ; for ( int i = 0 ; i < audio specific config channel count table length ; + + i ) { if ( channel count = = audio specific config channel count table [ i ] ) { channel config = i ; } } if ( sample rate = = c index unset | | channel config = = c index unset ) { throw new illegal argument exception ( " invalid sample rate or number of channels : " + sample rate + " , " + channel count ) ; } return build audio specific config ( audio object type aac lc , sample rate index , channel config ) ; }


this callback is only required for resolution of bean names in the { @ link # set beans ( java util map ) " beans " } { @ link map } and for autodetection of m beans ( in the latter case , a { @ code listable bean factory } is required )

public void set bean factory ( bean factory bean factory ) { if ( bean factory instanceof listable bean factory ) { this bean factory = ( listable bean factory ) bean factory ; } else { logger debug ( " m bean exporter not running in a listable bean factory : autodetection of m beans not available " ) ; } }


stops the application level timeline collector for this app this should be used only if the timeline service v 2 is enabled

public void stop timeline collector ( ) { rm context get r m timeline collector manager ( ) remove ( application id ) ; }


makes a string representation of the exception ' s stack trace , or " ( null ) " , if the exception is null this method makes a best effort and never fails

public static string stringify exception ( final throwable e ) { if ( e = = null ) { return stringified null exception ; } try { string writer stm = new string writer ( ) ; print writer wrt = new print writer ( stm ) ; e print stack trace ( wrt ) ; wrt close ( ) ; return stm to string ( ) ; } catch ( throwable t ) { return e get class ( ) get name ( ) + " ( error while printing stack trace ) " ; } }


the java compatible android package name of the app < code > optional string package name = 2 ; < code >

private void clear package name ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 2 ) ; package name = get default instance ( ) get package name ( ) ; }


removes activity listener from the activity

void remove activity listener ( activity listener listener ) ;


calculate the ratio of time spent in the specified state

public double duration ratio ( state ratio state , long now ) { if ( state = = null ) { return 0 0d ; } long duration current = now - start time ; / / since last state change long duration desired = ratio state = = state ? duration current : 0l ; switch ( ratio state ) { case unassigned : duration desired + = unassigned total time ms ; break ; case running : duration desired + = running total time ms ; break ; case paused : duration desired + = paused total time ms ; break ; case failed : duration desired + = failed total time ms ; break ; case destroyed : duration desired + = destroyed total time ms ; break ; } long total = duration current + unassigned total time ms + running total time ms + paused total time ms + failed total time ms + destroyed total time ms ; return total = = 0 0d ? 0 0d : ( double ) duration desired / total ; }


public logical plan create statement ( string sql ) { return create statement ( sql , collections empty list ( ) , utc ) ; }


reads characters into a portion of an array , reading from the underlying stream if necessary

private int read 1 ( char [ ] cbuf , int off , int len ) throws i o exception { if ( next char > = n chars ) { / * * if the requested length is at least as large as the buffer , and * if there is no mark / reset activity , and if line feeds are not * being skipped , do not bother to copy the characters into the * local buffer in this way buffered streams will cascade * harmlessly * / if ( len > = cb length & & marked char < = unmarked & & ! skip l f ) { return in read ( cbuf , off , len ) ; } fill ( ) ; } if ( next char > = n chars ) return - 1 ; if ( skip l f ) { skip l f = false ; if ( cb [ next char ] = = ' \ n ' ) { next char + + ; if ( next char > = n chars ) fill ( ) ; if ( next char > = n chars ) return - 1 ; } } int n = math min ( len , n chars - next char ) ; system arraycopy ( cb , next char , cbuf , off , n ) ; next char + = n ; return n ; }


build call for fake outer number serialize

public okhttp 3 call fake outer number serialize call ( big decimal body , final api callback callback ) throws api exception { object local var post body = body ; / / create path and map variables string local var path = " / fake / outer / number " ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " * / * " } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , " post " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


calls { @ link tree string # dedup ( map ) } recursively

private void dedup ( final map < string , char [ ] > table ) { node dedup ( table ) ; for ( child child : children values ( ) ) { child dedup ( table ) ; } }


@ test public void annotation is nested class ( ) throws exception { string source = java file builder ( " com squareup tacos " , type spec class builder ( " test component " ) add annotation ( class name get ( " dagger " , " component " ) ) add type ( type spec class builder ( " builder " ) add annotation ( class name get ( " dagger " , " component " , " builder " ) ) build ( ) ) build ( ) ) build ( ) to string ( ) ; assert that ( source ) is equal to ( " " + " package com squareup tacos ; \ n " + " \ n " + " import dagger component ; \ n " + " \ n " + " @ component \ n " + " class test component { \ n " + " @ component builder \ n " + " class builder { \ n " + " } \ n " + " } \ n " ) ; }


returns the { @ link method } instance for { @ link # test sub list original list set affects sub list ( ) } so that tests of { @ link copy on write array list } can suppress them with { @ code feature specific test suite builder suppressing ( ) } until < a href = " http : bugs sun combugdatabaseview bug do ? bug id = 6570631 " > sun bug 6570631 is fixed

public static method get sub list original list set affects sub list method ( ) { return get method ( list sub list tester class , " test sub list original list set affects sub list " ) ; }


public static resource list union ( resource list lists ) { return union ( arrays as list ( lists ) ) ; }


public void init ( ) { reloader = new thread ( this , " truststore reloader thread " ) ; reloader set daemon ( true ) ; running = true ; reloader start ( ) ; }


public static builder new builder ( ) { return new builder ( ) ; }


create an appropriate { @ code job story producer } object for the given trace

protected job story producer create job story producer ( string trace in , configuration conf ) throws i o exception { if ( " - " equals ( trace in ) ) { return new zombie job producer ( system in , null ) ; } return new zombie job producer ( new path ( trace in ) , null , conf ) ; }


int get port number ( ) { return server info component get port number ( ) ; }


sets the remote root log dir suffix class variable extracting { @ link yarn configuration # log aggregation remote app log dir suffix fmt } from the configuration , or { @ link yarn configuration # nm remote app log dir suffix } appended by the file controller ' s name , if the former is not set

private void extract remote root log dir suffix ( ) { string suffix = string format ( yarn configuration log aggregation remote app log dir suffix fmt , file controller name ) ; remote root log dir suffix = conf get ( suffix ) ; if ( remote root log dir suffix = = null | | remote root log dir suffix is empty ( ) ) { remote root log dir suffix = conf get ( yarn configuration nm remote app log dir suffix , yarn configuration default nm remote app log dir suffix ) + " - " + file controller name to lower case ( ) ; } }


public void capital camel test ( ) { / / todo : test capital camel }


returns the current type of link target set

public link target type get link target type ( ) { return link target type ; }


append a new record at the next sequential offset

public long append ( simple record record ) { return append with offset ( next sequential offset ( ) , record ) ; }


create label symbol giving preference to non - global symbols an existing function symbol may be returned if attempting to create a global symbol and the name already exists at the address no symbol will be created and null will be returned if attempting to create a non - global symbol , which does not exist , and a global symbol does exist with same name its namespace will be changed

public static symbol create preferred label or function symbol ( program program , address address , namespace namespace , string name , source type source ) throws invalid input exception { try { if ( ! address is memory address ( ) ) { throw new illegal argument exception ( " expected memory address " ) ; } if ( namespace = = null ) { namespace = program get global namespace ( ) ; } symbol table symbol table = program get symbol table ( ) ; / / check for symbol already existing at address symbol symbol = symbol table get symbol ( name , address , namespace ) ; if ( symbol ! = null ) { return symbol ; } if ( namespace is global ( ) ) { / / do not add global symbol if same name already exists at address for ( symbol s : program get symbol table ( ) get symbols ( address ) ) { if ( name equals ( s get name ( ) ) ) { return null ; } } } else { / / change namespace on global symbol with same name symbol = symbol table get global symbol ( name , address ) ; if ( symbol ! = null ) { symbol set namespace ( namespace ) ; return symbol ; } } / / create new symbol if needed return symbol table create label ( address , name , namespace , source ) ; } catch ( duplicate name exception | circular dependency exception e ) { throw new assert exception ( e ) ; } }


public void serialize snapshot ( output archive oa ) throws i o exception , interrupted exception { serialize utils serialize snapshot ( get data tree ( ) , oa , get session with time outs ( ) ) ; }


sets the path for writing execution statistics ( e g resource usage )

public command line builder set statistics path ( path statistics path ) { this statistics path = statistics path ; return this ; }


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

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


get the previous bucket item before provided timestamp

public window wrap < t > get previous window ( long time millis ) { if ( time millis < 0 ) { return null ; } int idx = calculate time idx ( time millis - window length in ms ) ; time millis = time millis - window length in ms ; window wrap < t > wrap = array get ( idx ) ; if ( wrap = = null | | is window deprecated ( wrap ) ) { return null ; } if ( wrap window start ( ) + window length in ms < ( time millis ) ) { return null ; } return wrap ; }


returns the path to the blaze bazel server info log

public static optional < string > get server log path ( ) throws i o exception { return log handler querier get configured instance ( ) get logger file path ( logger ) map ( path : : to absolute path ) map ( object : : to string ) ; }


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


sets whether to pause playback at the end of each media item this means the player will pause at the end of each window in the current { @ link # get current timeline ( ) timeline } listeners will be informed by a call to { @ link player event listener # on play when ready changed ( boolean , int ) } with the reason { @ link player # play when ready change reason end of media item } when this happens

public builder set pause at end of media items ( boolean pause at end of media items ) { assertions check state ( ! build called ) ; this pause at end of media items = pause at end of media items ; return this ; }


exhausts request line and headers of http request

static void read http request ( input stream stream ) throws i o exception { read http request ( stream , new hash map < string , string > ( ) ) ; }


extract a unique bean for the given type from the given map of matching beans

private static < t > t unique bean ( class < t > type , map < string , t > matching beans ) { int count = matching beans size ( ) ; if ( count = = 1 ) { return matching beans values ( ) iterator ( ) next ( ) ; } else if ( count > 1 ) { throw new no unique bean definition exception ( type , matching beans key set ( ) ) ; } else { throw new no such bean definition exception ( type ) ; } }


sets whether image loader will consider exif parameters of jpeg image ( rotate , flip )

public builder consider exif params ( boolean consider exif params ) { this consider exif params = consider exif params ; return this ; }


must override so it doesn ' t return an instance of the base { @ link table cell renderer } , which will override our changes in the { @ link instruction table cell renderer }

public table cell renderer get default renderer ( class < ? > column class ) { return renderer ; }


locates the function based on the location given at construction time

public static undefined function find function ( program program , address address , task monitor monitor ) { if ( program = = null | | address = = null ) { return null ; } if ( monitor is cancelled ( ) ) { return null ; } / / first try to walk back up to the top of the function undefined function function = find function using simple block model ( program , address , monitor ) ; if ( function ! = null ) { return function ; } return find function using isolated block model ( program , address , monitor ) ; }


return the originating bean definition , or { @ code null } if none allows for retrieving the decorated bean definition , if any note that this method returns the immediate originator iterate through the originator chain to find the original bean definition as defined by the user

public bean definition get originating bean definition ( ) { return ( this resource instanceof bean definition resource ? ( ( bean definition resource ) this resource ) get bean definition ( ) : null ) ; }


derives options to use in dex file merger actions from the given context and dx flags , where the latter typically come from a { @ code dexopts } attribute on a top - level target

static immutable set < string > merger dexopts ( rule context rule context , iterable < string > tokenized dexopts ) { / / we don ' t need an ordered set but might as well note we don ' t need to worry about coverage / / builds since the merger doesn ' t use - - no - locals return normalize dexopts ( iterables filter ( tokenized dexopts , new flag matcher ( get android config ( rule context ) get dexopts supported in dex merger ( ) ) ) ) ; }


looks up the currently running build , if known while most { @ link run } implementations do add a { @ link run execution } to the stack for the duration of the build , those which have a different implementation of { @ link run # run } ( or which do additional work after { @ link run # execute } completes ) may not consistently or ever keep an execution on the stack in such cases this method will return null , meaning that { @ link check point # block ( build listener , string ) } and { @ link check point # report } will do nothing

synchronized @ check for null run execution peek ( ) { executor e = executor current executor ( ) ; if ( e ! = null ) { stack < run execution > s = stack get ( e ) ; if ( s ! = null & & ! s is empty ( ) ) { return s peek ( ) ; } } return null ; }


loads finished missions from the data source

private array list < finished mission > load finished missions ( ) { array list < finished mission > finished missions = m finished mission store load finished missions ( ) ; / / check if the files exists , otherwise , forget the download for ( int i = finished missions size ( ) - 1 ; i > = 0 ; i - - ) { finished mission mission = finished missions get ( i ) ; if ( ! mission storage exists as file ( ) ) { if ( debug ) log d ( tag , " downloaded file removed : " + mission storage get name ( ) ) ; m finished mission store delete mission ( mission ) ; finished missions remove ( i ) ; } } return finished missions ; }


a string that is a 10 digit number can have leading zeros

public string get pattern with digits ( ) { return pattern with digits ; }


resolve the contextual object for the given key , if any e g the http servlet request object for key " request "

object resolve contextual object ( string key ) ;


public final int cursor ( ) { return cursor ; }


returns true if the text is clipped ( truncated )

public boolean is clipped ( ) { return is clipped ; }


public single < user > rx get user by name ( string username , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate get user by name ( username , auth info , fut ) ) ) ; }


gets the project metadata from memory requires that the metadata has already been loaded from the data store

public project metadata get project metadata ( string name ) { for ( project metadata pm : projects metadata values ( ) ) { if ( pm get name ( ) equals ( name ) ) { return pm ; } } return null ; }


register bean into application context t

public static < t > t register bean into application context ( final configurable application context application context , final t bean instance , final string bean id ) { val bean factory = application context get bean factory ( ) ; if ( bean factory contains bean ( bean id ) ) { return ( t ) application context get bean ( bean id , bean instance get class ( ) ) ; } bean factory initialize bean ( bean instance , bean id ) ; bean factory autowire bean ( bean instance ) ; bean factory register singleton ( bean id , bean instance ) ; return bean instance ; }


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


return the mask bit for " get mask pattern " at " x " and " y " see 8 8 of jisx0510 : 2004 for mask pattern conditions

static boolean get data mask bit ( int mask pattern , int x , int y ) { int intermediate ; int temp ; switch ( mask pattern ) { case 0 : intermediate = ( y + x ) & 0x 1 ; break ; case 1 : intermediate = y & 0x 1 ; break ; case 2 : intermediate = x % 3 ; break ; case 3 : intermediate = ( y + x ) % 3 ; break ; case 4 : intermediate = ( ( y / 2 ) + ( x / 3 ) ) & 0x 1 ; break ; case 5 : temp = y * x ; intermediate = ( temp & 0x 1 ) + ( temp % 3 ) ; break ; case 6 : temp = y * x ; intermediate = ( ( temp & 0x 1 ) + ( temp % 3 ) ) & 0x 1 ; break ; case 7 : temp = y * x ; intermediate = ( ( temp % 3 ) + ( ( y + x ) & 0x 1 ) ) & 0x 1 ; break ; default : throw new illegal argument exception ( " invalid mask pattern : " + mask pattern ) ; } return intermediate = = 0 ; }


this method must have the same result with jdk ' s string get bytes

public static byte [ ] encode u t f 8 ( string str ) { byte [ ] bytes = allocate reuse bytes ( str length ( ) * max bytes per char ) ; int len = encode u t f 8 ( str , bytes ) ; return arrays copy of ( bytes , len ) ; }


set the entity tag of the body , as specified by the { @ code e tag } header


validates latitude value is within standard + - 90 coordinate bounds

protected void check latitude ( double latitude ) { if ( double is na n ( latitude ) | | latitude < min lat incl | | latitude > max lat incl ) { throw new illegal argument exception ( " invalid latitude " + latitude + " ; must be between " + min lat incl + " and " + max lat incl ) ; } }


creates an appropriate javadoc depending on aspects of the type in question

static code block binding type docs ( type name type , boolean abstrakt , boolean members , boolean dependent ) { code block builder result = code block builder ( ) add ( " a { @ code binding < $ t > } implementation which satisfies \ n " , type ) add ( " dagger ' s infrastructure requirements including : \ n " ) ; if ( dependent ) { result add ( " \ n " ) add ( " owning the dependency links between { @ code $ t } and its \ n " , type ) add ( " dependencies \ n " ) ; } if ( ! abstrakt ) { result add ( " \ n " ) add ( " being a { @ code provider < $ t > } and handling creation and \ n " , type ) add ( " preparation of object instances \ n " ) ; } if ( members ) { result add ( " \ n " ) add ( " being a { @ code members injector < $ t > } and handling injection \ n " , type ) add ( " of annotated fields \ n " ) ; } return result build ( ) ; }


private dynamic i o statistics active instance ( ) { check state ( instance ! = null , " already built " ) ; return instance ; }


return whether this cache manager accepts and converts { @ code null } values for all of its caches

public boolean is allow null values ( ) { return this allow null values ; }


given a prefix , find solutions under it

public int solve ( int [ ] prefix , solution acceptor < column name > output ) { list < node < column name > > choices = new array list < node < column name > > ( ) ; for ( int i = 0 ; i < prefix length ; + + i ) { choices add ( advance ( prefix [ i ] ) ) ; } int result = search ( choices , output ) ; for ( int i = prefix length - 1 ; i > = 0 ; - - i ) { rollback ( choices get ( i ) ) ; } return result ; }


rounds { @ code n } up to the nearest multiple of { @ code k }

private static long round up to nearest ( long n , int k ) { return ( ( n + k - 1 ) / k ) * k ; }


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


the parameter value from the specified registry { @ link url }

public string get value ( url registry u r l ) { return registry u r l get parameter ( name , default value ) ; }


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


configure the default { @ code mime type } for payload data if the { @ code setup } frame did not specify one by default this is set to { @ code " messagex rsocket composite - metadata v 0 " }

public void set default metadata mime type ( mime type mime type ) { assert not null ( mime type , " ' metadata mime type ' is required " ) ; this default metadata mime type = mime type ; }


called to process media key events any { @ link key event } can be passed but only media key events will be handled

public boolean dispatch media key event ( key event event ) { int key code = event get key code ( ) ; @ nullable player player = this player ; if ( player = = null | | ! is handled media key ( key code ) ) { return false ; } if ( event get action ( ) = = key event action down ) { if ( key code = = key event keycode media fast forward ) { if ( player get playback state ( ) ! = player state ended ) { control dispatcher dispatch fast forward ( player ) ; } } else if ( key code = = key event keycode media rewind ) { control dispatcher dispatch rewind ( player ) ; } else if ( event get repeat count ( ) = = 0 ) { switch ( key code ) { case key event keycode media play pause : case key event keycode headsethook : dispatch play pause ( player ) ; break ; case key event keycode media play : dispatch play ( player ) ; break ; case key event keycode media pause : dispatch pause ( player ) ; break ; case key event keycode media next : control dispatcher dispatch next ( player ) ; break ; case key event keycode media previous : control dispatcher dispatch previous ( player ) ; break ; default : break ; } } } return true ; }


update an existing pet ( asynchronously )

public okhttp 3 call update pet async ( pet body , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = update pet validate before call ( body , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


specifies the types for the csv fields this method parses the csv data to a 1 - tuple which has fields of the specified types this method is overloaded for each possible length of the tuples to support type safe creation of data sets through csv parsing

public < t0 > data source < tuple 1 < t0 > > types ( class < t0 > type 0 ) { tuple type info < tuple 1 < t0 > > types = tuple type info get basic and basic value tuple type info ( type 0 ) ; csv input format < tuple 1 < t0 > > input format = new tuple csv input format < tuple 1 < t0 > > ( path , types , this included mask ) ; configure input format ( input format ) ; return new data source < tuple 1 < t0 > > ( execution context , input format , types , utils get call location name ( ) ) ; }


initializes the dns record type to descriptor mapping based on the provided service record

@ override public void init type to info mapping ( service record service record ) throws exception { if ( service record external is empty ( ) ) { log info ( service record description + " : no external endpoints defined " ) ; return ; } for ( int type : get record types ( ) ) { switch ( type ) { case type a : create a info ( service record ) ; break ; case type aaaa : create a a a a info ( service record ) ; break ; case type txt : create t x t info ( service record ) ; break ; case type cname : create c n a m e info ( service record ) ; break ; case type srv : create s r v info ( service record ) ; break ; default : throw new illegal argument exception ( " unknown type " + type ) ; } } }


verify if the health value is set properly though the constructor and setter

public void test set health ( ) { final var model = new giant model ( health healthy , fatigue alert , nourishment saturated ) ; assert equals ( health healthy , model get health ( ) ) ; var message format = " the giant looks % s , alert and saturated " ; for ( final var health : health values ( ) ) { model set health ( health ) ; assert equals ( health , model get health ( ) ) ; assert equals ( string format ( message format , health ) , model to string ( ) ) ; } }


protected void on refresh ( ) { this theme source = ui application context utils init theme source ( this ) ; }


overridden version of { @ code update } that adds the given statement parameters to the queue rather than executing them immediately all other { @ code update } methods of the sql update base class go through this method and will thus behave similarly you need to call { @ code flush } to actually execute the batch if the specified batch size is reached , an implicit flush will happen ; you still need to finally call { @ code flush } to flush all statements

public int update ( object params ) throws data access exception { validate parameters ( params ) ; this parameter queue add ( params clone ( ) ) ; if ( this parameter queue size ( ) = = this batch size ) { if ( logger is debug enabled ( ) ) { logger debug ( " triggering auto - flush because queue reached batch size of " + this batch size ) ; } flush ( ) ; } return - 1 ; }


set the key of an { @ link application context } reference to expose in the scheduler context , for example " application context " default is none only applicable when running in a spring application context note : when using persistent jobs whose job detail will be kept in the database , do not put an application context reference into the job data map but rather into the scheduler context in case of a quartz job bean , the reference will be applied to the job instance as bean property an " application context " attribute will correspond to a " set application context " method in that scenario note that bean factory callback interfaces like application context aware are not automatically applied to quartz job instances , because quartz itself is responsible for the lifecycle of its jobs

public void set application context scheduler context key ( string application context scheduler context key ) { this application context scheduler context key = application context scheduler context key ; }


see original { @ link stubber # when ( object ) }


public static tree node transfer get instance ( ) { return instance ; }


@ api note this method returns a cached index table that is ordered in a certain order

public optional < indexed table > get indexed table ( string table name , double scale factor , set < string > index column names ) { tpch scaled table table = new tpch scaled table ( table name , scale factor ) ; set < tpch scaled column > index columns = index column names stream ( ) map ( name - > new tpch scaled column ( table , name ) ) collect ( to immutable set ( ) ) ; return optional of nullable ( indexed tables get ( index columns ) ) ; }


trigger a new checkpoint on the task of this execution

public void trigger synchronous savepoint ( long checkpoint id , long timestamp , checkpoint options checkpoint options , boolean advance to end of event time ) { trigger checkpoint helper ( checkpoint id , timestamp , checkpoint options , advance to end of event time ) ; }


initial de select fields with unselected fields

public void init fields ( set < string > unselected fields ) { if ( unselected fields = = null ) { return ; } for ( string field : unselected fields ) { if ( ! field trim ( ) is empty ( ) ) { string [ ] literals array = field split ( " , " ) ; for ( string literals : literals array ) { if ( literals ! = null & & ! literals trim ( ) is empty ( ) ) { de select type type = de select type obtain type ( literals ) ; if ( type = = null ) { log warn ( " invalid de selects string " + literals trim ( ) ) ; de select type [ ] type array = de select type values ( ) ; string all suppport literals = arrays to string ( type array ) ; throw new bad request exception ( " invalid de selects string " + literals trim ( ) + " specified it should be one of " + all suppport literals ) ; } else { this types add ( type ) ; } } } } } }


tests if any view hierarchy under the root has the given content description

public view tree assert has content description ( final int resource id ) { return has content description ( runtime environment application get resources ( ) get string ( resource id ) ) ; }


returns the position offset in the first unplayed ad at which to begin playback , in microseconds

public long get ad resume position us ( ) { return ad playback state ad resume position us ; }


checks if the given file can be created on posix , this corresponds to the ' w ' permission of the parent directory

public boolean create ( file f ) throws security exception { return false ; }


the set of arityplural mappings < code > repeated aapt pb plural entry entry = 1 ; < code >

public builder set entry ( int index , com android aapt resources plural entry builder builder for value ) { copy on write ( ) ; instance set entry ( index , builder for value ) ; return this ; }


public void update n clob ( string column label , reader reader , long length ) throws s q l exception { }


returns the first node in the tree that is in range

private @ nullable avl node < e > first node ( ) { avl node < e > root = root reference get ( ) ; if ( root = = null ) { return null ; } avl node < e > node ; if ( range has lower bound ( ) ) { e endpoint = range get lower endpoint ( ) ; node = root reference get ( ) ceiling ( comparator ( ) , endpoint ) ; if ( node = = null ) { return null ; } if ( range get lower bound type ( ) = = bound type open & & comparator ( ) compare ( endpoint , node get element ( ) ) = = 0 ) { node = node succ ; } } else { node = header succ ; } return ( node = = header | | ! range contains ( node get element ( ) ) ) ? null : node ; }


waits for the all the services to reach a terminal state for no more than the given time after this method returns all services will either be { @ linkplain service state # terminated terminated } or { @ linkplain service state # failed failed }

public void await stopped ( long timeout , time unit unit ) throws timeout exception { state await stopped ( timeout , unit ) ; }


replace an existing value with a new value ; updates the element list and the hash table , but not the key as that has not changed

public t set ( int i , t value ) { t old element = elements get ( i ) ; elements set ( i , value ) ; / / update list super remove ( old element ) ; / / now update the set : remove / add super add ( value ) ; return old element ; }


tests that server certificate with invalid host name is accepted by a client that has disabled endpoint validation

public void test endpoint identification disabled ( args args ) throws exception { args server cert stores = cert builder ( true , " server " , args use inline pem ) add host name ( " notahost " ) build ( ) ; args client cert stores = cert builder ( false , " client " , args use inline pem ) add host name ( " localhost " ) build ( ) ; args ssl server configs = args get trusting config ( args server cert stores , args client cert stores ) ; args ssl client configs = args get trusting config ( args client cert stores , args server cert stores ) ; server = create echo server ( args , security protocol ssl ) ; inet socket address addr = new inet socket address ( " localhost " , server port ( ) ) ; / / disable endpoint validation , connection should succeed string node = " 1 " ; args ssl client configs put ( ssl configs ssl endpoint identification algorithm config , " " ) ; create selector ( args ssl client configs ) ; selector connect ( node , addr , buffer size , buffer size ) ; network test utils check client connection ( selector , node , 100 , 10 ) ; / / disable endpoint validation using null value , connection should succeed string node 2 = " 2 " ; args ssl client configs put ( ssl configs ssl endpoint identification algorithm config , null ) ; create selector ( args ssl client configs ) ; selector connect ( node 2 , addr , buffer size , buffer size ) ; network test utils check client connection ( selector , node 2 , 100 , 10 ) ; / / connection should fail with endpoint validation enabled string node 3 = " 3 " ; args ssl client configs put ( ssl configs ssl endpoint identification algorithm config , " https " ) ; create selector ( args ssl client configs ) ; selector connect ( node 3 , addr , buffer size , buffer size ) ; network test utils wait for channel close ( selector , node 3 , channel state state authentication failed ) ; selector close ( ) ; }


this creates a dt from a set of credentials , then verifies that you can use the round - tripped credentials as a source of authentication for another dt binding , and when that is asked for a dt token , the secrets it returns are the same as the original that is different from dt propagation , as here the propagation is by setting the fs s 3a sessionsecretid keys from the marshalled values , and using session token auth this verifies that session token authentication can be used for dt credential auth , and that new tokens aren ' t created from a testing perspective , this is not as " good " as having separate tests , but given the effort to create session tokens is all hidden in the first fs , it is actually easier to write and now forms an extra test on those generated tokens as well as the marshalling

public void test create and use d t ( ) throws throwable { describe ( " create a delegation token , round trip then reuse " ) ; final s 3 a file system fs = get file system ( ) ; final configuration conf = fs get conf ( ) ; assert null ( " current user has delegation token " , delegation tokens select token from f s owner ( ) ) ; encryption secrets secrets = new encryption secrets ( s 3 a encryption methods sse kms , kms key ) ; token < abstract s 3 a token identifier > original d t = delegation tokens create delegation token ( secrets , null ) ; assert equals ( " token kind mismatch " , get token kind ( ) , original d t get kind ( ) ) ; / / decode to get the binding info session token identifier issued = require non null ( ( session token identifier ) original d t decode identifier ( ) , ( ) - > " no identifier in " + original d t ) ; issued validate ( ) ; final marshalled credentials creds ; try ( s 3 a delegation tokens dt 2 = instantiate d t support ( get configuration ( ) ) ) { dt 2 start ( ) ; dt 2 reset token binding to d t ( original d t ) ; final a w s session credentials aws session creds = verify session credentials ( dt 2 get credential providers ( ) get credentials ( ) ) ; final marshalled credentials orig creds = from a w s credentials ( aws session creds ) ; token < abstract s 3 a token identifier > bound d t = dt 2 get bound or new d t ( secrets , null ) ; assert equals ( " delegation tokens " , original d t , bound d t ) ; / / simulate marshall and transmission creds = round trip ( orig creds , conf ) ; session token identifier reissued = ( session token identifier ) dt 2 create delegation token ( secrets , null ) decode identifier ( ) ; reissued validate ( ) ; string user agent field = dt 2 get user agent field ( ) ; assert that ( " ua field does not contain uuid " , user agent field , matchers contains string ( issued get uuid ( ) ) ) ; } / / now use those chained credentials to create a new fs instance / / and then get a session dt from it and expect equality verify credential propagation ( fs , creds , new configuration ( conf ) ) ; }


enables the " apply percentage filter " and " clear percentage filter " buttons

public void enable percentage filter buttons ( boolean enable ) { if ( apply percentage filter button ! = null ) { apply percentage filter button set enabled ( enable ) ; } if ( clear percentage filter button ! = null ) { clear percentage filter button set enabled ( enable ) ; } return ; }


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

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


t handle ( server request request ) throws exception ;


the string value is this class name and the string values of nested providers

public string to string ( ) { return " a w s credential provider list [ " + name + " refcount = " + ref count get ( ) + " : [ " + string utils join ( providers , " , " ) + ' ] ' + ( last provider ! = null ? ( " last provider : " + last provider ) : " " ) ; }


void delete reference ( program program , reference ref ) { remove reference cmd cmd = new remove reference cmd ( ref ) ; tool execute ( cmd , program ) ; }


< code > get differences < code > is used to determine the addresses where there are differences between two programs using the current filter this method only indicates that there is a difference at the address , not what type of difference it is possible differences are : the actual bytes at an address , comments , labels , code units , references , equates , properties , and program context register values

synchronized public address set view get differences ( task monitor monitor ) throws cancelled exception { return get differences ( pdf , monitor ) ; }


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

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case executor info : return is set executor info ( ) ; case component id : return is set component id ( ) ; case host : return is set host ( ) ; case port : return is set port ( ) ; case uptime secs : return is set uptime secs ( ) ; case stats : return is set stats ( ) ; } throw new illegal state exception ( ) ; }


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

public void update user ( string username , user body ) { / / todo : implement }


public string get name ( ) { return name ; }


removes and returns the item at the specified index

public float remove index ( int index ) { if ( index > = size ) throw new index out of bounds exception ( " index can ' t be > = size : " + index + " > = " + size ) ; float [ ] items = this items ; float value = items [ index ] ; size - - ; if ( ordered ) system arraycopy ( items , index + 1 , items , index , size - index ) ; else items [ index ] = items [ size ] ; return value ; }


public string get mnemonic representation ( code unit cu ) { string buffer string buffer = new string buffer ( ) ; string mnemonic = cu get mnemonic string ( ) ; if ( options show data mutability & & ( cu instanceof data ) & & mnemonic ! = null ) { data d = ( data ) cu ; if ( d is constant ( ) ) { string buffer append ( " const " ) ; } else if ( d is volatile ( ) ) { string buffer append ( " volatile " ) ; } } string buffer append ( mnemonic ) ; return string buffer to string ( ) ; }


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


set this to true to enable zooming in by double - tap on the chart default : enabled

public void set double tap to zoom enabled ( boolean enabled ) { m double tap to zoom enabled = enabled ; }


public final boolean is private ( ) { return modifier is private ( get modifiers ( ) ) ; }


performs subroutine inlining of the given program class pool

public void execute ( class pool program class pool ) { / / clean up any old visitor info program class pool classes accept ( new class cleaner ( ) ) ; / / inline all subroutines class visitor inliner = new all method visitor ( new all attribute visitor ( new code subroutine inliner ( ) ) ) ; / / in java standard edition , only class files from java 6 or higher / / should be preverified if ( ! configuration micro edition ) { inliner = new class version filter ( class constants class version 1 6 , inliner ) ; } program class pool classes accept ( inliner ) ; }


public void test outer enum integer ( ) { / / todo : test outer enum integer }


public void update user test ( ) throws exception { string username = cache get string ( " / update user / username " ) ; user body = cache get object ( " / update user / body " , user class ) ; api update user ( username , body ) ; }


clean up state associated with the connection and close it any exception arising from closing the connection are propagated

public void clear connection ( ) { if ( logger is debug enabled ( ) ) { logger debug ( " cleaning up connection state for session " + this session id ) ; } if ( this is remote client session ) { stomp broker relay message handler this connection handlers remove ( this session id ) ; } this is stomp connected = false ; tcp connection < byte [ ] > conn = this tcp connection ; this tcp connection = null ; if ( conn ! = null ) { if ( logger is debug enabled ( ) ) { logger debug ( " closing tcp connection in session " + this session id ) ; } conn close ( ) ; } }


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


this test validates the correctness of { @ link r m web service protocol # get app statistics ( ) } inside router

public void test app statistics x m l ( ) throws exception { submit application ( ) ; list < application statistics info > responses = perform get calls ( rm web service path + app statistics , application statistics info class , states , " running " ) ; application statistics info router response = responses get ( 0 ) ; application statistics info rm response = responses get ( 1 ) ; assert not null ( router response ) ; assert not null ( rm response ) ; assert equals ( rm response get stat items ( ) size ( ) , router response get stat items ( ) size ( ) ) ; }


updates an existing { @ link reservation allocation } in the plan this is required for re - negotiation

boolean update reservation ( reservation allocation reservation ) throws planning exception ;


get the index field associated with the specified encoded field type

static index field get index field ( byte field type ) throws unsupported field exception { field indexed field = field get field ( ( byte ) ( field type & field type mask ) ) ; byte primary key feld type = ( byte ) ( field type > > index field type shift & field type mask ) ; if ( primary key feld type = = field reserved 15 type ) { / / 0xf 0 0xff - reserved for schema use throw new unsupported field exception ( field type ) ; } if ( primary key feld type = = legacy index long type ) { return new legacy index field ( indexed field ) ; } field primary key type = field get field ( primary key feld type ) ; return new index field ( indexed field , primary key type ) ; }


< code > optional uint 3 2 line number = 1 ; < code >

public builder set line number ( int value ) { copy on write ( ) ; instance set line number ( value ) ; return this ; }


checks whether all of the data buffers allocated by this factory have also been released if not , then an { @ link assertion error } is thrown typically used from a j unit after method

public void check for leaks ( ) { this track created set ( false ) ; instant start = instant now ( ) ; while ( true ) { if ( this created stream ( ) none match ( leak aware data buffer : : is allocated ) ) { return ; } if ( instant now ( ) is before ( start plus ( duration of seconds ( 5 ) ) ) ) { try { thread sleep ( 50 ) ; } catch ( interrupted exception ex ) { / / ignore } continue ; } list < assertion error > errors = this created stream ( ) filter ( leak aware data buffer : : is allocated ) map ( leak aware data buffer : : leak error ) collect ( collectors to list ( ) ) ; errors for each ( it - > logger error ( " leaked error : " , it ) ) ; throw new assertion error ( errors size ( ) + " buffer leaks detected ( see logs above ) " ) ; } }


same as { @ link application # on trim memory ( int level ) }


returns the number of { @ link data } objects for the current action context


return the { @ link string } representation of this category path including the category name , where components are delimited with a forward slash any component that contains a forward slash will be have the forward slash characters escaped

public string get path ( ) { if ( is root ( ) ) { return delimiter string ; } if ( parent is root ( ) ) { return delimiter char + escape string ( name ) ; } return parent get path ( ) + delimiter char + escape string ( name ) ; }


converts the given object into a string representation by calling { @ link object # to string ( ) } and formatting ( possibly nested ) arrays and { @ code null } see { @ link arrays # deep to string ( object [ ] ) } for more information about the used format

public static string array aware to string ( object o ) { final string array string = arrays deep to string ( new object [ ] { o } ) ; return array string substring ( 1 , array string length ( ) - 1 ) ; }


< code > optional bytes data = 1 ; < code >

com google protobuf byte string get data ( ) ;


public long execute large update ( string sql , int auto generated keys ) throws s q l exception { connection mark commit state dirty ( ) ; return delegate execute large update ( sql , auto generated keys ) ; }


default visit implementation returns { @ code null }

protected v visit other ( ) { return null ; }


get a scanner that covers a portion of t file based on byte offsets

public scanner create scanner by byte range ( long offset , long length ) throws i o exception { return new scanner ( this , offset , offset + length ) ; }


public int get highlight thickness ( ) { return highlight thickness ; }


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


public static void main ( string [ ] args ) { try { logger info ( " start frame - based game loop : " ) ; var frame based game loop = new frame based game loop ( ) ; frame based game loop run ( ) ; thread sleep ( game loop duration time ) ; frame based game loop stop ( ) ; logger info ( " stop frame - based game loop " ) ; logger info ( " start variable - step game loop : " ) ; var variable step game loop = new variable step game loop ( ) ; variable step game loop run ( ) ; thread sleep ( game loop duration time ) ; variable step game loop stop ( ) ; logger info ( " stop variable - step game loop " ) ; logger info ( " start fixed - step game loop : " ) ; var fixed step game loop = new fixed step game loop ( ) ; fixed step game loop run ( ) ; thread sleep ( game loop duration time ) ; fixed step game loop stop ( ) ; logger info ( " stop variable - step game loop " ) ; } catch ( interrupted exception e ) { logger error ( e get message ( ) ) ; } }


like assert not equals , but fails at the end of the test ( during tear down )

public void verify not equals ( object s 1 , object s 2 ) { stb verify not equals ( s 1 , s 2 ) ; }


creates handling mode for null key map data see { @ link # json map null key mode fail } , { @ link # json map null key mode drop } , and { @ link # json map null key mode literal } for more information

public static map null key mode get map null key mode ( readable config config ) { string map null key mode = config get ( map null key mode ) ; switch ( map null key mode to upper case ( ) ) { case json map null key mode fail : return map null key mode fail ; case json map null key mode drop : return map null key mode drop ; case json map null key mode literal : return map null key mode literal ; default : throw new table exception ( string format ( " unsupported map null key handling mode ' % s ' validator should have checked that " , map null key mode ) ) ; } }


return the super class of the specified { @ link element } or null if this { @ code element } represents { @ link object }

public element get super class ( element element ) { list < ? extends type mirror > super types = this types direct supertypes ( element as type ( ) ) ; if ( super types is empty ( ) ) { return null ; / / reached java lang object } return this types as element ( super types get ( 0 ) ) ; }


post fakeouterboolean test serialization of outer boolean types

default completable future < response entity < boolean > > fake outer boolean serialize ( @ api param ( value = " input boolean as post body " ) @ valid @ request body ( required = false ) boolean body ) { return completable future completed future ( new response entity < > ( http status not implemented ) ) ; }


public result matcher attribute ( string name , @ nullable object value ) { return result - > { model and view mav = get model and view ( result ) ; assert equals ( " model attribute ' " + name + " ' " , value , mav get model ( ) get ( name ) ) ; } ; }


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


test that giving a null ' safe chars ' string causes a { @ link null pointer exception }

public void test bad arguments null ( ) { try { new percent escaper ( null , false ) ; fail ( " expected null pointer exception for null parameter " ) ; } catch ( null pointer exception expected ) { / / pass } }


private void init java home save file ( file install dir ) throws file not found exception { boolean is dev = new file ( install dir , " build gradle " ) is file ( ) ; / / ensure there is a user home directory ( there definitely should be ) string user home dir path = system get property ( " user home " ) ; if ( user home dir path = = null | | user home dir path is empty ( ) ) { throw new file not found exception ( " user home directory is not known " ) ; } file user home dir = new file ( user home dir path ) ; if ( ! user home dir is directory ( ) ) { throw new file not found exception ( " user home directory does not exist : " + user home dir ) ; } / / get the java home save file from user home directory ( it might not exist yet ) file user settings parent dir = new file ( user home dir , " " + application name replace all ( " \ \ s " , " " ) to lower case ( ) ) ; string user settings dir name = user settings parent dir get name ( ) + " " + application version + " " + application release name replace all ( " \ \ s " , " " ) to upper case ( ) ; if ( is dev ) { user settings dir name + = " location " + install dir get parent file ( ) get name ( ) ; } file user settings dir = new file ( user settings parent dir , user settings dir name ) ; java home save file = new file ( user settings dir , java home save name ) ; }


< code > required uint 3 2 year = 1 ; < code >


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


get the maximum capacity for running map tasks in the cluster

public int get max map tasks ( ) { return max map tasks ; }


sorts the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive in descending order

public static void sort descending ( short [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; arrays sort ( array , from index , to index ) ; reverse ( array , from index , to index ) ; }


write all buffered ops to disk and fsync file note : any exception during the sync process will be interpreted as a tragic exception and the writer will be closed before raising the exception

public void sync ( ) throws i o exception { sync up to ( long max value ) ; }


gets the remaining delay for allocating the replica shard when a node holding the replica left the cluster and the deciders are waiting to see if the node returns before allocating the replica elsewhere only returns a meaningful positive value if { @ link # get allocation status ( ) } returns { @ link allocation status # delayed allocation } if { @ link # is decision taken ( ) } returns { @ code false } , then invoking this method will throw an { @ code illegal state exception }

public long get remaining delay in millis ( ) { check decision state ( ) ; return remaining delay in millis ; }


public long get succeeded max elapsed ( ) { return succeeded max elapsed get ( ) ; }


get the current item index the first item has the index 0


creates a new { @ link client stream tracer factory } with provided { @ link orca per request report listener } installed to receive callback when a per - request orca report is received example usages : delegating policy ( e g , x d s ) { @ code class xds picker extends subchannel picker { public pick result pick subchannel ( pick subchannel args args ) { subchannel picker per locality picker = locality picking logic result result = per locality picker pick subchannel ( args ) ; return pick result with subchannel ( result get subchannel ( ) , orca per request report util get instance ( ) new orca client tracer factory ( result get stream tracer factory ( ) , listener ) ) ; } } } delegating policy with additional tracing logic { @ code class wrapping picker extends subchannel picker { public pick result pick subchannel ( pick subchannel args args ) { result result = delegate pick subchannel ( args ) ; return pick result with subchannel ( result get subchannel ( ) , new client stream tracer factory ( ) { public client stream tracer new client stream tracer ( stream info info , metadata metadata ) { client stream tracer factory orca tracer factory = orca per request report util get instance ( ) new orca client stream tracer factory ( result get stream tracer factory ( ) , listener ) ; wrap the tracer from the delegate factory if you need to trace the stream for your own final client stream tracer orca tracer = orca tracer factory new client stream tracer ( info , metadata ) ; return forwarding client stream tracer ( ) { protected client stream tracer delegate ( ) { return orca tracer ; } public void inbound message ( int seq no ) { handle this event } } ; } } ) ; } } }

public abstract client stream tracer factory new orca client stream tracer factory ( client stream tracer factory delegate , orca per request report listener listener ) ;


read bytes from the given position in the stream to the given buffer

public int read ( long position , byte [ ] buffer , int offset , int length ) throws i o exception { return ( ( positioned readable ) in ) read ( position , buffer , offset , length ) ; }


return the number of milliseconds to wait , based on the connection state and the throttle time , before attempting to send data if the connection has been established but being throttled , return throttle delay otherwise , return connection delay

long poll delay ms ( node node , long now ) ;


creates a table using the specified table metadata

default void create table ( connector session session , connector table metadata table metadata , boolean ignore existing ) { throw new presto exception ( not supported , " this connector does not support creating tables " ) ; }


read rest of packet string from byte buffers and return bytes

public byte [ ] read string e o f by bytes ( ) { byte [ ] result = new byte [ byte buf readable bytes ( ) ] ; byte buf read bytes ( result ) ; return result ; }


returns the x position of the given column takes into account scroll position

private int get column header x position ( @ not null grid column column ) { int x = 0 ; x - = get h scroll selection in pixels ( ) ; if ( row header visible ) { x + = row header width ; } column = column get first leaf ( ) ; for ( grid column column 2 : columns ) { if ( column 2 = = column ) { break ; } x + = column 2 get width ( ) ; } return x ; }


returns an array containing all direct xref addresses to the specified code unit

public final static address [ ] get x ref list ( code unit cu ) { return get x ref list ( cu , - 1 ) ; / / get all }


test if configuring a router to monitor particular namenodes actually takes effect

private void test config ( collection < string > expected n ns , string conf ns ids ) { / / setup and start the router configuration conf = get namenodes config ( ) ; configuration router conf = new router config builder ( conf ) heartbeat ( true ) build ( ) ; router conf set ( r b f config keys dfs router rpc address key , " 0 0 0 0 : 0 " ) ; router conf set ( r b f config keys dfs router monitor namenode , conf ns ids ) ; router = new router ( ) ; router init ( router conf ) ; / / test the heartbeat services of the router collection < namenode heartbeat service > heartbeat services = router get namenode heartbeat services ( ) ; assert namenode heartbeat service ( expected n ns , heartbeat services ) ; }


encodes bing tile as a 64 - bit long : version ( 5 bits ) , 0 ( 4 bits ) , x ( 23 bits ) , zoom ( 5 bits ) , 0 ( 4 bits ) , y ( 23 bits ) ( high bits left , low bits right ) this arrangement maximizes low - bit entropy for the java long hash function

public long encode ( ) { / / java ' s long hash function just x o rs itself right shifted 32 / / this is used for bucketing , so if you have 2 ^ k buckets , this only / / keeps the k lowest bits this puts the highest entropy bits / / ( finest resolution x and y bits ) in places that contribute to the / / low bits of the hash return ( ( ( long ) version < < version offset ) | y | ( ( long ) x < < 32 ) | ( ( long ) zoom level < < zoom offset ) ) ; }


runs the task in a background thread with the given monitor that cannot be null this is a special case for clients that already have a task monitor widget in their ui and they wish to let it show the progress of the given task while not blocking the swing thread

public void launch in background ( task monitor monitor ) { / / validate ( ) ; / / not needed since we are in the background objects require non null ( monitor ) ; background thread task launcher launcher = new background thread task launcher ( new task builder task ( false ) ) ; launcher run ( monitor ) ; }


whether the given object type is supported by this reader

boolean can read ( resolvable type element type , @ nullable media type media type ) ;


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


private path get src path ( string fed path ) throws i o exception { string address = get conf ( ) get trimmed ( r b f config keys dfs router admin address key , r b f config keys dfs router admin address default ) ; inet socket address router socket = net utils create socket addr ( address ) ; router client r client = new router client ( router socket , get conf ( ) ) ; try { mount table manager mount table = r client get mount table manager ( ) ; mount table entry = mount table procedure get mount entry ( fed path , mount table ) ; if ( entry = = null ) { throw new illegal argument exception ( " the mount point doesn ' t exist path = " + fed path ) ; } else if ( entry get destinations ( ) size ( ) > 1 ) { throw new illegal argument exception ( " the mount point has more than one destination path = " + fed path ) ; } else { string ns = entry get destinations ( ) get ( 0 ) get nameservice id ( ) ; string path = entry get destinations ( ) get ( 0 ) get dest ( ) ; return new path ( " hdfs : / / " + ns + path ) ; } } finally { r client close ( ) ; } }


extracts the first matching param in { @ code query params }

public string query param ( string name ) { list < string > values = query params get ( name ) ; return ( values = = null ) ? null : values get ( 0 ) ; }


creates a new { @ link thread } to process a multiplex request

public thread create response thread ( work request request ) { thread current thread = thread current thread ( ) ; return new thread ( ( ) - > { try { respond to request ( request ) ; } catch ( i o exception e ) { e print stack trace ( stderr ) ; / / in case of error , shut down the entire worker current thread interrupt ( ) ; } } , " multiplex - request - " + request get request id ( ) ) ; }


set of tls related options that govern the server ' s behavior use these options to control if all http requests should be redirected to https , and the tls modes to use < code > istio networking v 1alpha 3 server t l s options tls = 3 ; < code >

public builder set tls ( com alibaba nacos istio model server t l s options value ) { if ( tls builder = = null ) { if ( value = = null ) { throw new null pointer exception ( ) ; } tls = value ; on changed ( ) ; } else { tls builder set message ( value ) ; } return this ; }


returns a { @ link byte source } that reads from the given url

public static byte source as byte source ( url url ) { return new url byte source ( url ) ; }


add a bunch of subnets and i p ss to the file setup a low cache refresh test for inclusion check for exclusion remove a bunch of subnets and ips wait for cache timeout test for inclusion check for exclusion

public void test removal with sleep for cache timeout ( ) throws i o exception , interrupted exception { string [ ] ips = { " 10 119 103 112 " , " 10 221 102 0 / 23 " , " 10 222 0 0 / 16 " , " 10 113 221 221 " , " 10 113 221 222 " } ; test file based i p list create file with entries ( " ips txt " , ips ) ; cacheable i p list cipl = new cacheable i p list ( new file based i p list ( " ips txt " ) , 100 ) ; assert true ( " 10 113 221 222 is not in the list " , cipl is in ( " 10 113 221 222 " ) ) ; assert true ( " 10 222 103 121 is not in the list " , cipl is in ( " 10 222 103 121 " ) ) ; test file based i p list remove file ( " ips txt " ) ; string [ ] ips 2 = { " 10 119 103 112 " , " 10 221 102 0 / 23 " , " 10 113 221 221 " } ; test file based i p list create file with entries ( " ips txt " , ips 2 ) ; thread sleep ( 1005 ) ; assert false ( " 10 113 221 222 is in the list " , cipl is in ( " 10 113 221 222 " ) ) ; assert false ( " 10 222 103 121 is in the list " , cipl is in ( " 10 222 103 121 " ) ) ; test file based i p list remove file ( " ips txt " ) ; }


display info of each replica for replication block for striped block group , display info of each internal block

private string get replica info ( block info stored block ) { if ( ! ( show locations | | show racks | | show replica details | | show upgrade domains ) ) { return " " ; } final boolean is complete = stored block is complete ( ) ; iterator < datanode storage info > storages itr ; string builder sb = new string builder ( " [ " ) ; final boolean is striped = stored block is striped ( ) ; map < datanode storage info , long > storage 2 id = new hash map < > ( ) ; if ( is complete ) { if ( is striped ) { long block id = stored block get block id ( ) ; iterable < storage and block index > sis = ( ( block info striped ) stored block ) get storage and index infos ( ) ; for ( storage and block index si : sis ) { storage 2 id put ( si get storage ( ) , block id + si get block index ( ) ) ; } } storages itr = stored block get storage infos ( ) ; } else { storages itr = stored block get under construction feature ( ) get expected storage locations iterator ( ) ; } while ( storages itr has next ( ) ) { datanode storage info storage = storages itr next ( ) ; if ( is striped & & is complete ) { long index = storage 2 id get ( storage ) ; sb append ( " blk " + index + " : " ) ; } datanode descriptor dn desc = storage get datanode descriptor ( ) ; if ( show racks ) { sb append ( node base get path ( dn desc ) ) ; } else { sb append ( new datanode info with storage ( dn desc , storage get storage i d ( ) , storage get storage type ( ) ) ) ; } if ( show upgrade domains ) { string upgrade domain = ( dn desc get upgrade domain ( ) ! = null ) ? dn desc get upgrade domain ( ) : undefined ; sb append ( " ( ud = " + upgrade domain + " ) " ) ; } if ( show replica details ) { collection < datanode descriptor > corrupt replicas = block manager get corrupt replicas ( stored block ) ; sb append ( " ( " ) ; if ( dn desc is decommissioned ( ) ) { sb append ( " decommissioned ) " ) ; } else if ( dn desc is decommission in progress ( ) ) { sb append ( " decommissioning ) " ) ; } else if ( this show maintenance state & & dn desc is entering maintenance ( ) ) { sb append ( " entering maintenance ) " ) ; } else if ( this show maintenance state & & dn desc is in maintenance ( ) ) { sb append ( " in maintenance ) " ) ; } else if ( corrupt replicas ! = null & & corrupt replicas contains ( dn desc ) ) { sb append ( " corrupt ) " ) ; } else if ( block manager is excess ( dn desc , stored block ) ) { sb append ( " excess ) " ) ; } else if ( dn desc is stale ( this stale interval ) ) { sb append ( " stale node ) " ) ; } else if ( storage are block contents stale ( ) ) { sb append ( " stale block content ) " ) ; } else { sb append ( " live ) " ) ; } } if ( storages itr has next ( ) ) { sb append ( " , " ) ; } } sb append ( ' ] ' ) ; return sb to string ( ) ; }


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

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


extracts a version number from the given input stream , which should correspond to the output of a program ran with { @ code - - version } this drains the stream

public version t from input stream ( input stream input ) throws i o exception , parse exception { string first line = read first line and discard rest ( input ) ; if ( first line is empty ( ) ) { throw new parse exception ( " no data " ) ; } return parse ( first line ) ; }


gets the current generation stamp for this filesystem

public void set generation stamp ( long stamp ) { generation stamp set current value ( stamp ) ; }


delegates to the { @ link log # debug ( object ) } method of the underlying { @ link log } instance however , this form avoids superfluous object creation when the logger is disabled for level debug

public void debug ( string format , object arg a , object arg b ) { if ( logger is debug enabled ( ) ) { formatting tuple ft = message formatter format ( format , arg a , arg b ) ; logger debug ( ft get message ( ) , ft get throwable ( ) ) ; } }


public offset date time get ship date ( ) { return ship date ; }


extracts the nameindex of the replacement field that starts at the specified location

private string get field name ( char [ ] chars , int opening brace ) throws eval exception { string builder result = new string builder ( ) ; boolean found closing brace = false ; for ( int pos = opening brace + 1 ; pos < chars length ; + + pos ) { char current = chars [ pos ] ; if ( current = = ' } ' ) { found closing brace = true ; break ; } else { if ( current = = ' { ' ) { throw starlark errorf ( " nested replacement fields are not supported " ) ; } else if ( illegal in field contains ( current ) ) { throw starlark errorf ( " invalid character ' % s ' inside replacement field " , current ) ; } result append ( current ) ; } } if ( ! found closing brace ) { throw starlark errorf ( " found ' { ' without matching ' } ' " ) ; } return result to string ( ) ; }


returns the node identifier to be included in x d s requests

public node get node ( ) { return node ; }


creates a bitmap from encoded bytes supports jpeg but callers should use { @ link # decode j p e g from encoded image } for partial j p e gs in addition , a region to decode can be supplied in order to minimize memory usage note : not all platform decoders necessarily support supplying specific regions

closeable reference < bitmap > decode from encoded image with color space ( final encoded image encoded image , bitmap config bitmap config , @ nullable rect region to decode , @ nullable final color space color space ) ;


public static float read float l e ( byte [ ] arr , int offset ) { return float int bits to float ( read int l e ( arr , offset ) ) ; }


returns the { @ code k } least elements of the given iterable according to this ordering , in order from least to greatest if there are fewer than { @ code k } elements present , all will be included the implementation does not necessarily use a stable sorting algorithm ; when multiple elements are equivalent , it is undefined which will come first < b > java 8 users : < b > use { @ code streams stream ( iterable ) collect ( comparators least ( k , this comparator ) ) } instead

public < e extends t > list < e > least of ( iterable < e > iterable , int k ) { if ( iterable instanceof collection ) { collection < e > collection = ( collection < e > ) iterable ; if ( collection size ( ) < = 2l * k ) { / / in this case , just dumping the collection to an array and sorting is / / faster than using the implementation for iterator , which is / / specialized for k much smaller than n @ suppress warnings ( " unchecked " ) / / c only contains e ' s and doesn ' t escape e [ ] array = ( e [ ] ) collection to array ( ) ; arrays sort ( array , this ) ; if ( array length > k ) { array = arrays copy of ( array , k ) ; } return collections unmodifiable list ( arrays as list ( array ) ) ; } } return least of ( iterable iterator ( ) , k ) ; }


returns { @ code true } if we want to report missing members , { @ code false } otherwise

public boolean get check missing members ( ) { return check missing members ; }


returns a list of providers of the specified class , fetched from the given list of { @ link java info } s returns an empty list if no providers can be fetched returns a list of the same size as the given list if the requested providers are of type java compilation args provider

public static < t extends transitive info provider > immutable list < t > fetch providers from list ( iterable < java info > java providers , class < t > provider class ) { return stream providers ( java providers , provider class ) collect ( immutable list to immutable list ( ) ) ; }


matches resource requirements against available resources in a first round requirements are matched against free slot , and any match results in a slot allocation the remaining unfulfilled requirements are matched against pending slots , allocating more workers if no matching pending slot could be found if the requirements for a job could not be fulfilled then a notification is sent to the job master informing it as such performance notes : at it ' s core this method loops , for each job , over all freepending slots for each required slot , trying to find a matching slot one should generally go in with the assumption that this runs in number of jobs requiring resources number of required slots number of free or pending slots this is especially important when dealing with pending slots , as matches between requirements and pending slots are not persisted and recomputed on each call this may required further refinements in the future ; e g , persisting the matches between requirements and pending slots , or not matching against pending slots at all when dealing with unspecific resource profiles ( i e , { @ link resource profile # any } { @ link resource profile # unknown } ) , then the number of freepending slots is not relevant because we only need exactly 1 comparison to determine whether a slot can be fulfilled or not , since they are all the same anyway when dealing with specific resource profiles things can be a lot worse , with the classical cases where either no matches are found , or only at the very end of the iteration in the absolute worst case , with j jobs , requiring r slots each with a unique resource profile such each pair of these profiles is not matching , and s freepending slots that don ' t fulfill any requirement , then this method does a total of jrs resource profile comparisons

private void check resource requirements ( ) { final map < job i d , collection < resource requirement > > missing resources = resource tracker get missing resources ( ) ; if ( missing resources is empty ( ) ) { return ; } final map < job i d , resource counter > unfulfilled requirements = new linked hash map < > ( ) ; for ( map entry < job i d , collection < resource requirement > > resource requirements : missing resources entry set ( ) ) { final job i d job id = resource requirements get key ( ) ; final resource counter unfulfilled job requirements = try allocate slots for job ( job id , resource requirements get value ( ) ) ; if ( ! unfulfilled job requirements is empty ( ) ) { unfulfilled requirements put ( job id , unfulfilled job requirements ) ; } } if ( unfulfilled requirements is empty ( ) ) { return ; } final resource counter pending slots = new resource counter ( task executor manager get pending task manager slots ( ) stream ( ) collect ( collectors grouping by ( pending task manager slot : : get resource profile , collectors summing int ( x - > 1 ) ) ) ) ; for ( map entry < job i d , resource counter > unfulfilled requirement : unfulfilled requirements entry set ( ) ) { try fulfill requirements with pending slots ( unfulfilled requirement get key ( ) , unfulfilled requirement get value ( ) get resource profiles with count ( ) , pending slots ) ; } }


tests that an invalid parameter type entry will generate the proper error message shown in the status box , and not present the user with a stack trace

public void test invalid parameter data type edit ( ) throws exception { / / / / first create the tool and a function we ' ll modify one of the function / / params to have a bogus entry we can test against / / create function at entry ( ) ; function editor dialog dialog = edit function ( ) ; g table param table = find component ( dialog get component ( ) , g table class ) ; table cell editor cell editor = edit cell ( param table , 0 , 1 ) ; set editor text ( cell editor , " a / b / c " ) ; / / if the status field indicates that we have an invalid data type , then we ' re good if / / an exception is thrown on the stop cell editing ( ) call , then this will be skipped and / / the test will fail assert true ( dialog get status text ( ) contains ( " invalid data type " ) ) ; }


assert that { @ code super type is assignable from ( sub type ) } is { @ code true } < pre class = " code " > assert is assignable ( number class , my class ) ;

public static void is assignable ( class < ? > super type , class < ? > sub type ) { is assignable ( super type , sub type , " " ) ; }


returns the number of threads for the query server nio event loop these threads only process network events and dispatch query requests to the query threads

public int num state server threads ( ) { return num server threads ; }


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

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


returns the current transform matrix changing this within { @ link # begin ( ) } { @ link # end ( ) } results in undefined behaviour

public matrix 4 get transform matrix ( ) ;


gets the maximum client connections per host

public int get max client cnxns per host ( ) { return max client cnxns per host ; }


creates list of users with given input array

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


all tests run as a an administrative user but use < code > es - security - runas - user < code > to become a less privileged user when needed

protected settings rest client settings ( ) { return rest sql i t security settings ( ) ; }


this ensures we don ' t mistake i pv 6 localhost for a mapped i pv 4 0 0 0 1

@ test public void ipv 6 localhost ( ) { string ipv 6 = " : : 1 " ; endpoint endpoint = endpoint new builder ( ) ip ( ipv 6 ) build ( ) ; assert that ( endpoint ipv 4 ( ) ) is null ( ) ; assert that ( endpoint ipv 4 bytes ( ) ) is null ( ) ; assert that ( endpoint ipv 6 ( ) ) is equal to ( ipv 6 ) ; assert that ( endpoint ipv 6 bytes ( ) ) contains exactly ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ) ; }


grab current pending change records for each op in a multi - op this is used inside multi op error code path to rollback in the event of a failed multi - op

private map < string , change record > get pending changes ( multi operation record multi request ) { map < string , change record > pending change records = new hash map < string , change record > ( ) ; for ( op op : multi request ) { string path = op get path ( ) ; change record cr = get outstanding change ( path ) ; / / only previously existing records need to be rolled back if ( cr ! = null ) { pending change records put ( path , cr ) ; } / * * zookeeper - 1624 - we need to store for parent ' s change record * of the parent node of a request so that if this is a * sequential node creation request , rollback pending changes ( ) * can restore previous parent ' s change record correctly * * otherwise , sequential node name generation will be incorrect * for a subsequent request * / int last slash = path last index of ( ' / ' ) ; if ( last slash = = - 1 | | path index of ( ' \ 0 ' ) ! = - 1 ) { continue ; } string parent path = path substring ( 0 , last slash ) ; change record parent cr = get outstanding change ( parent path ) ; if ( parent cr ! = null ) { pending change records put ( parent path , parent cr ) ; } } return pending change records ; }


modifies { @ code multiset to modify } so that its count for an element { @ code e } is at most { @ code multiset to retain count ( e ) } to be precise , { @ code multiset to modify count ( e ) } is set to { @ code math min ( multiset to modify count ( e ) , multiset to retain count ( e ) ) } this is similar to { @ link # intersection ( multiset , multiset ) intersection } { @ code ( multiset to modify , multiset to retain ) } , but mutates { @ code multiset to modify } instead of returning a view in contrast , { @ code multiset to modify retain all ( multiset to retain ) } keeps all occurrences of elements that appear at all in { @ code multiset to retain } , and deletes all occurrences of all other elements

public static boolean retain occurrences ( multiset < ? > multiset to modify , multiset < ? > multiset to retain ) { return retain occurrences impl ( multiset to modify , multiset to retain ) ; }


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


by default the kafka source is set to run in { @ link boundedness # continuous unbounded } manner and thus never stops until the flink job fails or is canceled to let the kafka source run in { @ link boundedness # bounded } manner and stops at some point , one can set an { @ link offsets initializer } to specify the stopping offsets for each partition when all the partitions have reached their stopping offsets , the kafka source will then exit this method is different from { @ link # set unbounded ( offsets initializer ) } that after setting the stopping offsets with this method , { @ link kafka source # get boundedness ( ) } will return { @ link boundedness # bounded } instead of { @ link boundedness # continuous unbounded } the following { @ link offsets initializer } are commonly used and provided out of the box users can also implement their own { @ link offsets initializer } for custom behaviors { @ link offsets initializer # latest ( ) } - stop at the latest offsets of the partitions when the kafka source starts to run { @ link offsets initializer # committed offsets ( ) } - stops at the committed offsets of the consumer group { @ link offsets initializer # offsets ( map ) } - stops at the specified offsets for each partition { @ link offsets initializer # timestamp ( long ) } - stops at the specified timestamp for each partition the guarantee of setting the stopping timestamp is that no kafka records whose { @ link org apache kafka clients consumer consumer record # timestamp ( ) } is greater than the given stopping timestamp will be consumed however , it is possible that some records whose timestamp is smaller than the specified stopping timestamp are not consumed

public kafka source builder < out > set bounded ( offsets initializer stopping offsets initializer ) { this boundedness = boundedness bounded ; this stopping offsets initializer = stopping offsets initializer ; return this ; }


wait up to the specified timeout for this task to meet the expected number of records as defined by { @ code expected records }

public void await records ( long timeout , time unit unit ) throws interrupted exception { if ( records remaining latch = = null ) { throw new illegal state exception ( " illegal state encountered expected records ( ) was not set for this task ? " ) ; } if ( ! records remaining latch await ( timeout , unit ) ) { string msg = string format ( " insufficient records seen by task % s in % d millis records expected = % d , actual = % d " , task id , unit to millis ( timeout ) , expected records , expected records - records remaining latch get count ( ) ) ; throw new data exception ( msg ) ; } log debug ( " task { } saw { } records , expected { } records " , task id , expected records - records remaining latch get count ( ) , expected records ) ; }