writes a long value into a byte array see { @ link # get bytes ( long , byte [ ] ) }

default void put long ( byte [ ] b , long value ) { put long ( b , 0 , value ) ; }


visits the end of the method this method , which is the last one to be called , is used to inform the visitor that all the annotations and attributes of the method have been visited

public void visit end ( ) { if ( mv ! = null ) { mv visit end ( ) ; } }


check that whether debugging is enabled for this api client

public boolean is debugging ( ) { return debugging ; }


public static list < string > get files path ( final string zip file path ) throws i o exception { return get files path ( utils bridge get file by path ( zip file path ) ) ; }


public void test rename 2 pre descendant 3 ( ) throws exception { final path root = new path ( " / " ) ; final path sdir 1 = new path ( " / dir 1 " ) ; final path sdir 2 = new path ( " / dir 2 " ) ; final path foo = new path ( sdir 1 , " foo " ) ; final path bar = new path ( foo , " bar " ) ; final path file in bar = new path ( bar , " file " ) ; hdfs mkdirs ( bar ) ; hdfs mkdirs ( sdir 2 ) ; d f s test util create file ( hdfs , file in bar , blocksize , repl , seed ) ; hdfs set quota ( sdir 1 , long max value - 1 , long max value - 1 ) ; hdfs set quota ( sdir 2 , long max value - 1 , long max value - 1 ) ; hdfs set quota ( foo , long max value - 1 , long max value - 1 ) ; hdfs set quota ( bar , long max value - 1 , long max value - 1 ) ; / / create snapshot on root snapshot test helper create snapshot ( hdfs , root , snap 1 ) ; / / delete file in bar hdfs delete ( file in bar , true ) ; / / create another snapshot on root snapshot test helper create snapshot ( hdfs , root , snap 2 ) ; / / / dir 1 / foo / bar - > / dir 2 / bar final path bar 2 = new path ( sdir 2 , " bar 2 " ) ; hdfs rename ( bar , bar 2 ) ; / / / dir 1 / foo - > / dir 2 / bar / foo final path foo 2 = new path ( bar 2 , " foo 2 " ) ; hdfs rename ( foo , foo 2 ) ; restart cluster and check image ( true ) ; / / delete snapshot snap 1 hdfs delete snapshot ( root , snap 1 ) ; restart cluster and check image ( true ) ; }


this implementation returns { @ code true } if a transaction manager has been specified ; { @ code false } otherwise

public boolean is delivery transacted ( method method ) throws no such method exception { return ( this transaction factory ! = null ) ; }


private @ non null schedule result schedule internal ( task p , int quiet period , list < action > actions ) { lock lock ( ) ; try { try { calendar due = new gregorian calendar ( ) ; due add ( calendar second , quiet period ) ; / / do we already have this task in the queue ? because if so , we won ' t schedule a new one list < item > duplicates in queue = new array list < > ( ) ; for ( item item : live get items ( p ) ) { boolean should schedule item = false ; for ( queue action action : item get actions ( queue action class ) ) { should schedule item | = action should schedule ( actions ) ; } for ( queue action action : util filter ( actions , queue action class ) ) { should schedule item | = action should schedule ( ( new array list < > ( item get all actions ( ) ) ) ) ; } if ( ! should schedule item ) { duplicates in queue add ( item ) ; } } if ( duplicates in queue is empty ( ) ) { logger log ( level fine , " { 0 } added to queue " , p ) ; / / put the item in the queue waiting item added = new waiting item ( due , p , actions ) ; added enter ( this ) ; schedule maintenance ( ) ; / / let an executor know that a new item is in the queue return schedule result created ( added ) ; } logger log ( level fine , " { 0 } is already in the queue " , p ) ; / / but let the actions affect the existing stuff for ( item item : duplicates in queue ) { for ( foldable action a : util filter ( actions , foldable action class ) ) { a fold into existing ( item , p , actions ) ; if ( logger is loggable ( level fine ) ) { logger log ( level fine , " after folding { 0 } , { 1 } includes { 2 } " , new object [ ] { a , item , item get all actions ( ) } ) ; } } } boolean queue updated = false ; for ( waiting item wi : util filter ( duplicates in queue , waiting item class ) ) { / / make sure to always use the shorter of the available due times if ( wi timestamp before ( due ) ) continue ; / / waiting list is sorted , so when we change a timestamp we need to maintain order wi leave ( this ) ; wi timestamp = due ; wi enter ( this ) ; queue updated = true ; } if ( queue updated ) schedule maintenance ( ) ; / / revisit : when there are multiple existing items in the queue that matches the incoming one , / / whether the new one should affect all existing ones or not is debatable i for myself / / thought this would only affect one , so the code was bit of surprise , but i ' m keeping the current / / behaviour return schedule result existing ( duplicates in queue get ( 0 ) ) ; } finally { update snapshot ( ) ; } } finally { lock unlock ( ) ; } }


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

public void update user test ( ) throws api exception { string username = null ; user body = null ; api update user ( username , body ) ; / / todo : test validations }


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


adds a route to the given handler function that handles all http { @ code head } requests that match the given pattern and predicate

builder head ( string pattern , request predicate predicate , handler function < server response > handler function ) ;


returns a set backed by the specified map the resulting set displays the same ordering , concurrency , and performance characteristics as the backing map in essence , this factory method provides a { @ link set } implementation corresponding to any { @ link map } implementation there is no need to use this method on a { @ link map } implementation that already has a corresponding { @ link set } implementation ( such as { @ link java util hash map } or { @ link java util tree map } ) each method invocation on the set returned by this method results in exactly one method invocation on the backing map or its { @ code key set } view , with one exception the { @ code add all } method is implemented as a sequence of { @ code put } invocations on the backing map the specified map must be empty at the time this method is invoked , and should not be accessed directly after this method returns these conditions are ensured if the map is created empty , passed directly to this method , and no reference to the map is retained , as illustrated in the following code fragment : { @ code set < object > identity hash set = sets new set from map ( new identity hash map < object , boolean > ( ) ) ; } the returned set is serializable if the backing map is

public static < e > set < e > new set from map ( map < e , boolean > map ) { return collections new set from map ( map ) ; }


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


gets the value from a given index and moves it to the front of the mtf list ( inverse move to front transform )

byte index to front ( final int index ) { final byte value = mtf [ index ] ; system arraycopy ( mtf , 0 , mtf , 1 , index ) ; mtf [ 0 ] = value ; return value ; }


attempt to find a { @ link configured value creation exception } in a { @ link toolchain exception } , or its causes if one cannot be found , null is returned

public static configured value creation exception as configured value creation exception ( toolchain exception e ) { for ( throwable cause = e get cause ( ) ; cause ! = null & & cause ! = cause get cause ( ) ; cause = cause get cause ( ) ) { if ( cause instanceof configured value creation exception ) { return ( configured value creation exception ) cause ; } } return null ; }


draws the value of the given entry by using the provided i value formatter

public void draw value ( canvas c , i value formatter formatter , float value , entry entry , int data set index , float x , float y , int color ) { m value paint set color ( color ) ; c draw text ( formatter get formatted value ( value , entry , data set index , m view port handler ) , x , y , m value paint ) ; }


tests the failure response on a rejected execution , because the query executor has been closed

public void test query executor shut down ( ) throws throwable { kv state registry registry = new kv state registry ( ) ; atomic kv state request stats stats = new atomic kv state request stats ( ) ; kv state server impl local test server = new kv state server impl ( inet address get local host ( ) get host name ( ) , collections singleton list ( 0 ) iterator ( ) , 1 , 1 , new kv state registry ( ) , new disabled kv state request stats ( ) ) ; local test server start ( ) ; local test server shutdown ( ) ; assert true ( local test server get query executor ( ) is terminated ( ) ) ; message serializer < kv state internal request , kv state response > serializer = new message serializer < > ( new kv state internal request kv state internal request deserializer ( ) , new kv state response kv state response deserializer ( ) ) ; kv state server handler handler = new kv state server handler ( local test server , registry , serializer , stats ) ; embedded channel channel = new embedded channel ( get frame decoder ( ) , handler ) ; int num key groups = 1 ; abstract state backend abstract backend = new memory state backend ( ) ; dummy environment dummy env = new dummy environment ( " test " , 1 , 0 ) ; dummy env set kv state registry ( registry ) ; keyed state backend < integer > backend = create keyed state backend ( registry , num key groups , abstract backend , dummy env ) ; final test registry listener registry listener = new test registry listener ( ) ; registry register listener ( dummy env get job i d ( ) , registry listener ) ; / / register state value state descriptor < integer > desc = new value state descriptor < > ( " any " , int serializer instance ) ; desc set queryable ( " vanilla " ) ; backend get partitioned state ( void namespace instance , void namespace serializer instance , desc ) ; assert true ( registry listener registration name equals ( " vanilla " ) ) ; kv state internal request request = new kv state internal request ( registry listener kv state id , new byte [ 0 ] ) ; byte buf ser request = message serializer serialize request ( channel alloc ( ) , 282872l , request ) ; / / write the request and wait for the response channel write inbound ( ser request ) ; byte buf buf = ( byte buf ) read inbound blocking ( channel ) ; buf skip bytes ( 4 ) ; / / skip frame length / / verify the response assert equals ( message type request failure , message serializer deserialize header ( buf ) ) ; request failure response = message serializer deserialize request failure ( buf ) ; buf release ( ) ; assert true ( response get cause ( ) get message ( ) contains ( " rejected execution exception " ) ) ; assert equals ( 1l , stats get num requests ( ) ) ; assert equals ( 1l , stats get num failed ( ) ) ; local test server shutdown ( ) ; }


tell all the tasks that they are canceled

public synchronized void cancel queued tasks ( ) { while ( ! queue is empty ( ) ) { background command cmd = queue get first ( ) ; if ( cmd instanceof analysis worker command ) { analysis worker command worker cmd = ( analysis worker command ) cmd ; if ( ! worker cmd can cancel ( ) ) { return ; } } cmd = queue remove first ( ) ; cmd dispose ( ) ; } }


finds the class member with the given name and descriptor in the given class or its hierarchy

public member find member ( clazz referencing class , clazz clazz , string name , string descriptor , boolean is field ) { / / organize a search in the hierarchy of superclasses and interfaces / / the class member may be in a different class , if the code was / / compiled with " - target 1 2 " or higher ( the default in jdk 1 4 ) try { this clazz = null ; this member = null ; clazz hierarchy accept ( true , true , true , false , is field ? ( class visitor ) new named field visitor ( name , descriptor , new member class access filter ( referencing class , this ) ) : ( class visitor ) new named method visitor ( name , descriptor , new member class access filter ( referencing class , this ) ) ) ; } catch ( member found exception ex ) { / / we ' ve found the member we were looking for } return member ; }


wraps this subject and serializes the calls to the on subscribe , on next , on error and on complete methods , making them thread - safe the method is thread - safe

public final subject < t > to serialized ( ) { if ( this instanceof serialized subject ) { return this ; } return new serialized subject < > ( this ) ; }


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


public boolean get has teeth ( ) { return has teeth ; }


this is here to check up on the s 3 a test utils probes themselves

public void test authentication contains probes ( ) { configuration conf = new configuration ( false ) ; assert false ( " found assumed role credential provider " , authentication contains ( conf , assumed role credential provider name ) ) ; conf set ( aws credentials provider , assumed role credential provider name ) ; assert true ( " didn ' t find assumed role credential provider " , authentication contains ( conf , assumed role credential provider name ) ) ; }


hashes ( v2 ) { @ link string } , using unsigned 3 2 bit mod , which the user should ensure is < = 0xffffffff returns an unsigned integer value ( 32 - bit ) returned as a long

public long hash ( string string , long unsigned 3 2 bit mod ) throws pdb exception { byte [ ] bytes = string get bytes ( ) ; pdb byte reader reader = new pdb byte reader ( bytes ) ; int count = bytes length ; long hash = 0xb 1 7 0a 1bf l ; / / represents unsigned 32 - bit while ( count > = 4 ) { count - = 4 ; hash + = reader parse unsigned int val ( ) ; hash + = ( hash < < 10 ) ; hash ^ = ( hash > > 6 ) ; } / / hash remaining bytes while ( reader has more ( ) ) { hash + = reader parse unsigned byte val ( ) ; hash + = ( hash < < 10 ) ; hash ^ = ( hash > > 6 ) ; } / / mask down to 32 - bits hash & = 0xffffffff ; / / apply modulus return hash unsigned 3 2 bit ( hash ) % unsigned 3 2 bit mod ; }


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

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


simply queue the request , which will be processed in fifo order

public void process request ( request request ) { if ( ! finished ) { request upgrade request = null ; try { upgrade request = zks check upgrade session ( request ) ; } catch ( keeper exception ke ) { if ( request get hdr ( ) ! = null ) { request get hdr ( ) set type ( op code error ) ; request set txn ( new error txn ( ke code ( ) int value ( ) ) ) ; } request set exception ( ke ) ; log info ( " error creating upgrade request " , ke ) ; } catch ( i o exception ie ) { log error ( " unexpected error in upgrade " , ie ) ; } if ( upgrade request ! = null ) { queued requests add ( upgrade request ) ; } queued requests add ( request ) ; } }


public void test network host private dns ( ) throws i o exception { resolve gce ( " gce : hostname " , inet address get by name ( " localhost " ) ) ; }


update the server address if the address corresponding to the host name has changed

private synchronized boolean update address ( ) throws i o exception { / / do a fresh lookup with the old host name inet socket address current addr = net utils create socket addr for host ( server get host name ( ) , server get port ( ) ) ; if ( ! server equals ( current addr ) ) { log warn ( " address change detected old : " + server to string ( ) + " new : " + current addr to string ( ) ) ; server = current addr ; user group information ticket = remote id get ticket ( ) ; this set name ( " ipc client ( " + socket factory hash code ( ) + " ) connection to " + server to string ( ) + " from " + ( ( ticket = = null ) ? " an unknown user " : ticket get user name ( ) ) ) ; return true ; } return false ; }


deregister all { @ link file watcher } in this directory

public static synchronized boolean deregister all watcher ( final string path ) { watch dir job job = manager get ( path ) ; if ( job ! = null ) { job shutdown ( ) ; manager remove ( path ) ; now watch job cnt - - ; return true ; } return false ; }


returns the stream time in microseconds for a given position

public long get time us at position ( long position ) { return get time us at position ( position , first frame byte position , bitrate ) ; }


arguments must be the native container type for the corresponding sql types returns a value in the native container type corresponding to the declared sql return type

private object invoke ( built in scalar function implementation function , sql function properties properties , list < object > arguments ) { method handle method = function get method handle ( ) ; / / handle function on instance method , to allow use of fields method = bind instance factory ( method , function ) ; if ( method type ( ) parameter count ( ) > 0 & & method type ( ) parameter type ( 0 ) = = sql function properties class ) { method = method bind to ( properties ) ; } list < object > actual arguments = new array list < > ( ) ; for ( int i = 0 ; i < arguments size ( ) ; i + + ) { object argument = arguments get ( i ) ; argument property argument property = function get argument property ( i ) ; if ( argument property get argument type ( ) = = value type ) { if ( function get argument property ( i ) get null convention ( ) = = return null on null ) { if ( argument = = null ) { return null ; } actual arguments add ( argument ) ; } else if ( function get argument property ( i ) get null convention ( ) = = use null flag ) { boolean is null = argument = = null ; if ( is null ) { argument = defaults default value ( method type ( ) parameter type ( actual arguments size ( ) ) ) ; } actual arguments add ( argument ) ; actual arguments add ( is null ) ; } else { actual arguments add ( argument ) ; } } else { argument = as interface instance ( argument property get lambda interface ( ) , ( method handle ) argument ) ; actual arguments add ( argument ) ; } } try { return method invoke with arguments ( actual arguments ) ; } catch ( throwable throwable ) { throw propagate ( throwable ) ; } }


convert the file information in f t p file to a { @ link file status } object

private file status get file status ( f t p file ftp file , path parent path ) { long length = ftp file get size ( ) ; boolean is dir = ftp file is directory ( ) ; int block replication = 1 ; / / using default block size since there is no way in ftp client to know of / / block sizes on server the assumption could be less than ideal long block size = default block size ; long mod time = ftp file get timestamp ( ) get time in millis ( ) ; long access time = 0 ; fs permission permission = get permissions ( ftp file ) ; string user = ftp file get user ( ) ; string group = ftp file get group ( ) ; path file path = new path ( parent path , ftp file get name ( ) ) ; return new file status ( length , is dir , block replication , block size , mod time , access time , permission , user , group , this make qualified ( file path ) ) ; }


add cop instruction for exercising nfctx context ( consumes 2 - bytes ) location will not be added to defined instruction address list

public void add bytes cop instruction ( long offset ) throws memory access exception { add bytes cop instruction ( to hex ( offset ) ) ; }


to test class name in snake case to test class name in snake case

public void test classname test ( ) throws api exception { client body = null ; client response = api test classname ( body ) ; / / todo : test validations }


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

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


return the message source in use with this request

public message source get message source ( ) { return this message source ; }


moves all data to a source disk to create disk imbalance so we can run a planner

public void move data to source disk ( ) throws i o exception { move all data to dest disk ( this node , source disk index ) ; cluster restart data nodes ( ) ; cluster wait active ( ) ; }


public long long value ( ) { return max ( ) ; }


appends an optimized { @ code short array } value to the stream as an optimized array , the { @ code int 1 6 } value type marker and element count are encoded once at the array marker instead of repeating the type marker for each element

public u b json writer value ( short [ ] values ) throws i o exception { array ( ) ; out write byte ( ' $ ' ) ; out write byte ( ' i ' ) ; out write byte ( ' # ' ) ; value ( values length ) ; for ( int i = 0 , n = values length ; i < n ; i + + ) { out write short ( values [ i ] ) ; } pop ( true ) ; return this ; }


shutdown callback : stop the service and set an atomic boolean if it stopped within the shutdown time

public void run ( ) { if ( service ! = null ) { service stop ( ) ; service was shutdown set ( service wait for service to stop ( shutdown time millis ) ) ; } else { service was shutdown set ( true ) ; } }


public void update ( ) { logger info ( " update physics game component " ) ; / / process physics int stream range ( 0 , num entities ) filter ( i - > physics components length > i & & physics components [ i ] ! = null ) for each ( i - > physics components [ i ] update ( ) ) ; }


returns an array of string value from a node value if the node represents an array the corresponding array of strings is returned otherwise the node is treated as a comma - separated string

public static string [ ] node string array value ( object node ) { if ( is array ( node ) ) { list list = ( list ) node ; string [ ] arr = new string [ list size ( ) ] ; for ( int i = 0 ; i < arr length ; i + + ) { arr [ i ] = node string value ( list get ( i ) , null ) ; } return arr ; } else { return strings split string by comma to array ( node to string ( ) ) ; } }


abstract factory pattern for wrapping an { @ link s s l engine } object this is useful for npnapln support

abstract s s l engine wrap ssl engine ( s s l engine engine , byte buf allocator alloc , jdk application protocol negotiator application negotiator , boolean is server ) ;


obtain a metadata reader for the given resource

metadata reader get metadata reader ( resource resource ) throws i o exception ;


explicitly release the given savepoint note that most transaction managers will automatically release savepoints on transaction completion implementations should fail as silently as possible if proper resource cleanup will eventually happen at transaction completion

void release savepoint ( object savepoint ) throws transaction exception ;


release the given connection , stopping it ( if necessary ) and eventually closing it checks { @ link smart connection factory # should stop } , if available this is essentially a more sophisticated version of { @ link org springframework jms support jms utils # close connection }

public static void release connection ( @ nullable connection con , @ nullable connection factory cf , boolean started ) { if ( con = = null ) { return ; } if ( started & & cf instanceof smart connection factory & & ( ( smart connection factory ) cf ) should stop ( con ) ) { try { con stop ( ) ; } catch ( throwable ex ) { logger debug ( " could not stop jms connection before closing it " , ex ) ; } } try { con close ( ) ; } catch ( throwable ex ) { logger debug ( " could not close jms connection " , ex ) ; } }


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


get the delegation token binding for this test suite

protected string get delegation binding ( ) { return delegation token session binding ; }


gets the next smallest element , with respect to the definition of order implied by the { @ link type serializer } provided to this iterator

public e next ( ) throws i o exception { if ( this heap size ( ) > 0 ) { / / get the smallest element final head stream < e > top = this heap peek ( ) ; e result = top get head ( ) ; / / read an element if ( ! top next head ( ) ) { this heap poll ( ) ; } else { this heap adjust top ( ) ; } return result ; } else { return null ; } }


handle an inbound request the response will be returned through { @ link raft request inbound # completion }

public void handle ( raft request inbound request ) { message queue add ( objects require non null ( request ) ) ; }


same as { @ link # range query ( object , object , boolean , boolean , shape relation , zone id , date math parser , query shard context ) } but without the trouble of relations or date - specific options

protected query range query ( object lower term , object upper term , boolean include lower , boolean include upper , query shard context context ) { throw new illegal argument exception ( " field [ " + name ( ) + " ] of type [ " + type name ( ) + " ] does not support range queries " ) ; }


get the storage statistics of this filesystem

public s 3 a storage statistics get storage statistics ( ) { return storage statistics ; }


just like assert false ( b ) , but additionally recording ( using thread record failure ) any assertion failed error thrown , so that the current testcase will fail

public void thread assert false ( boolean b ) { try { assert false ( b ) ; } catch ( assertion failed error t ) { thread record failure ( t ) ; throw t ; } }


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


public indices aliases request builder add alias ( string indices [ ] , string alias , query builder filter builder ) { request add alias action ( alias actions add ( ) indices ( indices ) alias ( alias ) filter ( filter builder ) ) ; return this ; }


protected f s data input stream select ( final file system file system , final path source , final configuration conf , final string sql , final object args ) throws i o exception { string expression = sql ( sql , args ) ; describe ( " execution select call : % s " , expression ) ; future data input stream builder builder = file system open file ( source ) must ( select sql , expression ) ; / / propagate all known options for ( string key : internal select constants select options ) { string value = conf get ( key ) ; if ( value ! = null ) { builder must ( key , value ) ; } } return await future ( builder build ( ) ) ; }


adds all elements in the array to the given collection

public static < e > void add all ( collection < e > collection , e [ ] elements ) { if ( collection = = null | | elements = = null | | elements length = = 0 ) return ; collection add all ( arrays as list ( elements ) ) ; }


returns the status of { @ link async search task }

public async status response get status response ( ) { mutable search response mutable search response = search response get ( ) ; assert mutable search response ! = null ; return mutable search response to status response ( search id get encoded ( ) , get start time ( ) , expiration time millis ) ; }


public static http response execute ( final string url , final string method ) { return execute ( url , method , null , null , new hash map < > ( 0 ) , new hash map < > ( 0 ) ) ; }


if there exists an initial set of template parameters bracketed by ' < ' and ' > ' in the given demangled name , strip them

private static string remove template params ( demangled object demangled obj ) { string name = demangled obj get demangled name ( ) ; int pos 1 = name index of ( ' < ' ) ; if ( pos 1 < 0 ) { return null ; } int nesting = 1 ; int pos 2 ; for ( pos 2 = pos 1 + 1 ; pos 2 < name length ( ) ; + + pos 2 ) { char c = name char at ( pos 2 ) ; if ( c = = ' < ' ) { nesting + = 1 ; } else if ( c = = ' > ' ) { nesting - = 1 ; if ( nesting = = 0 ) { break ; } } } if ( nesting ! = 0 ) { return null ; } return name substring ( 0 , pos 1 + 1 ) + name substring ( pos 2 ) ; }


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


public void att n a m e test ( ) { / / todo : test att name }


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

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


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

public model with type < t > on visibility state changed ( on model visibility state changed listener < model with type < t > , object > listener ) { on mutation ( ) ; this on model visibility state changed listener epoxy generated model = listener ; return this ; }


invert a left shift of { @ code n } positions , that is shift right this is different from a normal shift right , in that it inserts unknowns at the left the normal right shift inserts zeros or sign bits additionally , if any ones would fall off the right , the inversion is undefined

public masked long inv shift left ( long n ) throws solver exception { if ( n = = 0 ) { return this ; } long check def = ~ ( - 1l < < n ) & val ; if ( check def ! = 0 ) { throw new solver exception ( " cannot invert left shift where ones appear on the right " ) ; } return shift right positional ( n ) ; }


@ t c description : , ， @ test step : @ expect result :

public void multiple tenant group get services of server ( ) throws exception { string service name = random domain name ( ) ; naming 1 register instance ( service name , test group 1 , " 11 11 11 11 " , test port , " c 1 " ) ; naming 1 register instance ( service name , test group 2 , " 22 22 22 22 " , test port , " c 1 " ) ; time unit seconds sleep ( 5l ) ; / / ， list view < string > list view = naming 1 get services of server ( 1 , 20 , test group 1 ) ; naming 2 register instance ( service name , " 33 33 33 33 " , test port , " c 1 " ) ; time unit seconds sleep ( 5l ) ; list view < string > list view 1 = naming 1 get services of server ( 1 , 20 , test group 1 ) ; assert assert equals ( list view get count ( ) , list view 1 get count ( ) ) ; assert assert not equals ( 0 , list view 1 get count ( ) ) ; }


builds and adds the action as a local action for the given provider

public t build and install local ( component provider provider ) { t action = build ( ) ; provider add local action ( action ) ; return action ; }


public void run ( task monitor monitor ) throws cancelled exception { this graph scope = get graph scope and generate graph title ( ) ; attributed graph graph = create graph ( ) ; monitor set message ( " generating graph " ) ; try { graph display display = graph provider get graph display ( reuse graph , monitor ) ; block model graph display listener listener = new block model graph display listener ( tool , block model , display ) ; display set graph display listener ( listener ) ; if ( show code ) { display define vertex attribute ( code attribute ) ; display define vertex attribute ( symbols attribute ) ; display set vertex label ( code attribute , graph display align left , 12 , true , code limit per block + 1 ) ; } display set graph ( graph , graph title , append graph , monitor ) ; if ( location ! = null ) { / / initialize the graph location , but don ' t have the graph send an event attributed vertex vertex = listener get vertex ( location get address ( ) ) ; display set focused vertex ( vertex , event trigger internal only ) ; } if ( selection ! = null & & ! selection is empty ( ) ) { set < attributed vertex > selected vertices = listener get vertices ( selection ) ; if ( selected vertices ! = null ) { / / initialize the graph selection , but don ' t have the graph send an event display select vertices ( selected vertices , event trigger internal only ) ; } } } catch ( graph exception e ) { if ( ! monitor is cancelled ( ) ) { msg show error ( this , null , " graphing error " , e get message ( ) ) ; } } }


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


used by auth sys return the auxiliary gids of the nfs user credential

public int [ ] get aux gids ( ) { throw new unsupported operation exception ( ) ; }


public int get time to live ( ) { return ( int ) time to live millis / 1000 ; }


public static mangled local file system create mangled filesystem ( string root path , boolean is versioned , boolean read only , boolean enable asyncronous dispatching ) throws i o exception { create root dir ( root path ) ; return new mangled local file system ( root path , is versioned , read only , enable asyncronous dispatching ) ; }


returns true if the storage directory on the given directory is already loaded

protected boolean contains storage dir ( storage location location ) throws i o exception { for ( storage directory sd : storage dirs ) { if ( location matches storage directory ( sd ) ) { return true ; } } return false ; }


returns the open g l es format of this pixmap used as the seventh parameter to { @ link gl20 # gl tex image 2 d ( int , int , int , int , int , int , int , int , java nio buffer ) }

public int get g l format ( ) { return pixmap get g l format ( ) ; }


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


sets a concrete index for this put mapping request

public put mapping request set concrete index ( index index ) { objects require non null ( index , " index must not be null " ) ; this concrete index = index ; return this ; }


assemble a line instruction at the given address , assuming the given context this method works like { @ link # assemble line ( address , string ) } except that it allows you to override the assumed context at that location

public byte [ ] assemble line ( address at , string line , assembly pattern block ctx ) throws assembly semantic exception , assembly syntax exception ;


ensures the truth of an expression involving one or more parameters to the calling method see { @ link # check argument ( boolean , string , object ) } for details

public static void check argument ( boolean b , @ nullable decl string error message template , long p 1 ) { if ( ! b ) { throw new illegal argument exception ( lenient format ( error message template , p 1 ) ) ; } }


gets type literal for the parameterized type represented by applying { @ code type arguments } to { @ code raw type }

public static type token < ? > get parameterized ( type raw type , type type arguments ) { return new type token < object > ( $ gson $ types new parameterized type with owner ( null , raw type , type arguments ) ) ; }


runs external binary in the specified working directory see { @ link builder runner }

public process result run binary ( path working directory , string process to run , boolean expect empty error , string arguments ) throws exception { process parameters parameters = process parameters builder ( ) set working directory ( working directory to file ( ) ) set name ( process to run ) set timeout millis ( get process timeout millis ( - 1 ) ) set arguments ( arguments ) set expected empty error ( expect empty error ) build ( ) ; return new process runner ( parameters , executor service ) run synchronously ( ) ; }


public string to string ( ) { return ints to string ( ) ; }


checks that thread does not terminate within the given millisecond delay

void assert thread stays alive ( thread thread , long millis ) { try { / / no need to optimize the failing case via thread join delay ( millis ) ; assert true ( thread is alive ( ) ) ; } catch ( interrupted exception fail ) { fail ( " unexpected interrupted exception " ) ; } }


flink - 5985 this tests checks the inverse of { @ link # test null subtask state leads to stateless task ( ) } we want to test that for subtasks that acknowledge some state are given an entry in the task states of the checkpoint

public void test non null subtask state leads to stateful task ( ) throws exception { pending checkpoint pending = create pending checkpoint ( checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) ) ; pending acknowledge task ( attempt id , mock ( task state snapshot class ) , mock ( checkpoint metrics class ) ) ; assert assert false ( pending get operator states ( ) is empty ( ) ) ; }


creates the panel displaying the source combo box note : the custom renderer is used so the name of the program associated with each function can be displayed in the combo box ; this is necessary since a combo box may show functions from any number of programs , and the default is to simply show the function name < br > eg : " init ( notepad ) " < br >

private j panel create source panel ( ) { j panel panel = new j panel ( new border layout ( ) ) ; source functions c b = new j combo box < > ( ) ; source functions c b model = new default combo box model < > ( ) ; source functions c b set model ( source functions c b model ) ; source functions c b set renderer ( new function list cell renderer ( ) ) ; source functions c b add item listener ( new item listener ( ) { @ override public void item state changed ( item event e ) { if ( e get state change ( ) ! = item event selected ) { return ; } function selected = ( function ) source functions c b model get selected item ( ) ; load functions ( selected , null ) ; / / each time a source function is selected we need / / to load the targets associated with it reload target list ( ( function ) source functions c b model get selected item ( ) ) ; update tab text ( ) ; / / fire a notification to update the ui state ; without this the / / actions would not be properly enabled / disabled tool context changed ( provider ) ; } } ) ; panel add ( source functions c b , border layout center ) ; return panel ; }


to test \ & quot ; client \ & quot ; model ( asynchronously ) to test \ & quot ; client \ & quot ; model

public okhttp 3 call test client model async ( client body , final api callback < client > callback ) throws api exception { okhttp 3 call local var call = test client model validate before call ( body , callback ) ; type local var return type = new type token < client > ( ) { } get type ( ) ; local var api client execute async ( local var call , local var return type , callback ) ; return local var call ; }


obtain a connection using the given properties template method to be implemented by subclasses

protected abstract connection get connection from driver ( properties props ) throws s q l exception ;


public void property class test ( ) { / / todo : test property class }


creates an { @ code array table } with the mappings in the provided table if { @ code table } includes a mapping with row key { @ code r } and a separate mapping with column key { @ code c } , the returned table contains a mapping with row key { @ code r } and column key { @ code c } if that row key column key pair in not in { @ code table } , the pair maps to { @ code null } in the generated table the returned table allows subsequent { @ code put } calls with the row keys in { @ code table row key set ( ) } and the column keys in { @ code table column key set ( ) } calling { @ link # put } with other keys leads to an { @ code illegal argument exception } the ordering of { @ code table row key set ( ) } and { @ code table column key set ( ) } determines the row and column iteration ordering of the returned table

public static < r , c , v > array table < r , c , v > create ( table < r , c , v > table ) { return ( table instanceof array table < ? , ? , ? > ) ? new array table < r , c , v > ( ( array table < r , c , v > ) table ) : new array table < r , c , v > ( table ) ; }


public static symbol table read ( @ non null file file , @ nullable string table package ) throws i o exception { return read ( file , table package , atlas symbol io in order handler : : new ) ; }


returns the current event - time watermark

public abstract long current watermark ( ) ;


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


get an input stream that reads in the raw data for this segment

public input stream get raw data stream ( binary reader reader , message log log ) throws i o exception { return new section stream ( reader , log ) ; }


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


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


find the boundaries of segments , and then compare memory segment

private int compare multi segments ( binary string data other ) { if ( binary section size in bytes = = 0 | | other binary section size in bytes = = 0 ) { return binary section size in bytes - other binary section size in bytes ; } int len = math min ( binary section size in bytes , other binary section size in bytes ) ; memory segment seg 1 = binary section segments [ 0 ] ; memory segment seg 2 = other binary section segments [ 0 ] ; int segment size = binary section segments [ 0 ] size ( ) ; int other segment size = other binary section segments [ 0 ] size ( ) ; int size of first 1 = segment size - binary section offset ; int size of first 2 = other segment size - other binary section offset ; int var seg index 1 = 1 ; int var seg index 2 = 1 ; / / find the first segment of this string while ( size of first 1 < = 0 ) { size of first 1 + = segment size ; seg 1 = binary section segments [ var seg index 1 + + ] ; } while ( size of first 2 < = 0 ) { size of first 2 + = other segment size ; seg 2 = other binary section segments [ var seg index 2 + + ] ; } int offset 1 = segment size - size of first 1 ; int offset 2 = other segment size - size of first 2 ; int need compare = math min ( math min ( size of first 1 , size of first 2 ) , len ) ; while ( need compare > 0 ) { / / compare in one segment for ( int i = 0 ; i < need compare ; i + + ) { int res = ( seg 1 get ( offset 1 + i ) & 0x f f ) - ( seg 2 get ( offset 2 + i ) & 0x f f ) ; if ( res ! = 0 ) { return res ; } } if ( need compare = = len ) { break ; } len - = need compare ; / / next segment if ( size of first 1 < size of first 2 ) { / / i am smaller seg 1 = binary section segments [ var seg index 1 + + ] ; offset 1 = 0 ; offset 2 + = need compare ; size of first 1 = segment size ; size of first 2 - = need compare ; } else if ( size of first 1 > size of first 2 ) { / / other is smaller seg 2 = other binary section segments [ var seg index 2 + + ] ; offset 2 = 0 ; offset 1 + = need compare ; size of first 2 = other segment size ; size of first 1 - = need compare ; } else { / / same , should go ahead both seg 1 = binary section segments [ var seg index 1 + + ] ; seg 2 = other binary section segments [ var seg index 2 + + ] ; offset 1 = 0 ; offset 2 = 0 ; size of first 1 = segment size ; size of first 2 = other segment size ; } need compare = math min ( math min ( size of first 1 , size of first 2 ) , len ) ; } check argument ( need compare = = len ) ; return binary section size in bytes - other binary section size in bytes ; }


public file download file from response ( response response ) throws api exception { try { file file = prepare download file ( response ) ; buffered sink sink = okio buffer ( okio sink ( file ) ) ; sink write all ( response body ( ) source ( ) ) ; sink close ( ) ; return file ; } catch ( i o exception e ) { throw new api exception ( e ) ; } }


gets a binding implementation first , it check to see if the parent has a binding if the parent has a binding and the binding is scoped , it will use that binding otherwise , this checks for an explicit binding if no explicit binding is found , it looks for a just - in - time binding

public < t > binding impl < t > get binding or throw ( key < t > key , errors errors ) throws errors exception { / / check explicit bindings , i e bindings created by modules binding impl < t > binding = state get explicit binding ( key ) ; if ( binding ! = null ) { return binding ; } / / look for an on - demand binding return get just in time binding ( key , errors ) ; }


convert a string to an int treating empty strings as the default value

private static int convert to int ( string value , int default value ) { string trim = value trim ( ) ; if ( trim length ( ) = = 0 ) { return default value ; } return integer parse int ( trim ) ; }


returns all of the request contexts headers

public map < string , string > get origin headers ( ) { return origin headers ; }


executed once for every successful shard level request

protected void on shard result ( result result , search shard iterator shard it ) { assert result get shard index ( ) ! = - 1 : " shard index is not set " ; assert result get search shard target ( ) ! = null : " search shard target must not be null " ; has shard response set ( true ) ; if ( logger is trace enabled ( ) ) { logger trace ( " got first - phase result from { } " , result ! = null ? result get search shard target ( ) : null ) ; } results consume result ( result , ( ) - > on shard result consumed ( result , shard it ) ) ; }


extension point that subclasses can use to add extra bind values for a request invoked before { @ link # do bind ( mutable property values ) } the default implementation is empty

protected void add bind values ( mutable property values mpvs , servlet request request ) { }


get the preferred free range size for the external memory block as addressable units within the default memory space

public int get preferred external block size ( ) { return 0x 2 0 0 0 0 ; / / 128k }


creates a number of random headers with the given namevalue lengths

static list < hpack header > create headers ( int num headers , int name length , int value length , boolean limit to ascii ) { list < hpack header > hpack headers = new array list < hpack header > ( num headers ) ; for ( int i = 0 ; i < num headers ; + + i ) { / / force always ascii for header names byte [ ] name = random bytes ( new byte [ name length ] , true ) ; byte [ ] value = random bytes ( new byte [ value length ] , limit to ascii ) ; hpack headers add ( new hpack header ( name , value ) ) ; } return hpack headers ; }


public void write long ( long l ) throws i o exception { out write ( type long code ) ; out write long ( l ) ; }


checks whether the specified test timeout could have been smaller or is too small and adds a warning message if verbose is true returns true if there was a test with the wrong timeout , but if was not reported

private static boolean should emit test size warning in summary ( boolean verbose , list < string > warnings , list < long > test times , transitive info collection target ) { test timeout specified timeout = target get provider ( test provider class ) get test params ( ) get timeout ( ) ; long max time of shard = 0 ; for ( long shard time : test times ) { if ( shard time ! = null ) { max time of shard = math max ( max time of shard , shard time ) ; } } int max time in seconds = ( int ) ( max time of shard / 1000 ) ; if ( ! specified timeout is in range fuzzy ( max time in seconds ) ) { test timeout expected timeout = test timeout get suggested test timeout ( max time in seconds ) ; test size expected size = test size get test size ( expected timeout ) ; if ( verbose ) { string builder builder = new string builder ( string format ( " % s : test execution time ( % 1fs excluding execution overhead ) outside of " + " range for % s tests consider setting timeout = \ " % s \ " " , alias provider get dependency label ( target ) , max time of shard / 1000 0 , specified timeout pretty print ( ) , expected timeout ) ) ; if ( expected size ! = null ) { builder append ( " or size = \ " " ) append ( expected size ) append ( " \ " " ) ; } builder append ( " " ) ; warnings add ( builder to string ( ) ) ; return false ; } return true ; } else { return false ; } }


marks the producing instructions of the variable consumer at the given offset

private void mark variable producers ( int consumer offset , int variable index ) { instruction offset value producer offsets = partial evaluator get variables before ( consumer offset ) get producer value ( variable index ) instruction offset value ( ) ; if ( producer offsets ! = null ) { int offset count = producer offsets instruction offset count ( ) ; for ( int offset index = 0 ; offset index < offset count ; offset index + + ) { / / make sure the variable and the instruction are marked / / at the producing offset int offset = producer offsets instruction offset ( offset index ) ; mark instruction ( offset ) ; } } }


tests that with { @ link high availability mode # zookeeper } distributed j a rs are recoverable from any participating blob server

public void test blob cache recovery ( ) throws exception { configuration config = new configuration ( ) ; config set string ( high availability options ha mode , " zookeeper " ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; config set string ( high availability options ha storage path , temporary folder new folder ( ) get path ( ) ) ; blob store service blob store service = null ; try { blob store service = blob utils create blob store from config ( config ) ; test blob cache recovery ( config , blob store service ) ; } finally { if ( blob store service ! = null ) { blob store service close and cleanup all data ( ) ; } } }


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


returns the default equivalence strategy used to compare and hash keys or values referenced at this strength this strategy will be used unless the user explicitly specifies an alternate strategy

abstract equivalence < object > default equivalence ( ) ;


updates artifact nested set function options if the flags ' values changed

private static boolean nested set as sky key options changed ( options provider options ) { build request options build request options = options get options ( build request options class ) ; if ( build request options = = null ) { return false ; } return artifact nested set function size threshold updated ( build request options nested set as sky key threshold ) ; }


public byte as byte ( ) { switch ( type ) { case string value : return byte parse byte ( string value ) ; case double value : return ( byte ) double value ; case long value : return ( byte ) long value ; case boolean value : return long value ! = 0 ? ( byte ) 1 : 0 ; } throw new illegal state exception ( " value cannot be converted to byte : " + type ) ; }


cleans up internal state , including calling { @ link web view # destroy ( ) } on the delegate view this method may only be called after this view has been removed from the view system no other methods may be called on this view after destroy

public void destroy ( ) { web view destroy ( ) ; }


fill slots between < code > from index < code > inclusive to < code > to index < code > exclusive with < code > value < code >

void fill ( long from index , long to index , long value ) ;


sets an icon that will be drawn to the left of the actor

public void set icon ( @ null drawable icon ) { this icon = icon ; }


returns a new , empty { @ code enum hash bi map } using the specified key type

public static < k extends enum < k > , v > enum hash bi map < k , v > create ( class < k > key type ) { return new enum hash bi map < > ( key type ) ; }


sets the name of the contract instance the name is only used to describe the contract instance in logging output and graphical representations

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


parses { @ link annotation } using a strict parser

public static annotation from x content ( x content parser parser , void context ) { return strict parser apply ( parser , context ) build ( ) ; }


public geo location request get geo location ( ) { val request = new geo location request ( ) ; request set accuracy ( get ( field geo accuracy ) ) ; request set timestamp ( get ( field geo timestamp ) ) ; request set longitude ( get ( field geo longitude ) ) ; request set latitude ( get ( field geo latitude ) ) ; return request ; }


returns the working directory of the test

public path get work dir ( ) { return work dir ; }


returns a { @ link collection } of all the permutations of the specified { @ link iterable } using the specified { @ link comparator } for establishing the lexicographical ordering examples : { @ code for ( list < string > perm : ordered permutations ( as list ( " b " , " c " , " a " ) ) ) { println ( perm ) ; } - > [ " a " , " b " , " c " ] - > [ " a " , " c " , " b " ] - > [ " b " , " a " , " c " ] - > [ " b " , " c " , " a " ] - > [ " c " , " a " , " b " ] - > [ " c " , " b " , " a " ] for ( list < integer > perm : ordered permutations ( as list ( 1 , 2 , 2 , 1 ) ) ) { println ( perm ) ; } - > [ 1 , 1 , 2 , 2 ] - > [ 1 , 2 , 1 , 2 ] - > [ 1 , 2 , 2 , 1 ] - > [ 2 , 1 , 1 , 2 ] - > [ 2 , 1 , 2 , 1 ] - > [ 2 , 2 , 1 , 1 ] } notes : this is an implementation of the algorithm for lexicographical permutations generation , described in knuth ' s " the art of computer programming " , volume 4 , chapter 7 , section 7 2 1 2 the iteration order follows the lexicographical order this means that the first permutation will be in ascending order , and the last will be in descending order elements that compare equal are considered equal and no new permutations are created by swapping them an empty iterable has only one permutation , which is an empty list

public static < e > collection < list < e > > ordered permutations ( iterable < e > elements , comparator < ? super e > comparator ) { return new ordered permutation collection < e > ( elements , comparator ) ; }


creates principal with given name and password

protected void create principal ( final string principal name , final char [ ] password ) throws exception { simple kdc ldap server create principal ( principal name , new string ( password ) ) ; }


update the moving average with a new value

public void update ( long n ) { uncounted add ( n ) ; }


public final void set subscription ( subscription s ) { if ( cancelled ) { s cancel ( ) ; return ; } objects require non null ( s , " s is null " ) ; if ( get ( ) = = 0 & & compare and set ( 0 , 1 ) ) { subscription a = actual ; if ( a ! = null & & cancel on replace ) { a cancel ( ) ; } actual = s ; long r = requested ; if ( decrement and get ( ) ! = 0 ) { drain loop ( ) ; } if ( r ! = 0l ) { s request ( r ) ; } return ; } subscription a = missed subscription get and set ( s ) ; if ( a ! = null & & cancel on replace ) { a cancel ( ) ; } drain ( ) ; }


match handlers that are assignable to a given type

public builder assignable type ( class < ? > types ) { this assignable types add all ( arrays as list ( types ) ) ; return this ; }


sets the offset of this section the offset is the actual byte offset into the file

public void set offset ( long offset ) throws i o exception { modified = true ; / * if we are overriding the offset , we must cache the section data * / if ( data = = null ) { data = get data ( ) ; } this sh offset = offset ; }


{ @ inherit doc } the default implementation does nothing

@ override public void exit select items ( sql base parser select items context ctx ) { }


load list of aws credential providercredential provider factory classes

public static list < class < ? > > load a w s provider classes ( configuration conf , string key , class < ? > default value ) throws i o exception { try { return arrays as list ( conf get classes ( key , default value ) ) ; } catch ( runtime exception e ) { throwable c = e get cause ( ) ! = null ? e get cause ( ) : e ; throw new i o exception ( " from option " + key + ' ' + c , c ) ; } }


returns the length of the underlying file

public long length ( ) throws i o exception { return provider length ( ) ; }


recover the description of the method at a specific address

public method info java get method info ( address addr ) { synchronized ( this ) { if ( method map = = null ) { try { build method map ( ) ; } catch ( memory access exception e ) { msg error ( this , e get message ( ) , e ) ; / / method map will be non - null but empty } } } return method map get ( addr ) ; }


test that the bpos can register to talk to two different n ns , sends block reports to both , etc

public void test basic functionality ( ) throws exception { b p offer service bpos = setup b p o s for n ns ( mock n n 1 , mock n n 2 ) ; bpos start ( ) ; try { wait for both actors ( bpos ) ; / / the dn should have register to both n ns mockito verify ( mock n n 1 ) register datanode ( mockito any ( ) ) ; mockito verify ( mock n n 2 ) register datanode ( mockito any ( ) ) ; / / should get block reports from both n ns wait for block report ( mock n n 1 ) ; wait for block report ( mock n n 2 ) ; / / when we receive a block , it should report it to both n ns bpos notify namenode received block ( fake block , null , " " , false ) ; received deleted block info [ ] ret = wait for block received ( fake block , mock n n 1 ) ; assert equals ( 1 , ret length ) ; assert equals ( fake block get local block ( ) , ret [ 0 ] get block ( ) ) ; ret = wait for block received ( fake block , mock n n 2 ) ; assert equals ( 1 , ret length ) ; assert equals ( fake block get local block ( ) , ret [ 0 ] get block ( ) ) ; } finally { bpos stop ( ) ; bpos join ( ) ; } }


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


public void clear patterns ( ) { patterns clear ( ) ; }


return the { @ link bitset filter cache } for this index

public bitset filter cache bitset filter cache ( ) { return bitset filter cache ; }


trying to abort from an invalid handle must fail

public void test abort unknown upload ( ) throws exception { path file = method path ( ) ; byte buffer byte buffer = byte buffer wrap ( " invalid - handle " get bytes ( charsets utf 8 ) ) ; intercept ( file not found exception class , ( ) - > abort upload ( b b upload handle from ( byte buffer ) , file ) ) ; }


copies all the bytes from one file to another copying is not an atomic operation - in the case of an io error , power loss , process termination , or other problems , { @ code to } may not be a complete copy of { @ code from } if you need to guard against those conditions , you should employ other file - level synchronization < b > warning : < b > if { @ code to } represents an existing file , that file will be overwritten with the contents of { @ code from } if { @ code to } and { @ code from } refer to the same file , the contents of that file will be deleted < b > { @ link java nio file path } equivalent : < b > { @ link java nio file files # copy ( java nio file path , java nio file path , java nio file copy option ) }

public static void copy ( file from , file to ) throws i o exception { check argument ( ! from equals ( to ) , " source % s and destination % s must be different " , from , to ) ; as byte source ( from ) copy to ( as byte sink ( to ) ) ; }


build new web application service simple web application service

protected static abstract web application service new web application service ( final http servlet request request , final string service to use ) { val artifact id = optional of nullable ( request ) map ( http servlet request - > http servlet request get parameter ( cas protocol constants parameter ticket ) ) or else ( null ) ; val id = cleanup url ( service to use ) ; val new service = new simple web application service impl ( id , service to use , artifact id ) ; determine web application format ( request , new service ) ; val source = get source parameter ( request , cas protocol constants parameter target service , cas protocol constants parameter service ) ; new service set source ( source ) ; if ( request ! = null ) { populate attributes ( new service , request ) ; } return new service ; }


this test creates a file and modifies the block generation stamp to number that name node has not seen yet it then asserts that name node moves into safe mode while it is in startup mode

public void test generation stamp in future ( ) throws exception { cluster wait active ( ) ; file system fs = cluster get file system ( ) ; output stream ostream = fs create ( file path 1 ) ; ostream write ( test data in future get bytes ( ) ) ; ostream close ( ) ; / / re - write the generation stamp to a generation stamp in future extended block block = d f s test util get first block ( fs , file path 1 ) ; final long gen stamp = block get generation stamp ( ) ; final int datanode index = 0 ; cluster change gen stamp of block ( datanode index , block , gen stamp + 1 ) ; data node test utils run directory scanner ( cluster get data nodes ( ) get ( 0 ) ) ; / / stop the data node so that it won ' t remove block final data node properties dn props = cluster stop data node ( datanode index ) ; / / simulate namenode forgetting a block cluster restart name node ( true ) ; cluster get name node ( ) get namesystem ( ) write lock ( ) ; block info b info = cluster get name node ( ) get namesystem ( ) get block manager ( ) get stored block ( block get local block ( ) ) ; b info delete ( ) ; cluster get name node ( ) get namesystem ( ) get block manager ( ) remove block ( b info ) ; cluster get name node ( ) get namesystem ( ) write unlock ( ) ; / / we also need to tell block manager that we are in the startup path block manager test util set startup safe mode for test ( cluster get name node ( ) get namesystem ( ) get block manager ( ) ) ; cluster restart data node ( dn props ) ; wait for num bytes ( test data in future length ( ) ) ; / / make sure that we find all written bytes in future block assert equals ( test data in future length ( ) , cluster get name node ( ) get bytes with future generation stamps ( ) ) ; / / assert safemode reason assert true ( cluster get name node ( ) get namesystem ( ) get safe mode tip ( ) contains ( " name node detected blocks with generation stamps in future " ) ) ; }


if the record has fields others than the primary keys this is used by test state store driver base to skip the modification check

public boolean has other fields ( ) { return true ; }


calls { @ link auto closeable # close ( ) } on the closable provided in { @ link auto closeable manager # auto closeable manager ( auto closeable ) }

public void stop ( ) throws exception { this auto closeable close ( ) ; }


return a map from feature name to usage information for that feature

public map < string , map < string , object > > get usages ( ) { return usages ; }


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

set < pet > find pets by tags ( @ param ( " tags " ) set < string > tags ) ;


this procedure enumerates all entries in the port mapper ' s database the procedure takes no parameters and returns a list of program , version , protocol , and port values

private xdr dump ( int xid , xdr in , xdr out ) { portmap mapping [ ] pmap list = map values ( ) to array ( new portmap mapping [ 0 ] ) ; return portmap response pmap list ( out , xid , pmap list ) ; }


returns an array containing all of the elements in this queue in proper sequence ( from first to last element ) ; the runtime type of the returned array is that of the specified array if the queue fits in the specified array , it is returned therein otherwise , a new array is allocated with the runtime type of the specified array and the size of this queue if this queue fits in the specified array with room to spare ( i e , the array has more elements than this queue ) , the element in the array immediately following the end of the queue is set to < tt > null < tt > like the { @ link # to array ( ) } method , this method acts as bridge between array - based and collection - based a p is further , this method allows precise control over the runtime type of the output array , and may , under certain circumstances , be used to save allocation costs suppose < tt > x < tt > is a queue known to contain only strings the following code can be used to dump the queue into a newly allocated array of < tt > string < tt > : { @ code string [ ] y = x to array ( new string [ 0 ] ) ; } note that < tt > to array ( new object [ 0 ] ) < tt > is identical in function to < tt > to array ( ) < tt >

public < t > t [ ] to array ( t [ ] a ) { int size = size ( ) ; if ( a length < size ) a = ( t [ ] ) java lang reflect array new instance ( a get class ( ) get component type ( ) , size ) ; if ( head < tail ) { system arraycopy ( elements , head , a , 0 , size ( ) ) ; } else if ( head > tail ) { int head portion len = elements length - head ; system arraycopy ( elements , head , a , 0 , head portion len ) ; system arraycopy ( elements , 0 , a , head portion len , tail ) ; } if ( a length > size ) a [ size ] = null ; return a ; }


this tests that the creation of { @ link task manager services } correctly creates the local state root directory for the { @ link task executor local state stores manager } with the configured root directory

public void test creation from config ( ) throws exception { final configuration config = new configuration ( ) ; file new folder = temporary folder new folder ( ) ; string tmp dir = new folder get absolute path ( ) + file separator ; final string root dir string = " local state root 1 , local state root 2 , local state root 3 " replace all ( " " , tmp dir ) ; / / test configuration of the local state directories config set string ( checkpointing options local recovery task manager state root dirs , root dir string ) ; / / test configuration of the local state mode config set boolean ( checkpointing options local recovery , true ) ; task manager services task manager services = create task manager services ( create task manager service configuration ( config ) ) ; try { task executor local state stores manager task state manager = task manager services get task manager state store ( ) ; / / verify configured directories for local state string [ ] split = root dir string split ( " , " ) ; file [ ] root directories = task state manager get local state root directories ( ) ; for ( int i = 0 ; i < split length ; + + i ) { assert assert equals ( new file ( split [ i ] , task manager services local state sub directory root ) , root directories [ i ] ) ; } / / verify local recovery mode assert assert true ( task state manager is local recovery enabled ( ) ) ; assert assert equals ( " local state " , task manager services local state sub directory root ) ; for ( file root directory : root directories ) { file utils delete file or directory ( root directory ) ; } } finally { task manager services shut down ( ) ; } }


the default cleanup subclasses can override this with a custom cleanup

public void cleanup ( ) throws i o exception { super close ( ) ; if ( super should preserve input ( ) ) return ; parent container cleanup ( ) ; }


public void remove ( ) { check state ( key ! = long min value ) ; prev next = next ; next prev = prev ; prev = next = null ; type = null ; }


disassociates given { @ link callback } if callback is not associated , nothing happens

public void remove view ( final callback callback ) { for ( int i = 0 ; i < m callbacks size ( ) ; i + + ) { final callback weak reference reference = m callbacks get ( i ) ; final callback item = reference get ( ) ; if ( item = = null | | item = = callback ) { / / always remove null references to reduce list size m callbacks remove ( reference ) ; } } }


test { @ link node # replace children } implementation on { @ link # subclass }

public void test replace children ( ) throws exception { constructor < t > ctor = longest ctor ( subclass ) ; object [ ] node ctor args = ctor args ( ctor ) ; t node = ctor new instance ( node ctor args ) ; type [ ] arg types = ctor get generic parameter types ( ) ; / / start at 1 because we can ' t change location for ( int changed arg offset = 1 ; changed arg offset < ctor get parameter count ( ) ; changed arg offset + + ) { object original arg value = node ctor args [ changed arg offset ] ; type changed arg type = arg types [ changed arg offset ] ; if ( original arg value instanceof collection ) { collection < ? > col = ( collection < ? > ) original arg value ; if ( col is empty ( ) | | col instanceof enum set ) { / * * we skip empty lists here because they ' ll spuriously * pass the conditions below if statements even if they don ' t * have anything to do with children this might cause us to * ignore the case where a parameter gets copied into the * children and just happens to be empty but i don ' t really * know another way * / continue ; } list < ? > original list = ( list < ? > ) original arg value ; if ( node children ( ) equals ( original list ) ) { / / the arg we ' re looking at * is * the children @ suppress warnings ( " unchecked " ) / / we pass a reasonable type so get reasonable results list < b > new children = ( list < b > ) make list of same size other than ( changed arg type , original list ) ; b transformed = node replace children ( new children ) ; assert transformed or replaced children ( node , transformed , ctor , node ctor args , changed arg offset , new children ) ; } else if ( false = = original list is empty ( ) & & node children ( ) contains all ( original list ) ) { / / the arg we ' re looking at is a collection contained within the children / / first make the new children @ suppress warnings ( " unchecked " ) / / we pass a reasonable type so get reasonable results list < b > new collection = ( list < b > ) make list of same size other than ( changed arg type , original list ) ; / / now merge that list of children into the original list of children list < b > original children = node children ( ) ; list < b > new children = new array list < > ( original children size ( ) ) ; int original offset = 0 ; for ( int i = 0 ; i < original children size ( ) ; i + + ) { if ( original offset < original list size ( ) & & original children get ( i ) equals ( original list get ( original offset ) ) ) { new children add ( new collection get ( original offset ) ) ; original offset + + ; } else { new children add ( original children get ( i ) ) ; } } / / finally ! we can assert b transformed = node replace children ( new children ) ; assert transformed or replaced children ( node , transformed , ctor , node ctor args , changed arg offset , new collection ) ; } else { / / the arg we ' re looking at has nothing to do with the children } } else { if ( node children ( ) contains ( original arg value ) ) { / / the arg we ' re looking at is one of the children list < b > new children = new array list < > ( node children ( ) ) ; @ suppress warnings ( " unchecked " ) / / make arg produced reasonable values b new child = ( b ) random value other than ( node ctor args [ changed arg offset ] , ( ) - > make arg ( changed arg type ) ) ; new children replace all ( e - > objects equals ( original arg value , e ) ? new child : e ) ; b transformed = node replace children ( new children ) ; assert transformed or replaced children ( node , transformed , ctor , node ctor args , changed arg offset , new child ) ; } else { / / the arg we ' re looking at has nothing to do with the children } } } }


extracts an integer argument with specified default value

private int int argument ( command line cli , string arg name , int default value ) { string o = cli get option value ( arg name ) ; try { if ( o ! = null ) { return integer parse int ( o ) ; } } catch ( number format exception ex ) { log error ( " couldn ' t parse value ( { } ) for option { } " + " using default : { } " , o , arg name , default value ) ; } return default value ; }


public static < t > http response < t > http request ( logger logger , string url , string method , object request body data , type reference < t > response format , int max tries ) throws i o exception , interrupted exception { i o exception exc = null ; for ( int tries = 0 ; tries < max tries ; tries + + ) { if ( tries > 0 ) { thread sleep ( tries > 1 ? 10 : 2 ) ; } try { return http request ( logger , url , method , request body data , response format ) ; } catch ( i o exception e ) { logger info ( " { } { } : error : { } " , method , url , e get message ( ) ) ; exc = e ; } } throw exc ; }


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

public long poll delay ms ( string id , long now ) { long throttle delay ms = throttle delay ms ( id , now ) ; if ( is connected ( id ) & & throttle delay ms > 0 ) { return throttle delay ms ; } else { return connection delay ( id , now ) ; } }


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


the virtual ip addresses associated with the service could be cidr prefix for http traffic , generated route configurations will include http route domains for both the ` addresses ` and ` hosts ` field values and the destination will be identified based on the http host authority header if one or more ip addresses are specified , the incoming traffic will be identified as belonging to this service if the destination ip matches the i p c i d rs specified in the addresses field if the addresses field is empty , traffic will be identified solely based on the destination port in such scenarios , the port on which the service is being accessed must not be shared by any other service in the mesh in other words , the sidecar will behave as a simple tcp proxy , forwarding incoming traffic on a specified port to the specified destination endpoint i phost unix domain socket addresses are not supported in this field < code > repeated string addresses = 2 ; < code >

public builder add addresses bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } check byte string is utf 8 ( value ) ; ensure addresses is mutable ( ) ; addresses add ( value ) ; on changed ( ) ; return this ; }


register the one ofany of descendants of the model class

public static void register descendants ( class < ? > model class , map < string , generic type > descendants ) { model descendants put ( model class , descendants ) ; }


access a value in this { @ link char sequence } this method is considered unsafe as index values are assumed to be legitimate only underlying array bounds checking is done

public char char at unsafe ( int index ) { return chars [ index ] ; }


verify that unless the config enables self - generation , job i ds are used

public void test job i d is u u i d ( ) throws exception { configuration config = new config ( ) ; pair < string , abstract s 3 a committer job u u i d source > t 3 = abstract s 3 a committer build job u u i d ( config , job id ) ; assert equals ( " job uuid source : " + t 3 , abstract s 3 a committer job u u i d source job i d , t 3 get right ( ) ) ; / / parse it as a job i d job i d for name ( t 3 get left ( ) ) ; }


attempt to export a random number of documents via { @ code exporters } from multiple threads

private int assert exporters ( final exporters exporters ) throws interrupted exception { final thread [ ] threads = new thread [ 3 + random int ( 7 ) ] ; final cyclic barrier barrier = new cyclic barrier ( threads length ) ; final list < throwable > exceptions = new copy on write array list < > ( ) ; final atomic integer counter = new atomic integer ( threads length ) ; int total = 0 ; for ( int i = 0 ; i < threads length ; i + + ) { final int thread docs = random int between ( 10 , 50 ) ; final int thread num = i ; total + = thread docs ; threads [ i ] = new thread ( new abstract runnable ( ) { @ override public void on failure ( exception e ) { exceptions add ( e ) ; } @ override protected void do run ( ) throws exception { final list < monitoring doc > docs = new array list < > ( ) ; for ( int n = 0 ; n < thread docs ; n + + ) { docs add ( new test monitoring doc ( random alpha of length ( 5 ) , random non negative long ( ) , random non negative long ( ) , null , monitored system es , random alpha of length ( 5 ) , null , string value of ( n ) ) ) ; } exporters export ( docs , action listener wrap ( r - > { counter decrement and get ( ) ; logger debug ( " - - > thread [ { } ] successfully exported { } documents " , thread num , thread docs ) ; } , e - > { exceptions add ( e ) ; logger debug ( " - - > thread [ { } ] failed to export { } documents " , thread num , thread docs ) ; } ) ) ; barrier await ( 10 , time unit seconds ) ; } } , " export thread " + i ) ; threads [ i ] start ( ) ; } for ( thread thread : threads ) { thread join ( ) ; } assert that ( exceptions , empty ( ) ) ; assert that ( counter get ( ) , is ( 0 ) ) ; return total ; }


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

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case function name : return is set function name ( ) ; } throw new illegal state exception ( ) ; }


returns a string that repeats the base string n times

public static string repeat ( string str , int repeat ) { return encoding utils repeat ( str , repeat ) ; }


determine if location corresponds to a shifted memory reference destination

public boolean is shifted address ( ) { return reference class ! = null & & shifted reference class is assignable from ( reference class ) ; }


public void set temporary state ( state temporary state ) { this temporary state = temporary state ; }


read and publish data one at a time until there is no more data , no more demand , or perhaps we completed in the mean time

private boolean read and publish ( ) throws i o exception { long r ; while ( ( r = this demand ) > 0 & & ! this state get ( ) equals ( state completed ) ) { t data = read ( ) ; if ( data ! = null ) { if ( r ! = long max value ) { demand field updater add and get ( this , - 1l ) ; } subscriber < ? super t > subscriber = this subscriber ; assert state ( subscriber ! = null , " no subscriber " ) ; if ( rs read logger is trace enabled ( ) ) { rs read logger trace ( get log prefix ( ) + " publishing data read " ) ; } subscriber on next ( data ) ; } else { if ( rs read logger is trace enabled ( ) ) { rs read logger trace ( get log prefix ( ) + " no more data to read " ) ; } return true ; } } return false ; }


given a dependency map , does the captured linear order of execution satisfy the ordering constraints ?

public void check order satisfies dependencies ( abstract dependency graph < string > dependency graph , list < string > visited order ) { if ( visited order size ( ) > dependency graph size ( ) ) { assert fail ( " more items were visited than the number of items in the graph " ) ; } if ( visited order size ( ) < dependency graph size ( ) ) { assert fail ( " not all items in the graph were visited " ) ; } hash set < string > items = new hash set < > ( visited order ) ; if ( items size ( ) ! = visited order size ( ) ) { assert fail ( " duplicate item ( s ) in linear order \ n " ) ; } hash map < string , integer > visited order map = new hash map < > ( ) ; for ( int i = 0 ; i < visited order size ( ) ; i + + ) { visited order map put ( visited order get ( i ) , i ) ; } for ( string key : dependency graph get values ( ) ) { integer visited ordinal = visited order map get ( key ) ; if ( visited ordinal = = null ) { assert fail ( " dependency graph key " + key + " not in linear order \ n " ) ; } set < string > dependents = dependency graph get dependent values ( key ) ; for ( string dependent : dependents ) { if ( key equals ( dependent ) ) { assert fail ( " dependency graph key " + key + " depends on itself \ n " ) ; } integer dependent visited ordinal = visited order map get ( dependent ) ; if ( dependent visited ordinal = = null ) { assert fail ( " dependent " + dependent + " of dependency graph key " + key + " not in linear order \ n " ) ; } if ( dependent visited ordinal < = visited ordinal ) { assert fail ( " dependent " + dependent + " of dependency graph key " + key + " came first ( " + dependent visited ordinal + " < " + visited ordinal + " ) \ n " ) ; } } } }


see { @ link # same ( attributes , boolean ) }

public final boolean same ( final attributes other ) { return same ( other , false ) ; }


async observable and semaphore isolation with functioning request context use hystrix context scheduler to make the user provided scheduler capture context

public void test timeout request context with semaphore isolated asynchronous observable and captured context scheduler ( ) { request context test results results = test request context on timeout ( execution isolation strategy semaphore , new hystrix context scheduler ( schedulers new thread ( ) ) ) ; assert true ( results is context initialized get ( ) ) ; / / the user scheduler captures context assert true ( results origin thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / the user provided thread / scheduler assert true ( results is context initialized observe on get ( ) ) ; / / the user scheduler captures context assert true ( results observe on thread get ( ) get name ( ) starts with ( " hystrix timer " ) ) ; / / timeout schedules on hystrix timer since the original thread was timed out / / semaphore isolated assert false ( results command is executed in thread ( ) ) ; hystrix circuit breaker factory reset ( ) ; }


get the next source value this calls { @ link # source has next ( ) } first to verify that there is data

protected s source next ( ) throws i o exception { try { if ( ! source has next ( ) ) { throw new no such element exception ( ) ; } return get source ( ) next ( ) ; } catch ( no such element exception | i o exception e ) { i o utils cleanup with logger ( log , this ) ; throw e ; } }


public static hosts file entries parse ( reader reader ) throws i o exception { check not null ( reader , " reader " ) ; buffered reader buff = new buffered reader ( reader ) ; try { map < string , inet 4 address > ipv 4 entries = new hash map < string , inet 4 address > ( ) ; map < string , inet 6 address > ipv 6 entries = new hash map < string , inet 6 address > ( ) ; string line ; while ( ( line = buff read line ( ) ) ! = null ) { / / remove comment int comment position = line index of ( ' # ' ) ; if ( comment position ! = - 1 ) { line = line substring ( 0 , comment position ) ; } / / skip empty lines line = line trim ( ) ; if ( line is empty ( ) ) { continue ; } / / split list < string > line parts = new array list < string > ( ) ; for ( string s : whitespaces split ( line ) ) { if ( ! s is empty ( ) ) { line parts add ( s ) ; } } / / a valid line should be [ ip , hostname , alias * ] if ( line parts size ( ) < 2 ) { / / skip invalid line continue ; } byte [ ] ip bytes = net util create byte array from ip address string ( line parts get ( 0 ) ) ; if ( ip bytes = = null ) { / / skip invalid ip continue ; } / / loop over hostname and aliases for ( int i = 1 ; i < line parts size ( ) ; i + + ) { string hostname = line parts get ( i ) ; string hostname lower = hostname to lower case ( locale english ) ; inet address address = inet address get by address ( hostname , ip bytes ) ; if ( address instanceof inet 4 address ) { inet 4 address previous = ipv 4 entries put ( hostname lower , ( inet 4 address ) address ) ; if ( previous ! = null ) { / / restore , we want to keep the first entry ipv 4 entries put ( hostname lower , previous ) ; } } else { inet 6 address previous = ipv 6 entries put ( hostname lower , ( inet 6 address ) address ) ; if ( previous ! = null ) { / / restore , we want to keep the first entry ipv 6 entries put ( hostname lower , previous ) ; } } } } return ipv 4 entries is empty ( ) & & ipv 6 entries is empty ( ) ? hosts file entries empty : new hosts file entries ( ipv 4 entries , ipv 6 entries ) ; } finally { try { buff close ( ) ; } catch ( i o exception e ) { logger warn ( " failed to close a reader " , e ) ; } } }


advances the read position to the specified absolute position

private void advance read to ( long absolute position ) { while ( absolute position > = read allocation node end position ) { read allocation node = read allocation node next ; } }


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 true if the character is ok to be contained inside c language string that is , the string should not be tokenized on this char

public static boolean is valid c language char ( char c ) { return character is letter or digit ( c ) | | c = = ' ' ; / / underscore }


schedules sending a { @ link player message }

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


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


write a document write ( indexdeleteupdate ) request

static void write document request ( stream output out , doc write request < ? > request ) throws i o exception { if ( request instanceof index request ) { out write byte ( ( byte ) 0 ) ; ( ( index request ) request ) write to ( out ) ; } else if ( request instanceof delete request ) { out write byte ( ( byte ) 1 ) ; ( ( delete request ) request ) write to ( out ) ; } else if ( request instanceof update request ) { out write byte ( ( byte ) 2 ) ; ( ( update request ) request ) write to ( out ) ; } else { throw new illegal state exception ( " invalid request [ " + request get class ( ) get simple name ( ) + " ] " ) ; } }


get an { @ code int } representation of { @ link # get content length ( http message , long ) }

public static int get content length ( http message message , int default value ) { return ( int ) math min ( integer max value , get content length ( message , ( long ) default value ) ) ; }


returns the least power of two smaller than or equal to 2 < s 3 0 < s and larger than or equal to < code > math ceil ( expected f ) < code >

public static int array size ( int expected , float f ) { long s = math max ( 2l , next power of two ( ( long ) math ceil ( ( double ) ( ( float ) expected / f ) ) ) ) ; if ( s > ( integer max value / 2 + 1 ) ) { throw new illegal argument exception ( " too large ( " + expected + " expected elements with load factor " + f + " ) " ) ; } else { return ( int ) s ; } }


gets the segment size for this cie record

public int get segment size ( ) { return segment size ; }


set whether http servlet request attributes are allowed to override ( hide ) controller generated model attributes of the same name default is " false " , which causes an exception to be thrown if request attributes of the same name as model attributes are found

public void set allow request override ( boolean allow request override ) { this allow request override = allow request override ; }


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

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


gets type literal for the given { @ code type } instance

public static type token < ? > get ( type type ) { return new type token < object > ( type ) ; }


public void set view bounds ( rect f view bounds ) { m view bounds set ( view bounds ) ; }


post fakeouternumber test serialization of outer number types

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


format the template with args , only supports the placeholder { @ code % s }

static string format ( string template , object args ) { return string format ( locale root , template , args ) ; }


public void set n clob ( int parameter index , reader reader ) throws s q l exception { }


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


invoked only if the converter type is { @ code mapping jackson 2 http message converter }

protected abstract void before body write internal ( mapping jackson value body container , media type content type , method parameter return type , server http request request , server http response response ) ;


heading h 6 ( string selector , string cdata ) ;


only select jobs that are timers cannot be used together with { @ link # messages ( ) }


main method for running it as a stand alone command

public static void main ( string [ ] argv ) throws exception { system exit ( tool runner run ( null , new quasi monte carlo ( ) , argv ) ) ; }


compose a " host : port " string from the address

public static string get host port string ( inet socket address addr ) { return addr get host name ( ) + " : " + addr get port ( ) ; }


returns the index of minimum value between { @ code index } and { @ code index + len } , or { @ code - 1 } if { @ code index } is greater than { @ code size }

int find min ( int index , int len ) { if ( index > = size ) { return - 1 ; } check state ( index > 0 ) ; int limit = math min ( index , size - len ) + len ; int min index = index ; for ( int i = index + 1 ; i < limit ; i + + ) { if ( compare elements ( i , min index ) < 0 ) { min index = i ; } } return min index ; }


public synchronized boolean set a m r m token ( token < a m r m token identifier > amrm token ) { token < a m r m token identifier > old value = this amrm token ; this amrm token = amrm token ; return ! this amrm token equals ( old value ) ; }


public method list get methods ( ) { parse to end if necessary ( ) ; return methods ; }


register a { @ link hystrix properties strategy } implementation as a global override of any injected or default implementations

public void register properties strategy ( hystrix properties strategy impl ) { if ( ! properties factory compare and set ( null , impl ) ) { throw new illegal state exception ( " another strategy was already registered " ) ; } }


returns the next available input buffer index or { @ link media codec # info try again later } if no such buffer exists

public int dequeue input buffer index ( ) { return available input buffers is empty ( ) ? media codec info try again later : available input buffers remove ( ) ; }


parse the sql statement and locate any placeholders or named parameters named parameters are substituted for a r2dbc placeholder , and any select list is expanded to the required number of placeholders select lists may contain an array of objects , and in that case the placeholders will be grouped and enclosed with parentheses this allows for the use of " expression lists " in the sql statement like : { @ code select id , name , state from table where ( name , age ) in ( ( ' john ' , 35 ) , ( ' ann ' , 50 ) ) } the parameter values passed in are used to determine the number of placeholders to be used for a select list select lists should be limited to 100 or fewer elements a larger number of elements is not guaranteed to be supported by the database and is strictly vendor - dependent

public static prepared operation < string > substitute named parameters ( parsed sql parsed sql , bind markers factory bind markers factory , bind parameter source param source ) { named parameters marker holder = new named parameters ( bind markers factory ) ; string original sql = parsed sql get original sql ( ) ; list < string > param names = parsed sql get parameter names ( ) ; if ( param names is empty ( ) ) { return new expanded query ( original sql , marker holder , param source ) ; } string builder actual sql = new string builder ( original sql length ( ) ) ; int last index = 0 ; for ( int i = 0 ; i < param names size ( ) ; i + + ) { string param name = param names get ( i ) ; int [ ] indexes = parsed sql get parameter indexes ( i ) ; int start index = indexes [ 0 ] ; int end index = indexes [ 1 ] ; actual sql append ( original sql , last index , start index ) ; named parameters named parameter marker = marker holder get or create ( param name ) ; if ( param source has value ( param name ) ) { object value = param source get value ( param name ) ; if ( value instanceof collection ) { iterator < ? > entry iter = ( ( collection < ? > ) value ) iterator ( ) ; int k = 0 ; int counter = 0 ; while ( entry iter has next ( ) ) { if ( k > 0 ) { actual sql append ( " , " ) ; } k + + ; object entry item = entry iter next ( ) ; if ( entry item instanceof object [ ] ) { object [ ] expression list = ( object [ ] ) entry item ; actual sql append ( ' ( ' ) ; for ( int m = 0 ; m < expression list length ; m + + ) { if ( m > 0 ) { actual sql append ( " , " ) ; } actual sql append ( marker get placeholder ( counter ) ) ; counter + + ; } actual sql append ( ' ) ' ) ; } else { actual sql append ( marker get placeholder ( counter ) ) ; counter + + ; } } } else { actual sql append ( marker get placeholder ( ) ) ; } } else { actual sql append ( marker get placeholder ( ) ) ; } last index = end index ; } actual sql append ( original sql , last index , original sql length ( ) ) ; return new expanded query ( actual sql to string ( ) , marker holder , param source ) ; }


called by generate font to create a new { @ link bitmap font } instance this allows injecting a customized { @ link bitmap font } , eg for a rtl font

protected bitmap font new bitmap font ( bitmap font data data , array < texture region > page regions , boolean integer ) { return new bitmap font ( data , page regions , integer ) ; }


the string pool containing source paths referenced throughout the resource table this does not end up in the final binary arsc file < code > optional aapt pb string pool source pool = 1 ; < code >

public builder set source pool ( com android aapt resources string pool builder builder for value ) { copy on write ( ) ; instance set source pool ( builder for value ) ; return this ; }


by default does not support multiple emits per next token invocation for efficiency reasons subclass and override this method , next token , and get token ( to push tokens into a list and pull from that list rather than a single variable as this implementation does )

public void emit ( token token ) { / / system err println ( " emit " + token ) ; this token = token ; }


try to install our custom rule profile into sandbox init ( ) to block execution

private static void mac impl ( path tmp file ) throws i o exception { / / first be defensive : we can give nice errors this way , at the very least boolean supported = constants mac os x ; if ( supported = = false ) { throw new illegal state exception ( " bug : should not be trying to initialize seatbelt for an unsupported os " ) ; } / / we couldn ' t link methods , could be some really ancient os x ( < leopard ) or some bug if ( libc mac = = null ) { throw new unsupported operation exception ( " seatbelt unavailable : could not link methods requires leopard or above " ) ; } / / write rules to a temporary file , which will be passed to sandbox init ( ) path rules = files create temp file ( tmp file , " es " , " sb " ) ; files write ( rules , collections singleton ( sandbox rules ) ) ; boolean success = false ; try { pointer by reference error ref = new pointer by reference ( ) ; int ret = libc mac sandbox init ( rules to absolute path ( ) to string ( ) , sandbox named , error ref ) ; / / if sandbox init ( ) fails , add the message from the os ( e g syntax error ) and free the buffer if ( ret ! = 0 ) { pointer error buf = error ref get value ( ) ; runtime exception e = new unsupported operation exception ( " sandbox init ( ) : " + error buf get string ( 0 ) ) ; libc mac sandbox free error ( error buf ) ; throw e ; } logger debug ( " os x seatbelt initialization successful " ) ; success = true ; } finally { if ( success ) { files delete ( rules ) ; } else { i o utils delete files ignoring exceptions ( rules ) ; } } }


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

public model with private field with same as field getter and setter name on bind ( on model bound listener < model with private field with same as field getter and setter name , object > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


returns the whole range relative to the specified comparator

static < t > general range < t > all ( comparator < ? super t > comparator ) { return new general range < t > ( comparator , false , null , open , false , null , open ) ; }


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


returns the index that is offset { @ code code point offset } code points from { @ code index }

public int offset by code points ( int index , int code point offset ) { return character offset by code points ( chars , 0 , length , index , code point offset ) ; }


returns the data set that contains the provided entry , or null , if no data set contains this entry

public t get data set for entry ( entry e ) { if ( e = = null ) return null ; for ( int i = 0 ; i < m data sets size ( ) ; i + + ) { t set = m data sets get ( i ) ; for ( int j = 0 ; j < set get entry count ( ) ; j + + ) { if ( e equal to ( set get entry for x value ( e get x ( ) , e get y ( ) ) ) ) return set ; } } return null ; }