private void begin file lease ( final long inode id , final d f s output stream out ) throws i o exception { synchronized ( files being written ) { put file being written ( inode id , out ) ; get lease renewer ( ) put ( this ) ; } }


exit a parse tree produced by { @ link sql base parser # boolean value }

void exit boolean value ( sql base parser boolean value context ctx ) ;


sets the failed result of this { @ code future } unless this { @ code future } has already been cancelled or set ( including { @ linkplain # set future set asynchronously } ) when a call to this method returns , the { @ code future } is guaranteed to be { @ linkplain # is done done } < b > only if < b > the call was accepted ( in which case it returns { @ code true } ) if it returns { @ code false } , the { @ code future } may have previously been set asynchronously , in which case its result may not be known yet that result , though not yet known , cannot be overridden by a call to a { @ code set } method , only by a call to { @ link # cancel }

protected boolean set exception ( throwable throwable ) { object value to set = new failure ( check not null ( throwable ) ) ; if ( atomic helper cas value ( this , null , value to set ) ) { complete ( this ) ; return true ; } return false ; }


clears the { @ link cuttable # is cut ( ) is cut } flag on any g tree nodes that are pointed to by the system clipboard

public static void clear cuttables ( ) { clear cuttables ( get system clipboard transferable ( ) ) ; }


tells whether the function was compiled with procedure guided optimization < p > note : believe this relates to procedure guided optimization

public boolean was compiled with pgo pgu ( ) { return was compiled with pgo pgu ; }


configure the path matcher to use to match url paths against registered url patterns to select the cache settings for a request this is an advanced property that should be used only when a customized { @ link ant path matcher } or a custom path matcher is required by default this is { @ link ant path matcher } note : setting { @ code path matcher } enforces use of string pattern matching even when a { @ link servlet request path utils # parse and cache parsed } { @ code request path } is available

public void set path matcher ( path matcher path matcher ) { assert not null ( path matcher , " path matcher must not be null " ) ; this path matcher = path matcher ; }


private void compare colors ( set < string > expected colors , set < string > actual colors ) { assert that ( only black ( actual colors ) ) as ( " only black " ) is false ( ) ; assert that ( only white ( actual colors ) ) as ( " only white " ) is false ( ) ; / / ignore black and white for further comparison set < string > clean actual colors = sets new hash set ( actual colors ) ; clean actual colors remove ( " # 000000 " ) ; clean actual colors remove ( " # ffffff " ) ; if ( ! expected colors contains all ( clean actual colors ) ) { fail ( " there are unexpected colors on the screenshot : " + sets difference ( clean actual colors , expected colors ) ) ; } if ( ! clean actual colors contains all ( expected colors ) ) { fail ( " there are expected colors not present on the screenshot : " + sets difference ( expected colors , clean actual colors ) ) ; } }


low level method to reset the buffer and attributes to the specified values use with care !

protected void set buffer ( buffer data , boolean owns buffer , vertex attributes value ) { if ( is bound ) throw new gdx runtime exception ( " cannot change attributes while vbo is bound " ) ; if ( this owns buffer & & byte buffer ! = null ) buffer utils dispose unsafe byte buffer ( byte buffer ) ; attributes = value ; if ( data instanceof byte buffer ) byte buffer = ( byte buffer ) data ; else throw new gdx runtime exception ( " only byte buffer is currently supported " ) ; this owns buffer = owns buffer ; final int l = byte buffer limit ( ) ; byte buffer limit ( byte buffer capacity ( ) ) ; buffer = byte buffer as float buffer ( ) ; byte buffer limit ( l ) ; buffer limit ( l / 4 ) ; }


protected boolean contains columns ( ) { return ! ( ( s q l insert recognizer ) sql recognizer ) insert columns is empty ( ) ; }


updates the map of attributes specified by the user to match the set of attributes decared in the rule definition

public static map < string , object > get final kwargs ( map < string , object > kwargs ) { / / ' repo mapping ' is not an explicit attribute of any rule and so it would / / result in a rule error if propagated to the rule factory return kwargs entry set ( ) stream ( ) filter ( x - > ! x get key ( ) equals ( " repo mapping " ) ) collect ( collectors to map ( map entry : : get key , map entry : : get value ) ) ; }


gets the java home directory from the user ' s java home save file

public file get saved java home ( ) throws i o exception { try ( buffered reader reader = new buffered reader ( new file reader ( java home save file ) ) ) { string line = reader read line ( ) trim ( ) ; if ( line ! = null & & ! line is empty ( ) ) { return new file ( line ) ; } } catch ( file not found exception e ) { / / fall through to return null } return null ; }


gets the data type of the appropriate size to be placed at the indicated component index

protected data type instance get drop data type ( int row index , data type dt ) throws invalid data type exception , cancelled exception { field range range = get selected range containing ( row index ) ; / / is the index in a selection if ( range ! = null ) { / / set the index to the minimum index in this range row index = range get start ( ) get index ( ) int value ( ) ; } boolean dynamic sizing allowed = true ; data type current dt = null ; data type component dtc = get component ( row index ) ; if ( dtc ! = null ) { dynamic sizing allowed = ! dtc is flexible array component ( ) ; current dt = dtc get data type ( ) ; } if ( ! ( current dt instanceof pointer ) ) { / / stacking on pointer allows any data type check is allowable data type ( dt , dynamic sizing allowed ) ; } data type result dt = data utilities reconcile applied data type ( current dt , dt , true ) ; int result len = result dt get length ( ) ; if ( result dt instanceof dynamic ) { result len = data type helper request dt size ( get provider ( ) , result dt get display name ( ) , last num bytes , get max add length ( row index ) ) ; } else if ( result len = = 0 ) { throw new invalid data type exception ( " data types of size 0 are not allowed " ) ; } return data type instance get data type instance ( result dt , result len ) ; }


replaces all instances of { @ code find } with { @ code replace }

public string builder replace ( string find , string replace ) { int find length = find length ( ) , replace length = replace length ( ) ; int index = 0 ; while ( true ) { index = index of ( find , index ) ; if ( index = = - 1 ) break ; replace 0 ( index , index + find length , replace ) ; index + = replace length ; } return this ; }


protected void save d t ( final file token file , final token < ? > token ) throws i o exception { require non null ( token , " null token " ) ; credentials cred = new credentials ( ) ; cred add token ( token get service ( ) , token ) ; try ( data output stream out = new data output stream ( new file output stream ( token file ) ) ) { cred write token storage to stream ( out ) ; } }


launches hms process and returns a future representing that process

private static future < void > start h m s ( hive server context context , int port ) throws exception { context init ( ) ; context get hive conf ( ) set var ( metastoreuris , " thrift : / / localhost : " + port ) ; hive conf outside conf = context get hive conf ( ) ; list < string > args = new array list < > ( ) ; string java home = system get property ( " java home " ) ; args add ( joiner on ( file separator ) join ( java home , " bin " , " java " ) ) ; / / set classpath args add ( " - cp " ) ; args add ( system get property ( " java class path " ) ) ; / / set sys properties args add ( hive cmd line config ( metastorewarehouse varname , outside conf get var ( metastorewarehouse ) ) ) ; args add ( hive cmd line config ( scratchdir varname , outside conf get var ( scratchdir ) ) ) ; args add ( hive cmd line config ( localscratchdir varname , outside conf get var ( localscratchdir ) ) ) ; args add ( hive cmd line config ( hivehistoryfileloc varname , outside conf get var ( hivehistoryfileloc ) ) ) ; / / the following config is removed in hive 3 1 0 args add ( hive cmd line config ( " hive warehouse subdir inherit perms " , string value of ( outside conf get boolean ( " hive warehouse subdir inherit perms " , true ) ) ) ) ; args add ( hive cmd line config ( " hadoop tmp dir " , outside conf get ( " hadoop tmp dir " ) ) ) ; args add ( hive cmd line config ( " test log dir " , outside conf get ( " test log dir " ) ) ) ; args add ( hive cmd line config ( metastoreconnecturlkey varname , outside conf get var ( metastoreconnecturlkey ) ) ) ; / / config derby log file file derby log = file create temp file ( " derby " , " log " ) ; derby log delete on exit ( ) ; args add ( hive cmd line config ( " derby stream error file " , derby log get absolute path ( ) ) ) ; / / config whether in test if ( outside conf get bool var ( hive in test ) ) { args add ( hive cmd line config ( hive in test varname , " true " ) ) ; } args add ( hive meta store class get canonical name ( ) ) ; args add ( " - p " ) ; args add ( string value of ( port ) ) ; process builder builder = new process builder ( args ) ; process process = builder start ( ) ; try { thread in logger = new thread ( new log redirect ( process get input stream ( ) , logger ) ) ; thread err logger = new thread ( new log redirect ( process get error stream ( ) , logger ) ) ; in logger set daemon ( true ) ; in logger set name ( " hms - in - logger " ) ; err logger set daemon ( true ) ; err logger set name ( " hms - err - logger " ) ; in logger start ( ) ; err logger start ( ) ; future task < void > res = new future task < > ( ( ) - > { try { int r = process wait for ( ) ; in logger join ( ) ; err logger join ( ) ; if ( r ! = 0 ) { throw new runtime exception ( " hms process exited with " + r ) ; } } catch ( interrupted exception e ) { logger info ( " shutting down hms " ) ; } finally { if ( process is alive ( ) ) { / / give it a chance to terminate gracefully process destroy ( ) ; try { process wait for ( 5 , time unit seconds ) ; } catch ( interrupted exception e ) { logger info ( " interrupted waiting for hms to shut down , killing it forcibly " ) ; } process destroy forcibly ( ) ; } } } , null ) ; thread thread = new thread ( res ) ; thread set name ( " hms - watcher " ) ; / / we need the watcher thread to kill hms , don ' t make it daemon thread set daemon ( false ) ; thread start ( ) ; wait for h m s start ( port ) ; return res ; } catch ( throwable e ) { / / make sure to kill the process in case anything goes wrong process destroy forcibly ( ) ; throw e ; } }


creates a new block builder of the same type based on the expected entries and the current usage statistics of this block builder

block builder new block builder like ( block builder status block builder status , int expected entries ) ;


set a list of topics the kafka source should consume from all the topics in the list should have existed in the kafka cluster otherwise an exception will be thrown to allow some of the topics to be created lazily , please use { @ link # set topic pattern ( pattern ) } instead

public kafka source builder < out > set topics ( string topics ) { return set topics ( arrays as list ( topics ) ) ; }


set whether or not file extensions should be stripped from the uri when generating the view name default is " true "

public void set strip extension ( boolean strip extension ) { this strip extension = strip extension ; }


locate matching http request and determine if bypass should be enabled

protected boolean locate matching http request ( final authentication authentication , final http servlet request request ) { if ( string utils is not blank ( bypass properties get http request remote address ( ) ) ) { if ( http request remote address pattern matcher ( request get remote addr ( ) ) find ( ) ) { logger debug ( " http request remote address [ { } ] matches [ { } ] " , bypass properties get http request remote address ( ) , request get remote addr ( ) ) ; return true ; } if ( http request remote address pattern matcher ( request get remote host ( ) ) find ( ) ) { logger debug ( " http request remote host [ { } ] matches [ { } ] " , bypass properties get http request remote address ( ) , request get remote host ( ) ) ; return true ; } } if ( string utils is not blank ( bypass properties get http request headers ( ) ) ) { val header names = collections list ( request get header names ( ) ) ; val matched = this http request header patterns stream ( ) any match ( pattern - > header names stream ( ) any match ( pattern as match predicate ( ) ) ) ; if ( matched ) { logger debug ( " http request remote headers [ { } ] match [ { } ] " , header names , bypass properties get http request headers ( ) ) ; return true ; } } return false ; }


sets the < code > user status < code > property

public user user status ( integer user status ) { this user status = user status ; return this ; }


protected string is consent required ( final service service , final registered service registered service , final authentication authentication , final request context request context ) { val required = consent activation strategy is consent required ( service , registered service , authentication , request context ) ; return required ? event id consent required : null ; }


< code > merge bookmark < code > merges the indicated bookmark from the origin program into the result program at an address equivalent to the origin address merging means replace any existing bookmark of the specified type for n o t es or of the specified type and category for non - note types note : this method merges a single bookmark without affecting other bookmarks at the indicated address

public void merge bookmark ( address origin address , string type , string category , task monitor monitor ) throws cancelled exception { if ( origin address ! = null ) { address result address = origin to result translator get address ( origin address ) ; bookmark manager bm 1 = result program get bookmark manager ( ) ; bookmark manager bm 2 = origin program get bookmark manager ( ) ; if ( type equals ( bookmark type note ) ) { bookmark [ ] books 2 = bm 2 get bookmarks ( origin address , type ) ; if ( books 2 length = = 0 ) { bm 1 remove bookmarks ( new address set ( result address ) , type , monitor ) ; } else if ( books 2 length = = 1 ) { bm 1 set bookmark ( result address , type , books 2 [ 0 ] get category ( ) , books 2 [ 0 ] get comment ( ) ) ; } else if ( books 2 length > 1 ) { throw new assert exception ( " error in program ' " + result program get name ( ) + " ' - shouldn ' t be multiple notes at a single address address = " + origin address to string ( ) ) ; } } else { bookmark book 1 = bm 1 get bookmark ( result address , type , category ) ; bookmark book 2 = bm 2 get bookmark ( origin address , type , category ) ; if ( book 2 ! = null ) { bm 1 set bookmark ( result address , type , category , book 2 get comment ( ) ) ; } else if ( book 1 ! = null ) { bm 1 remove bookmark ( book 1 ) ; } } } }


creates a thread - local mock controller for all constructions of the given class the returned object ' s { @ link mocked construction # close ( ) } method must be called upon completing the test or the mock will remain active on the current thread see examples in javadoc for { @ link mockito } class

public static < t > mocked construction < t > mock construction ( class < t > class to mock , mock settings mock settings , mocked construction mock initializer < t > mock initializer ) { return mock construction ( class to mock , index - > mock settings , mock initializer ) ; }


for a given partition { @ code topic - partition } the { @ code i } - th records looks like following { @ code topic : topic partition : partition timestamp : 1000 partition key : topic - partition value : i }

public static list < producer record < string , integer > > get records for partition ( topic partition tp ) { list < producer record < string , integer > > records = new array list < > ( ) ; for ( int i = 0 ; i < num records per partition ; i + + ) { records add ( new producer record < > ( tp topic ( ) , tp partition ( ) , i * 1000l , tp to string ( ) , i ) ) ; } return records ; }


public synchronized long get samples ( ) { return samples ; }


returns true if the icon is an animated image < b > warning : < b > this call may block the swing thread for up to { @ link # max image load time } milliseconds the first time it is called !

public boolean is animated ( ) { if ( ! has checked for animated status ) { check animated ( base icon ) ; has checked for animated status = true ; } return is animated ; }


gets the status code for parsing this zip entry

public status get code ( ) { return code ; }


gets the list of successors that this block may branch to

public int list get successors ( ) { return successors ; }


get the annotated classes that were declared via { @ link context configuration @ context configuration } note : this is a mutable property the returned value may therefore represent a processed value that does not match the original value declared via { @ link context configuration @ context configuration }

public class < ? > [ ] get classes ( ) { return this classes ; }


normalize the supplied string to an icon name e g " blue anime " to " blue - anime "

public static string to normalized icon name ( string string ) { if ( string = = null ) { return null ; } if ( string ends with ( " png " ) | | string ends with ( " gif " ) ) { string = string substring ( 0 , string length ( ) - 4 ) ; } return string replace ( ' ' , ' - ' ) ; }


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


executes the execution listeners defined on the given element , with the given event type uses the { @ link # execution } of this operation instance as argument for the execution listener

protected void execute execution listeners ( has execution listeners element with execution listeners , string event type ) { execute execution listeners ( element with execution listeners , execution , event type ) ; }


returns the char array which this buffer is based on , if there is one

public final char [ ] array ( ) { return protected array ( ) ; }


public void update null ( string column label ) throws s q l exception { }


returns a function that allows to wrap filter all clients that are exposed by the test cluster this is useful for debugging or request response pre and post processing it also allows to intercept all calls done by the test framework by default this method returns an identity function { @ link function # identity ( ) }

protected function < client , client > get client wrapper ( ) { return function identity ( ) ; }


generic test for getting the destination subcluster

private void test get destination ( destination order order , list < string > expect file location , list < string > expect no file location , list < string > expect dir location ) throws exception { setup order mount path ( order ) ; router client client = router context get admin client ( ) ; mount table manager mount table manager = client get mount table manager ( ) ; / / if the file exists , it should be in the expected subcluster final string path file = " dir / file " ; final path path router file = new path ( " / mount " , path file ) ; final path path local file = new path ( " / tmp " , path file ) ; file status file status = router fs get file status ( path router file ) ; assert true ( file status + " should be a file " , file status is file ( ) ) ; get destination response resp file = mount table manager get destination ( get destination request new instance ( path router file ) ) ; if ( expect file location ! = null ) { assert equals ( expect file location , resp file get destinations ( ) ) ; assert path status ( expect file location , path local file , false ) ; } else { collection < string > dests = resp file get destinations ( ) ; assert path status ( dests , path local file , false ) ; } / / if the file does not exist , it should give us the expected subclusters final string path no file = " dir / no - file " ; final path path router no file = new path ( " / mount " , path no file ) ; final path path local no file = new path ( " / tmp " , path no file ) ; lambda test utils intercept ( file not found exception class , ( ) - > router fs get file status ( path router no file ) ) ; get destination response resp no file = mount table manager get destination ( get destination request new instance ( path router no file ) ) ; if ( expect no file location ! = null ) { assert equals ( expect no file location , resp no file get destinations ( ) ) ; } assert path status ( collections empty list ( ) , path local no file , false ) ; / / if the folder exists , it should be in the expected subcluster final string path nested dir = " dir / dir " ; final path path router nested dir = new path ( " / mount " , path nested dir ) ; final path path local nested dir = new path ( " / tmp " , path nested dir ) ; file status dir status = router fs get file status ( path router nested dir ) ; assert true ( dir status + " should be a directory " , dir status is directory ( ) ) ; get destination response resp dir = mount table manager get destination ( get destination request new instance ( path router nested dir ) ) ; assert equals collection ( expect dir location , resp dir get destinations ( ) ) ; assert path status ( expect dir location , path local nested dir , true ) ; }


returns the component at the given position in the binder

component tree get component at ( int position ) ;


returns the file system implementation used by bazel it is an error if more than one module returns a file system if all return null , the default unix file system is used this method will be called at the beginning of bazel startup ( in - between { @ link # global init } and { @ link # blaze startup } )

public module file system get file system ( options parsing result startup options , path fragment real exec root base ) throws abrupt exit exception { return null ; }


sets the { @ linkplain http async client builder # set default credentials provider ( credentials provider ) credential provider } , { @ linkplain http async client builder # set s s l context ( s s l context ) ssl context } , and { @ linkplain http async client builder # set s s l hostname verifier ( hostname verifier ) ssl hostname verifier }

public http async client builder customize http client ( final http async client builder http client builder ) { / / enable ssl / tls http client builder set s s l strategy ( ssl strategy ) ; / / enable user authentication if ( credentials provider ! = null ) { http client builder set default credentials provider ( credentials provider ) ; } return http client builder ; }


common metadata describing the resource < code > istio mcp v 1alpha 1 metadata metadata = 1 ; < code >

public boolean has metadata ( ) { return metadata builder ! = null | | metadata ! = null ; }


the number of missing fields that had been configured for analysis

public long get missing field count ( ) { return missing field count ; }


returns a new multibinder that collects instances of { @ code type } in a { @ link set } that is itself bound with { @ code annotation type }

public static < t > multibinder < t > new set binder ( binder binder , type literal < t > type , class < ? extends annotation > annotation type ) { binder = binder skip sources ( real multibinder class , multibinder class ) ; real multibinder < t > result = new real multibinder < > ( binder , type , " @ " + annotation type get name ( ) , key get ( multibinder < t > set of ( type ) , annotation type ) ) ; binder install ( result ) ; return result ; }


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


get the federated path for a nameservice

public string get federated path for n s ( string ns id ) { return " / " + ns id ; }


enables a cross fade animation between both the placeholder and the first resource and between subsequent resources ( if thumbnails are used )

public drawable transition options cross fade ( @ non null drawable cross fade factory builder builder ) { return cross fade ( builder build ( ) ) ; }


look up a field id type index from a field index cheaper than : { @ code field ids ( ) get ( field dex index ) get type index ( ) ; }

public int type index from field index ( int field index ) { check bounds ( field index , table of contents field ids size ) ; int position = table of contents field ids off + ( size of member id item * field index ) ; position + = size of ushort ; / / declaring class index return data get short ( position ) & 0x f f f f ; / / type index }


get a self - renewing lease on the specified file

public self renewing lease acquire lease ( path path ) throws azure exception { string full key = path to key ( make absolute ( path ) ) ; return get store ( ) acquire lease ( full key ) ; }


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


static initializer names this thread " j unit "

public static void name test thread ( ) { thread current thread ( ) set name ( " j unit " ) ; }


clears any object associations within the given range

public synchronized void clear range ( long start , long end ) { last range = null ; / / check for range before that extends into cleared area int pos = get position of range before ( new object value range < t > ( start , end , null ) ) ; if ( pos > = 0 ) { object value range < t > range = ranges get ( pos ) ; if ( range get end ( ) > = start ) { / / truncate previous range if it needed ranges set ( pos , new object value range < t > ( range get start ( ) , start - 1 , range get value ( ) ) ) ; } if ( range get end ( ) > end ) { / / create leftover if previous range extends / / beyond cleared area ranges add ( pos + 1 , new object value range < t > ( end + 1 , range get end ( ) , range get value ( ) ) ) ; } } / / now clear ranges until we find one past the cleared area pos = math max ( 0 , pos + 1 ) ; / / start at 0 or 1 past the previous range while ( pos < ranges size ( ) ) { object value range < t > range = ranges get ( pos ) ; if ( range get end ( ) < = end ) { / / range totally inside cleared area ranges remove ( pos ) ; } else if ( range get start ( ) > end ) { / / range totally past clear area - done break ; } else { / / intersects , fixup start ranges set ( pos , new object value range < t > ( end + 1 , range get end ( ) , range get value ( ) ) ) ; } } }


public void set incrementer name ( string incrementer name ) { this incrementer name = incrementer name ; }


for a given output base directory , returns the command log file path

static path get command log path ( path output base ) { return output base get relative ( " command log " ) ; }


public static void set background ( @ non null final fragment fragment , final drawable background ) { view view = fragment get view ( ) ; if ( view = = null ) return ; if ( build version sdk int > = build version codes jelly bean ) { view set background ( background ) ; } else { view set background drawable ( background ) ; } }


deletes the reference popping instruction at the given offset , if it is at the start of a subroutine that doesn ' t return or a subroutine that is only called from one place

private void delete reference pop instruction ( clazz clazz , int offset , instruction instruction ) { if ( partial evaluator is subroutine start ( offset ) & & ( ! partial evaluator is subroutine returning ( offset ) | | partial evaluator branch origins ( offset ) instruction offset count ( ) = = 1 ) ) { if ( debug ) system out println ( " deleting store of subroutine return address " + instruction to string ( offset ) ) ; / / a reference value can only be specific if it is null code attribute editor delete instruction ( offset ) ; } }


return a target given its label and a set of package values we know to contain the target this method assumes { @ code setting } is a valid build setting target or an alias of a build setting target based on checking done in { @ code # verify build settings and get aliases }

private static target get build setting target ( map < package value key , package value > build setting packages , label setting ) { package build setting package = build setting packages get ( package value key ( setting get package identifier ( ) ) ) get package ( ) ; preconditions check not null ( build setting package , " reading build setting for which we don ' t have a package " ) ; target build setting target ; try { build setting target = build setting package get target ( setting get name ( ) ) ; } catch ( no such target exception e ) { / / this should never happen , see javadoc throw new illegal state exception ( e ) ; } return build setting target ; }


redirect to provider receive the client name from the request and then try to determine and build the endpoint url for the redirection the redirection dataurl must contain a delegated client ticket id so that the request be can restored on the trip back saml clients use the relay - state session attribute while others use request parameters

public view redirect to provider ( final http servlet request request , final http servlet response response ) { var client name = request get parameter ( pac 4j constants default client name parameter ) ; if ( string utils is blank ( client name ) ) { client name = ( string ) request get attribute ( pac 4j constants default client name parameter ) ; } try { if ( string utils is blank ( client name ) ) { throw new unauthorized service exception ( " no client name parameter is provided in the incoming request " ) ; } val client result = get clients ( ) find client ( client name ) ; if ( client result is empty ( ) ) { throw new unauthorized service exception ( " unable to locate client " + client name ) ; } val client = indirect client class cast ( client result get ( ) ) ; client init ( ) ; val web context = new j e e context ( request , response , get session store ( ) ) ; val ticket = get delegated client webflow manager ( ) store ( web context , client ) ; return get resulting view ( client , web context , ticket ) ; } catch ( final http action e ) { if ( e get code ( ) = = http status unauthorized value ( ) ) { logger debug ( " authentication request was denied from the provider [ { } ] " , client name , e ) ; } else { logging utils warn ( logger , e ) ; } throw new unauthorized service exception ( e get message ( ) , e ) ; } }


match the given " mapping " to the start of the " request uri " and if there is a match return the extra part this method is needed because the context path and the servlet path returned by the http servlet request are stripped of semicolon content unlike the request uri

private string get remaining path ( string request uri , string mapping , boolean ignore case ) { int index 1 = 0 ; int index 2 = 0 ; for ( ; ( index 1 < request uri length ( ) ) & & ( index 2 < mapping length ( ) ) ; index 1 + + , index 2 + + ) { char c 1 = request uri char at ( index 1 ) ; char c 2 = mapping char at ( index 2 ) ; if ( c 1 = = ' ; ' ) { index 1 = request uri index of ( ' / ' , index 1 ) ; if ( index 1 = = - 1 ) { return null ; } c 1 = request uri char at ( index 1 ) ; } if ( c 1 = = c 2 | | ( ignore case & & ( character to lower case ( c 1 ) = = character to lower case ( c 2 ) ) ) ) { continue ; } return null ; } if ( index 2 ! = mapping length ( ) ) { return null ; } else if ( index 1 = = request uri length ( ) ) { return " " ; } else if ( request uri char at ( index 1 ) = = ' ; ' ) { index 1 = request uri index of ( ' / ' , index 1 ) ; } return ( index 1 ! = - 1 ? request uri substring ( index 1 ) : " " ) ; }


returns the result of dividing this by { @ code val }

public unsigned long divided by ( unsigned long val ) { return from long bits ( unsigned longs divide ( value , check not null ( val ) value ) ) ; }


validates the implementation of input stream skip , seekable get pos , and input stream available

public void test 0313 skip and available and position ( ) throws i o exception { assume huge file exists ( ) ; try ( f s data input stream input stream = fs open ( test file path ) ; ) { byte [ ] expected 1 = { 0 , 1 , 2 } ; byte [ ] expected 2 = { 3 , 4 , 5 } ; byte [ ] expected 3 = { 1 , 2 , 3 } ; byte [ ] expected 4 = { 6 , 7 , 8 } ; assert equals ( test file length , input stream available ( ) ) ; assert equals ( 0 , input stream get pos ( ) ) ; int n = 3 ; long skipped = input stream skip ( n ) ; assert equals ( skipped , input stream get pos ( ) ) ; assert equals ( test file length - input stream get pos ( ) , input stream available ( ) ) ; assert equals ( skipped , n ) ; byte [ ] buffer = new byte [ 3 ] ; int bytes read = input stream read ( buffer ) ; assert equals ( buffer length , bytes read ) ; assert array equals ( expected 2 , buffer ) ; assert equals ( buffer length + skipped , input stream get pos ( ) ) ; assert equals ( test file length - input stream get pos ( ) , input stream available ( ) ) ; / / does skip still work after seek ? int seek pos = 1 ; input stream seek ( seek pos ) ; bytes read = input stream read ( buffer ) ; assert equals ( buffer length , bytes read ) ; assert array equals ( expected 3 , buffer ) ; assert equals ( buffer length + seek pos , input stream get pos ( ) ) ; assert equals ( test file length - input stream get pos ( ) , input stream available ( ) ) ; long current position = input stream get pos ( ) ; n = 2 ; skipped = input stream skip ( n ) ; assert equals ( current position + skipped , input stream get pos ( ) ) ; assert equals ( test file length - input stream get pos ( ) , input stream available ( ) ) ; assert equals ( skipped , n ) ; bytes read = input stream read ( buffer ) ; assert equals ( buffer length , bytes read ) ; assert array equals ( expected 4 , buffer ) ; assert equals ( buffer length + skipped + current position , input stream get pos ( ) ) ; assert equals ( test file length - input stream get pos ( ) , input stream available ( ) ) ; } }


public void set id ( string id ) { this id = id ; }


stops listening safe to call when already stopped ignored on devices without appropriate hardware

public void stop ( ) { if ( accelerometer ! = null ) { queue clear ( ) ; sensor manager unregister listener ( this , accelerometer ) ; sensor manager = null ; accelerometer = null ; } }


this test verifies that state is correctly assigned to key groups and that restore restores the relevant key groups in the backend we have 128 key groups initially , four backends with different states are responsible for all the key groups equally different backends for the same operator may contains different states if we create the state in runtime ( such as { @ link delta trigger # on element } then we snapshot , split up the state and restore into 2 backends where each is responsible for 64 key groups then we make sure that the state is only available in the correct backend

public void test key group snapshot restore scale down ( ) throws exception { test key group snapshot restore ( 4 , 2 , 128 ) ; }


tests the external checkpoints properties

public void test checkpoint properties ( ) { checkpoint properties props = checkpoint properties for checkpoint ( checkpoint retention policy retain on failure ) ; assert false ( props force checkpoint ( ) ) ; assert true ( props discard on subsumed ( ) ) ; assert true ( props discard on job finished ( ) ) ; assert true ( props discard on job cancelled ( ) ) ; assert false ( props discard on job failed ( ) ) ; assert true ( props discard on job suspended ( ) ) ; props = checkpoint properties for checkpoint ( checkpoint retention policy retain on cancellation ) ; assert false ( props force checkpoint ( ) ) ; assert true ( props discard on subsumed ( ) ) ; assert true ( props discard on job finished ( ) ) ; assert false ( props discard on job cancelled ( ) ) ; assert false ( props discard on job failed ( ) ) ; assert false ( props discard on job suspended ( ) ) ; }


return value matching this enumerated type note that the returned value is trimmed by this method

public < t extends enum < t > > t get enum ( string name , t default value ) { final string val = get trimmed ( name ) ; return null = = val ? default value : enum value of ( default value get declaring class ( ) , val ) ; }


tests that we can retrieve the correct { @ link task manager info } from the { @ link resource manager }

public void test request task manager info ( ) throws exception { final resource i d task manager id = resource i d generate ( ) ; final task executor gateway task executor gateway = new testing task executor gateway builder ( ) set address ( uuid random u u i d ( ) to string ( ) ) create testing task executor gateway ( ) ; rpc service register gateway ( task executor gateway get address ( ) , task executor gateway ) ; resource manager = create and start resource manager ( heartbeat services ) ; final resource manager gateway resource manager gateway = resource manager get self gateway ( resource manager gateway class ) ; register task executor ( resource manager gateway , task manager id , task executor gateway get address ( ) ) ; completable future < task manager info > task manager info future = resource manager gateway request task manager info ( task manager id , testing utils timeout ( ) ) ; task manager info task manager info = task manager info future get ( ) ; assert equals ( task manager id , task manager info get resource id ( ) ) ; assert equals ( hardware description , task manager info get hardware description ( ) ) ; assert equals ( task executor gateway get address ( ) , task manager info get address ( ) ) ; assert equals ( data port , task manager info get data port ( ) ) ; assert equals ( jmx port , task manager info get jmx port ( ) ) ; assert equals ( 0 , task manager info get number slots ( ) ) ; assert equals ( 0 , task manager info get number available slots ( ) ) ; }


private int alloc space ( int size ) { if ( size > floats length - next free ) { adjust space ( 2 * ( total space allocated + size ) ) ; } int ret = next free ; next free + = size ; total space allocated + = size ; return ret ; }


this method is called when an attempt to connect a channel throws an exception

protected void connect exception ( socket channel context context , exception exception ) { context handle exception ( exception ) ; }


this is the main routine for launching a distributed random write job it runs 10 mapsnode and each node writes 1 gig of data to a dfs file the reduce doesn ' t do anything

public int run ( string [ ] args ) throws exception { if ( args length = = 0 ) { return print usage ( ) ; } job job = create job ( get conf ( ) ) ; file output format set output path ( job , new path ( args [ 0 ] ) ) ; date start time = new date ( ) ; system out println ( " job started : " + start time ) ; int ret = job wait for completion ( true ) ? 0 : 1 ; date end time = new date ( ) ; system out println ( " job ended : " + end time ) ; system out println ( " the job took " + ( end time get time ( ) - start time get time ( ) ) / 1000 + " seconds " ) ; return ret ; }


create route implementation or use default response transformer

private route impl create route impl ( string path , route route ) { if ( default response transformer ! = null ) { return response transformer route impl create ( path , route , default response transformer ) ; } return route impl create ( path , route ) ; }


gets the costs incurred by this node the costs reflect also the costs incurred by the shipping strategies of the incoming connections

public costs get node costs ( ) { return this node costs ; }


whether the renderer is able to immediately render media from the current position if the renderer is in the { @ link # state started } state then returning true indicates that the renderer has everything that it needs to continue playback returning false indicates that the player should pause until the renderer is ready if the renderer is in the { @ link # state enabled } state then returning true indicates that the renderer is ready for playback to be started returning false indicates that it is not this method may be called when the renderer is in the following states : { @ link # state enabled } , { @ link # state started }


return a read - only list of view resolvers

public list < view resolver > get view resolvers ( ) { return collections unmodifiable list ( this view resolvers ) ; }


add an archive path to the current set of classpath entries it adds the archive to cache as well intended to be used by user code

public static void add archive to class path ( path archive , configuration conf , file system fs ) throws i o exception { string classpath = conf get ( m r job config classpath archives ) ; conf set ( m r job config classpath archives , classpath = = null ? archive to string ( ) : classpath + " , " + archive to string ( ) ) ; uri uri = fs make qualified ( archive ) to uri ( ) ; add cache archive ( uri , conf ) ; }


public void get supp matrix ( matrix matrix ) { matrix set ( m supp matrix ) ; }


returns an immutable array containing a single value

public static immutable int array of ( int e 0 ) { return new immutable int array ( new int [ ] { e 0 } ) ; }


for each template name wait for the template to be created and for the template version to be equal to the master node version

public static void wait for templates ( rest client client , list < string > expected templates ) throws exception { atomic reference < version > master node version = new atomic reference < > ( ) ; assert busy ( ( ) - > { request request = new request ( " get " , " / cat / nodes " ) ; request add parameter ( " h " , " master , version " ) ; request add parameter ( " error trace " , " true " ) ; string response = entity utils to string ( client perform request ( request ) get entity ( ) ) ; for ( string line : response split ( " \ n " ) ) { if ( line starts with ( " * " ) ) { master node version set ( version from string ( line substring ( 2 ) trim ( ) ) ) ; return ; } } fail ( " no master elected " ) ; } ) ; assert busy ( ( ) - > { final request request = new request ( " get " , " template " ) ; request add parameter ( " error trace " , " true " ) ; string string = entity utils to string ( client perform request ( request ) get entity ( ) ) ; map < string , object > response = x content helper convert to map ( json x content json x content , string , false ) ; final set < string > templates = new tree set < > ( response key set ( ) ) ; final list < string > missing templates = expected templates stream ( ) filter ( each - > templates contains ( each ) = = false ) collect ( collectors to list ( ) ) ; / / while it ' s possible to use a hamcrest matcher for this , the failure is much less legible if ( missing templates is empty ( ) = = false ) { fail ( " some expected templates are missing : " + missing templates + " the templates that exist are : " + templates + " " ) ; } expected templates for each ( template - > { map < ? , ? > template definition = ( map < ? , ? > ) response get ( template ) ; assert that ( " template [ " + template + " ] has unexpected version " , version from id ( ( integer ) template definition get ( " version " ) ) , equal to ( master node version get ( ) ) ) ; } ) ; } ) ; }


private string get algorithm ( string cipher ) { int slash = cipher index of ( ' / ' ) ; if ( slash = = - 1 ) { return cipher ; } else { return cipher substring ( 0 , slash ) ; } }


invokes { @ code executor } { @ link executor service # await termination ( long , time unit ) await termination ( long , time unit ) } uninterruptibly

public static boolean await termination uninterruptibly ( executor service executor , long timeout , time unit unit ) { boolean interrupted = false ; try { long remaining nanos = unit to nanos ( timeout ) ; long end = system nano time ( ) + remaining nanos ; while ( true ) { try { return executor await termination ( remaining nanos , nanoseconds ) ; } catch ( interrupted exception e ) { interrupted = true ; remaining nanos = end - system nano time ( ) ; } } } finally { if ( interrupted ) { thread current thread ( ) interrupt ( ) ; } } }


gets all available state handles from zoo keeper and locks the respective state nodes if there is a concurrent modification , the operation is retried until it succeeds

public list < tuple 2 < retrievable state handle < t > , string > > get all and lock ( ) throws exception { final list < tuple 2 < retrievable state handle < t > , string > > state handles = new array list < > ( ) ; boolean success = false ; retry : while ( ! success ) { state handles clear ( ) ; stat stat = client check exists ( ) for path ( " / " ) ; if ( stat = = null ) { break ; / / node does not exist , done } else { / / initial c version ( number of changes to the children of this node ) int initial c version = stat get cversion ( ) ; list < string > children = client get children ( ) for path ( " / " ) ; for ( string path : children ) { path = " / " + path ; try { final retrievable state handle < t > state handle = get and lock ( path ) ; state handles add ( new tuple 2 < > ( state handle , path ) ) ; } catch ( keeper exception no node exception ignored ) { / / concurrent deletion , retry continue retry ; } catch ( i o exception io exception ) { log warn ( " could not get all zoo keeper children node { } contained " + " corrupted data ignoring this node " , path , io exception ) ; } } int final c version = client check exists ( ) for path ( " / " ) get cversion ( ) ; / / check for concurrent modifications success = initial c version = = final c version ; } } return state handles ; }


because thread interrupt ( ) can invoke arbitrary code , it can be slow ( e g perform io ) to protect ourselves from that we want to make sure that tasks don ' t spin too much waiting for the interrupting thread to complete the protocol

public void test interrupt is slow ( ) throws exception { final count down latch is interruptible registered = new count down latch ( 1 ) ; final slow channel slow channel = new slow channel ( ) ; final interruptible task < void > task = new interruptible task < void > ( ) { @ override void run interruptibly ( ) throws exception { slow channel do begin ( ) ; is interruptible registered count down ( ) ; try { new count down latch ( 1 ) await ( ) ; / / the interrupt will wake us up } catch ( interrupted exception ie ) { / / continue } lock support unpark ( thread current thread ( ) ) ; / / simulate a spurious wakeup return null ; } @ override boolean is done ( ) { return false ; } @ override string to pending string ( ) { return " " ; } @ override void after ran interruptibly ( void result , throwable error ) { } } ; thread runner = new thread ( task , " runner " ) ; runner start ( ) ; is interruptible registered await ( ) ; / / trigger the interrupt on another thread since it will block new thread ( " interrupter " ) { @ override public void run ( ) { task interrupt task ( ) ; } } start ( ) ; / / this will happen once the interrupt has been set which means that / / 1 the runner has been woken up / / 2 the interrupter is stuck in the call the thread interrupt ( ) / / after some period of time the runner thread should become blocked on the task because it is / / waiting for the slow interrupting thread to complete thread interrupt await blocked on ( runner , task ) ; slow channel exit close count down ( ) ; / / release the interrupter / / we need to wait for the runner to exit to make sure that the interrupting thread wakes it / / back up runner join ( time unit seconds to millis ( 10 ) ) ; }


public t order ( sort order order ) { objects require non null ( order , " sort order cannot be null " ) ; this order = order ; return ( t ) this ; }


public pet get pet by id ( long pet id ) throws api exception { api response < pet > local var resp = get pet by id with http info ( pet id ) ; return local var resp get data ( ) ; }


protected map < k , v > get subcluster mapping ( ) { return this subcluster mapping ; }


this primitive checks for arbitrary set of desired probability if the level hasn ' t been set method will return default setting the probability expected to be set as an float between 0 0 and 1 0

protected static float get probability ( final string klass ) { string new prob name = fprob name + klass ; string new value = system get property ( new prob name , conf get ( all probabilities ) ) ; if ( new value ! = null & & ! new value equals ( conf get ( new prob name ) ) ) conf set ( new prob name , new value ) ; float ret = conf get float ( new prob name , conf get float ( all probabilities , default prob ) ) ; log debug ( " request for " + new prob name + " returns = " + ret ) ; / / make sure that probability level is valid if ( ret < default prob | | ret > max prob ) ret = conf get float ( all probabilities , default prob ) ; return ret ; }


returns the { @ code short } value whose big - endian representation is stored in the first 2 bytes of { @ code bytes } ; equivalent to { @ code byte buffer wrap ( bytes ) get short ( ) } for example , the input byte array { @ code { 0x 5 4 , 0x 3 2 } } would yield the { @ code short } value { @ code 0x 5 4 3 2 } arguably , it ' s preferable to use { @ link java nio byte buffer } ; that library exposes much more flexibility at little cost in readability

public static short from byte array ( byte [ ] bytes ) { check argument ( bytes length > = bytes , " array too small : % s < % s " , bytes length , bytes ) ; return from bytes ( bytes [ 0 ] , bytes [ 1 ] ) ; }


creates a symbolic link to an existing file an exception is thrown if the symlink exits , the user does not have permission to create symlink , or the underlying file system does not support symlinks symlink permissions are ignored , access to a symlink is determined by the permissions of the symlink target symlinks in paths leading up to the final path component are resolved transparently if the final path component refers to a symlink some functions operate on the symlink itself , these are : - delete ( f ) and delete on exit ( f ) - deletes the symlink - rename ( src , dst ) - if src refers to a symlink , the symlink is renamed if dst refers to a symlink , the symlink is over - written - get link target ( f ) - returns the target of the symlink - get file link status ( f ) - returns a file status object describing the symlink some functions , create ( ) and mkdir ( ) , expect the final path component does not exist if they are given a path that refers to a symlink that does exist they behave as if the path referred to an existing file or directory all other functions fully resolve , ie follow , the symlink these are : open , set replication , set owner , set times , set working directory , set permission , get file checksum , set verify checksum , get file block locations , get fs status , get file status , exists , and list status symlink targets are stored as given to create symlink , assuming the underlying file system is capable of storing a fully qualified uri dangling symlinks are permitted file context supports four types of symlink targets , and resolves them as follows given a path referring to a symlink of form : { @ literal < - - - } x { @ literal - - - > } fs : host a blink { @ literal < - - - - - } y { @ literal - - - - - > } in this path x is the scheme and authority that identify the file system , and y is the path leading up to the final path component " link " if y is a symlink itself then let y ' be the target of y and x ' be the scheme and authority of y ' symlink targets may : 1 fully qualified u r is fs : host x a bfile resolved according to the target file system 2 partially qualified u r is ( eg scheme but no host ) fs : a bfile resolved according to the target file system eg resolving a symlink to hdfs : a results in an exception because hdfs u r is must be fully qualified , while a symlink to file : a will not since hadoop ' s local file systems require partially qualified u r is 3 relative paths path resolves to [ y ' ] [ path ] eg if y resolves to hdfs : host a and path is " bfile " then [ y ' ] [ path ] is hdfs : host bfile 4 absolute paths path resolves to [ x ' ] [ path ] eg if y resolves hdfs : host a b and path is " file " then [ x ] [ path ] is hdfs : hostfile

public void create symlink ( final path target , final path link , final boolean create parent ) throws access control exception , file already exists exception , file not found exception , parent not directory exception , unsupported file system exception , i o exception { if ( ! file system are symlinks enabled ( ) ) { throw new unsupported operation exception ( " symlinks not supported " ) ; } final path non rel link = fix relative part ( link ) ; new f s link resolver < void > ( ) { @ override public void next ( final abstract file system fs , final path p ) throws i o exception , unresolved link exception { fs create symlink ( target , p , create parent ) ; return null ; } } resolve ( this , non rel link ) ; }


set get the spring frequency in hertz setting the frequency to zero disables the spring

public void set spring frequency hz ( float hz ) { jni set spring frequency hz ( addr , hz ) ; }


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


sets the default context for decimal division calculation { @ link java math math context # decimal128 } by default

public void set decimal context ( math context decimal context ) { this decimal context = preconditions check not null ( decimal context ) ; }


checks if a string is a valid path component for instance , components cannot contain a " : " or " " , and cannot be equal to a reserved component like " snapshot " the primary use of this method is for validating paths when loading the f s image during normal nn operation , paths are sometimes allowed to contain reserved components

public static boolean is valid name for component ( string component ) { if ( component equals ( " " ) | | component equals ( " " ) | | component index of ( " : " ) > = 0 | | component index of ( " / " ) > = 0 ) { return false ; } return ! is reserved path component ( component ) ; }


public double get double ( ) { return double ; }


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

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


protected string extract access token from ( final string token ) { return o auth 2 0 jwt access token encoder builder ( ) access token jwt builder ( get o auth configuration context ( ) get access token jwt builder ( ) ) build ( ) decode ( token ) ; }


this test makes sure that there is no infinite loop of flushing ( the condition ` should periodically flush ` eventually is false ) in peer - recovery if a primary sends a fully - baked index commit

public void test should flush after peer recovery ( ) throws exception { try ( replication group shards = create group ( 0 ) ) { shards start all ( ) ; int num docs = shards index docs ( between ( 10 , 100 ) ) ; final long translog size on primary = shards get primary ( ) translog stats ( ) get uncommitted size in bytes ( ) ; shards flush ( ) ; final index shard replica = shards add replica ( ) ; index metadata builder builder = index metadata builder ( replica index settings ( ) get index metadata ( ) ) ; long flush threshold = random numbers random long between ( random ( ) , 100 , translog size on primary ) ; builder settings ( settings builder ( ) put ( replica index settings ( ) get settings ( ) ) put ( index settings index translog flush threshold size setting get key ( ) , flush threshold + " b " ) ) ; replica index settings ( ) update index metadata ( builder build ( ) ) ; replica on settings changed ( ) ; shards recover replica ( replica ) ; / / make sure the flushing will eventually be completed ( eg ` should periodically flush ` is false ) assert busy ( ( ) - > assert that ( get engine ( replica ) should periodically flush ( ) , equal to ( false ) ) ) ; boolean soft deletes enabled = replica index settings ( ) is soft delete enabled ( ) ; assert that ( get translog ( replica ) total operations ( ) , equal to ( soft deletes enabled ? 0 : num docs ) ) ; shards assert all equal ( num docs ) ; } }


called when a output eos was received in tunneling mode

private void on processed tunneled end of stream ( ) { set pending output end of stream ( ) ; }


add the given model attribute with the supplied name

b model attribute ( string name , object value ) ;


makes a user choice as indicated by option this is equivalent to the user clicking a mouse on a radio button indicating which program version to choose it can also be used to press the cancel button on the merge

protected void choose comment ( final string comment type , final address addr , final int option , final boolean use for all ) throws exception { wait for prompting ( ) ; listing merge panel comp = get merge panel ( ) ; assert not null ( comp ) ; window window = swing utilities get window ancestor ( comp ) ; conflict info panel info comp = find component ( comp , conflict info panel class ) ; assert not null ( info comp ) ; assert equals ( " comment " , info comp get conflict type ( ) ) ; assert equals ( addr to string ( ) , info comp get address ( ) to string ( ) ) ; if ( option = = canceled ) { press button by text ( merge tool get tool frame ( ) , " cancel " , false ) ; return ; } abstract button button ; if ( ( option & keep latest ) ! = 0 ) { button = ( abstract button ) find component by name ( comp , latest button ) ; if ( button = = null ) { final j check box checkbox = ( j check box ) find component by name ( comp , latest check box ) ; assert not null ( checkbox ) ; run swing ( ( ) - > checkbox do click ( ) , false ) ; } else { press button ( button , false ) ; } } if ( ( option & keep my ) ! = 0 ) { button = ( abstract button ) find component by name ( comp , my button ) ; if ( button = = null ) { final j check box checkbox = ( j check box ) find component by name ( comp , my check box ) ; assert not null ( checkbox ) ; run swing ( ( ) - > checkbox do click ( ) , false ) ; } else { press button ( button , false ) ; } } wait for swing ( ) ; set use for all ( use for all , vertical choices panel class ) ; wait for apply ( true ) ; press button by text ( window , " apply " ) ; wait for apply ( false ) ; }


allow access to the client rpc server for testing

public rpc server get client rpc server ( ) { return client rpc server ; }


create a transactional entity manager proxy for the given entity manager factory

public static entity manager create shared entity manager ( entity manager factory emf ) { return create shared entity manager ( emf , null , true ) ; }


create a new writer if the writer is null

private void create writer if null ( ) { if ( writer = = null ) { writer = service stub with deadline after ( handshake rpc deadline secs , seconds ) do handshake ( reader ) ; } }


returns the smallest extension of the content rect ( width or height )

public float get smallest content extension ( ) { return math min ( m content rect width ( ) , m content rect height ( ) ) ; }


continues a join transformation and defines the { @ link tuple } fields of the second join { @ link data set } that should be used as join keys < b > note : fields can only be selected as join keys on tuple data sets < b > the resulting { @ link join function assigner } needs to be finished by providing a { @ link join function } by calling { @ link join function assigner # with ( join function ) }

public join function assigner < i1 , i2 > equal to ( int fields ) { return create join function assigner ( new keys expression keys < > ( fields , input 2 get type ( ) ) ) ; }


connect the { @ link channel } of the given { @ link channel future } with the given remote { @ link socket address } if a specific local { @ link socket address } should be used it need to be given as argument otherwise just pass { @ code null } to it the { @ link channel promise } will get notified once the connect operation was complete

void connect ( socket address remote address , socket address local address , channel promise promise ) ;


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public on visibility changed view model on visibility changed ( on model visibility changed listener < on visibility changed view model , on visibility changed view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


test keyed co process function side output with multiple consumers

public void test legacy keyed co process function side output with multiple consumers ( ) throws exception { final output tag < string > side output tag 1 = new output tag < string > ( " side 1 " ) { } ; final output tag < string > side output tag 2 = new output tag < string > ( " side 2 " ) { } ; test list result sink < string > side output result sink 1 = new test list result sink < > ( ) ; test list result sink < string > side output result sink 2 = new test list result sink < > ( ) ; test list result sink < integer > result sink = new test list result sink < > ( ) ; stream execution environment see = stream execution environment get execution environment ( ) ; see set parallelism ( 3 ) ; data stream < integer > ds 1 = see from collection ( elements ) ; data stream < integer > ds 2 = see from collection ( elements ) ; single output stream operator < integer > pass throught stream = ds 1 key by ( i - > i ) connect ( ds 2 key by ( i - > i ) ) process ( new co process function < integer , integer , integer > ( ) { @ override public void process element 1 ( integer value , context ctx , collector < integer > out ) throws exception { if ( value < 4 ) { out collect ( value ) ; ctx output ( side output tag 1 , " sideout 1 - " + string value of ( value ) ) ; } } @ override public void process element 2 ( integer value , context ctx , collector < integer > out ) throws exception { if ( value > = 4 ) { out collect ( value ) ; ctx output ( side output tag 2 , " sideout 2 - " + string value of ( value ) ) ; } } } ) ; pass throught stream get side output ( side output tag 1 ) add sink ( side output result sink 1 ) ; pass throught stream get side output ( side output tag 2 ) add sink ( side output result sink 2 ) ; pass throught stream add sink ( result sink ) ; see execute ( ) ; assert equals ( arrays as list ( " sideout 1 - 1 " , " sideout 1 - 2 " , " sideout 1 - 3 " ) , side output result sink 1 get sorted result ( ) ) ; assert equals ( arrays as list ( " sideout 2 - 4 " , " sideout 2 - 5 " ) , side output result sink 2 get sorted result ( ) ) ; assert equals ( arrays as list ( 1 , 2 , 3 , 4 , 5 ) , result sink get sorted result ( ) ) ; }


exposes a stream of namesystem events only events occurring after the stream is created are available see { @ link org apache hadoop hdfs d f s inotify event input stream } for information on stream usage see { @ link org apache hadoop hdfs inotify event } for information on the available events inotify users may want to tune the following hdfs parameters to ensure that enough extra hdfs edits are saved to support inotify clients that fall behind the current state of the namespace while reading events the default parameter values should generally be reasonable if edits are deleted before their corresponding events can be read , clients will see a { @ link org apache hadoop hdfs inotify missing events exception } on { @ link org apache hadoop hdfs d f s inotify event input stream } method calls it should generally be sufficient to tune these parameters : dfs namenode num extra edits retained dfs namenode max extra edits segments retained parameters that affect the number of created segments and the number of edits that are considered necessary , i e do not count towards the dfs namenode num extra edits retained quota ) : dfs namenode checkpoint period dfs namenode checkpoint txns dfs namenode num checkpoints retained dfs ha log - roll period it is recommended that local journaling be configured ( dfs namenode edits dir ) for inotify ( in addition to a shared journal ) so that edit transfers from the shared journal can be avoided

public d f s inotify event input stream get inotify event stream ( ) throws i o exception { return dfs get inotify event stream ( ) ; }


this should only be called as last operation from a method as this may adjust the underlying array of components and so affect the index etc

private void consolidate if needed ( ) { / / consolidate if the number of components will exceed the allowed maximum by the current / / operation int size = component count ; if ( size > max num components ) { consolidate 0 ( 0 , size ) ; } }


creates list of users with given input array < b > 0 < b > - successful operation

public void create users with list input ( list < user > body , map < string , object > params ) throws i o exception { create users with list input for http response ( body , params ) ; }


returns the fifteen - minute moving average rate


public static boolean delete all in dir ( final file dir ) { return delete files in dir with filter ( dir , new file filter ( ) { @ override public boolean accept ( file pathname ) { return true ; } } ) ; }


returns a matcher with identical behavior to the given { @ link character } - based predicate , but which operates on primitive { @ code char } instances instead

public static char matcher for predicate ( final predicate < ? super character > predicate ) { return predicate instanceof char matcher ? ( char matcher ) predicate : new for predicate ( predicate ) ; } / / constructors


returns file id associated with original buffer file

long get original file i d ( ) { return original file id ; }


sets a tag to use instead of the fully qualifier class name this can make the json easier to read

public void add class tag ( string tag , class type ) { tag to class put ( tag , type ) ; class to tag put ( type , tag ) ; }


prevents subtle bugs which can result in mixed - length traces from linking

@ test protected void get traces differentiates debug from shared ( test info test info ) throws exception { string test suffix = test suffix ( test info ) ; span client span = new client span ( test suffix ) to builder ( ) debug ( true ) build ( ) ; span server span = client span to builder ( ) kind ( server ) debug ( null ) shared ( true ) build ( ) ; accept ( client span , server span ) ; / / assert get traces returns does recursive comparison assert get traces returns ( as list ( client span trace id ( ) ) , as list ( client span , server span ) ) ; }


adds a move instruction after the phi insn block

public void add move to beginning ( register spec result , register spec source ) { if ( result get reg ( ) = = source get reg ( ) ) { / / sometimes we end up with no - op moves ignore them here return ; } register spec list sources = register spec list make ( source ) ; normal ssa insn to add = new normal ssa insn ( new plain insn ( rops op move ( result get type ( ) ) , source position no info , result , sources ) , this ) ; insns add ( get count phi insns ( ) , to add ) ; moves from phis at beginning + + ; }


returns a { @ link com bumptech glide request request options } with { @ link # encode format ( android graphics bitmap compress format ) } called with the given format

public static request options encode format of ( @ non null bitmap compress format format ) { return new request options ( ) encode format ( format ) ; }


protected static boolean is login flow active ( final request context request context ) { return request context get active flow ( ) get id ( ) equals ignore case ( cas webflow configurer flow id login ) ; }


returns an encoded form of the class name for compact use

private static string encode ( string class name ) { return feature make enum name ( class name ) replace first ( " strong keys " , " p " ) / / puissant replace first ( " weak keys " , " f " ) / / faible replace first ( " strong values " , " s " ) replace first ( " weak values " , " w " ) replace first ( " soft values " , " d " ) / / doux replace first ( " expire access " , " a " ) replace first ( " expire write " , " w " ) replace first ( " refresh write " , " r " ) replace first ( " maximum " , " m " ) replace first ( " weight " , " w " ) replace first ( " size " , " s " ) ; }


take a string which is a delimited list and convert it to a string array a single delimiter can consists of more than one character : it will still be considered as single delimiter string , rather than as bunch of potential delimiter characters - in contrast to { @ code tokenize to string array }

public static string [ ] delimited list to string array ( string str , string delimiter , string chars to delete ) { if ( str = = null ) { return new string [ 0 ] ; } if ( delimiter = = null ) { return new string [ ] { str } ; } list < string > result = new array list < > ( ) ; if ( " " equals ( delimiter ) ) { for ( int i = 0 ; i < str length ( ) ; i + + ) { result add ( delete any ( str substring ( i , i + 1 ) , chars to delete ) ) ; } } else { int pos = 0 ; int del pos ; while ( ( del pos = str index of ( delimiter , pos ) ) ! = - 1 ) { result add ( delete any ( str substring ( pos , del pos ) , chars to delete ) ) ; pos = del pos + delimiter length ( ) ; } if ( str length ( ) > 0 & & pos < = str length ( ) ) { / / add rest of string , but not in case of empty input result add ( delete any ( str substring ( pos ) , chars to delete ) ) ; } } return to string array ( result ) ; }


request object metadata ; increments counters in the process retry policy : retry untranslated

object metadata get object metadata ( string key ) throws i o exception { return get object metadata ( key , null , invoker , null ) ; }


variant of { @ link # with publisher ( string , publisher , class ) } that accepts a { @ link parameterized type reference } for the element type , which allows specifying generic type information

< t , p extends publisher < t > > multipart inserter with publisher ( string name , p publisher , parameterized type reference < t > type reference ) ;


marks the given visitor accepter as being used in this context , the visitor accepter will be a name and type constant object

private void mark as used ( visitor accepter visitor accepter ) { visitor accepter set visitor info ( used ) ; }


given the local state of pending storage mutations , this will generate a result that will include that data that needs to be written to the storage service , as well as any changes you need to write back to local storage ( like storage keys that might have changed for updated contacts )

public static @ non null optional < local write result > build storage updates for local ( long current manifest version , @ non null list < storage id > current local keys , @ non null list < recipient settings > updates , @ non null list < recipient settings > inserts , @ non null list < recipient settings > deletes , @ non null optional < signal account record > account update , @ non null optional < signal account record > account insert ) { int account count = stream of ( current local keys ) filter ( id - > id get type ( ) = = manifest record identifier type account value ) to list ( ) size ( ) ; if ( account count > 1 ) { throw new multiple existing accounts exception ( ) ; } optional < storage id > account id = optional from nullable ( stream of ( current local keys ) filter ( id - > id get type ( ) = = manifest record identifier type account value ) find first ( ) or else ( null ) ) ; if ( account id is present ( ) & & account insert is present ( ) & & ! account insert get ( ) get id ( ) equals ( account id get ( ) ) ) { throw new invalid account insert exception ( ) ; } if ( account id is present ( ) & & account update is present ( ) & & ! account update get ( ) get id ( ) equals ( account id get ( ) ) ) { throw new invalid account update exception ( ) ; } if ( account update is present ( ) & & account insert is present ( ) ) { throw new invalid account dual insert update exception ( ) ; } set < storage id > complete ids = new linked hash set < > ( current local keys ) ; set < signal storage record > storage inserts = new linked hash set < > ( ) ; set < byte buffer > storage deletes = new linked hash set < > ( ) ; map < recipient id , byte [ ] > storage key updates = new hash map < > ( ) ; for ( recipient settings insert : inserts ) { if ( insert get group type ( ) = = recipient database group type signal v2 & & insert get sync extras ( ) get group master key ( ) = = null ) { log w ( tag , " missing master key on gv 2 recipient " ) ; continue ; } storage inserts add ( storage sync models local to remote record ( insert ) ) ; switch ( insert get group type ( ) ) { case none : complete ids add ( storage id for contact ( insert get storage id ( ) ) ) ; break ; case signal v1 : complete ids add ( storage id for group v 1 ( insert get storage id ( ) ) ) ; break ; case signal v2 : complete ids add ( storage id for group v 2 ( insert get storage id ( ) ) ) ; break ; default : throw new assertion error ( " unsupported type ! " ) ; } } if ( account insert is present ( ) ) { storage inserts add ( signal storage record for account ( account insert get ( ) ) ) ; complete ids add ( account insert get ( ) get id ( ) ) ; } for ( recipient settings delete : deletes ) { byte [ ] key = objects require non null ( delete get storage id ( ) ) ; storage deletes add ( byte buffer wrap ( key ) ) ; complete ids remove ( storage id for contact ( key ) ) ; } for ( recipient settings update : updates ) { storage id old id ; storage id new id ; switch ( update get group type ( ) ) { case none : old id = storage id for contact ( update get storage id ( ) ) ; new id = storage id for contact ( generate key ( ) ) ; break ; case signal v1 : old id = storage id for group v 1 ( update get storage id ( ) ) ; new id = storage id for group v 1 ( generate key ( ) ) ; break ; case signal v2 : old id = storage id for group v 2 ( update get storage id ( ) ) ; new id = storage id for group v 2 ( generate key ( ) ) ; break ; default : throw new assertion error ( " unsupported type ! " ) ; } storage inserts add ( storage sync models local to remote record ( update , new id get raw ( ) ) ) ; storage deletes add ( byte buffer wrap ( old id get raw ( ) ) ) ; complete ids remove ( old id ) ; complete ids add ( new id ) ; storage key updates put ( update get id ( ) , new id get raw ( ) ) ; } if ( account update is present ( ) ) { storage id old id = account update get ( ) get id ( ) ; storage id new id = storage id for account ( generate key ( ) ) ; storage inserts add ( signal storage record for account ( new id , account update get ( ) ) ) ; storage deletes add ( byte buffer wrap ( old id get raw ( ) ) ) ; complete ids remove ( old id ) ; complete ids add ( new id ) ; storage key updates put ( recipient self ( ) get id ( ) , new id get raw ( ) ) ; } if ( storage inserts is empty ( ) & & storage deletes is empty ( ) ) { return optional absent ( ) ; } else { list < byte [ ] > storage delete bytes = stream of ( storage deletes ) map ( byte buffer : : array ) to list ( ) ; list < storage id > complete ids bytes = new array list < > ( complete ids ) ; signal storage manifest manifest = new signal storage manifest ( current manifest version + 1 , complete ids bytes ) ; write operation result write operation result = new write operation result ( manifest , new array list < > ( storage inserts ) , storage delete bytes ) ; return optional of ( new local write result ( write operation result , storage key updates ) ) ; } }


adds port information to the builder does only affect redis uri , cannot be used with sentinel connections

public redis connection config builder with port ( int port ) { assert util assert state ( this host ! = null , " host is null cannot use in sentinel mode " ) ; assert util is true ( is valid port ( port ) , string format ( " port out of range : % s " , port ) ) ; this port = port ; return this ; }


public abstract file i o channel get channel ( ) ;


transcodes an image to match the specified rotation angle and the scale factor

public static void transcode jpeg ( final input stream input stream , final output stream output stream , final int rotation angle , final int scale numerator , final int quality ) throws i o exception { native jpeg transcoder so loader ensure ( ) ; preconditions check argument ( scale numerator > = min scale numerator ) ; preconditions check argument ( scale numerator < = max scale numerator ) ; preconditions check argument ( quality > = min quality ) ; preconditions check argument ( quality < = max quality ) ; preconditions check argument ( jpeg transcoder utils is rotation angle allowed ( rotation angle ) ) ; preconditions check argument ( scale numerator ! = scale denominator | | rotation angle ! = 0 , " no transformation requested " ) ; native transcode jpeg ( preconditions check not null ( input stream ) , preconditions check not null ( output stream ) , rotation angle , scale numerator , quality ) ; }


returns the { @ link platform info } provider from the { @ link configured target } in the { @ link value or exception 3 } , or { @ code null } if the { @ link configured target } is not present if the { @ link configured target } does not have a { @ link platform info } provider , a { @ link invalid platform exception } is thrown

private static platform info find platform info ( configured target key key , value or exception 3 < configured value creation exception , no such thing exception , action conflict exception > value or exception , boolean sanity check configuration ) throws invalid platform exception { try { configured target value ctv = ( configured target value ) value or exception get ( ) ; if ( ctv = = null ) { return null ; } configured target configured target = ctv get configured target ( ) ; build configuration value key configuration key = configured target get configuration key ( ) ; / / this check is necessary because trimming for other rules assumes that platform resolution / / uses the platform fragment and only the platform fragment without this check , it ' s / / possible another fragment could slip in without us realizing , and thus break this / / assumption if ( sanity check configuration & & configuration key get fragments ( ) stream ( ) any match ( not ( equal to ( platform configuration class ) ) ) ) { / / only the platform configuration fragment may be present on a platform rule in retroactive / / trimming mode string extra fragment description = configuration key get fragments ( ) stream ( ) filter ( not ( equal to ( platform configuration class ) ) ) map ( class : : get simple name ) collect ( joining ( " , " ) ) ; throw new invalid platform exception ( configured target get label ( ) , " has fragments other than platform configuration , " + " which is forbidden in retroactive trimming mode : " + " extra fragments are [ " + extra fragment description + " ] " ) ; } platform info platform info = platform provider utils platform ( configured target ) ; if ( platform info = = null ) { throw new invalid platform exception ( configured target get label ( ) ) ; } return platform info ; } catch ( configured value creation exception e ) { throw new invalid platform exception ( key get label ( ) , e ) ; } catch ( no such thing exception e ) { throw new invalid platform exception ( e ) ; } catch ( action conflict exception e ) { throw new invalid platform exception ( key get label ( ) , e ) ; } }


if this future has been cancelled ( and possibly interrupted ) , cancels ( and possibly interrupts ) the given future ( if available )

final void maybe propagate cancellation to ( @ nullable decl future < ? > related ) { if ( related ! = null & is cancelled ( ) ) { related cancel ( was interrupted ( ) ) ; } }


sets the path to use for redirecting stderr , if any

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


public g byte provider get byte provider ( ) { return provider ; }


specify the delayed duration when the procedures need to retry

public builder set delay duration ( long value ) { this delay duration = value ; return this ; }


{ @ inherit doc } the default implementation does nothing

@ override public void exit order by ( sql base parser order by context ctx ) { }


this creates a new { @ link exec group context } object every time this is called this seems better than pre - creating and storing all { @ link exec group context } s since they ' re just thin wrappers around { @ link resolved toolchain context } objects

public exec group context get index ( starlark semantics semantics , object key ) throws eval exception { string exec group = cast group name ( key ) ; if ( ! contains key ( semantics , key ) ) { throw starlark errorf ( " in % s , unrecognized exec group ' % s ' requested available exec groups : [ % s ] " , toolchain collection ( ) get default toolchain context ( ) target description ( ) , exec group , string join ( " , " , get scrubbed exec groups ( ) ) ) ; } return new exec group context ( toolchain collection ( ) get toolchain context ( exec group ) ) ; }


tests that the number of remembered checkpoints configuration is respected

public void test tracker without history ( ) throws exception { int number of subtasks = 3 ; execution job vertex job vertex = mock ( execution job vertex class ) ; when ( job vertex get job vertex id ( ) ) then return ( new job vertex i d ( ) ) ; when ( job vertex get parallelism ( ) ) then return ( number of subtasks ) ; checkpoint stats tracker tracker = new checkpoint stats tracker ( 0 , collections singleton list ( job vertex ) , mock ( checkpoint coordinator configuration class ) , new unregistered metrics group ( ) ) ; pending checkpoint stats pending = tracker report pending checkpoint ( 0 , 1 , checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) ) ; pending report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 0 ) ) ; pending report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 1 ) ) ; pending report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 2 ) ) ; pending report completed checkpoint ( null ) ; checkpoint stats snapshot snapshot = tracker create snapshot ( ) ; / / history should be empty assert false ( snapshot get history ( ) get checkpoints ( ) iterator ( ) has next ( ) ) ; / / counts should be available checkpoint stats counts counts = snapshot get counts ( ) ; assert equals ( 1 , counts get number of completed checkpoints ( ) ) ; assert equals ( 1 , counts get total number of checkpoints ( ) ) ; / / summary should be available completed checkpoint stats summary summary = snapshot get summary stats ( ) ; assert equals ( 1 , summary get state size stats ( ) get count ( ) ) ; assert equals ( 1 , summary get end to end duration stats ( ) get count ( ) ) ; / / latest completed checkpoint assert not null ( snapshot get history ( ) get latest completed checkpoint ( ) ) ; assert equals ( 0 , snapshot get history ( ) get latest completed checkpoint ( ) get checkpoint id ( ) ) ; }


returns the string value for the given key if the key does not exist it will return null

public string get ( string key ) { add to defaults ( key , null ) ; unrequested parameters remove ( key ) ; return data get ( key ) ; }


private static < k , v > red black entry node color color of ( red black entry < k , v > p ) { return ( p = = null ? black : p color ) ; }


get the maximum interval between receiving a row and emitting it ( as part of a joined result ) this is the time interval by which watermarks need to be held back

public long get max output delay ( ) { return math max ( left relative size , right relative size ) + allowed lateness ; }


get the url for the leader ' s rest interface , or null if we do not have the leader ' s url yet

private string leader url ( ) { if ( assignment = = null ) return null ; return assignment leader url ( ) ; }


gets the decoded frames only used if the { @ code image decode options } were configured to decode all frames at decode time

public list < closeable reference < bitmap > > get decoded frames ( ) { return closeable reference clone or null ( m decoded frames ) ; }


post fakeinline - additional properties : test inline additional properties

default response entity < void > test inline additional properties ( @ api param ( value = " request body " , required = true ) @ valid @ request body map < string , string > param ) { return get delegate ( ) test inline additional properties ( param ) ; }


get a cached peer connected to the given data node

public peer get ( datanode i d dn id , boolean is domain ) { if ( capacity < = 0 ) { / / disabled return null ; } return get internal ( dn id , is domain ) ; }


returns a field location for the given block , offset

field location get field location ( byte block block , big integer offset ) { return index map get field location ( block , offset , field factories ) ; }


after data has been inserted into the partition path , the partition may need to be created ( if doesn ' t exists ) or updated

void create or alter partition ( linked hash map < string , string > partition spec , path partition path ) throws exception ;


public void update character stream ( int column index , reader x , long length ) throws s q l exception { }


public void print context ( print writer out ) { out println ( get message ( ) ) ; out print ( context ) ; }


return true if this instance has a defined port

public boolean has port ( ) { return port > = 0 ; }


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

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


only report metrics which match the given filter

public builder filter ( metric filter filter ) { this filter = filter ; return this ; }


set whether to lazily start a database resource transaction within a spring - managed eclipse link transaction by default , read - only transactions are started lazily but regular non - read - only transactions are started early this allows for reusing the same jdbc connection throughout an entire eclipse link transaction , for enforced isolation and consistent visibility with jdbc access code working on the same data source switch this flag to " true " to enforce a lazy database transaction begin even for non - read - only transactions , allowing access to eclipse link ' s shared cache and following eclipse link ' s connection mode configuration , assuming that isolation and visibility at the jdbc level are less important

public void set lazy database transaction ( boolean lazy database transaction ) { this lazy database transaction = lazy database transaction ; }


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

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


returns constraint ' s summary all constraints summary will be formatted as constraint [ constraint - name ] [ constraint - type ] ( [ constraint - definition ] ) e g constraint pk primary key ( f 0 , f 1 )

public final string as summary string ( ) { final string type string ; switch ( get type ( ) ) { case primary key : type string = " primary key " ; break ; case unique key : type string = " unique " ; break ; default : throw new illegal state exception ( " unknown key type : " + get type ( ) ) ; } return string format ( " constraint % s % s ( % s ) " , get name ( ) , type string , string join ( " , " , columns ) ) ; }


test sps for low redundant file blocks 1 create cluster with 10 datanode 1 create one striped file with default ec policy 2 set policy and call satisfy storage policy for file 3 stop name node and datanodes 4 start name node with 5 datanode and wait for block movement 5 start remaining 5 datanode 6 all replica should be moved in proper storage based on policy

public void test s p s when file has low redundancy blocks ( ) throws exception { / / start 9 datanodes int num of datanodes = 9 ; int storages per datanode = 2 ; long capacity = 20 * default stripe block size ; long [ ] [ ] capacities = new long [ num of datanodes ] [ storages per datanode ] ; for ( int i = 0 ; i < num of datanodes ; i + + ) { for ( int j = 0 ; j < storages per datanode ; j + + ) { capacities [ i ] [ j ] = capacity ; } } conf set ( d f s config keys dfs storage policy satisfier recheck timeout millis key , " 3000 " ) ; conf set ( d f s config keys dfs storage policy satisfier self retry timeout millis key , " 5000 " ) ; final mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( num of datanodes ) storages per datanode ( storages per datanode ) storage types ( new storage type [ ] [ ] { { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } } ) storage capacities ( capacities ) build ( ) ; try { cluster wait active ( ) ; start s p s ( ) ; distributed file system fs = cluster get file system ( ) ; fs enable erasure coding policy ( striped file test util get default e c policy ( ) get name ( ) ) ; path bar dir = new path ( " / bar " ) ; fs mkdirs ( bar dir ) ; / / set an ec policy on " / bar " directory fs set erasure coding policy ( bar dir , striped file test util get default e c policy ( ) get name ( ) ) ; / / write file to bar dir final path foo file = new path ( " / bar / foo " ) ; long file len = cell size * data blocks ; d f s test util create file ( cluster get file system ( ) , foo file , file len , ( short ) 3 , 0 ) ; / / move file to archive fs set storage policy ( bar dir , " cold " ) ; / / stop data nodes and restart namenode list < data node properties > list = new array list < > ( num of datanodes ) ; for ( int i = 0 ; i < num of datanodes ; i + + ) { list add ( cluster stop data node ( 0 ) ) ; } cluster restart name nodes ( ) ; / / restart half datanodes for ( int i = 0 ; i < 5 ; i + + ) { cluster restart data node ( list get ( i ) , false ) ; } cluster wait active ( ) ; fs satisfy storage policy ( foo file ) ; d f s test util wait expected storage type ( foo file to string ( ) , storage type archive , 5 , 30000 , cluster get file system ( ) ) ; / / start remaining datanodes for ( int i = num of datanodes - 1 ; i > = 5 ; i - - ) { cluster restart data node ( list get ( i ) , false ) ; } cluster wait active ( ) ; / / verify storage types and locations wait expected storage type ( cluster , foo file to string ( ) , file len , storage type archive , 9 , 9 , 60000 ) ; } finally { cluster shutdown ( ) ; sps stop gracefully ( ) ; } }


collects java compilation arguments for this target

public java compilation args provider collect java compilation args ( boolean is never link , boolean src less deps export ) { return collect java compilation args ( is never link , src less deps export , / * java proto library strict deps = * / false ) ; }


we ' re using the get settings api here to resolve the authorized indices for the user this is because the cluster state and cluster health a p is do not filter output based on index privileges , so they can ' t be used to determine which indices are authorized or not on top of this , the indices stats api cannot be used either to resolve indices as it does not provide information for all existing indices ( for example recovering indices or non replicated closed indices are not reported in indices stats response )

private void send get settings request ( final string [ ] indices , final indices options indices options , final time value master node timeout , final node client client , final action listener < get settings response > listener ) { final get settings request request = new get settings request ( ) ; request indices ( indices ) ; request indices options ( indices options ) ; request master node timeout ( master node timeout ) ; request names ( index settings index search throttled get key ( ) ) ; client admin ( ) indices ( ) get settings ( request , listener ) ; }


resets the component to the initial state

public void reset ( ) { m detector reset ( ) ; }


tests that at least one checkpoint needs to be retained

public void test exception on no retained checkpoints ( ) throws exception { create completed checkpoints ( 0 ) ; }


job graph retrieve job graph ( configuration configuration ) throws flink exception ;


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

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


recompute function body an open transaction must already exist

public static boolean fixup function body ( program program , instruction start inst , task monitor monitor ) throws cancelled exception { / / have no instruction , so nothing to do , body is already good if ( start inst = = null ) { return true ; } function func = program get function manager ( ) get function containing ( start inst get min address ( ) ) ; return fixup function body ( program , func , monitor ) ; }


post pet { pet id } upload image : uploads an image

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


checks if the given other instance contains the same files as well as the same { @ link # shard state identifier }

public boolean is same ( snapshot files other ) { if ( objects equals ( shard state identifier , other shard state identifier ) = = false ) { return false ; } final int file count = index files size ( ) ; if ( other index files size ( ) ! = file count ) { return false ; } for ( int i = 0 ; i < file count ; i + + ) { if ( index files get ( i ) is same ( other index files get ( i ) ) = = false ) { return false ; } } return true ; }


public void delete pet ( long pet id , string api key ) { }


utility to create a { @ link container status } during exceptional circumstances

public static container status create preempted container status ( container id container id , string diagnostics ) { return create abnormal container status ( container id , container exit status preempted , diagnostics ) ; }


verify that if all config options are unset , the file output committer is returned

public void test implicit file binding ( ) throws throwable { task conf ref unset ( fs s3a committer name ) ; filesystem conf ref unset ( fs s3a committer name ) ; assert factory creates expected committer ( file output committer class ) ; }


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

public void start timeline collector ( ) { app level timeline collector collector = new app level timeline collector ( application id , user ) ; rm context get r m timeline collector manager ( ) put if absent ( application id , collector ) ; }


create a kafka topic with given partition and a replication factor of 1

public void create topic ( string topic , int partitions ) { create topic ( topic , partitions , 1 , new hash map < > ( ) ) ; }


the offset of the transform from the world origin ( which at the time of writing is the ( 0 , 0 ) at the upper left - hand corner of the gui this is for the layout transformer

public point get layout translate coordinates ( ) { return layout translate coordinates ; }


wraps an expression in a predicate or returns null

static predicate of ( rex node t ) { final predicate p = comparison of ( t ) ; if ( p ! = null ) { return p ; } return is predicate of ( t ) ; }


assert that a service configuration contains a specific key ; the value is ignored

public static void assert service configuration contains ( service service , string key ) { assert not null ( " no option " + key + " in service configuration " , service get config ( ) get ( key ) ) ; }