create a shell command executor object which returns numerical group names of a user

protected shell command executor create group executor ( string user name ) { shell command executor executor = mock ( shell command executor class ) ; try { / / there is a numerical group 23 , but no group name 23 / / thus 23 is treated as a resolvable group name do nothing ( ) when ( executor ) execute ( ) ; when ( executor get output ( ) ) then return ( " 23 \ n 2 3 groupname zzz " ) ; } catch ( i o exception e ) { testlog warn ( e get message ( ) ) ; } return executor ; }


this method should be invoked to notify the policy about responses being received this is useful for stateful policies that make decisions based on previous responses being received

void notify of response ( sub cluster id sub cluster id , allocate response response ) throws yarn exception ;


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

t visit order by ( sql base parser order by context ctx ) ;


prepare deps of patterns function always keeps going despite any target pattern parsing errors , in keeping with the original behavior of { @ link walkable graph walkable graph factory # prepare and get } , which always used { @ code keep going = true } during target pattern parsing because it was responsible for ensuring that queries had a complete graph to work on

public void test parsing problems no keep going ( ) throws exception { parsing problem ( / * keep going = * / false ) ; }


query given sql to create a prepared statement from sql and a list of arguments to bind to the query , expecting a result list the results will be mapped to a list ( one entry for each row ) of maps ( one entry for each column , using the column name as the key ) each element in the list will be of the form returned by this interface ' s { @ code query for map } methods

list < map < string , object > > query for list ( string sql , object [ ] args , int [ ] arg types ) throws data access exception ;


replace " $ prefix " or " ~ " prefix with termux absolute paths

private string parse path ( string path ) { if ( path ! = null & & ! path is empty ( ) ) { path = path replace all ( " ^ \ \ $ prefix \ \ / " , termux service prefix path + " / " ) ; path = path replace all ( " ^ ~ \ \ / " , termux service home path + " / " ) ; } return path ; }


sets all deprecated properties that are not currently set but have a corresponding new property that is set useful for iterating the properties when all deprecated properties for currently set properties need to be present

public void set deprecated properties ( ) { deprecation context deprecations = deprecation context get ( ) ; properties props = get props ( ) ; properties overlay = get overlay ( ) ; for ( map entry < string , deprecated key info > entry : deprecations get deprecated key map ( ) entry set ( ) ) { string dep key = entry get key ( ) ; if ( ! overlay contains ( dep key ) ) { for ( string new key : entry get value ( ) new keys ) { string val = overlay get property ( new key ) ; if ( val ! = null ) { props set property ( dep key , val ) ; overlay set property ( dep key , val ) ; break ; } } } } }


creates a new { @ link thread pool layout handler } with the provided configuration this method will create a new { @ code thread pool executor } which can negatively affect the performance of the app

public static thread pool layout handler get new instance ( layout thread pool configuration configuration ) { return new thread pool layout handler ( configuration ) ; }


< code > optional string foo = 1 ; < code >


returns an input stream for reading the contents of the specified zip file entry closing this zip file will , in turn , close all input streams that have been returned by invocations of this method

public input stream get input stream ( zip file entry entry ) throws i o exception { if ( ! zip data get entry ( entry get name ( ) ) equals ( entry ) ) { throw new zip exception ( string format ( " zip file ' % s ' does not contain the requested entry ' % s ' " , file get name ( ) , entry get name ( ) ) ) ; } return new zip entry input stream ( this , entry , / * raw * / false ) ; }


test the audit log format for successful events passing nulls

private void test success log nulls ( boolean check i p ) { string s log = r m audit logger create success log ( null , null , null , null , null , null , null ) ; string builder exp log = new string builder ( ) ; exp log append ( " user = null \ t " ) ; if ( check i p ) { inet address ip = server get remote ip ( ) ; exp log append ( keys ip name ( ) + " = " + ip get host address ( ) + " \ t " ) ; } exp log append ( " operation = null \ t t a r g e t = null \ t r e s u l t = success " ) ; assert equals ( exp log to string ( ) , s log ) ; }


sets new values to all fields of the tuple

public void set fields ( t0 value 0 , t1 value 1 ) { this f 0 = value 0 ; this f 1 = value 1 ; }


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

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


register a field error for the specified field of the current object ( respecting the current nested path , if any ) , using the given error description the field name may be { @ code null } or empty string to indicate the current object itself rather than a field of it this may result in a corresponding field error within the nested object graph or a global error if the current object is the top object

void reject value ( @ nullable string field , string error code , @ nullable object [ ] error args , @ nullable string default message ) ;


tracks the given new non runnable app so that it can be made runnable when it would not violate max running app limits

public void track non runnable app ( f s app attempt app ) { string user = app get user ( ) ; users non runnable apps put ( user , app ) ; }


set the delivery mode to use when sending a message default is the jms message default : " persistent "

public void set delivery mode ( int delivery mode ) { this delivery mode = delivery mode ; }


set whether to allow circular references between beans - and automatically try to resolve them note that circular reference resolution means that one of the involved beans will receive a reference to another bean that is not fully initialized yet this can lead to subtle and not - so - subtle side effects on initialization ; it does work fine for many scenarios , though default is " true " turn this off to throw an exception when encountering a circular reference , disallowing them completely < b > note : < b > it is generally recommended to not rely on circular references between your beans refactor your application logic to have the two beans involved delegate to a third bean that encapsulates their common logic

public void set allow circular references ( boolean allow circular references ) { this allow circular references = allow circular references ; }


adds an encoding character to the encoded key value string - two parameter version

void metaph add ( string main , string alt ) { if ( ! ( main equals ( " a " ) & & ( m primary length ( ) > 0 ) & & ( m primary char at ( m primary length ( ) - 1 ) = = ' a ' ) ) ) { m primary append ( main ) ; } if ( ! ( alt equals ( " a " ) & & ( m secondary length ( ) > 0 ) & & ( m secondary char at ( m secondary length ( ) - 1 ) = = ' a ' ) ) ) { if ( ! alt is empty ( ) ) { m secondary append ( alt ) ; } } }


public global transactional get transaction annotation ( ) { return transaction annotation ; }


returns the number of remaining elements in this buffer , that is { @ code limit - position }

public final int remaining ( ) { return limit - position ; }


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

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


returns all child configurations resulting from a given split transition on a given configuration

protected list < build configuration > get split configurations ( build configuration configuration , split transition split transition ) throws interrupted exception , options parsing exception , invalid configuration exception { immutable list builder < build configuration > split configs = immutable list builder ( ) ; build options view fragment restricted options = new build options view ( configuration get options ( ) , split transition requires option fragments ( ) ) ; for ( build options split options : split transition split ( fragment restricted options , event collector ) values ( ) ) { split configs add ( get skyframe executor ( ) get configuration for testing ( reporter , configuration fragment classes ( ) , split options ) ) ; } return split configs build ( ) ; }


returns a filter that evaluates to { @ code true } if the test case description matches specified regular expression otherwise , returns { @ code false }

public static reg ex test case filter include ( string regular expression ) { return new reg ex test case filter ( regular expression , false ) ; }


copy or hardlink cached value to a specified directory , if it exists we ' re using hardlinking instead of symlinking because symlinking require weird checks to verify that the symlink still points to an existing artifact e g cleaning up the central cache but not the workspace cache

public synchronized path get ( string cache key , path target path , key type key type , string canonical id ) throws i o exception , interrupted exception { if ( thread interrupted ( ) ) { throw new interrupted exception ( ) ; } preconditions check state ( is enabled ( ) ) ; assert key is valid ( cache key , key type ) ; if ( ! exists ( cache key , key type ) ) { return null ; } path cache entry = key type get cache path ( content addressable path ) get relative ( cache key ) ; path cache value = cache entry get relative ( default cache filename ) ; try { assert file checksum ( cache key , cache value , key type ) ; } catch ( i o exception e ) { / / new lines because this error message gets large printing multiple absolute filepaths throw new i o exception ( e get message ( ) + " \ n \ n " + " please delete the directory " + cache entry + " and try again " ) ; } if ( ! strings is null or empty ( canonical id ) ) { if ( ! has canonical id ( cache key , key type , canonical id ) ) { return null ; } } file system utils create directory and parents ( target path get parent directory ( ) ) ; if ( use hardlinks ) { file system utils create hard link ( target path , cache value ) ; } else { file system utils copy file ( cache value , target path ) ; } try { file system utils touch file ( cache value ) ; } catch ( i o exception e ) { / / ignore , because the cache might be on a read - only volume } return target path ; }


grant a vote to a candidate and become a follower for this epoch we will remain in this state until either the election timeout expires or a leader is elected in particular , we do not begin fetching until the election has concluded and { @ link # transition to follower ( int , int ) } is invoked

public void transition to voted ( int epoch , int candidate id ) throws i o exception { if ( candidate id = = local id ) { throw new illegal state exception ( " cannot transition to voted with voted id = " + candidate id + " and epoch = " + epoch + " since it matches the local broker id " ) ; } else if ( is observer ( ) ) { throw new illegal state exception ( " cannot transition to voted with voted id = " + candidate id + " and epoch = " + epoch + " since the local broker id = " + local id + " is not a voter " ) ; } else if ( ! is voter ( candidate id ) ) { throw new illegal state exception ( " cannot transition to voted with voter id = " + candidate id + " and epoch = " + epoch + " since it is not one of the voters " + voters ) ; } int current epoch = state epoch ( ) ; if ( epoch < current epoch ) { throw new illegal state exception ( " cannot transition to voted with voted id = " + candidate id + " and epoch = " + epoch + " since the current epoch " + current epoch + " is larger " ) ; } else if ( epoch = = current epoch & & ! is unattached ( ) ) { throw new illegal state exception ( " cannot transition to voted with voted id = " + candidate id + " and epoch = " + epoch + " from the current state " + state ) ; } / / note that we reset the election timeout after voting for a candidate because we / / know that the candidate has at least as good of a chance of getting elected as us transition to ( new voted state ( time , epoch , candidate id , voters , state high watermark ( ) , random election timeout ms ( ) ) ) ; }


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

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


returns whether this result is equivalent to { @ code other } for the renderer at the given index the results are equivalent if they have equal track selections and configurations for the renderer

public boolean is equivalent ( @ nullable track selector result other , int index ) { if ( other = = null ) { return false ; } return util are equal ( renderer configurations [ index ] , other renderer configurations [ index ] ) & & util are equal ( selections get ( index ) , other selections get ( index ) ) ; }


returns the full url of the request including the query string used as a convenience method for logging purposes

protected string get request u r l ( http servlet request request ) { string buffer sb = request get request u r l ( ) ; if ( request get query string ( ) ! = null ) { sb append ( " ? " ) append ( request get query string ( ) ) ; } return sb to string ( ) ; }


returns the latest { @ link completed checkpoint } instance or < code > null < code > if none was added

default completed checkpoint get latest checkpoint ( boolean is prefer checkpoint for recovery ) throws exception { list < completed checkpoint > all checkpoints = get all checkpoints ( ) ; if ( all checkpoints is empty ( ) ) { return null ; } completed checkpoint last completed = all checkpoints get ( all checkpoints size ( ) - 1 ) ; if ( is prefer checkpoint for recovery & & all checkpoints size ( ) > 1 & & last completed get properties ( ) is savepoint ( ) ) { list iterator < completed checkpoint > list iterator = all checkpoints list iterator ( all checkpoints size ( ) - 1 ) ; while ( list iterator has previous ( ) ) { completed checkpoint prev = list iterator previous ( ) ; if ( ! prev get properties ( ) is savepoint ( ) ) { log info ( " found a completed checkpoint ( { } ) before the latest savepoint , will use it to recover ! " , prev ) ; return prev ; } } log info ( " did not find earlier checkpoint , using latest savepoint to recover " ) ; } return last completed ; }


get pet { pet id } : find pet by id returns a single pet

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


splits bulk data streamed from the c + + process on ' \ 0 ' characters the data is expected to be a series of elasticsearch bulk requests in utf - 8 json ( as would be uploaded to the public rest api ) separated by zero bytes ( ' \ 0 ' )

private bytes reference split and persist ( bytes reference bytes ref , int search from ) throws i o exception { int split from = 0 ; while ( true ) { int next zero byte = find next zero byte ( bytes ref , search from , split from ) ; if ( next zero byte = = - 1 ) { / / no more zero bytes in this block break ; } / / ignore completely empty chunks if ( next zero byte > split from ) { / / no validation - assume the native process has formatted the state correctly find appropriate index or alias and persist ( bytes ref slice ( split from , next zero byte - split from ) ) ; } split from = next zero byte + 1 ; } if ( split from > = bytes ref length ( ) ) { return null ; } return bytes ref slice ( split from , bytes ref length ( ) - split from ) ; }


called before an edit batch is scrutinized


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


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


gets the local strategy comparator from this channel

public type comparator factory < ? > get local strategy comparator ( ) { return local strategy comparator ; }


a utility method for creating credentials used by web hdfs to return url encoded token

public static credentials create credentials ( final router router , final user group information ugi , final string renewer ) throws i o exception { final token < delegation token identifier > token = router get rpc server ( ) get delegation token ( new text ( renewer ) ) ; if ( token = = null ) { return null ; } final inet socket address addr = router get rpc server address ( ) ; security util set token service ( token , addr ) ; final credentials c = new credentials ( ) ; c add token ( new text ( ugi get short user name ( ) ) , token ) ; return c ; }


get the timestamp of the latest scheduler operation

public long get last scheduler run time ( ) { return last scheduler run time ; }


retrieves all of the tree props used by this component from the tree props map and sets the tree props as fields on the component impl

protected void populate tree props ( @ nullable tree props parent tree props ) { }


creates a char sequence reader wrapping the given char sequence and tests that the reader produces the same sequence when read using each type of read method it provides

private static void assert reads correctly ( char sequence char sequence ) throws i o exception { string expected = char sequence to string ( ) ; / / read char by char char sequence reader reader = new char sequence reader ( char sequence ) ; for ( int i = 0 ; i < expected length ( ) ; i + + ) { assert equals ( expected char at ( i ) , reader read ( ) ) ; } assert fully read ( reader ) ; / / read all to one array reader = new char sequence reader ( char sequence ) ; char [ ] buf = new char [ expected length ( ) ] ; assert equals ( expected length ( ) = = 0 ? - 1 : expected length ( ) , reader read ( buf ) ) ; assert equals ( expected , new string ( buf ) ) ; assert fully read ( reader ) ; / / read in chunks to fixed array reader = new char sequence reader ( char sequence ) ; buf = new char [ 5 ] ; string builder builder = new string builder ( ) ; int read ; while ( ( read = reader read ( buf , 0 , buf length ) ) ! = - 1 ) { builder append ( buf , 0 , read ) ; } assert equals ( expected , builder to string ( ) ) ; assert fully read ( reader ) ; / / read all to one char buffer reader = new char sequence reader ( char sequence ) ; char buffer buf 2 = char buffer allocate ( expected length ( ) ) ; assert equals ( expected length ( ) = = 0 ? - 1 : expected length ( ) , reader read ( buf 2 ) ) ; buf 2 flip ( ) ; assert equals ( expected , buf 2 to string ( ) ) ; assert fully read ( reader ) ; / / read in chunks to fixed char buffer reader = new char sequence reader ( char sequence ) ; buf 2 = char buffer allocate ( 5 ) ; builder = new string builder ( ) ; while ( reader read ( buf 2 ) ! = - 1 ) { buf 2 flip ( ) ; builder append ( buf 2 ) ; buf 2 clear ( ) ; } assert equals ( expected , builder to string ( ) ) ; assert fully read ( reader ) ; / / skip fully reader = new char sequence reader ( char sequence ) ; assert equals ( expected length ( ) , reader skip ( long max value ) ) ; assert fully read ( reader ) ; / / skip 5 and read the rest if ( expected length ( ) > 5 ) { reader = new char sequence reader ( char sequence ) ; assert equals ( 5 , reader skip ( 5 ) ) ; buf = new char [ expected length ( ) - 5 ] ; assert equals ( buf length , reader read ( buf , 0 , buf length ) ) ; assert equals ( expected substring ( 5 ) , new string ( buf ) ) ; assert fully read ( reader ) ; } }


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

public unsigned integer divided by ( unsigned integer val ) { return from int bits ( unsigned ints divide ( value , check not null ( val ) value ) ) ; }


< code > repeated io netty example worldclock local time local time = 1 ; < code >

io netty example worldclock world clock protocol local time or builder get local time or builder ( int index ) ;


public static synchronized void apk 2 jar ( file input , file output ) { if ( bytecode viewer python 3 equals ( " " ) ) { bytecode viewer show message ( " you need to set your python ( or py py for speed ) 3 x executable path " ) ; bytecode viewer viewer python c 3 ( ) ; } if ( bytecode viewer python 3 equals ( " " ) ) { bytecode viewer show message ( " you need to set python ! " ) ; return ; } bytecode viewer sm stop blocking ( ) ; try { process builder pb = new process builder ( bytecode viewer python 3 , " - o " , " - m " , " enjarify main " , input get absolute path ( ) , " - o " , output get absolute path ( ) , " - f " ) ; pb directory ( new file ( bytecode viewer enjarify working directory ) ) ; process process = pb start ( ) ; bytecode viewer created processes add ( process ) ; process wait for ( ) ; misc utils print process ( process ) ; } catch ( exception e ) { new the bytecode club bytecodeviewer api exception u i ( e ) ; } finally { bytecode viewer sm set blocking ( ) ; } }


get memory required to run a reduce task of the job , in mb if a value is specified in the configuration , it is returned else , it returns { @ link job context # default reduce memory mb } for backward compatibility , if the job configuration sets the key { @ link # mapred task maxvmem property } to a value different from { @ link # disabled memory limit } , that value will be used after converting it from bytes to mb

public long get memory for reduce task ( ) { long value = get deprecated memory value ( ) ; if ( value < 0 ) { return get memory required ( task type reduce ) ; } return value ; }


check whether this transaction object has a connection holder

public boolean has connection holder ( ) { return ( this connection holder ! = null ) ; }


register the given { @ link advisor adapter } note that it is not necessary to register adapters for an aop alliance interceptors or spring advices : these must be automatically recognized by an { @ code advisor adapter registry } implementation

void register advisor adapter ( advisor adapter adapter ) ;


shut down the embedded database instance that backs the supplied { @ link data source }

void shutdown ( data source data source , string database name ) ;


shows the batch import dialog ( via run swing later ) and prompts the user to select a file if the supplied { @ code batch info } is empty the dialog will chain to the { @ link import batch task } when the user clicks the ok button

public static void show and import ( plugin tool tool , batch info batch info , list < fsrl > initial files , domain folder default folder , program manager program manager ) { batch import dialog dialog = new batch import dialog ( batch info , default folder ) ; dialog set program manager ( program manager ) ; system utilities run swing later ( ( ) - > { dialog build ( ) ; if ( initial files ! = null & & ! initial files is empty ( ) ) { dialog add sources ( initial files ) ; } if ( ! dialog setup initial defaults ( ) ) { return ; } tool show dialog ( dialog ) ; } ) ; }


check if a method is supported by the server or not

public synchronized boolean is method supported ( string method name , class < ? > parameter types ) throws i o exception { if ( ! support server method check ) { return true ; } method method ; try { method = protocol get declared method ( method name , parameter types ) ; } catch ( security exception e ) { throw new i o exception ( e ) ; } catch ( no such method exception e ) { throw new i o exception ( e ) ; } if ( ! server methods fetched ) { fetch server methods ( method ) ; } if ( server methods = = null ) { / / client & server have the same protocol return true ; } return server methods contains ( integer value of ( protocol signature get fingerprint ( method ) ) ) ; }


this method is called to ask the client if they wish to consume the given event this allows clients to keep events from propagating to other listeners

public boolean should consume ( mouse event e ) { return false ; }


gracefully start the shut down of all thread pools

public synchronized void shutdown ( ) { log info ( " shutting down all async disk service threads " ) ; for ( map entry < string , thread pool executor > e : executors entry set ( ) ) { e get value ( ) shutdown ( ) ; } }


public static void main ( string [ ] args ) { / * set up * / var char proto = new character ( ) ; char proto set ( stats strength , 10 ) ; char proto set ( stats agility , 10 ) ; char proto set ( stats armor , 10 ) ; char proto set ( stats attack power , 10 ) ; var mage proto = new character ( type mage , char proto ) ; mage proto set ( stats intellect , 15 ) ; mage proto set ( stats spirit , 10 ) ; var war proto = new character ( type warrior , char proto ) ; war proto set ( stats rage , 15 ) ; war proto set ( stats armor , 15 ) ; / / boost default armor for warrior var rogue proto = new character ( type rogue , char proto ) ; rogue proto set ( stats energy , 15 ) ; rogue proto set ( stats agility , 15 ) ; / / boost default agility for rogue / * usage * / var mag = new character ( " player 1 " , mage proto ) ; mag set ( stats armor , 8 ) ; logger info ( mag to string ( ) ) ; var warrior = new character ( " player 2 " , war proto ) ; logger info ( warrior to string ( ) ) ; var rogue = new character ( " player 3 " , rogue proto ) ; logger info ( rogue to string ( ) ) ; var rogue double = new character ( " player 4 " , rogue ) ; rogue double set ( stats attack power , 12 ) ; logger info ( rogue double to string ( ) ) ; }


called once a deregister operation is made from the current registered { @ link event loop }

void deregister ( channel handler context ctx , channel promise promise ) throws exception ;


verifies a given number of bytes from a file - less number of bytes may be read if a header can not be read in due to the byte limit

private verify output verify bytes ( long byte am , long bytes read , data input stream in ) throws i o exception , bad file exception { if ( byte am < = 0 ) { return new verify output ( 0 , 0 , 0 , 0 ) ; } long chunks same = 0 ; long chunks different = 0 ; long read time = 0 ; long bytes left = byte am ; long buf left = 0 ; long buf read = 0 ; long seq num = 0 ; data hasher hasher = null ; byte buffer read buf = byte buffer wrap ( new byte [ buffer size ] ) ; while ( bytes left > 0 ) { if ( buf left < = 0 ) { if ( bytes left < data writer get header length ( ) ) { / / no bytes left to read a header break ; } / / time to read a new header read info header = null ; try { header = read header ( in ) ; } catch ( e o f exception e ) { / / eof ok on header reads / / but not on data readers break ; } + + seq num ; hasher = new data hasher ( header get hash value ( ) ) ; buf left = header get byte am ( ) ; read time + = header get time taken ( ) ; bytes read + = header get bytes read ( ) ; bytes left - = header get bytes read ( ) ; buf read = 0 ; / / number of bytes to read greater than how many we want to read if ( buf left > bytes left ) { buf left = bytes left ; } / / does the buffer amount have anything ? ? if ( buf left < = 0 ) { continue ; } } / / figure out the buffer size to read int buf size = buffer size ; if ( bytes left < buf size ) { buf size = ( int ) bytes left ; } if ( buf left < buf size ) { buf size = ( int ) buf left ; } / / read it in try { read buf rewind ( ) ; long start time = timer now ( ) ; in read fully ( read buf array ( ) , 0 , buf size ) ; read time + = timer elapsed ( start time ) ; } catch ( e o f exception e ) { throw new bad file exception ( " could not read the number of expected data bytes " + buf size + " due to unexpected end of file during sequence " + seq num , e ) ; } / / update the counters bytes read + = buf size ; bytes left - = buf size ; buf left - = buf size ; / / verify what we read read buf rewind ( ) ; / / figure out the expected hash offset start point long v offset = determine offset ( buf read ) ; / / now update for new position buf read + = buf size ; / / verify verify info verify res = verify buffer ( read buf , buf size , v offset , hasher ) ; / / update the verification counters chunks same + = verify res get same ( ) ; chunks different + = verify res get different ( ) ; } return new verify output ( chunks same , chunks different , bytes read , read time ) ; }


similar to { @ link # bind ( object ) } , but provides a non null , non empty list of payloads describing what changed this is the payloads list specified in the adapter ' s notify item changed method this is a useful optimization to allow you to only change part of a view instead of updating the whole thing , which may prevent unnecessary layout calls if there are no payloads then { @ link # bind ( object ) } is called instead this will only be used if the model is used with an { @ link epoxy adapter }

public void bind ( @ non null t view , @ non null list < object > payloads ) { bind ( view ) ; }


public map < string , boolean > get indirect map ( ) { return indirect map ; }


public @ resize mode int get resize mode ( ) { assertions check state not null ( content frame ) ; return content frame get resize mode ( ) ; }


checks boost value of a nested span clause is equal to { @ link abstract query builder # default boost }

static void check no boost ( string query name , string field name , x content parser parser , span query builder clause ) { try { if ( clause boost ( ) ! = abstract query builder default boost ) { throw new parsing exception ( parser get token location ( ) , query name + " [ " + field name + " ] " + " as a nested span clause can ' t have non - default boost value [ " + clause boost ( ) + " ] " ) ; } } catch ( unsupported operation exception ignored ) { / / if boost is unsupported it can ' t have been set } }


the < b > first < b > provider instance with a class equal to that of the given class

public < t extends component provider > t get component provider ( class < t > clazz ) { list < t > all providers = get component providers ( clazz ) ; return collection utils any ( all providers ) ; }


a sensible definition of { @ link # add ( object ) } in terms of { @ link # add ( object , int ) } if you override { @ link # add ( object , int ) } , you may wish to override { @ link # add ( object ) } to forward to this implementation

protected boolean standard add ( e element ) { add ( element , 1 ) ; return true ; }


adds providers for runtime frameworks included in the final app bundle but not linked with at build time

builder add runtime deps ( list < ? extends transitive info collection > runtime deps ) { immutable list builder < objc provider > propagated objc deps = immutable list builder ( ) ; immutable list builder < cc info > cpp deps = immutable list builder ( ) ; for ( transitive info collection dep : runtime deps ) { add any providers ( propagated objc deps , dep , objc provider starlark constructor ) ; add any providers ( cpp deps , dep , cc info provider ) ; } this runtime dep objc providers = iterables concat ( this runtime dep objc providers , propagated objc deps build ( ) ) ; add dep cc header providers ( cpp deps build ( ) ) ; return this ; }


start tracking a node for decommission or maintenance the given datanode will be queued for later processing in pending nodes this method must be called under the namenode write lock

public void start tracking node ( datanode descriptor dn ) { pending nodes add ( dn ) ; }


the number of objects available to be obtained

public int get free ( ) { return free objects size ; }


return a hexadecimal string representation of the md5 digest of the given bytes

public static string md 5 digest as hex ( byte [ ] bytes ) { return digest as hex string ( md5 algorithm name , bytes ) ; }


public int bit size ( ) { return bit length ; }


the list of sends that completed on the last { @ link # poll ( long ) poll ( ) } call

list < network send > completed sends ( ) ;


test to verify that the checksum can be computed by giving greater than cellsize length of file range for checksum calculation

public void test striped file checksum with missed data blocks range query 6 ( ) throws exception { test striped file checksum with missed data blocks range query ( striped file 1 , cell size + 1 ) ; }


determine the http status for the given exception as of 5 3 this method always returns { @ code null } in which case { @ link # determine raw status code ( throwable ) } is used instead

protected http status determine status ( throwable ex ) { return null ; }


like { @ link # do install necessary plugins ( stapler request ) } but only checks if everything is installed or if some plugins need updates or installation this method runs without side - effect i ' m still requiring the administer permission since xml file can contain various external references and we don ' t configure parsers properly against that

public j s o n array do prevalidate config ( stapler request req ) throws i o exception { jenkins get ( ) check permission ( jenkins administer ) ; j s o n array response = new j s o n array ( ) ; for ( map entry < string , version number > p : parse requested plugins ( req get input stream ( ) ) entry set ( ) ) { plugin wrapper pw = get plugin ( p get key ( ) ) ; j s o n object j = new j s o n object ( ) accumulate ( " name " , p get key ( ) ) accumulate ( " version " , p get value ( ) to string ( ) ) ; if ( pw = = null ) { / / install new response add ( j accumulate ( " mode " , " missing " ) ) ; } else if ( pw is older than ( p get value ( ) ) ) { / / upgrade response add ( j accumulate ( " mode " , " old " ) ) ; } / / else already good } return response ; }


peeks the next frame and returns a { @ link constant bitrate seeker } based on its bitrate

private seeker get constant bitrate seeker ( extractor input input ) throws i o exception { input peek fully ( scratch get data ( ) , 0 , 4 ) ; scratch set position ( 0 ) ; synchronized header set for header data ( scratch read int ( ) ) ; return new constant bitrate seeker ( input get length ( ) , input get position ( ) , synchronized header ) ; } @ ensures non null ( { " extractor output " , " real track output " }


returns a single socket or else a not found code

public io grpc channelz v 1 get socket response get socket ( io grpc channelz v 1 get socket request request ) { return io grpc stub client calls blocking unary call ( get channel ( ) , get get socket method ( ) , get call options ( ) , request ) ; }


server stream tracer factory get server tracer factory ( ) { return server tracer factory ; }


set the service names that the dubbo interface subscribed

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


returns a configuration fragment instances of the given class

public < t extends fragment > t get fragment ( class < t > clazz ) { return clazz cast ( fragments get ( clazz ) ) ; }


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


for this test , the body for this request much reference a schema named & # x 6 0 ; file & # x 6 0 ;

public void test body with file schema test ( test context context ) { async async = context async ( ) ; file schema test class body = null ; api test body with file schema ( body , result - > { / / todo : test validations async complete ( ) ; } ) ; }


reads the header following a < code > type map < code > code

public int read map header ( ) throws i o exception { return in read int ( ) ; }


returns the { @ link artifact } of the single jar deploy jar

public artifact get single jar ( ) { return single jar ; }


a float between 0 0 and 1 0 , indicating the % of reduce work completed

public float reduce progress ( ) throws i o exception { return job reduce progress ( ) ; }


adds a given local variable type to the local variable type table attribute

public void add local variable type info ( local variable type info local variable type info ) { target local variable type table attribute local variable type table = ( local variable type info [ ] ) array util add ( target local variable type table attribute local variable type table , target local variable type table attribute u 2local variable type table length + + , local variable type info ) ; }


public type list get catches ( ) { return catches ; }


execute all expired scheduled tasks and all current tasks in the executor queue until both queues are empty , or { @ code max drain attempts } has been exceeded

protected final boolean run scheduled and executor tasks ( final int max drain attempts ) { assert in event loop ( ) ; boolean ran at least one task ; int drain attempt = 0 ; do { / / we must run the task queue tasks first , because the scheduled tasks from outside the event loop are queued / / here because the task queue is thread safe and the scheduled task queue is not thread safe ran at least one task = run existing tasks from ( task queue ) | execute expired scheduled tasks ( ) ; } while ( ran at least one task & & + + drain attempt < max drain attempts ) ; if ( drain attempt > 0 ) { last execution time = scheduled future task nano time ( ) ; } after running all tasks ( ) ; return drain attempt > 0 ; }


extracts properties from a java properties file to create an { @ link extension details } object

public static extension details create extension details from properties ( properties props ) { string name = props get property ( " name " ) ; string desc = props get property ( " description " ) ; string author = props get property ( " author " ) ; string date = props get property ( " created on " ) ; string version = props get property ( " version " ) ; return new extension details ( name , desc , author , date , version ) ; }


returns a copy of this data spec with the specified http request headers headers already in the data spec are not copied to the new instance

public data spec with request headers ( map < string , string > http request headers ) { return new data spec ( uri , uri position offset , http method , http body , http request headers , position , length , key , flags , custom data ) ; }


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


public circle builder radius ( distance radius ) { return radius ( radius value , radius unit ) ; }


public void add next value ( long new val ) { if ( this min val > new val ) { this min val = new val ; } ; }


helper method to configure authentications which respects aliases of api keys

public api client configure api keys ( map < string , string > secrets ) { for ( map entry < string , authentication > auth entry : authentications entry set ( ) ) { authentication auth = auth entry get value ( ) ; if ( auth instanceof api key auth ) { string name = auth entry get key ( ) ; / / respect x - auth - id - alias property name = authentication lookup contains key ( name ) ? authentication lookup get ( name ) : name ; if ( secrets contains key ( name ) ) { ( ( api key auth ) auth ) set api key ( secrets get ( name ) ) ; } } } return this ; }


checks whether this could possibly be a field sig only looks at the identifier byte useful for signature index that could be to different kinds of signatures

public static boolean is field sig ( cli blob blob ) throws i o exception { return blob get contents reader ( ) read next byte ( ) = = clisigfield prolog ; }


public void visit branch ( int opcode , int offset , int length , int target ) { switch ( opcode ) { case byte ops ifeq : case byte ops ifne : case byte ops iflt : case byte ops ifge : case byte ops ifgt : case byte ops ifle : { machine pop args ( frame , type int ) ; break ; } case byte ops ifnull : case byte ops ifnonnull : { machine pop args ( frame , type object ) ; break ; } case byte ops if icmpeq : case byte ops if icmpne : case byte ops if icmplt : case byte ops if icmpge : case byte ops if icmpgt : case byte ops if icmple : { machine pop args ( frame , type int , type int ) ; break ; } case byte ops if acmpeq : case byte ops if acmpne : { machine pop args ( frame , type object , type object ) ; break ; } case byte ops goto : case byte ops jsr : case byte ops goto w : case byte ops jsr w : { machine clear args ( ) ; break ; } default : { visit invalid ( opcode , offset , length ) ; return ; } } machine aux target arg ( target ) ; machine run ( frame , offset , opcode ) ; }


encode special case " colonel " = > krnl can somebody tell me how this pronounciation came to be ?

boolean encode colonel ( ) { if ( string at ( ( m current - 2 ) , 7 , " colonel " , " " ) ) { metaph add ( " r " ) ; m current + = 2 ; return true ; } return false ; }


accessor for the usernames that this request pertains to < code > null < code > should never be returned !


returns the boolean value of the requested attribute , or - default value - if the attribute is missing or not the correct type

public boolean get bool ( int attribute , boolean default value ) { d w a r f boolean attribute val = get attribute ( attribute , d w a r f boolean attribute class ) ; return ( val ! = null ) ? val get value ( ) : default value ; }


create a stripped down string value for error messages

public static string to string ( uri path uri ) { return path uri ! = null ? string format ( " % s : / / % s / % s " , path uri get scheme ( ) , path uri get host ( ) , path uri get path ( ) ) : " ( null uri ) " ; }


set the name of the script engine for evaluating the scripts ( e g " groovy " ) , as exposed by the jsr - 223 script engine factory

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


set a constructor argument and build the target object if all constructor arguments have arrived

private void constructor arg ( int position , object value ) { constructor args [ position ] = value ; constructor args collected + + ; if ( constructor args collected = = constructor arg infos size ( ) ) { build target ( ) ; } }


invalidate corrupt replicas this will remove the replicas from the block ' s location list , add them to { @ link # invalidate blocks } so that they could be further deleted from the respective data - nodes , and remove the block from corrupt replicas map this method should be called when the block has sufficient number of live replicas

private void invalidate corrupt replicas ( block info blk , block reported , number replicas number replicas ) { collection < datanode descriptor > nodes = corrupt replicas get nodes ( blk ) ; boolean removed from blocks map = true ; if ( nodes = = null ) return ; / / make a copy of the array of nodes in order to avoid / / concurrent modification exception , when the block is removed from the node datanode descriptor [ ] nodes copy = nodes to array ( new datanode descriptor [ nodes size ( ) ] ) ; for ( datanode descriptor node : nodes copy ) { try { if ( ! invalidate block ( new block to mark corrupt ( reported , blk , null , reason any ) , node , number replicas ) ) { removed from blocks map = false ; } } catch ( i o exception e ) { block log debug ( " invalidate corrupt replicas error in deleting bad block " + " { } on { } " , blk , node , e ) ; removed from blocks map = false ; } } / / remove the block from corrupt replicas map if ( removed from blocks map ) { corrupt replicas remove from corrupt replicas map ( blk ) ; } }


create a datanode registration for a specific block pool

datanode registration create b p registration ( namespace info ns info ) { storage info storage info = storage get b p storage ( ns info get block pool i d ( ) ) ; if ( storage info = = null ) { / / it ' s null in the case of simulated data set storage info = new storage info ( data node layout version get current layout version ( ) , ns info get namespace i d ( ) , ns info cluster i d , ns info get c time ( ) , node type data node ) ; } datanode i d dn id = new datanode i d ( streaming addr get address ( ) get host address ( ) , host name , storage get datanode uuid ( ) , get xfer port ( ) , get info port ( ) , info secure port , get ipc port ( ) ) ; return new datanode registration ( dn id , storage info , new exported block keys ( ) , version info get version ( ) ) ; }


calculates the cubic b - spline value for the given position ( t )

public static < t extends vector < t > > t cubic ( final t out , final float t , final t [ ] points , final boolean continuous , final t tmp ) { final int n = continuous ? points length : points length - 3 ; float u = t * n ; int i = ( t > = 1f ) ? ( n - 1 ) : ( int ) u ; u - = i ; return cubic ( out , i , u , points , continuous , tmp ) ; }


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


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


updates statistics by setting the last buffer usage size

public synchronized void set last buffer size ( int value ) { last buffer size = value ; if ( min buffer size = = init value | | value < min buffer size ) { min buffer size = value ; } if ( value > max buffer size ) { max buffer size = value ; } }


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


filters out all generations that don ' t belong to any of the supplied { @ code indices } and prunes all { @ link # deleted shard gen } entries from the builder

public builder retain indices and prune deletes ( set < index id > indices ) { generations key set ( ) retain all ( indices ) ; for ( index id index : indices ) { final map < integer , string > shards = generations get or default ( index , collections empty map ( ) ) ; final iterator < map entry < integer , string > > iterator = shards entry set ( ) iterator ( ) ; while ( iterator has next ( ) ) { map entry < integer , string > entry = iterator next ( ) ; final string generation = entry get value ( ) ; if ( generation equals ( deleted shard gen ) ) { iterator remove ( ) ; } } if ( shards is empty ( ) ) { generations remove ( index ) ; } } return this ; }


< code > optional aapt pb reference type type = 1 ; < code >


returns the x - position of the highlight in pixels

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


public string to string ( ) { int value = get int bits ( ) ; return " byte { 0x " + hex u 1 ( value ) + " / " + value + ' } ' ; }


returns list of snapshots for the specified repository

public list < snapshot info > get snapshots ( string repo ) { list < snapshot info > snapshots = successful responses get ( repo ) ; if ( snapshots ! = null ) { return snapshots ; } elasticsearch exception error = failed responses get ( repo ) ; if ( error = = null ) { throw new illegal argument exception ( " no such repository " ) ; } throw error ; }


tests the simple operations inside the builder

public void test ( ) { tree string builder b = new tree string builder ( ) ; verify ( " foo " , b intern ( " foo " ) ) ; tree string s = b intern ( " foo / bar / zot " ) ; verify ( " foo / bar / zot " , s ) ; verify ( " " , b intern ( " " ) ) ; verify ( " foo / bar / xxx " , b intern ( " foo / bar / xxx " ) ) ; / / this will create new / / middle node verify ( " foo / bar / zot " , s ) ; / / make sure existing strings aren ' t affected }


public void update blob ( string column label , blob x ) throws s q l exception { }


public all types model view model drawable res ( @ drawable res int drawable res ) { on mutation ( ) ; this drawable res int = drawable res ; return this ; }


returns a default port to { @ link name resolver } for use in cases where the target string doesn ' t include a port the default implementation returns { @ link grpc util # default port ssl }

int get default port ( ) { return channel builder default port provider get default port ( ) ; }


initializes the internal state for decoding ints of ` bit width `

private void init width and packer ( int bit width ) { preconditions check argument ( bit width > = 0 & & bit width < = 32 , " bit width must be > = 0 and < = 32 " ) ; this bit width = bit width ; this bytes width = bytes utils padded byte count from bits ( bit width ) ; this packer = packer little endian new byte packer ( bit width ) ; }


bans all tasks with the specified parent task from execution , cancels all tasks that are currently executing this method is called when a parent task that has children is cancelled

public list < cancellable task > set ban ( task id parent task id , string reason , transport channel channel ) { logger trace ( " setting ban for the parent task { } { } " , parent task id , reason ) ; synchronized ( banned parents ) { final ban ban = banned parents compute if absent ( parent task id , k - > new ban ( reason ) ) ; while ( channel instanceof task transport channel ) { channel = ( ( task transport channel ) channel ) get channel ( ) ; } if ( channel instanceof tcp transport channel ) { start tracking channel ( ( ( tcp transport channel ) channel ) get channel ( ) , ban : : register channel ) ; } else { assert channel get channel type ( ) equals ( " direct " ) : " expect direct channel ; got [ " + channel + " ] " ; ban register channel ( direct channel tracker ) ; } } return cancellable tasks values ( ) stream ( ) filter ( t - > t has parent ( parent task id ) ) map ( t - > t task ) collect ( collectors to unmodifiable list ( ) ) ; }


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


use for report or some work at the beginning of tinker patch service { @ code tinker patch service on handle intent } begin

public void on patch service start ( intent intent ) { share tinker log i ( tag , " patch reporter on patch service start : patch service start " ) ; should retry = false ; upgrade patch retry get instance ( context ) on patch service start ( intent ) ; }


public static s q l type value of ( int i ) { for ( s q l type t : values ( ) ) { if ( t value ( ) = = i ) { return t ; } } throw new illegal argument exception ( " invalid s q l type : " + i ) ; }


configures the string that starts comments by default comments will be treated as invalid lines this function only recognizes comments which start at the beginning of the line !

public csv reader ignore comments ( string comment prefix ) { if ( comment prefix = = null | | comment prefix length ( ) = = 0 ) { throw new illegal argument exception ( " the comment prefix must not be null or an empty string " ) ; } this comment prefix = comment prefix ; return this ; }


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

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


returns a range that contains all values strictly greater than { @ code lower } and less than or equal to { @ code upper }

public static < c extends comparable < ? > > range < c > open closed ( c lower , c upper ) { return create ( cut above value ( lower ) , cut above value ( upper ) ) ; }


makes an instance for the given value this may ( but does not necessarily ) return an already - allocated instance

public static cst double make ( long bits ) { / * * note : javadoc notwithstanding , this implementation always * allocates * / return new cst double ( bits ) ; }


public void write ( char [ ] cbuf , int off , int len ) throws i o exception { synchronized ( lock ) { while ( len > 0 ) { write ( cbuf [ off ] ) ; off + + ; len - - ; } } }


public < t > future < t > submit ( runnable runnable , t result ) { submitted mark ( ) ; return delegate submit ( new instrumented runnable ( runnable ) , result ) ; }


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


returns the underlying { @ link jersey test } for sending requests prefer { @ link # target ( string ) }

public jersey test get jersey test ( ) { return resource get jersey test ( ) ; }


returns the stable rate ( as { @ code permits per seconds } ) with which this { @ code rate limiter } is configured with the initial value of this is the same as the { @ code permits per second } argument passed in the factory method that produced this { @ code rate limiter } , and it is only updated after invocations to { @ linkplain # set rate }

public final double get rate ( ) { synchronized ( mutex ( ) ) { return do get rate ( ) ; } }


one or more labels associated with the endpoint < code > map & lt ; string , string & gt ; labels = 3 ; < code >

public java util map < java lang string , java lang string > get labels map ( ) { return internal get labels ( ) get map ( ) ; }


public okhttp 3 call delete order call ( string order id , final api callback callback ) throws api exception { object local var post body = null ; / / create path and map variables string local var path = " / store / order / { order id } " replace all ( " \ \ { " + " order id " + " \ \ } " , local var api client escape string ( order id to string ( ) ) ) ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , " delete " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


returns true if the substring within the text string starting at start index and having the given length is a whole word a whole word is defined as the character before and after the occurrence must not be a java identifier part

public static boolean is whole word ( string text , int start index , int length ) { if ( start index > 0 ) { if ( character is java identifier part ( text char at ( start index - 1 ) ) ) { return false ; } } int end index = start index + length ; if ( end index < text length ( ) ) { if ( character is java identifier part ( text char at ( end index ) ) ) { return false ; } } return true ; }


switch to the next available user to bind to

protected void switch bind user ( authentication exception e ) { bind user info old bind user = this current bind user ; current bind user = this bind users next ( ) ; if ( ! old bind user equals ( current bind user ) ) { log info ( " switched from { } to { } after an authentication exception : { } " , old bind user , current bind user , e get message ( ) ) ; } }


returns the scr value read from the next pack in the stream , given the buffer at the pack header start position ( just behind the pack start code )

public static long read scr value from pack ( parsable byte array packet buffer ) { int original position = packet buffer get position ( ) ; if ( packet buffer bytes left ( ) < 9 ) { / / we require at 9 bytes for pack header to read scr value return c time unset ; } byte [ ] scr bytes = new byte [ 9 ] ; packet buffer read bytes ( scr bytes , / * offset = * / 0 , scr bytes length ) ; packet buffer set position ( original position ) ; if ( ! check marker bits ( scr bytes ) ) { return c time unset ; } return read scr value from pack header ( scr bytes ) ; }


determine whether this context currently holds a bean factory , i e has been refreshed at least once and not been closed yet

protected final boolean has bean factory ( ) { return ( this bean factory ! = null ) ; }


public void add task ( string datum key , data operation action ) { if ( services contains key ( datum key ) & & action = = data operation change ) { return ; } if ( action = = data operation change ) { services put ( datum key , string utils empty ) ; } tasks offer ( pair with ( datum key , action ) ) ; }


create a proxy with the configured interceptors if the bean is identified as one to proxy by the subclass

public object post process after initialization ( @ nullable object bean , string bean name ) { if ( bean ! = null ) { object cache key = get cache key ( bean get class ( ) , bean name ) ; if ( this early proxy references remove ( cache key ) ! = bean ) { return wrap if necessary ( bean , bean name , cache key ) ; } } return bean ; }


returns the section header at the specified position in the array

public section header get section header ( int index ) { if ( index > = 0 & & index < section headers length ) { return section headers [ index ] ; } return null ; }


returns the size of this big array in bytes

public long size of ( ) { return instance size + size of size of ( array ) + ( segments * size of segment ) ; }


public preview datafeed response preview datafeed ( preview datafeed request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , m l request converters : : preview datafeed , options , preview datafeed response : : from x content , collections empty set ( ) ) ; }


get flowed context value at arbitrary destination address without affecting state use this method if keeping separate flows from different flow from addresses is not important

public register value get flow context value ( address dest addr , boolean is fall through ) { return get flow context value ( address no address , dest addr , is fall through ) ; }


creates a new { @ link inet socket address } that overrides the host with { @ link # test server host }

public static inet socket address test server address ( string host , int port ) { try { inet address inet address = inet address get by name ( host ) ; inet address = inet address get by address ( test server host , inet address get address ( ) ) ; return new inet socket address ( inet address , port ) ; } catch ( unknown host exception e ) { throw new runtime exception ( e ) ; } }


fully qualified name of the resource unique in context of a collection the fully qualified name consists of a directory and basename the directory identifies the resources location in a resource hierarchy the basename identifies the specific resource name within the context of that directory the directory and basename are composed of one or more segments segments must be valid [ dns labels ] ( https : tools ietf orghtmlrfc 1 1 2 3 ) " " is the delimiter between segments the rightmost segment is the basename all segments to the left of the basename form the directory segments moving towards the left represent higher positions in the resource hierarchy , similar to reverse dns notation e g & lt ; org & gt ; & lt ; team & gt ; & lt ; subteam & gt ; & lt ; resource basename & gt ; an empty directory indicates a resource that is located at the root of the hierarchy , e g & lt ; globally scoped resource & gt ; on kubernetes the resource hierarchy is two - levels : namespaces and cluster - scoped ( i e global ) namespace resources fully qualified name is of the form : " & lt ; k 8s namespace & gt ; & lt ; k 8s resource name & gt ; " cluster scoped resources are located at the root of the hierarchy and are of the form : " & lt ; k 8s resource name & gt ; " < code > string name = 1 ; < code >

public builder set name ( java lang string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } name = value ; on changed ( ) ; return this ; }


delete user { username } : delete user this can only be done by the logged in user

completable future < response entity < void > > delete user ( @ api param ( value = " the name that needs to be deleted " , required = true ) @ path variable ( " username " ) string username ) ;


fallback to clear text passwords in configuration

protected char [ ] get password from config ( string name ) { char [ ] pass = null ; if ( get boolean ( credential provider clear text fallback , common configuration keys public hadoop security credential clear text fallback default ) ) { string pass str = get ( name ) ; if ( pass str ! = null ) { pass = pass str to char array ( ) ; } } return pass ; }


returns an { @ code unsigned long } corresponding to a given bit representation the argument is interpreted as an unsigned 64 - bit value specifically , the sign bit of { @ code bits } is interpreted as a normal bit , and all other bits are treated as usual if the argument is nonnegative , the returned result will be equal to { @ code bits } , otherwise , the result will be equal to { @ code 2 ^ 64 + bits } to represent decimal constants less than { @ code 2 ^ 63 } , consider { @ link # value of ( long ) } instead

public static unsigned long from long bits ( long bits ) { / / todo ( lowasser ) : consider caching small values , like long value of return new unsigned long ( bits ) ; }


triggers a savepoint for a job that uses the fs state backend we expect that all checkpoint files are written to a new savepoint directory submit job , wait for some progress trigger savepoint and verify that savepoint has been created shut down the cluster , re - submit the job from the savepoint , verify that the initial state has been reset , and all tasks are running again cancel job , dispose the savepoint , and verify that everything has been cleaned up

public void test trigger savepoint and resume with file based checkpoints ( ) throws exception { final int num task managers = 2 ; final int num slots per task manager = 2 ; final int parallelism = num task managers * num slots per task manager ; final mini cluster resource factory cluster factory = new mini cluster resource factory ( num task managers , num slots per task manager , get file based checkpoints config ( ) ) ; final string savepoint path = submit job and take savepoint ( cluster factory , parallelism ) ; verify savepoint ( parallelism , savepoint path ) ; restore job and verify state ( savepoint path , cluster factory , parallelism ) ; }


rx version of { @ link abstract dao # insert or replace in tx ( iterable ) } returning an observable note that the observable will emit the given entities back to its subscribers

public observable < iterable < t > > insert or replace in tx ( final iterable < t > entities ) { return wrap ( new callable < iterable < t > > ( ) { @ override public iterable < t > call ( ) throws exception { dao insert or replace in tx ( entities ) ; return entities ; } } ) ; }


perform an { @ link r socket # request stream request stream } or a { @ link r socket # request channel request channel } exchange depending on whether the request input is single or multi - payload if the return type is { @ code flux < void > } , the { @ code flux } will complete after all data is consumed

< t > flux < t > retrieve flux ( class < t > data type ) ;


updates the repository generation that running deletes and snapshot finalizations will be based on for this repository if any such operations are found in the cluster state while setting the safe repository generation

private cluster state update repository generations if necessary ( cluster state state , long old gen , long new gen ) { final string repo name = metadata name ( ) ; final snapshots in progress updated snapshots in progress ; boolean changed snapshots = false ; final list < snapshots in progress entry > snapshot entries = new array list < > ( ) ; for ( snapshots in progress entry entry : state custom ( snapshots in progress type , snapshots in progress empty ) entries ( ) ) { if ( entry repository ( ) equals ( repo name ) & & entry repository state id ( ) = = old gen ) { snapshot entries add ( entry with repo gen ( new gen ) ) ; changed snapshots = true ; } else { snapshot entries add ( entry ) ; } } updated snapshots in progress = changed snapshots ? snapshots in progress of ( snapshot entries ) : null ; final snapshot deletions in progress updated deletions in progress ; boolean changed deletions = false ; final list < snapshot deletions in progress entry > deletion entries = new array list < > ( ) ; for ( snapshot deletions in progress entry entry : state custom ( snapshot deletions in progress type , snapshot deletions in progress empty ) get entries ( ) ) { if ( entry repository ( ) equals ( repo name ) & & entry repository state id ( ) = = old gen ) { deletion entries add ( entry with repo gen ( new gen ) ) ; changed deletions = true ; } else { deletion entries add ( entry ) ; } } updated deletions in progress = changed deletions ? snapshot deletions in progress of ( deletion entries ) : null ; return snapshots service update with snapshots ( state , updated snapshots in progress , updated deletions in progress ) ; }


public synchronized void do do delete ( stapler request req , stapler response rsp ) throws i o exception , servlet exception { check permission ( delete ) ; owner delete view ( this ) ; rsp send redirect 2 ( req get context path ( ) + " / " + owner get url ( ) ) ; }


returns true if an entry with the given name may be copied over


as classloading is lazy , the classes referenced in this method will not be resolved until the first time the method is invoked , so we use this method to guard access to jenkins jvm only classes

private static list < process killing veto > all ( ) { return extension list lookup ( process killing veto class ) ; }


create mount links as follows hdfs : localhost : xxx h d f s user 0 - - > hdfs : localhost : xxx h d f s user hdfs : localhost : xxx h d f s user 1 - - > hdfs : localhost : xxx h d f s user when inner cache disabled , all matching view file system overload scheme initialized scheme file systems would not use file system cache

public void test view fs overload scheme with no inner cache and hdfs targets ( ) throws exception { final path hdfs target path = new path ( default f s u r i + hdfs user folder ) ; add mount links ( default f s u r i get authority ( ) , new string [ ] { hdfs user folder + 0 , hdfs user folder + 1 } , new string [ ] { hdfs target path to uri ( ) to string ( ) , hdfs target path to uri ( ) to string ( ) } , conf ) ; conf set boolean ( constants config viewfs enable inner cache , false ) ; / / two hdfs file systems should be there if no cache try ( file system vfs = file system get ( conf ) ) { assert assert equals ( is fall back exist ( conf ) ? 3 : 2 , vfs get child file systems ( ) length ) ; } }


tests that an access execution graph is invalidated after its ttl expired

public void test execution graph entry invalidation ( ) throws exception { final time timeout = time milliseconds ( 100l ) ; final time time to live = time milliseconds ( 1l ) ; final counting restful gateway restful gateway = create counting restful gateway ( expected job id , completable future completed future ( expected execution graph ) , completable future completed future ( expected execution graph ) ) ; try ( execution graph cache execution graph cache = new default execution graph cache ( timeout , time to live ) ) { completable future < access execution graph > execution graph future = execution graph cache get execution graph ( expected job id , restful gateway ) ; assert equals ( expected execution graph , execution graph future get ( ) ) ; / / sleep for the ttl thread sleep ( time to live to milliseconds ( ) * 5l ) ; completable future < access execution graph > execution graph future 2 = execution graph cache get execution graph ( expected job id , restful gateway ) ; assert equals ( expected execution graph , execution graph future 2 get ( ) ) ; assert that ( restful gateway get num request job calls ( ) , matchers equal to ( 2 ) ) ; } }


set additional interceptors ( or advisors ) to be applied before the implicit transaction interceptor , e g a performance monitor interceptor you may specify any aop alliance method interceptors or other spring aop advices , as well as spring aop advisors

public void set pre interceptors ( object [ ] pre interceptors ) { this pre interceptors = pre interceptors ; }


returns the { @ code short } value whose byte representation is the given 2 bytes , in big - endian order ; equivalent to { @ code shorts from byte array ( new byte [ ] { b 1 , b 2 } ) }

public static short from bytes ( byte b 1 , byte b 2 ) { return ( short ) ( ( b 1 < < 8 ) | ( b 2 & 0x f f ) ) ; }


removes a { @ link media source } from the playlist and executes a custom action on completion note : if you want to move the instance , it ' s preferable to use { @ link # move media source ( int , int , handler , runnable ) } instead note : if you want to remove a set of contiguous sources , it ' s preferable to use { @ link # remove media source range ( int , int , handler , runnable ) } instead

public synchronized media source remove media source ( int index , handler handler , runnable on completion action ) { media source removed media source = get media source ( index ) ; remove public media sources ( index , index + 1 , handler , on completion action ) ; return removed media source ; }


wait for all files in wait list to have replication number equal to rep

private void wait for replication ( ) throws i o exception { for ( path data item : wait list ) { out print ( " waiting for " + item + " " ) ; out flush ( ) ; boolean printed warning = false ; boolean done = false ; while ( ! done ) { item refresh status ( ) ; block location [ ] locations = item fs get file block locations ( item stat , 0 , item stat get len ( ) ) ; int i = 0 ; for ( ; i < locations length ; i + + ) { int current rep = locations [ i ] get hosts ( ) length ; if ( current rep ! = new rep ) { if ( ! printed warning & & current rep > new rep ) { out println ( " \ n w a r n i n g : the waiting time may be long for " + " decreasing the number of replications " ) ; printed warning = true ; } break ; } } done = i = = locations length ; if ( done ) break ; out print ( " " ) ; out flush ( ) ; try { thread sleep ( 10000 ) ; } catch ( interrupted exception e ) { } } out println ( " done " ) ; } }


public cancellable delete job async ( delete job request request , request options options , action listener < delete job response > listener ) { return rest high level client perform request async and parse entity ( request , m l request converters : : delete job , options , delete job response : : from x content , listener , collections empty set ( ) ) ; }


returns a live , read - only view of the map backing this { @ code atomic long map }

public map < k , long > as map ( ) { map < k , long > result = as map ; return ( result = = null ) ? as map = create as map ( ) : result ; }


join records of this stream with { @ link global k table } ' s records using non - windowed inner equi join the join is a primary key table lookup join with join attribute { @ code key value mapper map ( stream key value ) = = table key } " table lookup join " means , that results are only computed if { @ code k stream } records are processed this is done by performing a lookup for matching records in the current internal { @ link global k table } state in contrast , processing { @ link global k table } input records will only update the internal { @ link global k table } state and will not produce any result records for each { @ code k stream } record that finds a corresponding record in { @ link global k table } the provided { @ link value joiner } will be called to compute a value ( with arbitrary type ) for the result record the key of the result record is the same as the key of this { @ code k stream } if a { @ code k stream } input record key or value is { @ code null } the record will not be included in the join operation and thus no output record will be added to the resulting { @ code k stream } if { @ code key value mapper } returns { @ code null } implying no match exists , no output record will be added to the resulting { @ code k stream }

< gk , gv , rv > k stream < k , rv > join ( final global k table < gk , gv > global table , final key value mapper < ? super k , ? super v , ? extends gk > key selector , final value joiner < ? super v , ? super gv , ? extends rv > joiner ) ;


public void int 6 4 test ( ) { / / todo : test int 6 4 }


https : code google compguava - librariesissuesdetail ? id = 1791

public void test infinity busty time elapsed ( ) { rate limiter limiter = rate limiter create ( double positive infinity , stopwatch ) ; stopwatch instant + = 1000000 ; limiter set rate ( 2 0 ) ; for ( int i = 0 ; i < 5 ; i + + ) { limiter acquire ( ) ; } assert events ( " r0 00 " , / / first comes the saved - up burst , which defaults to a 1 - second burst ( 2 requests ) " r0 00 " , " r0 00 " , / / now comes the free request " r0 50 " , / / now it ' s 0 5 seconds per request " r0 50 " ) ; }


similar to above , but perform negative cases using bad output for decoding

protected void test coding with bad output ( boolean using direct buffer ) { this using direct buffer = using direct buffer ; prepare coders ( true ) ; try { perform test coding ( base chunk size , false , false , true , true ) ; assert fail ( " decoding test with bad output should fail " ) ; } catch ( exception e ) { / / expected } }


public boolean remove file ( final string file name ) { files remove ( file name ) ; return true ; }


returns the c + + fdo optimization support provider

public fdo context get fdo context ( ) { return fdo context ; }


discard upstream media chunks from { @ code chunk index } and corresponding samples from sample queues

private base media chunk discard upstream media chunks from index ( int chunk index ) { base media chunk first removed chunk = media chunks get ( chunk index ) ; util remove range ( media chunks , / * from index = * / chunk index , / * to index = * / media chunks size ( ) ) ; next notify primary format media chunk index = max ( next notify primary format media chunk index , media chunks size ( ) ) ; primary sample queue discard upstream samples ( first removed chunk get first sample index ( 0 ) ) ; for ( int i = 0 ; i < embedded sample queues length ; i + + ) { embedded sample queues [ i ] discard upstream samples ( first removed chunk get first sample index ( i + 1 ) ) ; } return first removed chunk ; }


return the set of all option arguments present on the command line

public set < string > get option names ( ) { return collections unmodifiable set ( this option args key set ( ) ) ; }


updates the progress of the current { @ link action future } with the given value , indicating that the range from { @ code start } ( inclusive ) to { @ code progress } ( exclusive ) is available calling this method potentially triggers the execution of one or more listeners that are waiting for the progress to reach a value lower than the one just updated

public void on progress ( final long progress ) { ensure not completed ( ) ; if ( progress < = start ) { assert false : progress + " < = " + start ; throw new illegal argument exception ( " cannot update progress with a value less than [ start = " + start + ' ] ' ) ; } if ( end < progress ) { assert false : end + " < " + progress ; throw new illegal argument exception ( " cannot update progress with a value greater than [ end = " + end + ' ] ' ) ; } list < action listener < long > > listeners to execute = null ; synchronized ( this ) { assert this progress < progress : this progress + " < " + progress ; this progress = progress ; final list < tuple < long , action listener < long > > > listeners = this listeners ; if ( listeners ! = null ) { list < tuple < long , action listener < long > > > listeners to keep = null ; for ( tuple < long , action listener < long > > listener : listeners ) { if ( progress < listener v 1 ( ) ) { if ( listeners to keep = = null ) { listeners to keep = new array list < > ( ) ; } listeners to keep add ( listener ) ; } else { if ( listeners to execute = = null ) { listeners to execute = new array list < > ( ) ; } listeners to execute add ( listener v 2 ( ) ) ; } } this listeners = listeners to keep ; } } if ( listeners to execute ! = null ) { listeners to execute for each ( listener - > execute listener ( listener , ( ) - > progress ) ) ; } assert invariant ( ) ; }


wraps a given input stream with a crypto input stream the size of the data buffer required for the stream is specified by the " mapreduce job encrypted - intermediate - data buffer kb " job configuration variable if the value of ' length ' is & gt ; - 1 , the input stream is additionally wrapped in a limit input stream crypto streams are late buffering in nature this means they will always try to read ahead if they can the limit input stream will ensure that the crypto stream does not read past the provided length from the given input stream

public static input stream wrap if necessary ( configuration conf , input stream in , long length ) throws i o exception { if ( is encrypted spill enabled ( conf ) ) { int buffer size = get buffer size ( conf ) ; if ( length > - 1 ) { in = new limit input stream ( in , length ) ; } byte [ ] offset array = new byte [ 8 ] ; i o utils read fully ( in , offset array , 0 , 8 ) ; long offset = byte buffer wrap ( offset array ) get long ( ) ; crypto codec crypto codec = crypto codec get instance ( conf ) ; byte [ ] iv = new byte [ crypto codec get cipher suite ( ) get algorithm block size ( ) ] ; i o utils read fully ( in , iv , 0 , crypto codec get cipher suite ( ) get algorithm block size ( ) ) ; if ( log is debug enabled ( ) ) { log debug ( " iv read from [ " + base 6 4 encode base 6 4 u r l safe string ( iv ) + " ] " ) ; } return new crypto input stream ( in , crypto codec , buffer size , get encryption key ( ) , iv , offset + crypto padding ( conf ) ) ; } else { return in ; } }


public boolean is leader ( string ip ) { if ( env util get standalone mode ( ) ) { return true ; } if ( leader = = null ) { loggers raft warn ( " [ is leader ] no leader is available now ! " ) ; return false ; } return string utils equals ( leader ip , ip ) ; }


get the current maximum download bandwidth

public long get current maximum download bandwidth ( ) { return current maximum download bytes per second ; }


applies an aggregation that sums every window of the data stream at the given position

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


returns the ghidra language minor version ( used to create the library )

public int get ghidra language minor version ( ) { return record get int value ( ghidra language minor version col ) ; }


protected void service stop ( ) throws exception { stop executor ( ) ; super service stop ( ) ; }


memory banks associated with specific address spaces must be registers with this memory state via this method each address space that will be used during emulation must be registered separately the memory state object does not assume responsibility for freeing the memory bank

public final void set memory bank ( memory bank bank ) { address space spc = bank get space ( ) ; int index = spc get unique ( ) ; while ( index > = memspace size ( ) ) memspace push back ( null ) ; memspace set ( index , bank ) ; }


resolve the path following any symlinks or mount points

public path resolve path ( final path f ) throws file not found exception , unresolved link exception , access control exception , i o exception { return resolve ( f ) ; }


schedules sending a { @ link player message }

public builder send message ( target target , long position ms ) { return apply ( new send messages ( tag , target , position ms ) ) ; }


tests the situation where the property only has a setter

public void test with only getter ( ) throws exception { model m bean info info = get m bean info from assembler ( ) ; model m bean attribute info attr = info get attribute ( " superman " ) ; assert that ( attr ) as ( " attribute should not be null " ) is not null ( ) ; }


returns a future that delegates to another but will finish early ( via a { @ link timeout exception } wrapped in an { @ link execution exception } ) if the specified duration expires the delegate future is interrupted and cancelled if it times out

public static < v > listenable future < v > with timeout ( listenable future < v > delegate , duration time , scheduled executor service scheduled executor ) { return with timeout ( delegate , to nanos saturated ( time ) , time unit nanoseconds , scheduled executor ) ; }


get the key class for the map output data if it is not set , use the ( final ) output key class this allows the map output key class to be different than the final output key class

public class < ? > get map output key class ( ) { class < ? > retv = get class ( job context map output key class , null , object class ) ; if ( retv = = null ) { retv = get output key class ( ) ; } return retv ; }


public long get int 6 4 ( ) { return int 6 4 ; }


public long checksum ( ) { if ( checksum = = null ) this checksum = default record compute partial checksum ( timestamp , serialized key size , serialized value size ) ; return this checksum ; }


updates the persistent journal by writing all entries to the { @ link # journal out } stream and clearing the in memory journal

private void write journal ( ) { try { if ( journal out = = null ) { if ( journal file exists ( ) ) { / / the journal file was left around after the last save ( ) because / / keep journal ( ) was true append to it journal out = new data output stream ( new buffered output stream ( journal file get output stream ( true ) ) ) ; } else { / / create new journal journal out = create map file ( journal file ) ; } } write entries ( journal out , journal ) ; journal out flush ( ) ; journal clear ( ) ; } catch ( i o exception e ) { this deferred i o failure = e get message ( ) + " during journal append " ; } }


public void update object ( string column label , object x ) throws s q l exception { }


@ serial data the number of distinct elements , the first element , its count , the second element , its count , and so on

private void write object ( object output stream stream ) throws i o exception { stream default write object ( ) ; serialization write multiset ( this , stream ) ; }


advances the indices in the bundle to point to the next sample in the sample table ( if it has not reached the fragments yet ) or in the current fragment if the current sample is the last one in the sample table , then the advanced state will be { @ code current sample index = = moov sample table sample count } if the current sample is the last one in the current fragment , then the advanced state will be { @ code current sample index = = fragment sample count } , { @ code current track run index = = fragment trun count } and { @ code # current sample in track run = = 0 }

public boolean next ( ) { current sample index + + ; if ( ! currently in fragment ) { return false ; } current sample in track run + + ; if ( current sample in track run = = fragment trun length [ current track run index ] ) { current track run index + + ; current sample in track run = 0 ; return false ; } return true ; }


public static void check upgrade ( n n storage storage ) throws i o exception { / / upgrade or rolling upgrade is allowed only if there are / / no previous fs states in any of the local directories for ( iterator < storage directory > it = storage dir iterator ( false ) ; it has next ( ) ; ) { storage directory sd = it next ( ) ; if ( sd get previous dir ( ) exists ( ) ) throw new inconsistent f s state exception ( sd get root ( ) , " previous fs state should not exist during upgrade " + " finalize or rollback first " ) ; } }


to test the collection format in query parameters

completion stage < response < void > > test query parameter collection format ( @ retrofit 2 http query ( " pipe " ) c s v params pipe , @ retrofit 2 http query ( " ioutil " ) c s v params ioutil , @ retrofit 2 http query ( " http " ) s s v params http , @ retrofit 2 http query ( " url " ) c s v params url , @ retrofit 2 http query ( " context " ) list < string > context ) ;


private static void encode key ( byte buf buf , byte buf key ) { if ( key = = null | | ! key is readable ( ) ) { return ; } buf write bytes ( key ) ; }


subtract another vector from this one and return result - alters this vector

public final vec 2 sub local ( vec 2 v ) { x - = v x ; y - = v y ; return this ; }


returns the size taken up on the stack by the parameters of the given internal method descriptor this accounts for long and double parameters taking up two spaces , and a non - static method taking up an additional entry

public static int internal method parameter size ( string internal method descriptor , boolean is static ) { int size = is static ? 0 : 1 ; int index = 1 ; while ( true ) { char c = internal method descriptor char at ( index + + ) ; switch ( c ) { case class constants type long : case class constants type double : { size + = 2 ; break ; } case class constants type class start : { size + + ; / / skip the class name index = internal method descriptor index of ( class constants type class end , index ) + 1 ; break ; } case class constants type array : { size + + ; / / skip all array characters while ( ( c = internal method descriptor char at ( index + + ) ) = = class constants type array ) { } if ( c = = class constants type class start ) { / / skip the class type index = internal method descriptor index of ( class constants type class end , index ) + 1 ; } break ; } default : { size + + ; break ; } case class constants method arguments close : { return size ; } } } }


protected event new event ( final string id , final attribute map attributes ) { return new event ( this , id , attributes ) ; }


creates an empty placeholder playback info which can be used for masking as long as no real playback info is available

public static playback info create dummy ( track selector result empty track selector result ) { return new playback info ( timeline empty , placeholder media period id , / * requested content position us = * / c time unset , player state idle , / * playback error = * / null , / * is loading = * / false , track group array empty , empty track selector result , placeholder media period id , / * play when ready = * / false , player playback suppression reason none , playback parameters default , / * buffered position us = * / 0 , / * total buffered duration us = * / 0 , / * position us = * / 0 , / * offload scheduling enabled = * / false ) ; }


notify the debugger that it will no longer receive events from the interpreter


returns the collection of { @ link message path parameter } that the request supports the collection should not be modifiable

public abstract collection < message path parameter < ? > > get path parameters ( ) ;


determines whether the extension list ( jpg , gif , etc ) should show up in the human readable description only relevant if a description was provided in the constructor or using set description ( ) ;

public void set extension list in description ( boolean b ) { use extensions in description = b ; full description = null ; }


public synchronized int get min buffer size ( ) { return min buffer size ; }


read operator { @ code union state } from a { @ code savepoint }

public < t > data set < t > read union state ( string uid , string name , type information < t > type info ) throws i o exception { operator state operator state = metadata get operator state ( uid ) ; list state descriptor < t > descriptor = new list state descriptor < > ( name , type info ) ; union state input format < t > input format = new union state input format < > ( operator state , descriptor ) ; return env create input ( input format , type info ) ; }


updates the gui when the user has made a new selection

protected void revalidate ( ) { remove work panel ( ) ; add work panel ( create work panel ( ) ) ; generate yara ( ) ; }


get the total number of bytes read on erasure - coded files

public long get bytes read erasure coded ( ) { return visit all ( new statistics aggregator < long > ( ) { private long bytes read erasure coded = 0 ; @ override public void accept ( statistics data data ) { bytes read erasure coded + = data bytes read erasure coded ; } public long aggregate ( ) { return bytes read erasure coded ; } } ) ; }


public boolean get namespace boolean ( ) { return namespace boolean ; }


public string read output file ( configuration conf ) throws i o exception { file system local fs = file system get local ( conf ) ; path file = new path ( output dir , " part - 00000 " ) ; return utils for tests slurp hadoop ( file , local fs ) ; }


clear out the n - gram array to an uninitialized list

protected void clear n grams ( int sz ) { n grams = new hash [ sz ] ; }


get credentials to update the delegation tokens for accessed fs objects

protected credentials get credentials ( ) { return credentials ; }


copies an iterator ' s elements into an array the iterator will be left exhausted : its { @ code has next ( ) } method will return { @ code false }

public static < t > t [ ] to array ( iterator < ? extends t > iterator , class < t > type ) { list < t > list = lists new array list ( iterator ) ; return iterables to array ( list , type ) ; }


this overrides the default implementation since hdfs does have delegation tokens

int get expected delegation token count ( ) { return 8 ; }


public void unref ( ) { cache unref ( this ) ; }


public static string compare md 5 old result ( list < string > changed group keys ) { string builder sb = new string builder ( ) ; for ( string group key : changed group keys ) { string [ ] data id group id = group key 2 parse key ( group key ) ; sb append ( data id group id [ 0 ] ) ; sb append ( " : " ) ; sb append ( data id group id [ 1 ] ) ; sb append ( " ; " ) ; } return sb to string ( ) ; }


check that whether debugging is enabled for this api client

public boolean is debugging ( ) { return debugging ; }


test create , update and delete events of model entities

public void test model events ( ) throws exception { model model = null ; try { model = repository service new model ( ) ; model set name ( " my model " ) ; model set key ( " key " ) ; repository service save model ( model ) ; / / check create event assert that ( listener get events received ( ) ) has size ( 2 ) ; assert that ( listener get events received ( ) get ( 0 ) get type ( ) ) is equal to ( activiti event type entity created ) ; assert that ( ( ( model ) ( ( activiti entity event ) listener get events received ( ) get ( 0 ) ) get entity ( ) ) get id ( ) ) is equal to ( model get id ( ) ) ; assert that ( listener get events received ( ) get ( 1 ) get type ( ) ) is equal to ( activiti event type entity initialized ) ; assert that ( ( ( model ) ( ( activiti entity event ) listener get events received ( ) get ( 1 ) ) get entity ( ) ) get id ( ) ) is equal to ( model get id ( ) ) ; listener clear events received ( ) ; / / update model model = repository service get model ( model get id ( ) ) ; model set name ( " updated " ) ; repository service save model ( model ) ; assert that ( listener get events received ( ) ) has size ( 1 ) ; assert that ( listener get events received ( ) get ( 0 ) get type ( ) ) is equal to ( activiti event type entity updated ) ; assert that ( ( ( model ) ( ( activiti entity event ) listener get events received ( ) get ( 0 ) ) get entity ( ) ) get id ( ) ) is equal to ( model get id ( ) ) ; listener clear events received ( ) ; / / test additional update - methods ( source and extra - source ) repository service add model editor source ( model get id ( ) , " test " get bytes ( ) ) ; repository service add model editor source extra ( model get id ( ) , " test extra " get bytes ( ) ) ; assert that ( listener get events received ( ) ) has size ( 2 ) ; assert that ( listener get events received ( ) get ( 0 ) get type ( ) ) is equal to ( activiti event type entity updated ) ; assert that ( listener get events received ( ) get ( 1 ) get type ( ) ) is equal to ( activiti event type entity updated ) ; listener clear events received ( ) ; / / delete model events repository service delete model ( model get id ( ) ) ; assert that ( listener get events received ( ) ) has size ( 1 ) ; assert that ( listener get events received ( ) get ( 0 ) get type ( ) ) is equal to ( activiti event type entity deleted ) ; assert that ( ( ( model ) ( ( activiti entity event ) listener get events received ( ) get ( 0 ) ) get entity ( ) ) get id ( ) ) is equal to ( model get id ( ) ) ; listener clear events received ( ) ; } finally { if ( model ! = null & & repository service get model ( model get id ( ) ) ! = null ) { repository service delete model ( model get id ( ) ) ; } } }


verifies that nested directories are properly copied and registered with the given filesystem and paths

static void test register multiple local resources ( file system target file system , path target dir , string local resource directory , temporary folder temp folder , boolean add scheme to local path , boolean use remote files ) throws exception { / / directory must not yet exist assert false ( target file system exists ( target dir ) ) ; final file src dir = temp folder new folder ( ) ; final hash map < string / * ( relative ) path * / , / * contents * / string > src files = new hash map < > ( 4 ) ; / / create and fill source files src files put ( " 1 " , " hello 1 " ) ; src files put ( " 2 " , " hello 2 " ) ; src files put ( " nested / 3 " , " hello nested / 3 " ) ; src files put ( " nested / 4 / 5 " , " hello nested / 4 / 5 " ) ; src files put ( " test jar " , " jar content " ) ; generate files in directory ( src dir , src files ) ; final path src path ; if ( use remote files ) { src path = new path ( hdfs root path to string ( ) + " / tmp / remote files " ) ; hdfs cluster get file system ( ) copy from local file ( new path ( src dir get absolute path ( ) ) , src path ) ; } else { if ( add scheme to local path ) { src path = new path ( " file : / / " + src dir get absolute path ( ) ) ; } else { src path = new path ( src dir get absolute path ( ) ) ; } } / / copy the created directory recursively : try { final list < path > remote paths = new array list < > ( ) ; final application id application id = application id new instance ( 0 , 0 ) ; final yarn application file uploader uploader = yarn application file uploader from ( target file system , target dir , collections empty list ( ) , application id , d f s config keys dfs replication default ) ; final list < string > classpath = uploader register multiple local resources ( collections singleton list ( src path ) , local resource directory , local resource type file ) ; final path base path = new path ( local resource directory , src path get name ( ) ) ; final path nested path = new path ( base path , " nested " ) ; assert that ( classpath , contains in any order ( base path to string ( ) , nested path to string ( ) , new path ( nested path , " 4 " ) to string ( ) , new path ( base path , " test jar " ) to string ( ) ) ) ; final map < string , local resource > local resources = uploader get registered local resources ( ) ; assert equals ( src files size ( ) , local resources size ( ) ) ; final path work dir = converter utils get path from yarn u r l ( local resources get ( new path ( local resource directory , new path ( src path get name ( ) , " 1 " ) ) to string ( ) ) get resource ( ) ) get parent ( ) ; verify directory recursive ( target file system , work dir , src files ) ; } finally { / / clean up target file system delete ( target dir , true ) ; } }


for an identifier of the form " a b c d " , returns " a b c " for an identifier of the form " a " , returns absent

public optional < qualified name > get prefix ( ) { if ( parts size ( ) = = 1 ) { return optional empty ( ) ; } list < string > sub list = parts sub list ( 0 , parts size ( ) - 1 ) ; return optional of ( new qualified name ( sub list , sub list ) ) ; }