public embedded database build ( ) { return this database factory get database ( ) ; }


the remaining capacity in the block before it is full


get userlogin : logs user into the system

completable future < response entity < string > > login user ( @ not null @ api param ( value = " the user name for login " , required = true ) @ valid @ request param ( value = " username " , required = true ) string username , @ not null @ api param ( value = " the password for login in clear text " , required = true ) @ valid @ request param ( value = " password " , required = true ) string password ) ;


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

public < e extends t > list < e > least of ( iterator < e > iterator , int k ) { check not null ( iterator ) ; check nonnegative ( k , " k " ) ; if ( k = = 0 | | ! iterator has next ( ) ) { return collections empty list ( ) ; } else if ( k > = integer max value / 2 ) { / / k is really large ; just do a straightforward sorted - copy - and - sublist array list < e > list = lists new array list ( iterator ) ; collections sort ( list , this ) ; if ( list size ( ) > k ) { list sub list ( k , list size ( ) ) clear ( ) ; } list trim to size ( ) ; return collections unmodifiable list ( list ) ; } else { top k selector < e > selector = top k selector least ( k , this ) ; selector offer all ( iterator ) ; return selector top k ( ) ; } }


sets the { @ code additional properties } and returns a reference to this builder so that the methods can be chained together

public builder with additional property ( string key , object value ) { if ( this additional properties = = null ) { this additional properties = new hash map < > ( ) ; } this additional properties put ( key , value ) ; return this ; }


public optional < consumer group state > state ( ) { return state ; }


remember : s q lite does not support joins nor table alias for delete

public static string create sql delete ( string tablename , string [ ] columns ) { string quoted tablename = ' " ' + tablename + ' " ' ; string builder builder = new string builder ( " delete from " ) ; builder append ( quoted tablename ) ; if ( columns ! = null & & columns length > 0 ) { builder append ( " where " ) ; append columns eq value ( builder , quoted tablename , columns ) ; } return builder to string ( ) ; }


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


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


whether phrase queries should be automatically generated for multi terms synonyms defaults to { @ code true }

public boolean auto generate synonyms phrase query ( ) { return auto generate synonyms phrase query ; }


setup the dependencies needed for the rest tests

static void setup dependencies ( project project , source set source set ) { build params with internal build ( ( ) - > { project get dependencies ( ) add ( source set get implementation configuration name ( ) , project project ( " : test : framework " ) ) ; } ) or else ( ( ) - > { project get dependencies ( ) add ( source set get implementation configuration name ( ) , " org elasticsearch test : framework : " + version properties get elasticsearch ( ) ) ; } ) ; }


private inet address [ ] resolve internal ( final string host ) throws i o exception { if ( ( host starts with ( " # " ) & & host ends with ( " # " ) ) | | ( host starts with ( " " ) & & host ends with ( " " ) ) ) { final string interface spec = host substring ( 1 , host length ( ) - 1 ) ; / / next check any registered custom resolvers if any if ( custom name resolvers ! = null ) { for ( custom name resolver custom name resolver : custom name resolvers ) { inet address addresses [ ] = custom name resolver resolve if possible ( interface spec ) ; if ( addresses ! = null ) { return addresses ; } } } switch ( interface spec ) { case " local " : return network utils get loopback addresses ( ) ; case " local : ipv 4 " : return network utils filter i p v 4 ( network utils get loopback addresses ( ) ) ; case " local : ipv 6 " : return network utils filter i p v 6 ( network utils get loopback addresses ( ) ) ; case " site " : return network utils get site local addresses ( ) ; case " site : ipv 4 " : return network utils filter i p v 4 ( network utils get site local addresses ( ) ) ; case " site : ipv 6 " : return network utils filter i p v 6 ( network utils get site local addresses ( ) ) ; case " global " : return network utils get global addresses ( ) ; case " global : ipv 4 " : return network utils filter i p v 4 ( network utils get global addresses ( ) ) ; case " global : ipv 6 " : return network utils filter i p v 6 ( network utils get global addresses ( ) ) ; default : / * an interface specification * / if ( interface spec ends with ( " : ipv 4 " ) ) { return network utils filter i p v 4 ( network utils get addresses for interface ( host , " : ipv 4 " , interface spec substring ( 0 , interface spec length ( ) - 5 ) ) ) ; } else if ( interface spec ends with ( " : ipv 6 " ) ) { return network utils filter i p v 6 ( network utils get addresses for interface ( host , " : ipv 6 " , interface spec substring ( 0 , interface spec length ( ) - 5 ) ) ) ; } else { return network utils get addresses for interface ( host , " " , interface spec ) ; } } } return inet address get all by name ( host ) ; }


set the default value type name ( class name ) to be used for this map

public void set value type name ( @ nullable string value type name ) { this value type name = value type name ; }


extract uri template variables from the matching pattern as defined in { @ link path matcher # extract uri template variables }

public map < string , string > extract uri template variables ( ) { return ( this path pattern ! = null ? this path pattern match and extract ( this lookup path container ) get uri variables ( ) : this path matcher extract uri template variables ( this pattern , this lookup path ) ) ; }


returns { @ code true } if { @ code object } is an { @ code immutable long array } containing the same values as this one , in the same order

public boolean equals ( @ nullable decl object object ) { if ( object = = this ) { return true ; } if ( ! ( object instanceof immutable long array ) ) { return false ; } immutable long array that = ( immutable long array ) object ; if ( this length ( ) ! = that length ( ) ) { return false ; } for ( int i = 0 ; i < length ( ) ; i + + ) { if ( this get ( i ) ! = that get ( i ) ) { return false ; } } return true ; }


public void test multi threaded edit log ( ) throws i o exception { test edit log ( 2048 ) ; / / force edit buffer to automatically sync on each log of edit log entry test edit log ( 1 ) ; }


test block manager won ' t leave safe mode if there are blocks with generation stamp ( gs ) in future

public void test stay in safe mode when bytes in future ( ) throws exception { bm safe mode activate ( block total ) ; / / inject blocks with future gs inject blocks with fugure g s ( 100l ) ; assert equals ( 100l , bm safe mode get bytes in future ( ) ) ; / / safe blocks are enough set block safe ( block threshold ) ; / / pending threshold - > extension bm safe mode check safe mode ( ) ; assert false ( " shouldn ' t leave safe mode in case of blocks with future gs ! " , bm safe mode leave safe mode ( false ) ) ; assert true ( " leaving safe mode forcefully should succeed regardless of " + " blocks with future gs " , bm safe mode leave safe mode ( true ) ) ; assert equals ( " number of blocks with future gs should have been cleared " + " after leaving safe mode " , 0l , bm safe mode get bytes in future ( ) ) ; assert true ( " leaving safe mode should succeed after blocks with future gs " + " are cleared " , bm safe mode leave safe mode ( false ) ) ; }


parse a data - type string specification with category path if category is not null , the data type manager service will not be queried

public data type parse ( string data type string , category path category ) throws invalid data type exception , cancelled exception { data type string = data type string replace all ( " \ \ s + " , " " ) trim ( ) ; string data type name = get base string ( data type string ) ; data type named dt = get named data type ( data type name , category ) ; if ( named dt = = null ) { throw new invalid data type exception ( " valid data - type not specified " ) ; } return parse data type modifiers ( named dt , data type string substring ( data type name length ( ) ) ) ; }


remove suspect and dead node from suspect and dead nodes # dfs input stream and local dead nodes

private synchronized void remove node from dead node detector ( datanode info datanode info ) { for ( map entry < d f s input stream , hash set < datanode info > > entry : suspect and dead nodes entry set ( ) ) { set < datanode info > datanode infos = entry get value ( ) ; if ( datanode infos remove ( datanode info ) ) { d f s input stream dfs input stream = entry get key ( ) ; dfs input stream remove from local dead nodes ( datanode info ) ; if ( datanode infos is empty ( ) ) { suspect and dead nodes remove ( dfs input stream ) ; } } } }


writes a portion of an array of characters

public void write ( char cbuf [ ] , int off , int len ) throws i o exception { final int off plus len = off + len ; for ( int i = off ; i < off plus len ; ) { char c = cbuf [ i + + ] ; if ( c < 0x 8 0 ) { bytes [ index ] = ( byte ) c ; if ( + + index > = bytes length ) { flush buffer ( ) ; } } else { write ( c ) ; } } }


returns the arguments of this expression

protected list < string > get arguments ( ) { return this arguments ; }


gets the memory dedicated to each sub - task for this node

public double get relative memory per sub task ( ) { return this relative memory per sub task ; }


returns whether the given line segment intersects the given circle

public static boolean intersect segment circle ( vector 2 start , vector 2 end , circle circle , minimum translation vector mtv ) { v 2a set ( end ) sub ( start ) ; v 2b set ( circle x - start x , circle y - start y ) ; float len = v 2a len ( ) ; float u = v 2b dot ( v 2a nor ( ) ) ; if ( u < = 0 ) { v 2c set ( start ) ; } else if ( u > = len ) { v 2c set ( end ) ; } else { v 2d set ( v 2a scl ( u ) ) ; / / remember v 2a is already normalized v 2c set ( v 2d ) add ( start ) ; } v 2a set ( v 2c x - circle x , v 2c y - circle y ) ; if ( mtv ! = null ) { / / handle special case of segment containing circle center if ( v 2a equals ( vector 2 zero ) ) { v 2d set ( end y - start y , start x - end x ) ; mtv normal set ( v 2d ) nor ( ) ; mtv depth = circle radius ; } else { mtv normal set ( v 2a ) nor ( ) ; mtv depth = circle radius - v 2a len ( ) ; } } return v 2a len 2 ( ) < = circle radius * circle radius ; }


determines whether to enable strict java deps

public strict deps mode get strict java deps ( ) { return strict java deps ; }


returns the { @ link range } that represents the intersection of the two

public range intersect ( range that ) { assert ! is disjoint ( that ) ; return new range ( math max ( this start , that start ) , math min ( this end , that end ) ) ; }


returns a { @ link string } view of the data

public string string ( ) { return text = = null ? bytes utf 8 to string ( ) : text ; }


public big decimal get prefix ns number ( ) { return prefix ns number ; }


private static boolean is valid port ( int port ) { return port > = 0 & & port < = 65535 ; }


a callback that should never be invoked directly

public synchronized void on resource ready ( @ non null r resource , @ nullable transition < ? super r > transition ) { / / ignored , synchronized for backwards compatibility }


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

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


get maximum allocation setting for the specified queue from the configuration

public resource get queue maximum allocation ( string queue ) { string queue prefix = get queue prefix ( queue ) ; string raw queue max allocation = get ( queue prefix + maximum allocation , null ) ; if ( strings is null or empty ( raw queue max allocation ) ) { return resources none ( ) ; } else { return resource utils create resource from string ( raw queue max allocation , resource utils get resources type info ( ) ) ; } }


public static list < sub component > get sub components ( component context context , component component , int width spec , int height spec ) { return get immediate sub components ( context , component , width spec , height spec ) ; }


gets called when the user clicks on the ok action for the dialog

protected void ok callback ( ) { if ( check input ( ) ) { / / check if archive file exists string archive = archive field get text ( ) trim ( ) ; if ( ! archive ends with ( archive plugin archive extension ) ) { archive + = archive plugin archive extension ; } file file = new file ( archive ) ; if ( file exists ( ) & & option dialog show option dialog ( root panel , " archive file exists " , " file " + archive + " exists \ n " + " do you want to overwrite existing file ? " , " yes " ) ! = option dialog option one ) { return ; } action complete = true ; close ( ) ; } else { root panel get toolkit ( ) beep ( ) ; } }


return an new { @ link channel progressive promise }

channel progressive promise new progressive promise ( ) ;


gets the { @ link job property descriptor } by name primarily used for making them web - visible

public job property descriptor get job property ( string short class name ) { / / combining these two lines triggers javac bug see issue # 610 descriptor d = find descriptor ( short class name , job property descriptor all ( ) ) ; return ( job property descriptor ) d ; }


create a new big - endian buffer that holds a sequence of the specified 16 - bit integers

public static byte buf copy short ( short values ) { if ( values = = null | | values length = = 0 ) { return empty buffer ; } byte buf buffer = buffer ( values length * 2 ) ; for ( int v : values ) { buffer write short ( v ) ; } return buffer ; }


@ test public void enums may define abstract methods ( ) throws exception { type spec roshambo = type spec enum builder ( " tortilla " ) add modifiers ( modifier public ) add enum constant ( " corn " , type spec anonymous class builder ( " " ) add method ( method spec method builder ( " fold " ) add annotation ( override class ) add modifiers ( modifier public ) build ( ) ) build ( ) ) add method ( method spec method builder ( " fold " ) add modifiers ( modifier public , modifier abstract ) build ( ) ) build ( ) ; assert that ( to string ( roshambo ) ) is equal to ( " " + " package com squareup tacos ; \ n " + " \ n " + " import java lang override ; \ n " + " \ n " + " public enum tortilla { \ n " + " corn { \ n " + " @ override \ n " + " public void fold ( ) { \ n " + " } \ n " + " } ; \ n " + " \ n " + " public abstract void fold ( ) ; \ n " + " } \ n " ) ; }


put a blocker to the blocker map - replacing any with the same name

protected void put blocker ( string name , string details ) { synchronized ( blocker map ) { blocker map put ( name , details ) ; } }


creates a new async stub that supports all call types for the service

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


converts multiple sinkexit nodes in a graph into a single sink of which those become parents

protected static < v , e extends g edge < v > > v unify sinks ( mutable g directed graph wrapper < v , e > graph , graph navigator < v , e > graph navigator ) { set < v > sinks = graph navigator get sinks ( graph ) ; if ( sinks is empty ( ) ) { throw new illegal argument exception ( " the graph does not contain at least one sink node " ) ; } if ( sinks size ( ) = = 1 ) { return sinks iterator ( ) next ( ) ; } / / turn the sinks into children of a single sink v dummy = graph add dummy vertex ( dummy sink name ) ; sinks for each ( s - > { if ( graph navigator is top down ( ) ) { graph add dummy edge ( s , dummy ) ; } else { graph add dummy edge ( dummy , s ) ; } } ) ; return dummy ; }


public int write method id ( method id method id ) { ensure four bytes aligned ( table of contents method ids , true ) ; return super write method id ( method id ) ; }


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


initialize the user transaction as well as the transaction manager handle

public void after properties set ( ) throws transaction system exception { init user transaction and transaction manager ( ) ; check user transaction and transaction manager ( ) ; init transaction synchronization registry ( ) ; }


encodes the image data given as rgb565 or rgb888 does not modify the position or limit of the { @ link byte buffer }

private static native byte buffer encode image p k m ( byte buffer image data , int offset , int width , int height , int pixel size ) ; / * int compressed size = etc 1 get encoded data size ( width , height ) ; etc 1 byte * compressed = ( etc 1 byte * ) malloc ( compressed size + etc pkm header size ) ; etc 1 pkm format header ( compressed , width , height ) ; etc 1 encode image ( ( etc 1 byte * ) image data + offset , width , height , pixel size , width * pixel size , compressed + etc pkm header size ) ; return env - > new direct byte buffer ( compressed , compressed size + etc pkm header size ) ; * /


constructs standard ( non - legacy ) timestamp value corresponding to argument

public static sql timestamp sql timestamp of ( local date time date time ) { return new sql timestamp ( days to millis ( date time to local date ( ) to epoch day ( ) ) + nanoseconds to millis ( date time to local time ( ) to nano of day ( ) ) ) ; }


gets the default merge progress panel that indicates all the phases and their current status

public merge progress panel get merge progress panel ( ) { return merge progress panel ; }


computes how much of the queue can be filled by splits with the network topology distance to a node given by split affinity a split with zero affinity can only fill half the queue , whereas one that matches exactly can fill the entire queue

private int calculate max pending splits ( int split affinity , int total depth ) { if ( total depth = = 0 ) { return max pending splits per task ; } / / use half the queue for any split / / reserve the other half for splits that have some amount of network affinity double queue fraction = 0 5 * ( 1 0 + split affinity / ( double ) total depth ) ; return ( int ) math ceil ( max pending splits per task * queue fraction ) ; }


removes metadata this method may be slow and shouldn ' t normally be called on the main thread

public void remove ( string name ) throws database i o exception { assertions check not null ( table name ) ; try { s q lite database writable database = database provider get writable database ( ) ; writable database delete ( table name , where name equals , new string [ ] { name } ) ; } catch ( s q l exception e ) { throw new database i o exception ( e ) ; } }


remove the attribute of the given name , if it exists also removes the registered destruction callback for the specified attribute , if any however it does not execute the callback it is assumed the removed object will continue to be used and destroyed independently at the appropriate time

public void remove attribute ( string name ) { this attributes remove ( name ) ; remove destruction callback ( name ) ; }


copy file from source path to destination path ( the caller should make sure src path is a file and dst path is valid )

private boolean copy file ( path src path , long src len , path dst path ) { string src key = path to key ( src path ) ; string dst key = path to key ( dst path ) ; return store copy file ( src key , src len , dst key ) ; }


some sections have address alignment constraints for example , if a section holds a doubleword , the system must ensure doubleword alignment for the entire section that is , the value of sh addr must be congruent to 0 , modulo the value of sh addralign currently , only 0 and positive integral powers of two are allowed values 0 and 1 mean the section has no alignment constraints

public long get address alignment ( ) { return sh addralign ; }


convenience method , so that we don ' t open a new connection when using this method from within another method otherwise every api invocation incurs the overhead of openingclosing a tcp connection

private file status [ ] list status ( f t p client client , path file ) throws i o exception { path work dir = new path ( client print working directory ( ) ) ; path absolute = make absolute ( work dir , file ) ; file status file stat = get file status ( client , absolute ) ; if ( file stat is file ( ) ) { return new file status [ ] { file stat } ; } f t p file [ ] ftp files = client list files ( absolute to uri ( ) get path ( ) ) ; file status [ ] file stats = new file status [ ftp files length ] ; for ( int i = 0 ; i < ftp files length ; i + + ) { file stats [ i ] = get file status ( ftp files [ i ] , absolute ) ; } return file stats ; }


overwrites { @ code num bits } from this array using the { @ code num bits } least significant bits from { @ code value } bits are written in order from most significant to least significant the read position is advanced by { @ code num bits }

public void put int ( int value , int num bits ) { int remaining bits to read = num bits ; if ( num bits < 32 ) { value & = ( 1 < < num bits ) - 1 ; } int first byte read size = min ( 8 - bit offset , num bits ) ; int first byte right padding size = 8 - bit offset - first byte read size ; int first byte bitmask = ( 0x f f 0 0 > > bit offset ) | ( ( 1 < < first byte right padding size ) - 1 ) ; data [ byte offset ] = ( byte ) ( data [ byte offset ] & first byte bitmask ) ; int first byte input bits = value > > > ( num bits - first byte read size ) ; data [ byte offset ] = ( byte ) ( data [ byte offset ] | ( first byte input bits < < first byte right padding size ) ) ; remaining bits to read - = first byte read size ; int current byte index = byte offset + 1 ; while ( remaining bits to read > 8 ) { data [ current byte index + + ] = ( byte ) ( value > > > ( remaining bits to read - 8 ) ) ; remaining bits to read - = 8 ; } int last byte right padding size = 8 - remaining bits to read ; data [ current byte index ] = ( byte ) ( data [ current byte index ] & ( ( 1 < < last byte right padding size ) - 1 ) ) ; int last byte input = value & ( ( 1 < < remaining bits to read ) - 1 ) ; data [ current byte index ] = ( byte ) ( data [ current byte index ] | ( last byte input < < last byte right padding size ) ) ; skip bits ( num bits ) ; assert valid offset ( ) ; }


perform any formatting for the registry needed to convert non - simple - dns elements

public static string encode for registry ( string element ) { return idn to a s c i i ( element ) ; }


public short get version ( ) { return ne ver ; }


prints out the internal state of the policy

private void print lirs ( ) { system out println ( " * * lirs stack top * * " ) ; for ( node n = head s next s ; n ! = head s ; n = n next s ) { check state ( n is in s ) ; if ( n status = = status hir non resident ) { system out println ( " < nr > " + n key ) ; } else if ( n status = = status hir resident ) { system out println ( " < rh > " + n key ) ; } else { system out println ( " < rl > " + n key ) ; } } system out println ( " * * lirs stack bottom * * " ) ; system out println ( " \ n * * lirs queue end * * " ) ; for ( node n = head q next q ; n ! = head q ; n = n next q ) { check state ( n is in q ) ; system out println ( n key ) ; } system out println ( " * * lirs queue front * * " ) ; system out println ( " \ n l i r s evicted page sequence : " ) ; for ( int i = 0 ; i < evicted size ( ) ; i + + ) { system out println ( " < " + i + " > " + evicted get ( i ) ) ; } }


parses the given string as a numeric value , detecting whether or not it begins with a hex prefix , and if not , parses as a long int value

public static long parse oct long ( string num str ) { long value = 0 ; long sign = 1 ; num str = ( num str = = null ? " " : num str trim ( ) ) ; if ( num str length ( ) = = 0 ) { return value ; } if ( num str starts with ( " - " ) ) { sign = - 1 ; num str = num str substring ( 1 ) ; } int radix = 8 ; if ( num str starts with ( " 0 " ) ) { if ( num str length ( ) > 18 ) { throw new number format exception ( num str + " has too many digits " ) ; } num str = num str substring ( 1 ) ; } big integer bi = new big integer ( num str , radix ) ; return bi long value ( ) * sign ; }


get the number of pending deletion blocks

public long get num of blocks pending deletion ( ) { return this num of blocks pending deletion ; }


returns the string representation of the { @ link # sum }

public string to string ( ) { return long to string ( sum ( ) ) ; }


public void anytype 3 test ( ) { / / todo : test anytype 3 }


assert the number of events received by this instance checks that unexpected events have not been received if an event is handled by several listeners , each instance will be registered

public void assert total events count ( int number ) { int actual = 0 ; for ( map entry < string , list < object > > entry : this content entry set ( ) ) { actual + = entry get value ( ) size ( ) ; } assert that ( actual ) as ( " wrong number of total events ( " + this content size ( ) + " ) registered listener ( s ) " ) is equal to ( 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 " ) ; }


if true , then memory contents should be readwritten

public boolean is memory contents ( ) { return memory contents ; }


whether the response received from was the result of some type of failure and < code > get fallback ( ) < code > being called

public boolean is response from fallback ( ) { return get command result ( ) get event counts ( ) contains ( hystrix event type fallback success ) ; }


this test fixes some constants , because changing them can harm backwards compatibility

public void fix constants ( ) { string expected timer state prefix = " timer state " ; assert assert equals ( expected timer state prefix , internal time service manager impl timer state prefix ) ; assert assert equals ( expected timer state prefix + " / processing " , internal time service manager impl processing timer prefix ) ; assert assert equals ( expected timer state prefix + " / event " , internal time service manager impl event timer prefix ) ; }


public encoding mode get encoding mode ( ) { return this encoding mode ; }


publish a batch of events to the ring buffer

public < a > void publish events ( final event translator one arg < t , a > event translator , final a [ ] arg ) { ring buffer publish events ( event translator , arg ) ; }


start an unnamed task the results are undefined if { @ link # stop ( ) } or timing methods are called without invoking this method

public stop watch start ( ) throws illegal state exception { return start ( " " ) ; }


returns the values from each provided array combined into a single array for example , { @ code concat ( new float [ ] { a , b } , new float [ ] { } , new float [ ] { c } } returns the array { @ code { a , b , c } }

public static float [ ] concat ( float [ ] arrays ) { int length = 0 ; for ( float [ ] array : arrays ) { length + = array length ; } float [ ] result = new float [ length ] ; int pos = 0 ; for ( float [ ] array : arrays ) { system arraycopy ( array , 0 , result , pos , array length ) ; pos + = array length ; } return result ; }


gets the underlying { @ link token source } which provides tokens for this stream

public token source get token source ( ) ;


returns an iterator over the elements in this deque the elements will be ordered from first ( head ) to last ( tail ) this is the same order that elements would be dequeued ( via successive calls to { @ link # remove } or popped ( via successive calls to { @ link # pop } )

public iterator < e > iterator ( ) { return new deq iterator ( ) ; }


sets the < code > namespace array < code > property

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


returns the dash path effect that is used for highlighting

dash path effect get dash path effect highlight ( ) ;


the value of the enumflag < code > optional uint 3 2 value = 4 ; < code >


controls the response of an observer to the receipt of a quorumpacket

protected void process packet ( quorum packet qp ) throws exception { txn log entry log entry ; txn header hdr ; txn digest digest ; record txn ; switch ( qp get type ( ) ) { case leader ping : ping ( qp ) ; break ; case leader proposal : log warn ( " ignoring proposal " ) ; break ; case leader commit : log warn ( " ignoring commit " ) ; break ; case leader uptodate : log error ( " received an uptodate message after observer started " ) ; break ; case leader revalidate : revalidate ( qp ) ; break ; case leader sync : ( ( observer zoo keeper server ) zk ) sync ( ) ; break ; case leader inform : server metrics get metrics ( ) learner commit received count add ( 1 ) ; log entry = serialize utils deserialize txn ( qp get data ( ) ) ; hdr = log entry get header ( ) ; txn = log entry get txn ( ) ; digest = log entry get digest ( ) ; request request = new request ( hdr get client id ( ) , hdr get cxid ( ) , hdr get type ( ) , hdr , txn , 0 ) ; request log latency ( server metrics get metrics ( ) commit propagation latency ) ; request set txn digest ( digest ) ; observer zoo keeper server obs = ( observer zoo keeper server ) zk ; obs commit request ( request ) ; break ; case leader informandactivate : / / get new designated leader from ( current ) leader ' s message byte buffer buffer = byte buffer wrap ( qp get data ( ) ) ; long suggested leader id = buffer get long ( ) ; byte [ ] remainingdata = new byte [ buffer remaining ( ) ] ; buffer get ( remainingdata ) ; log entry = serialize utils deserialize txn ( remainingdata ) ; hdr = log entry get header ( ) ; txn = log entry get txn ( ) ; digest = log entry get digest ( ) ; quorum verifier qv = self config from string ( new string ( ( ( set data txn ) txn ) get data ( ) , utf 8 ) ) ; request = new request ( hdr get client id ( ) , hdr get cxid ( ) , hdr get type ( ) , hdr , txn , 0 ) ; request set txn digest ( digest ) ; obs = ( observer zoo keeper server ) zk ; boolean major change = self process reconfig ( qv , suggested leader id , qp get zxid ( ) , true ) ; obs commit request ( request ) ; if ( major change ) { throw new exception ( " changes proposed in reconfig " ) ; } break ; default : log warn ( " unknown packet type : { } " , learner handler packet to string ( qp ) ) ; break ; } }


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

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


partially resolves the path this is used during symlink resolution in { @ link f s link resolver } , and differs from the similarly named method { @ link file context # get link target ( path ) }

public path get link target ( final path f ) throws i o exception { throw new assertion error ( " implementation error : " + get class ( ) + " that threw an unresolved link exception , causing this method to be " + " called , needs to override this method " ) ; }


this method is deprecated and will be removed in the future releases handle async db operation in your own logic instead

public < t > find multi executor < t > find async ( final class < t > model class , final boolean is eager ) { final find multi executor < t > executor = new find multi executor < > ( ) ; runnable runnable = new runnable ( ) { @ override public void run ( ) { synchronized ( lite pal support class ) { final list < t > t = find ( model class , is eager ) ; if ( executor get listener ( ) ! = null ) { operator get handler ( ) post ( new runnable ( ) { @ override public void run ( ) { executor get listener ( ) on finish ( t ) ; } } ) ; } } } } ; executor submit ( runnable ) ; return executor ; }


void set home address ( address address ) { instruction inst = program get listing ( ) get instruction at ( address ) ; if ( inst = = null ) { return ; } current addr = inst get min address ( ) ; current fallthrough addr = inst get fall through ( ) ; default fallthrough addr = inst get default fall through ( ) ; is user defined = inst is fall through overridden ( ) ; is default = ! is user defined ; listener state changed ( null ) ; }


returns the total number of entries in this { @ link copy on write state map } this is the sum of both sub - maps

public int size ( ) { return primary table size + incremental rehash table size ; }


get the { @ linkplain platform transaction manager transaction manager } to use for the supplied { @ linkplain test context test context } the default implementation simply delegates to { @ link test context transaction utils # retrieve transaction manager }

protected platform transaction manager get transaction manager ( test context test context ) { return test context transaction utils retrieve transaction manager ( test context , null ) ; }


test the behavior of the router when one of the subclusters in a mount point fails it assumes that ns 1 is already down

private void test write with failed subcluster ( final destination order order ) throws exception { final file system router 0 fs = get file system ( routers get ( 0 ) ) ; final file system router 1 fs = get file system ( routers get ( 1 ) ) ; final file system ns 0 fs = get file system ( namenodes get ( " ns 0 " ) get r p c port ( ) ) ; final string mount point = " / " + order + " - failsubcluster " ; final path mount path = new path ( mount point ) ; log info ( " setup { } with order { } " , mount point , order ) ; create mount table entry ( get random router ( ) , mount point , order , namenodes key set ( ) ) ; refresh routers caches ( routers ) ; log info ( " write in { } should succeed writing in ns 0 and fail for ns 1 " , mount path ) ; check directories fault tolerant ( mount path , order , router 0 fs , router 1 fs , ns 0 fs , false ) ; check files fault tolerant ( mount path , order , router 0 fs , router 1 fs , ns 0 fs , false ) ; log info ( " make { } fault tolerant and everything succeeds " , mount path ) ; i o exception ioe = null ; try { update mount point fault tolerant ( mount point ) ; } catch ( i o exception e ) { ioe = e ; } if ( destination order folder all contains ( order ) ) { assert null ( ioe ) ; check directories fault tolerant ( mount path , order , router 0 fs , router 1 fs , ns 0 fs , true ) ; check files fault tolerant ( mount path , order , router 0 fs , router 1 fs , ns 0 fs , true ) ; } else { assert true ( ioe get message ( ) starts with ( " invalid entry , fault tolerance only supported for all order " ) ) ; } }


the default character set to use for reading form data this is a shortcut for : < br > { @ code get form converter set charset ( charset ) }

public void set charset ( charset charset ) { this form converter set charset ( charset ) ; }


public static byte [ ] read file 2 bytes by stream ( final string file path ) { return read file 2 bytes by stream ( utils bridge get file by path ( file path ) , null ) ; }


returns the total number of shards plus the number of empty groups

public int total size with 1 for empty ( ) { int size = 0 ; for ( shard it shard : iterators ) { size + = math max ( 1 , shard size ( ) ) ; } return size ; }


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

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


this is a regression test for antlrantlr 4 # 649 " unknown target causes null ptr exception " https : github comantlrantlr 4issues 6 4 9 stops before processing the lexer

@ test public void test invalid language in grammar with lexer command ( ) throws exception { string grammar = " grammar t ; \ n " + " options { language = foo ; } \ n " + " start : ' t ' eof ; \ n " + " something : ' something ' - > channel ( custom ) ; " ; string expected = " error ( " + error type cannot create target generator code + " ) : antlr cannot generate foo code as of version " + tool version + " \ n " ; string [ ] pair = new string [ ] { grammar , expected } ; super test errors ( pair , true ) ; }


get a resource given bundle name and key

public static synchronized < t > t get value ( string bundle name , string key , string suffix , t default value ) { t value ; try { resource bundle bundle = get bundle ( bundle name ) ; value = ( t ) bundle get object ( get lookup key ( key , suffix ) ) ; } catch ( exception e ) { return default value ; } return value ; }


public static < e > function < e , e > identity ( ) { return ( function < e , e > ) identity function instance ; }


loads the value from the variable with the given index

public value load ( int index ) { if ( index < 0 | | index > = size ) { throw new index out of bounds exception ( " variable index [ " + index + " ] out of bounds [ " + size + " ] " ) ; } return values [ index ] ; }


public synchronized void save ( ) throws i o exception { if ( bulk change contains ( this ) ) return ; get config file ( ) write ( this ) ; saveable listener fire on change ( this , get config file ( ) ) ; }


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


determine if the handler type referenced is volatile

public boolean is volatile ( ) { return is bit set ( volatile bit ) ; }


set to true if the request should be validated without creating new partitions

public create partitions options validate only ( boolean validate only ) { this validate only = validate only ; return this ; }


from a map of workers to assignment object generate the equivalent map of workers to byte buffers of serialized assignments

protected map < string , byte buffer > serialize assignments ( map < string , extended assignment > assignments ) { return assignments entry set ( ) stream ( ) collect ( collectors to map ( map entry : : get key , e - > incremental cooperative connect protocol serialize assignment ( e get value ( ) ) ) ) ; }


private boolean route verify ( route meta meta ) { string path = meta get path ( ) ; if ( string utils is empty ( path ) | | ! path starts with ( " / " ) ) { / / the path must be start with ' / ' and not empty ! return false ; } if ( string utils is empty ( meta get group ( ) ) ) { / / use default group ( the first word in path ) try { string default group = path substring ( 1 , path index of ( " / " , 1 ) ) ; if ( string utils is empty ( default group ) ) { return false ; } meta set group ( default group ) ; return true ; } catch ( exception e ) { logger error ( " failed to extract default group ! " + e get message ( ) ) ; return false ; } } return true ; }


attempt to create a fixed - length data - type instance factory and non - sizable dynamic data - types are not handled

public static data type instance get data type instance ( data type data type , int length ) { if ( data type = = null ) { return null ; } if ( data type instanceof factory data type ) { return null ; } boolean is function def = ( data type instanceof function definition ) ; if ( data type instanceof type def ) { is function def = ( ( ( type def ) data type ) get base data type ( ) instanceof function definition ) ; } if ( is function def ) { data type = new pointer data type ( data type , - 1 , data type get data type manager ( ) ) ; length = data type get length ( ) ; } else if ( data type instanceof dynamic ) { dynamic dynamic data type = ( dynamic ) data type ; if ( length < = 0 | | ! dynamic data type can specify length ( ) ) { return null ; } } else { length = data type get length ( ) ; } if ( length < 0 ) { return null ; } return new data type instance ( data type , length ) ; }


tells whether the last action can be undone

public boolean can undo ( ) { return hex edit control ! = null & & hex edit control can undo ( ) ; }


commit block ' s length and generation stamp as reported by the client set block state to { @ link block u c state # committed }

list < replica under construction > commit block ( block block ) throws i o exception { if ( get block id ( ) ! = block get block id ( ) ) { throw new i o exception ( " trying to commit inconsistent block : id = " + block get block id ( ) + " , expected id = " + get block id ( ) ) ; } preconditions check state ( ! is complete ( ) ) ; uc commit ( ) ; this set num bytes ( block get num bytes ( ) ) ; / / sort out invalid replicas return set generation stamp and verify replicas ( block get generation stamp ( ) ) ; }


get the name of this tree which is the same name as the view in the program

string get tree name ( ) { return tree get tree name ( ) ; }


gets the start y coordinates for the all pointers mutable array is exposed for performance reasons and is not to be modified by the callers

public float [ ] get start y ( ) { return m start y ; }


returns a rectangle that contains all vertices , in the layout space

public static < v , e > rectangle get bounds for vertices in layout space ( collection < v > vertices , function < v , rectangle > vertex to bounds ) { if ( vertices is empty ( ) ) { throw new illegal state exception ( " no vertices for which to find bounds ! " ) ; } double largest x = 0 ; double largest y = 0 ; double smallest x = integer max value ; double smallest y = integer max value ; for ( v v : vertices ) { rectangle bounds = vertex to bounds apply ( v ) ; int half width = bounds width > > 1 ; int half height = bounds height > > 1 ; double vertex x = bounds get x ( ) ; double vertex y = bounds get y ( ) ; double component min x = vertex x - half width ; double component min y = vertex y - half height ; double component max x = vertex x + half width ; double component max y = vertex y + half height ; smallest x = math min ( component min x , smallest x ) ; smallest y = math min ( component min y , smallest y ) ; largest x = math max ( component max x , largest x ) ; largest y = math max ( component max y , largest y ) ; } int width = ( int ) ( largest x - smallest x ) ; int height = ( int ) ( largest y - smallest y ) ; return new rectangle ( ( int ) smallest x , ( int ) smallest y , width , height ) ; }


private void flush ( flink kafka producer kafka transaction state transaction ) throws flink kafka exception { if ( transaction producer ! = null ) { transaction producer flush ( ) ; } long pending records count = pending records get ( ) ; if ( pending records count ! = 0 ) { throw new illegal state exception ( " pending record count must be zero at this point : " + pending records count ) ; } / / if the flushed requests has errors , we should propagate it also and fail the checkpoint check erroneous ( ) ; }


returns the string form of the arguments to the given instruction the instruction must be of this instance ' s format if the instruction has no arguments , then the result should be { @ code " " } , not { @ code null } subclasses must override this method

public abstract string insn arg string ( dalv insn insn ) ;


public string type name ( ) { return " nat " ; }


get the checksum of a file , if the fs supports checksums

public file checksum get file checksum ( path f ) throws i o exception { return get file checksum ( f , long max value ) ; }


expose the name of the current transaction , if any called by the transaction manager on transaction begin and on cleanup

public static void set current transaction name ( @ nullable string name ) { current transaction name set ( name ) ; }


return whether this proxy configuration is pre - filtered so that it only contains applicable advisors ( matching this proxy ' s target class )


public void add ( int i , int j , double s ) { data [ j * m + i ] + = s ; }


set optional boolean parameter for the builder

public b opt ( @ nonnull final string key , boolean value ) { mandatory keys remove ( key ) ; options set boolean ( key , value ) ; return get this builder ( ) ; }


this method updates the queue for a specific application , and it is reachable by using { @ link r m w s consts # apps appid queue }

response update app queue ( app queue target queue , http servlet request hsr , string app id ) throws authorization exception , yarn exception , interrupted exception , i o exception ;


set the maximum number of compositions to keep cached in memory this must be { @ literal > } 0

public void resize ( int size ) { cache resize ( size ) ; }


attempts to extract generic parameter type of given type if there is no generic parameter it returns object class

private static class < ? > extract generic ( type type ) { if ( type instanceof parameterized type ) { type [ ] generic types = ( ( parameterized type ) type ) get actual type arguments ( ) ; if ( generic types length > 0 & & generic types [ 0 ] instanceof class ) { return ( class < ? > ) generic types [ 0 ] ; } } return object class ; }


return a potentially adapted variant of this { @ link resource property source } , overriding the previously given name ( if any ) with the original resource name ( equivalent to the name generated by the name - less constructor variants )

public resource property source with resource name ( ) { if ( this resource name = = null ) { return this ; } return new resource property source ( this resource name , null , this source ) ; }


return the locale associated with the current thread , if any , or the system default locale otherwise this is effectively a replacement for { @ link java util locale # get default ( ) } , able to optionally respect a user - level locale setting note : this method has a fallback to the shared default locale , either at the framework level or at the jvm - wide system level if you ' d like to check for the raw locale context content ( which may indicate no specific locale through { @ code null } , use { @ link # get locale context ( ) } and call { @ link locale context # get locale ( ) }

public static locale get locale ( ) { return get locale ( get locale context ( ) ) ; }


sets the { @ link standard socket options # tcp nodelay } option please note that the default value of this option is { @ code true } unlike the operating system default ( { @ code false } ) however , for some buggy platforms , such as android , that shows erratic behavior with nagle ' s algorithm disabled , the default value remains to be { @ code false }

socket channel config set tcp no delay ( boolean tcp no delay ) ;


notes that an action has started , giving the key

void note action evaluation started ( action lookup data action lookup data , action action ) ;


add the specified program header type to the specified map

public static void add program header type ( elf program header type type , map < integer , elf program header type > program header type map ) throws duplicate name exception { elf program header type conflict type = program header type map get ( type value ) ; if ( conflict type ! = null ) { throw new duplicate name exception ( " elf program header type conflict during initialization ( " + type name + " / " + conflict type name + " ) , value = 0x " + integer to hex string ( type value ) ) ; } for ( elf program header type existing type : program header type map values ( ) ) { if ( type name equals ignore case ( existing type name ) ) { throw new duplicate name exception ( " elf program header type conflict during initialization , name = " + type name ) ; } } program header type map put ( type value , type ) ; }


like get longest phase spawn runner name ( ) , but returns the runner details

public string get longest phase spawn runner subtype ( ) { return longest phase spawn runner subtype ; }


public static boolean region matches ( final char sequence cs , final boolean ignore case , final int this start , final char sequence substring , final int start , final int length ) { if ( cs instanceof string & & substring instanceof string ) { return ( ( string ) cs ) region matches ( ignore case , this start , ( string ) substring , start , length ) ; } int index 1 = this start ; int index 2 = start ; int tmp len = length ; while ( tmp len - - > 0 ) { final char c 1 = cs char at ( index 1 + + ) ; final char c 2 = substring char at ( index 2 + + ) ; if ( c 1 = = c 2 ) { continue ; } if ( ! ignore case ) { return false ; } / / the same check as in string region matches ( ) : if ( character to upper case ( c 1 ) ! = character to upper case ( c 2 ) & & character to lower case ( c 1 ) ! = character to lower case ( c 2 ) ) { return false ; } } return true ; }


adds an efficient flag based on transitive values the flag will only be specified once , followed by the joined values specified by the converter , for example : - - flag value 1 , value 2 the values will only be collapsed and turned into a flag at execution time the values will not be added as inputs - use { @ link # add transitive input values ( nested set ) } for that

public < t > busy box action builder add transitive flag ( @ compile time constant string arg , nested set < ? extends t > transitive values , android data converter < t > converter ) { command line add all ( arg , converter get vector arg ( transitive values ) ) ; return this ; }


whether the layout params set on the view stub for the given model should be carried over to the model ' s view default is true set this to false if you want the layout params on the model ' s layout resource to be kept

protected boolean use view stub layout params ( epoxy model < ? > model , int model position ) { return true ; }


protected void run test ( string assembly , string instr , collection < string > disassembly , long addr , string ctxstr , boolean check one compat , boolean check all exact , boolean check all syntax errs , boolean check all semantic errs ) { / / a sanity check , first if ( instr ! = null ) { assembly pattern block ins = assembly pattern block from string ( instr ) ; if ( ! ins is full mask ( ) ) { throw new runtime exception ( " desired instruction bytes should be fully - defined " ) ; } final assembly pattern block ctx = ( ctxstr = = null ? context get default ( ) : assembly pattern block from string ( ctxstr ) ) fill mask ( ) ; try { string disstr ; pseudo instruction psins = disassemble ( addr , ins get vals ( ) , ctx get vals ( ) ) ; sleigh instruction prototype sip = ( sleigh instruction prototype ) psins get prototype ( ) ; msg debug ( this , " expected tree : " + sip dump constructor tree ( ) ) ; disstr = psins to string ( ) trim ( ) ; if ( ! disassembly contains ( disstr ) ) { throw new disassembly mismatch exception ( " desired instruction bytes do not disassemble to a desired string : " + disassembly + " ; found instead : " + disstr ) ; } } catch ( insufficient bytes exception | unknown instruction exception | address overflow exception | memory access exception e ) { throw new runtime exception ( " cannot disassemble desired instruction bytes " , e ) ; } } assembler assembler = assemblers get assembler ( lang , new assembly selector ( ) { @ override public collection < assembly parse result > filter parse ( collection < assembly parse result > parse ) throws assembly syntax exception { dbg print trees ( parse ) ; if ( check all syntax errs ) { check all syntax errs ( parse ) ; } return super filter parse ( parse ) ; } @ override public assembly resolved constructor select ( assembly resolution results rr , assembly pattern block ctx ) throws assembly semantic exception { if ( check one compat ) { check one compat ( instr , rr ) ; } if ( check all exact ) { check all exact ( rr , disassembly , addr , ctxstr ) ; } if ( check all semantic errs ) { check all semantic errs ( rr ) ; } return super select ( rr , ctx ) ; } } ) ; try { if ( ctxstr = = null ) { assembler assemble line ( lang get default space ( ) get address ( addr ) , assembly ) ; } else { sleigh assembler sas = ( sleigh assembler ) assembler ; sas assemble line ( lang get default space ( ) get address ( addr ) , assembly , assembly pattern block from string ( ctxstr ) ) ; } } catch ( assembly semantic exception e ) { if ( ! check all semantic errs ) { throw new assertion error ( " there was an unexpected semantic error : " + e ) ; } } catch ( assembly syntax exception e ) { if ( ! check all syntax errs ) { throw new assertion error ( " there was an unexpected syntax error : " + e ) ; } } }


public static void update rop statistics ( rop method non opt rmeth , rop method rmeth ) { int old count insns = non opt rmeth get blocks ( ) get effective instruction count ( ) ; int old count regs = non opt rmeth get blocks ( ) get reg count ( ) ; if ( debug ) { system err println ( " insns ( old / new ) : " + old count insns + " / " + rmeth get blocks ( ) get effective instruction count ( ) + " regs ( o / n ) : " + old count regs + " / " + rmeth get blocks ( ) get reg count ( ) ) ; } int new count insns = rmeth get blocks ( ) get effective instruction count ( ) ; running delta insns + = ( new count insns - old count insns ) ; running delta registers + = ( rmeth get blocks ( ) get reg count ( ) - old count regs ) ; running total insns + = new count insns ; }


generates a welcome message for the passed user

string get welcome message ( user user ) ;


exec the given command and assert it executed successfully

private static void exec ignore ret ( string cmd ) throws i o exception { log debug ( " exec " + cmd ) ; r exec ( cmd ) ; }


converts the given byte array to a binary string

public static string to binary str ( byte [ ] bs ) { string builder sb = new string builder ( ) ; for ( byte b : bs ) { string s 1 = string format ( " % 8s " , integer to binary string ( b & 0x f f ) ) replace ( ' ' , ' 0 ' ) ; sb append ( s 1 ) ; } return sb to string ( ) ; }


public array get array ( string column label ) throws s q l exception { return null ; }


public void set expected locations ( block block , datanode storage info [ ] targets , block type block type ) { if ( targets = = null ) { return ; } int num locations = 0 ; for ( datanode storage info target : targets ) { if ( target ! = null ) { num locations + + ; } } this replicas = new replica under construction [ num locations ] ; int offset = 0 ; for ( int i = 0 ; i < targets length ; i + + ) { if ( targets [ i ] ! = null ) { / / when creating a new striped block we simply sequentially assign block / / index to each storage block replica block = block type = = block type striped ? new block ( block get block id ( ) + i , 0 , block get generation stamp ( ) ) : block ; replicas [ offset + + ] = new replica under construction ( replica block , targets [ i ] , replica state rbw ) ; } } }


order by tenant id ( needs to be followed by { @ link # asc ( ) } or { @ link # desc ( ) } )

dead letter job query order by tenant id ( ) ;


prevent any side - effects due to this test modifying thread locals that might affect subsequent tests when all tests are run in the same jvm , as with eclipse

public void tear down ( ) { assert that ( transaction synchronization manager get resource map ( ) is empty ( ) ) is true ( ) ; assert that ( transaction synchronization manager is synchronization active ( ) ) is false ( ) ; assert that ( transaction synchronization manager get current transaction name ( ) ) is null ( ) ; assert that ( transaction synchronization manager is current transaction read only ( ) ) is false ( ) ; assert that ( transaction synchronization manager is actual transaction active ( ) ) is false ( ) ; }


gets the human readable name that identifies this tool among other { @ link tool installation } s of the same kind

public string get name ( ) { return name ; }


public rounding params get rounding params ( ) { return m rounding params ; }


sets the compression method for the entry

public void set method ( compression method ) { if ( method = = null ) { throw new null pointer exception ( ) ; } if ( this method ! = null ) { feature set remove ( this method get feature ( ) ) ; } this method = method ; feature set add ( this method get feature ( ) ) ; }


sets the font on this code completion window basically sets the font in the completion list

public void set font ( font font ) { jlist set font ( font ) ; }


creates a new function record in a specific library in this fid database

public function record create new function ( library record library , fid hash quad hash quad , string name , long entry point , string domain path , boolean has terminator ) { try { check update allowed ( ) ; function record function record = functions table create function record ( library get library i d ( ) , hash quad , name , entry point , domain path , has terminator ) ; return function record ; } catch ( read only exception e ) { msg error ( this , e ) ; } catch ( i o exception e ) { msg error ( this , " serious problem creating fid function record " , e ) ; } return null ; }


visits a { @ link fill array data insn }

public void visit fill array data insn ( fill array data insn insn ) ;


creates a { @ link span query builder } which allows having a sub query which implements { @ link multi term query builder } this is useful for having e g wildcard or fuzzy queries inside spans

public static span multi term query builder span multi term query builder ( multi term query builder multi term query builder ) { return new span multi term query builder ( multi term query builder ) ; }


the current state of the application cache


public just symbol enum get just symbol ( ) { return just symbol ; }


set the error reporters for this connector

public void reporters ( collection < error reporter > reporters ) { objects require non null ( reporters ) ; this reporters = reporters ; }


public void visit switch insn ( switch insn insn ) ;


configure custom deserializers for the given types

public void set deserializers by type ( map < class < ? > , json deserializer < ? > > deserializers ) { this builder deserializers by type ( deserializers ) ; }


convert the object to a string with no linebreaks < p > this to string method is relatively expensive , so avoid calling it unless debug logging is turned on

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


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

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


returns true if this value corresponds to a special file or symlink to a special file if so , its parent directory is guaranteed to exist

public boolean is special file ( ) { return real file state value ( ) get type ( ) = = file state type special file ; }


check if identity is allowed to drop the specified schema in a catalog

default void check can drop schema ( identity identity , access control context context , catalog schema name schema ) { deny drop schema ( schema to string ( ) ) ; }


if the display creation fails , this method will be called suggested usage is to modify the passed configuration to use a common width and height , and set fullscreen to false

public lwjgl application configuration on failure ( lwjgl application configuration initial config ) ;


return the request header of the given name , or { @ code null } if none retrieves the first header value in case of a multi - value header

string get header ( string header name ) ;


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

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


returns whether the constant ' s class index has been set for this instance

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


returns an iterator over the lines in the string if the string ends in a newline , a final empty string is not included , to match the behavior of buffered reader line reader read line ( )

private iterator < string > lines iterator ( ) { return new abstract iterator < string > ( ) { iterator < string > lines = line splitter split ( seq ) iterator ( ) ; @ override protected string compute next ( ) { if ( lines has next ( ) ) { string next = lines next ( ) ; / / skip last line if it ' s empty if ( lines has next ( ) | | ! next is empty ( ) ) { return next ; } } return end of data ( ) ; } } ; }


returns the value for the cumulative total number of statements that can be made in all loops in a script before an exception is thrown this attempts to prevent infinite loops note if the counter is set to 0 , no loop counter will be written

public int get max loop counter ( ) { return max loop counter ; }


returns a new builder the generated builder is equivalent to the builder created by the { @ link builder } constructor

public static < e > builder < e > builder ( ) { return new builder < e > ( ) ; }


see original { @ link stubber # do return ( object ) }

b d d stubber will return ( object to be returned ) ;


stores register value in map if < code > new value precedence < code > is true , then the given < code > new value < code > overrides the < code > current value < code >

private void set register value ( address from addr , address dest addr , register value new value , boolean new value precedence ) { if ( new value = = null ) { return ; } if ( is flow active ( ) & & current address equals ( dest addr ) ) { set register value ( new value ) ; return ; } register register = new value get register ( ) ; register base register = register get base register ( ) ; / / get the future flow state map for the given address map < register , register value > state map = find future flow state map ( from addr , dest addr ) ; / / merge the new value with any existing future value or a value from the program if the future / / value was not previously set register value value = state map get ( base register ) ; if ( value = = null ) { / / if there is no previously saved future value , always give precedence to the new value value = program context get non default value ( base register , dest addr ) ; new value precedence = true ; } value = combine register values ( value , new value , new value precedence ) ; state map put ( base register , value ) ; }


opens an f s data input stream at the indicated path

public f s data input stream open ( path f , int buffer size ) throws i o exception { file system fs ; input stream in ; if ( verify checksum ) { fs = this ; in = new checksum f s input checker ( this , f , buffer size ) ; } else { fs = get raw file system ( ) ; in = fs open ( f , buffer size ) ; } return new f s data bounded input stream ( fs , f , in ) ; }


public abstract security details validate peer object ( object peer object ) throws general security exception ;


stores the specified watch record any existing watch record will be overwritten

private void force put history ( watch record watch record ) { try { try ( x content builder builder = x content factory json builder ( ) ; thread context stored context ignore = client thread pool ( ) get thread context ( ) stash with origin ( watcher origin ) ) { watch record to x content ( builder , watcher params hide secrets ) ; index request request = new index request ( history store field data stream ) id ( watch record id ( ) value ( ) ) source ( builder ) op type ( index request op type create ) ; client index ( request ) get ( 30 , time unit seconds ) ; logger debug ( " indexed watch history record [ { } ] " , watch record id ( ) value ( ) ) ; } catch ( version conflict engine exception vcee ) { watch record = new watch record message watch record ( watch record , execution state executed multiple times , " watch record [ { " + watch record id ( ) + " } ] has been stored before , previous state [ " + watch record state ( ) + " ] " ) ; try ( x content builder x content builder = x content factory json builder ( ) ; thread context stored context ignore = client thread pool ( ) get thread context ( ) stash with origin ( watcher origin ) ) { index request request = new index request ( history store field data stream ) id ( watch record id ( ) value ( ) ) source ( x content builder value ( watch record ) ) ; client index ( request ) get ( 30 , time unit seconds ) ; } logger debug ( " overwrote watch history record [ { } ] " , watch record id ( ) value ( ) ) ; } } catch ( interrupted exception | execution exception | timeout exception | i o exception ioe ) { final watch record wr = watch record ; logger error ( ( supplier < ? > ) ( ) - > new parameterized message ( " failed to persist watch record [ { } ] " , wr ) , ioe ) ; } }


public void test client login override ( ) throws exception { security protocol security protocol = security protocol sasl plaintext ; test jaas config jaas config = configure mechanisms ( " plain " , collections singleton list ( " plain " ) ) ; jaas config set client options ( " plain " , " invaliduser " , " invalidpassword " ) ; server = create echo server ( security protocol ) ; / / connection should succeed using login override that sets correct username / password in subject sasl client configs put ( sasl configs sasl login class , test login class get name ( ) ) ; create and check client connection ( security protocol , " 1 " ) ; assert equals ( 1 , test login login count get ( ) ) ; / / connection should fail without login override since username / password in jaas config is invalid sasl client configs remove ( sasl configs sasl login class ) ; create and check client connection failure ( security protocol , " invalid " ) ; assert equals ( 1 , test login login count get ( ) ) ; }


get the flag which if set to true , { @ link skip bad records # counter reduce processed groups } is incremented by framework after invoking the reduce function this value must be set to false for applications which process the records asynchronously or buffer the input records for example streaming in such cases applications should increment this counter on their own default value is true

public static boolean get auto incr reducer proc count ( configuration conf ) { return conf get boolean ( auto incr reduce proc count , true ) ; }


verifies that the given rule throws a sensible error if the minimum os attribute has a bad value

protected void check minimum os invalid non version ( rule type rule type ) throws exception { check error ( " x " , " x " , string format ( multi arch split transition provider invalid version string error format , " foobar " ) , rule type target ( scratch , " x " , " x " , " minimum os version " , " ' foobar ' " ) ) ; }


public void test delete on exit ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; if ( simulated storage ) { simulated f s dataset set factory ( conf ) ; } mini d f s cluster cluster = new mini d f s cluster builder ( conf ) build ( ) ; file system fs = cluster get file system ( ) ; file system localfs = file system get local ( conf ) ; try { / / creates files in hdfs and local file system / / path file 1 = new path ( " filestatus dat " ) ; path file 2 = new path ( " filestatus 2 dat " ) ; path file 3 = new path ( " filestatus 3 dat " ) ; f s data output stream stm 1 = create file ( fs , file 1 , 1 ) ; f s data output stream stm 2 = create file ( fs , file 2 , 1 ) ; f s data output stream stm 3 = create file ( localfs , file 3 , 1 ) ; system out println ( " delete on exit : created files " ) ; / / write to files and close purposely , do not close file 2 write file ( stm 1 ) ; write file ( stm 3 ) ; stm 1 close ( ) ; stm 2 close ( ) ; stm 3 close ( ) ; / / set delete on exit flag on files fs delete on exit ( file 1 ) ; fs delete on exit ( file 2 ) ; localfs delete on exit ( file 3 ) ; / / close the file system this should make the above files / / disappear fs close ( ) ; localfs close ( ) ; fs = null ; localfs = null ; / / reopen file system and verify that file does not exist fs = cluster get file system ( ) ; localfs = file system get local ( conf ) ; assert true ( file 1 + " still exists inspite of delet on exit set " , ! fs exists ( file 1 ) ) ; assert true ( file 2 + " still exists inspite of delet on exit set " , ! fs exists ( file 2 ) ) ; assert true ( file 3 + " still exists inspite of delet on exit set " , ! localfs exists ( file 3 ) ) ; system out println ( " delete on exit successful " ) ; } finally { i o utils close stream ( fs ) ; i o utils close stream ( localfs ) ; cluster shutdown ( ) ; } }


handle conflicts on a category that was deleted in one program , and renamed or moved in another program

private void category deleted ( long id ) throws cancelled exception { category my cat = dtms [ my ] get category ( id ) ; category latest cat = dtms [ latest ] get category ( id ) ; category orig cat = dtms [ original ] get category ( id ) ; if ( conflict option = = canceled ) { throw new cancelled exception ( ) ; } int option to use = ( category choice = = ask user ) ? conflict option : category choice ; switch ( option to use ) { case option latest : if ( latest cat ! = null ) { / / make sure path still exists if ( ! dtms [ result ] contains category ( latest cat get category path ( ) ) ) { dtms [ result ] create category ( latest cat get category path ( ) ) ; } } break ; case option my : if ( my cat = = null ) { delete latest category ( latest cat ) ; } else { / / choose my category dtms [ result ] create category ( my cat get category path ( ) ) ; } break ; case option original : / / put category back category parent cat = dtms [ result ] get category ( orig cat get parent ( ) get category path ( ) ) ; if ( latest cat ! = null ) { if ( category was moved ( id , dtms [ result ] ) ) { category result cat = dtms [ result ] get category ( id ) ; move category ( parent cat , result cat ) ; } else { category result cat = dtms [ result ] get category ( id ) ; if ( result cat ! = null ) { set category name ( result cat , orig cat get name ( ) ) ; } else { dtms [ result ] create category ( orig cat get category path ( ) ) ; } } } else { dtms [ result ] create category ( orig cat get category path ( ) ) ; } break ; case canceled : throw new cancelled exception ( ) ; } }


public consume power power buffered ( float power capacity ) { return add ( new consume power ( 0f , power capacity , true ) ) ; }


returns the upper value ( inclusive ) of the leading source

comparable get upper value lead source ( ) throws i o exception { return size ( ) > = max size ? arrays [ 0 ] to comparable ( top ( ) ) : null ; }


notify all matching listeners registered with this application of an event if the specified { @ code event } is not an { @ link application event } , it is wrapped in a { @ link payload application event } such an event publication step is effectively a hand - off to the multicaster and does not imply synchronousasynchronous execution or even immediate execution at all event listeners are encouraged to be as efficient as possible , individually using asynchronous execution for longer - running and potentially blocking operations


order by retries ( needs to be followed by { @ link # asc ( ) } or { @ link # desc ( ) } )

dead letter job query order by job retries ( ) ;


a raw - style query where you can pass any where clause and arguments

public list < tree entity > query deep ( string where , string selection arg ) { cursor cursor = db raw query ( get select deep ( ) + where , selection arg ) ; return load deep all and close cursor ( cursor ) ; }


public v t match info create random match ( v t session session ) { return create random match ( addr ( ) , addr ( ) , session ) ; }


returns the url of the server that hosts the update - center json file

public string get update center url ( ) { return update center url ; }


same contract as for http servlet ' s { @ code get last modified } method can simply return - 1 if there ' s no support in the handler class

long get last modified ( http servlet request request , object handler ) ;


public void test dog all of ( ) { / / todo : test dog all of }


public static void init web root context ( ) { / / support the web context with ali - yun if the app deploy by edas final string web context = system get property ( system property key const naming web context ) ; template utils string not empty and then execute ( web context , new runnable ( ) { @ override public void run ( ) { util and coms web context = context path util normalize context path ( web context ) ; util and coms nacos url base = util and coms web context + " / v 1 / ns " ; util and coms nacos url instance = util and coms nacos url base + " / instance " ; } } ) ; }


because of timing of state being restored on projects being opened and created by the project manager , we initialize our workspace state manually whenever a project is opened this should only be called by set active project ( ) !

private void init project state ( project project ) { / / set this value so the workspace added ( ) routine doesn ' t set selected item / / in the workspace chooser value is adjusting = true ; tool manager tm = project get tool manager ( ) ; workspace [ ] workspaces = tm get workspaces ( ) ; for ( workspace workspace : workspaces ) { workspace added ( workspace ) ; } value is adjusting = false ; workspace set active ( tm get active workspace ( ) ) ; }


test that the minimum string length parameter works - - strings shorter than the minimum string length should not be created

public void test min string length ( ) throws exception { program test program = build program ( " libopencoreplayer so " , false ) ; listing listing = test program get listing ( ) ; address space space = test program get language ( ) get address factory ( ) get default address space ( ) ; / / test strings string [ ] existing strings = new string [ ] { " drm / duration " , " p v f m video m i o " , " set to invalid mode ( % d ) " , " device " , " height " , " player quit " , " video / decoder " } ; int [ ] offsets = new int [ ] { 0xa 7 1 9 8 1 2 0 , 0xa 7 1 9 5fd 4 , 0xa 7 1 9 6ee 8 , 0xa 7 1 7fa 4 8 , 0xa 7 1 9 5 6a 0 , 0xa 7 1 9 7 3 0 4 , 0xa 7 1 8 0 2 5c } ; / / sort strings by length tree map < integer , list < string > > strings by size = new tree map < > ( ) ; hash map < string , address > string to addr = new hash map < > ( ) ; int str len ; for ( int i = 0 ; i < existing strings length ; i + + ) { string to addr put ( existing strings [ i ] , addr ( space , offsets [ i ] ) ) ; str len = existing strings [ i ] length ( ) ; if ( ! strings by size contains key ( str len ) ) { list < string > temp arr = new array list < > ( ) ; temp arr add ( existing strings [ i ] ) ; strings by size put ( str len , temp arr ) ; } else { strings by size get ( str len ) add ( existing strings [ i ] ) ; } } data data here ; / / verify none of these strings exist prior to running the strings analyzer for ( string candidate str : string to addr key set ( ) ) { data here = listing get defined data at ( string to addr get ( candidate str ) ) ; assert null ( data here ) ; } auto analysis manager manager = auto analysis manager get analysis manager ( test program ) ; / / run strings analyzer for each string length strings analyzer analyzer = new strings analyzer ( ) ; list < integer > str sizes = new array list < > ( strings by size key set ( ) ) ; string string here ; / / first verify that setting min string size to one greater than largest string / / will result in none of the test strings being made analyzer set min string length ( str sizes get ( str sizes size ( ) - 1 ) + 1 ) ; analyzer set string end alignment ( 1 ) ; analyzer added ( test program , null , monitor , manager get message log ( ) ) ; for ( string candidate str : string to addr key set ( ) ) { data here = listing get defined data at ( string to addr get ( candidate str ) ) ; assert null ( " did not expect to find ' " + candidate str + " ' when min string length is set to " + str sizes get ( str sizes size ( ) - 1 ) + 1 , data here ) ; } / / now decrease min string size to equivalent to each of test string sizes , run analyzer , / / and verify that expected strings are / aren ' t created for ( int j = str sizes size ( ) - 1 ; j > = 0 ; j - - ) { int min str len = str sizes get ( j ) ; / / run analyzer with min string size equal to size of current set of strings analyzer set min string length ( str sizes get ( j ) ) ; analyzer added ( test program , null , monitor , manager get message log ( ) ) ; / / verify that strings below this size do not exist for ( int k = 0 ; k < j ; k + + ) { for ( string this string : strings by size get ( str sizes get ( k ) ) ) { data here = listing get defined data at ( string to addr get ( this string ) ) ; assert null ( " did not expect to find : ' " + this string + " ' when min str length is set to " + min str len , data here ) ; } } / / verify that strings this size and higher do exist for ( int k = j ; k < str sizes size ( ) ; k + + ) { for ( string this string : strings by size get ( str sizes get ( k ) ) ) { / / verify string is actually there data here = listing get defined data at ( string to addr get ( this string ) ) ; assert not null ( " expected to find : ' " + this string + " ' when min string length is set to " + min str len , data here ) ; string here = data here get default value representation ( ) ; assert equals ( " \ " " + this string + " \ " " , string here ) ; } } } }


public long get seqno ( ) { return proto get seqno ( ) ; }


predicate to test if the index name represents the name of a remote index

public static boolean is remote index ( final string index ) { return index index of ( remote cluster aware remote cluster index separator ) ! = - 1 ; }


create action for generating an empty def file without any exports , should only be used when targeting windows

private static artifact create empty def file action ( rule context rule context ) { artifact trivial def file = rule context get bin artifact ( rule context get label ( ) get name ( ) + " gen empty " + iterables get only element ( cpp file types windows def file get extensions ( ) ) ) ; rule context register action ( file write action create ( rule context , trivial def file , " " , false ) ) ; return trivial def file ; }


tests the url of the given event if the url is invalid , a new event may be created if a new , valid url can be created creates a new event with a patched url if the given event ' s url is invalid

private hyperlink event validate u r l ( hyperlink event event ) { url url = event get u r l ( ) ; try { url open stream ( ) ; / / assume that this will fail if the file does not exist } catch ( i o exception ioe ) { / / assume this means that the url is invalid msg trace ( this , " url of link is invalid : " + url to external form ( ) ) ; return maybe create new hyperlink event with updated u r l ( event ) ; } return event ; / / url is fine }


take a snapshot this completely overwrites the map data with the statistics from the source

public synchronized void snapshot ( i o statistics source ) { check not null ( source ) ; counters = snapshot map ( source counters ( ) ) ; gauges = snapshot map ( source gauges ( ) ) ; minimums = snapshot map ( source minimums ( ) ) ; maximums = snapshot map ( source maximums ( ) ) ; mean statistics = snapshot map ( source mean statistics ( ) , mean statistic : : copy ) ; }


invoked once immediately after construction

public void prepare ( map storm conf , configuration login conf ) { this login conf = login conf ; }


return the application ' s signature for sha256 value

public static list < string > get app signatures s h a 2 5 6 ( ) { return get app signatures s h a 2 5 6 ( utils get app ( ) get package name ( ) ) ; }


register a listener that waits until the ssl context factory has started once it has started we can grab the fully initialized context so we can log the parameters

protected abstract life cycle abstract life cycle listener log ssl info on start ( final ssl context factory ssl context factory ) { return new abstract life cycle abstract life cycle listener ( ) { @ override public void life cycle started ( life cycle event ) { log supported parameters ( ssl context factory ) ; } } ; }


sets the current { @ link com bumptech glide request manager }

public void set request manager ( @ nullable request manager request manager ) { this request manager = request manager ; }


get the unique set of declared methods on the leaf class and all superclasses leaf class methods are included first and while traversing the superclass hierarchy any methods found with signatures matching a method already included are filtered out

public static method [ ] get unique declared methods ( class < ? > leaf class ) { return get unique declared methods ( leaf class , null ) ; }


public void pet id test ( ) { / / todo : test pet id }


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


returns the exact bytes length of utf8 character sequence this method is producing the exact length according to { @ link # write utf 8 ( byte buf , char sequence ) }

public static int utf 8 bytes ( final char sequence seq ) { return utf 8 byte count ( seq , 0 , seq length ( ) ) ; }


for use with debug statements ; verifies bytes length on creation , expecting it to represent exactly one crc , and returns a hex formatted value

public static string to single crc string ( final byte [ ] bytes ) throws i o exception { if ( bytes length ! = 4 ) { throw new i o exception ( ( string format ( " unexpected byte [ ] length ' % d ' for single crc contents : % s " , bytes length , arrays to string ( bytes ) ) ) ) ; } return string format ( " 0x % 0 8x " , read int ( bytes , 0 ) ) ; }


whether the animation would be finished if played without looping ( play mode # normal ) , given the state time

public boolean is animation finished ( float state time ) { int frame number = ( int ) ( state time / frame duration ) ; return key frames length - 1 < frame number ; }


enables or disables animating the alpha of the { @ link drawable } the cross fade will animate from defaults to { @ code false }

public builder set cross fade enabled ( boolean is cross fade enabled ) { this is cross fade enabled = is cross fade enabled ; return this ; }


get the disabled rendering of the given icon

public static image icon get disabled icon ( icon icon ) { return new disabled image icon wrapper ( get image icon ( icon ) ) ; }


test serialization and deserialization of the test aggregator factory

public void test serialization ( ) throws i o exception { af test agg = create test aggregator factory ( ) ; try ( bytes stream output output = new bytes stream output ( ) ) { output write named writeable ( test agg ) ; try ( stream input in = new named writeable aware stream input ( output bytes ( ) stream input ( ) , named writeable registry ) ) { pipeline aggregation builder deserialized query = in read named writeable ( pipeline aggregation builder class ) ; assert equals ( deserialized query , test agg ) ; assert equals ( deserialized query hash code ( ) , test agg hash code ( ) ) ; assert not same ( deserialized query , test agg ) ; } } }


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


the list of array elements < code > repeated aapt pb array element element = 1 ; < code >

private void remove element ( int index ) { ensure element is mutable ( ) ; element remove ( index ) ; }


returns the preferred locations for the slot

public collection < task manager location > get preferred locations ( ) { return preferred locations ; }


test serialization of outer boolean types

public void fake outer boolean serialize ( boolean body , handler < async result < boolean > > result handler ) { delegate fake outer boolean serialize ( body , result handler ) ; }


writes a list of { @ link writeable } objects

public void write list ( list < ? extends writeable > list ) throws i o exception { write collection ( list ) ; }


sends a large unary rpc with compute engine credentials

public void compute engine creds ( string service account , string oauth scope ) throws exception { compute engine credentials credentials = compute engine credentials create ( ) ; test service grpc test service blocking stub stub = blocking stub with call credentials ( more call credentials from ( credentials ) ) ; final simple request request = simple request new builder ( ) set fill username ( true ) set fill oauth scope ( true ) set response size ( 314159 ) set payload ( payload new builder ( ) set body ( byte string copy from ( new byte [ 271828 ] ) ) ) build ( ) ; final simple response response = stub unary call ( request ) ; assert equals ( service account , response get username ( ) ) ; assert false ( response get oauth scope ( ) is empty ( ) ) ; assert true ( " received oauth scope : " + response get oauth scope ( ) , oauth scope contains ( response get oauth scope ( ) ) ) ; final simple response golden response = simple response new builder ( ) set oauth scope ( response get oauth scope ( ) ) set username ( response get username ( ) ) set payload ( payload new builder ( ) set body ( byte string copy from ( new byte [ 314159 ] ) ) ) build ( ) ; assert response ( golden response , response ) ; }


get the { @ link hystrix circuit breaker } instance for a given { @ link hystrix command key } this is thread - safe and ensures only 1 { @ link hystrix circuit breaker } per { @ link hystrix command key }

public static hystrix circuit breaker get instance ( hystrix command key key , hystrix command group key group , hystrix command properties properties , hystrix command metrics metrics ) { / / this should find it for all but the first time hystrix circuit breaker previously cached = circuit breakers by command get ( key name ( ) ) ; if ( previously cached ! = null ) { return previously cached ; } / / if we get here this is the first time so we need to initialize / / create and add to the map use put if absent to atomically handle the possible race - condition of / / 2 threads hitting this point at the same time and let concurrent hash map provide us our thread - safety / / if 2 threads hit here only one will get added and the other will get a non - null response instead hystrix circuit breaker cb for command = circuit breakers by command put if absent ( key name ( ) , new hystrix circuit breaker impl ( key , group , properties , metrics ) ) ; if ( cb for command = = null ) { / / this means the put if absent step just created a new one so let ' s retrieve and return it return circuit breakers by command get ( key name ( ) ) ; } else { / / this means a race occurred and while attempting to ' put ' another one got there before / / and we instead retrieved it and will now return it return cb for command ; } }


an open job that later gets added to a calendar , should take the scheduled events into account

public void test add opened job to group with calendar ( ) throws exception { time value bucket span = time value time value minutes ( 30 ) ; string group name = " opened - calendar - job - group " ; job builder job = create job ( " scheduled - events - add - opened - job - to - group - with - calendar " , bucket span ) ; long start time = 1514764800000l ; final int bucket count = 5 ; / / open the job open job ( job get id ( ) ) ; / / write some buckets of data post data ( job get id ( ) , generate data ( start time , bucket span , bucket count , bucket index - > random int between ( 100 , 200 ) ) stream ( ) collect ( collectors joining ( ) ) ) ; string calendar id = " test - calendar - open - job - update " ; / / create a new calendar referencing group name put calendar ( calendar id , collections singleton list ( group name ) , " test add opened job to group with calendar calendar " ) ; / / put events in the calendar list < scheduled event > events = new array list < > ( ) ; long event start time = start time + ( bucket count + 1 ) * bucket span millis ( ) ; long event end time = event start time + ( long ) ( 1 5 * bucket span millis ( ) ) ; events add ( new scheduled event builder ( ) description ( " some event " ) start time ( ( instant of epoch milli ( event start time ) ) ) end time ( ( instant of epoch milli ( event end time ) ) ) calendar id ( calendar id ) build ( ) ) ; post scheduled events ( calendar id , events ) ; / / update the job to be a member of the group update job action request job update request = new update job action request ( job get id ( ) , new job update builder ( job get id ( ) ) set groups ( collections singleton list ( group name ) ) build ( ) ) ; client ( ) execute ( update job action instance , job update request ) action get ( ) ; / / wait until the notification that the job was updated is indexed assert busy ( ( ) - > { search response search response = client ( ) prepare search ( notifications index notifications index ) set size ( 1 ) add sort ( " timestamp " , sort order desc ) set query ( query builders bool query ( ) filter ( query builders term query ( " job id " , job get id ( ) ) ) filter ( query builders term query ( " level " , " info " ) ) ) get ( ) ; search hit [ ] hits = search response get hits ( ) get hits ( ) ; assert that ( hits length , equal to ( 1 ) ) ; assert that ( hits [ 0 ] get source as map ( ) get ( " message " ) , equal to ( " job updated : [ groups ] " ) ) ; } ) ; / / write some more buckets of data that cover the scheduled event period post data ( job get id ( ) , generate data ( start time + bucket count * bucket span millis ( ) , bucket span , 5 , bucket index - > random int between ( 100 , 200 ) ) stream ( ) collect ( collectors joining ( ) ) ) ; / / and close close job ( job get id ( ) ) ; get buckets action request get buckets request = new get buckets action request ( job get id ( ) ) ; list < bucket > buckets = get buckets ( get buckets request ) ; / / the first 6 buckets have no events for ( int i = 0 ; i < = bucket count ; i + + ) { assert equals ( 0 , buckets get ( i ) get scheduled events ( ) size ( ) ) ; } / / 7th and 8th buckets have the event but the last one does not assert equals ( 1 , buckets get ( 6 ) get scheduled events ( ) size ( ) ) ; assert equals ( " some event " , buckets get ( 6 ) get scheduled events ( ) get ( 0 ) ) ; assert equals ( 1 , buckets get ( 7 ) get scheduled events ( ) size ( ) ) ; assert equals ( " some event " , buckets get ( 7 ) get scheduled events ( ) get ( 0 ) ) ; assert equals ( 0 , buckets get ( 8 ) get scheduled events ( ) size ( ) ) ; }


public void test dynamic owner fails ( ) { test hystrix command < boolean > command = new dynamic owner test command ( null ) ; assert equals ( true , command execute ( ) ) ; }


get the column types of the specified side - output table

public type information < ? > [ ] get side output col types ( int index ) { check side output accessibility ( index ) ; return side outputs [ index ] get schema ( ) get field types ( ) ; }


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


public static void set status bar custom ( @ non null final view fake status bar ) { if ( build version sdk int < build version codes kitkat ) return ; activity activity = utils bridge get activity by context ( fake status bar get context ( ) ) ; if ( activity = = null ) return ; transparent status bar ( activity ) ; fake status bar set visibility ( view visible ) ; view group layout params layout params = fake status bar get layout params ( ) ; if ( layout params = = null ) { layout params = new view group layout params ( view group layout params match parent , get status bar height ( ) ) ; fake status bar set layout params ( layout params ) ; } else { layout params width = view group layout params match parent ; layout params height = get status bar height ( ) ; } }


tr td ( string selector , string cdata ) ;


returns the format of the worker protocol

public worker protocol format get protocol format ( ) { return protocol format ; }


appends the string representation of each entry in { @ code entries } , using the previously configured separator and key - value separator , to { @ code appendable }

public < a extends appendable > a append to ( a appendable , iterator < ? extends entry < ? , ? > > parts ) throws i o exception { check not null ( appendable ) ; if ( parts has next ( ) ) { entry < ? , ? > entry = parts next ( ) ; appendable append ( joiner to string ( entry get key ( ) ) ) ; appendable append ( key value separator ) ; appendable append ( joiner to string ( entry get value ( ) ) ) ; while ( parts has next ( ) ) { appendable append ( joiner separator ) ; entry < ? , ? > e = parts next ( ) ; appendable append ( joiner to string ( e get key ( ) ) ) ; appendable append ( key value separator ) ; appendable append ( joiner to string ( e get value ( ) ) ) ; } } return appendable ; }


return the { @ code type } that this instance is using to filter candidates

public final class < ? > get target type ( ) { return this target type ; }


take an i o exception and a uri , wrap it where possible with something that includes the uri

public static i o exception wrap exception ( final string dest , final string operation , final i o exception exception ) { string action = operation + " " + dest ; string xref = null ; if ( exception instanceof connect exception ) { xref = " connection refused " ; } else if ( exception instanceof unknown host exception ) { xref = " unknown host " ; } else if ( exception instanceof socket timeout exception ) { xref = " socket timeout " ; } else if ( exception instanceof no route to host exception ) { xref = " no route to host " ; } string msg = action + " failed on exception : " + exception ; if ( xref ! = null ) { msg = msg + " ; " + see ( xref ) ; } return wrap with message ( exception , msg ) ; }


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


put a value in the j s o n array , where the value will be a j s o n array which is produced from a collection

public j s o n array put ( int index , collection value ) throws j s o n exception { put ( index , new j s o n array ( value ) ) ; return this ; }


returns the current data type name ( structure or union ) as a string

protected string get type name ( ) { return " composite data type " ; }


returns a converter for point values if it ' s safe to use the indexed data instead of doc values generally , this means that the query has no filters or scripts , the aggregation is top level , and the underlying field is indexed , and the index is sorted in the right order if those conditions aren ' t met , return < code > null < code > to indicate a point reader cannot be used in this case

public final function < byte [ ] , number > point reader if available ( values source config config ) { if ( top level query ( ) ! = null & & top level query ( ) get class ( ) ! = match all docs query class ) { return null ; } if ( parent ! = null ) { return null ; } return config get point reader or null ( ) ; }


reads a repository location on disk and extracts the list of blobs for each shards

private map < string , blob store index shard snapshot > blobs in snapshot ( path repository location , string snapshot id ) throws i o exception { final map < string , blob store index shard snapshot > blobs per shard = new hash map < > ( ) ; for each file recursively ( repository location resolve ( " indices " ) , ( ( file , basic file attributes ) - > { final string file name = file get file name ( ) to string ( ) ; if ( file name equals ( blob store repository snapshot format blob name ( snapshot id ) ) ) { blobs per shard put ( string join ( " / " , snapshot id , file get parent ( ) get parent ( ) get file name ( ) to string ( ) , file get parent ( ) get file name ( ) to string ( ) ) , index shard snapshot format deserialize ( file name , x content registry ( ) , streams read fully ( files new input stream ( file ) ) ) ) ; } } ) ) ; return map copy of ( blobs per shard ) ; }


specifies a channel option as the underlying channel as well as network implementation may ignore this value applications should consider it a hint

public < t > netty channel builder with option ( channel option < t > option , t value ) { channel options put ( option , value ) ; return this ; }


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


public void remove ( ) { throw new unsupported operation exception ( " remove not supported " ) ; }


public void append msg ( string message ) { add ( message ) ; }


mark this request as completed , keeping its state

public void close ( ) { this active = false ; }


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


this test validates the correctness of { @ link r m web service protocol # create new reservation ( ) } inside router

public void test new reservation x m l ( ) throws exception { / / test with a wrong http method client response bad response = perform call ( rm web service path + reservation new , null , null , null , put ) ; assert equals ( sc internal server error , bad response get status ( ) ) ; / / test with the correct http method client response response = perform call ( rm web service path + reservation new , null , null , null , post ) ; assert equals ( sc ok , response get status ( ) ) ; new reservation ci = response get entity ( new reservation class ) ; assert not null ( ci ) ; }


public float get shard balance ( ) { return weight function shard balance ; }


set the periodicity of this reservation representing the time period of the periodic job period is represented in milliseconds for periodic jobs period is 0 for non - periodic jobs