detect a solid side which has minimum transition

private result point [ ] detect solid 1 ( result point [ ] corner points ) { / / 0 2 / / 1 3 result point point a = corner points [ 0 ] ; result point point b = corner points [ 1 ] ; result point point c = corner points [ 3 ] ; result point point d = corner points [ 2 ] ; int tr a b = transitions between ( point a , point b ) ; int tr b c = transitions between ( point b , point c ) ; int tr c d = transitions between ( point c , point d ) ; int tr d a = transitions between ( point d , point a ) ; / / 0 3 / / : : / / 1 - - 2 int min = tr a b ; result point [ ] points = { point d , point a , point b , point c } ; if ( min > tr b c ) { min = tr b c ; points [ 0 ] = point a ; points [ 1 ] = point b ; points [ 2 ] = point c ; points [ 3 ] = point d ; } if ( min > tr c d ) { min = tr c d ; points [ 0 ] = point b ; points [ 1 ] = point c ; points [ 2 ] = point d ; points [ 3 ] = point a ; } if ( min > tr d a ) { points [ 0 ] = point c ; points [ 1 ] = point d ; points [ 2 ] = point a ; points [ 3 ] = point b ; } return points ; }


public void reset ( ) throws i o exception { throw new i o exception ( " reset not implemented " ) ; }


execute a void operation with the default retry callback invoked when do retry = true , else just once

public void maybe retry ( boolean do retry , string action , string path , boolean idempotent , void operation operation ) throws i o exception { maybe retry ( do retry , action , path , idempotent , retry callback , operation ) ; }


gets the average xceiver count with respect to the storage types

private double get in service xceiver average by storage type ( set < storage type > storage types ) { double avg load = 0 ; final map < storage type , storage type stats > storage stats = stats get storage type stats ( ) ; int num nodes = 0 ; int num xceiver = 0 ; for ( storage type s : storage types ) { storage type stats storage type stats = storage stats get ( s ) ; num nodes + = storage type stats get nodes in service ( ) ; num xceiver + = storage type stats get nodes in service xceiver count ( ) ; } if ( num nodes ! = 0 ) { avg load = ( double ) num xceiver / num nodes ; } return avg load ; }


expect that touch ( ) will fail because the parent is a file

protected void expect create under file fails ( string action , path file , path descendant ) throws exception { create file ( file ) ; try { / / create the child create file ( descendant ) ; } catch ( file already exists exception | parent not directory exception ex ) { / / expected handle expected exception ( ex ) ; } catch ( i o exception e ) { handle relaxed exception ( action , " parent not directory exception " , e ) ; } }


returns the first { @ link channel handler } in this pipeline


this is called when a horizontal scan finds a possible alignment pattern it will cross check with a vertical scan , and if successful , will , ah , cross - cross - check with another horizontal scan this is needed primarily to locate the real horizontal center of the pattern in cases of extreme skew and then we cross - cross - cross check with another diagonal scan if that succeeds the finder pattern location is added to a list that tracks the number of times each location has been nearly - matched as a finder pattern each additional find is more evidence that the location is in fact a finder pattern center

protected final boolean handle possible center ( int [ ] state count , int i , int j ) { int state count total = state count [ 0 ] + state count [ 1 ] + state count [ 2 ] + state count [ 3 ] + state count [ 4 ] ; float center j = center from end ( state count , j ) ; float center i = cross check vertical ( i , ( int ) center j , state count [ 2 ] , state count total ) ; if ( ! float is na n ( center i ) ) { / / re - cross check center j = cross check horizontal ( ( int ) center j , ( int ) center i , state count [ 2 ] , state count total ) ; if ( ! float is na n ( center j ) & & cross check diagonal ( ( int ) center i , ( int ) center j ) ) { float estimated module size = state count total / 7 0f ; boolean found = false ; for ( int index = 0 ; index < possible centers size ( ) ; index + + ) { finder pattern center = possible centers get ( index ) ; / / look for about the same center and module size : if ( center about equals ( estimated module size , center i , center j ) ) { possible centers set ( index , center combine estimate ( center i , center j , estimated module size ) ) ; found = true ; break ; } } if ( ! found ) { finder pattern point = new finder pattern ( center j , center i , estimated module size ) ; possible centers add ( point ) ; if ( result point callback ! = null ) { result point callback found possible result point ( point ) ; } } return true ; } } return false ; }


whether the given object type is supported by this reader

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


id for a peer recovery retention lease for the given node see { @ link replication tracker # add peer recovery retention lease }

public static string get peer recovery retention lease id ( string node id ) { return " peer recovery / " + node id ; }


run an immediate block report on this thread used by tests

void trigger block report for tests ( ) throws i o exception { for ( b p service actor actor : bp services ) { actor trigger block report for tests ( ) ; } }


returns a string of the form { @ code " foo star : 1 : 2 : oops " }

public string to string ( ) { return location + " : " + message ; }


number of lines read , when printing to the console

public long get lines read ( ) { return lines read ; }


called when the native type is an { @ link int }

t for int ( function < int consumer , grok capture extracter > build extracter ) ;


fake endpoint to test group parameters ( optional ) fake endpoint to test group parameters ( optional )

public completable future < void > test group parameters ( a p itest group parameters request api request ) throws api exception { integer required string group = api request required string group ( ) ; boolean required boolean group = api request required boolean group ( ) ; long required int 6 4 group = api request required int 6 4 group ( ) ; integer string group = api request string group ( ) ; boolean boolean group = api request boolean group ( ) ; long int 6 4 group = api request int 6 4 group ( ) ; return test group parameters ( required string group , required boolean group , required int 6 4 group , string group , boolean group , int 6 4 group ) ; }


public string section name ranges ( ) { return prefix + " debug ranges " ; }


todo ( # 8118 ) : this test can go away once flag is flipped

public void test incompatible depset for libraries to link getter ( ) throws exception { analysis mock get ( ) cc support ( ) setup cc toolchain config ( mock tools config , cc toolchain config builder ( ) with features ( cpp rule classes pic , cpp rule classes supports pic , cpp rule classes supports dynamic linker ) ) ; this set build language options ( " - - incompatible depset for libraries to link getter " ) ; set up cc linking context test ( false ) ; configured target a = get configured target ( " / / a : a " ) ; struct impl info = ( ( struct impl ) get my info from target ( a ) get value ( " info " ) ) ; depset libraries to link = info get value ( " libraries to link " , depset class ) ; assert that ( libraries to link to list ( library to link class ) stream ( ) filter ( x - > x get static library ( ) ! = null ) map ( x - > x get static library ( ) get filename ( ) ) collect ( immutable list to immutable list ( ) ) ) contains exactly ( " a a " , " b a " , " c a " , " d a " ) ; assert that ( libraries to link to list ( library to link class ) stream ( ) filter ( x - > x get pic static library ( ) ! = null ) map ( x - > x get pic static library ( ) get filename ( ) ) collect ( immutable list to immutable list ( ) ) ) contains exactly ( " a pic a " , " libdep 2 a " , " b pic a " , " c pic a " , " e pic a " , " libdep 1 a " ) ; assert that ( libraries to link to list ( library to link class ) stream ( ) filter ( x - > x get dynamic library ( ) ! = null ) map ( x - > x get dynamic library ( ) get filename ( ) ) collect ( immutable list to immutable list ( ) ) ) contains exactly ( " a so " , " liba slibdep 2 so " , " b so " , " e so " , " liba slibdep 1 so " ) ; }


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


public model api response upload file with required file ( long pet id , file required file , string additional metadata ) throws api exception { return upload file with required file with http info ( pet id , required file , additional metadata ) get data ( ) ; }


updates this range set by the intersection of this range and the given range

public synchronized boolean retain all ( range set that ) { list < range > intersection = new array list < > ( ) ; int lhs = 0 , rhs = 0 ; while ( lhs < this ranges size ( ) & & rhs < that ranges size ( ) ) { range lr = this ranges get ( lhs ) ; range rr = that ranges get ( rhs ) ; if ( lr end < = rr start ) { / / lr has no overlap with that ranges lhs + + ; continue ; } if ( rr end < = lr start ) { / / rr has no overlap with this ranges rhs + + ; continue ; } / / overlap figure out the intersection range v = lr intersect ( rr ) ; intersection add ( v ) ; / / move on to the next pair if ( lr end < rr end ) { lhs + + ; } else { rhs + + ; } } boolean same = this ranges equals ( intersection ) ; if ( ! same ) { this ranges clear ( ) ; this ranges add all ( intersection ) ; return true ; } else { return false ; } }


public static long read long ( byte [ ] bytes , int start ) { return ( ( long ) ( read int ( bytes , start ) ) < < 32 ) + ( read int ( bytes , start + 4 ) & 0x f f f f f f f f l ) ; }


parse the supplied xml file data to a { @ link document }

public static @ non null document parse ( @ non null file file ) throws s a x exception , i o exception { if ( ! file exists ( ) | | ! file is file ( ) ) { throw new illegal argument exception ( string format ( " file % s does not exist or is not a ' normal ' file " , file get absolute path ( ) ) ) ; } try ( input stream file input stream = files new input stream ( file to path ( ) ) ) { return parse ( file input stream ) ; } catch ( invalid path exception e ) { throw new i o exception ( e ) ; } }


test for the choose replica to delete are processed based on block locality and free space

public void test choose replica to delete ( ) throws exception { list < datanode storage info > replica list = new array list < > ( ) ; final map < string , list < datanode storage info > > rack map = new hash map < string , list < datanode storage info > > ( ) ; storages [ 0 ] set remaining for tests ( 4 * 1024 * 1024 ) ; data nodes [ 0 ] set remaining ( calculate remaining ( data nodes [ 0 ] ) ) ; replica list add ( storages [ 0 ] ) ; storages [ 1 ] set remaining for tests ( 3 * 1024 * 1024 ) ; data nodes [ 1 ] set remaining ( calculate remaining ( data nodes [ 1 ] ) ) ; replica list add ( storages [ 1 ] ) ; storages [ 2 ] set remaining for tests ( 2 * 1024 * 1024 ) ; data nodes [ 2 ] set remaining ( calculate remaining ( data nodes [ 2 ] ) ) ; replica list add ( storages [ 2 ] ) ; / / even if this node has the most space , because the storage [ 5 ] has / / the lowest it should be chosen in case of block delete storages [ 4 ] set remaining for tests ( 100 * 1024 * 1024 ) ; storages [ 5 ] set remaining for tests ( 512 * 1024 ) ; data nodes [ 5 ] set remaining ( calculate remaining ( data nodes [ 5 ] ) ) ; replica list add ( storages [ 5 ] ) ; / / refresh the last update time for all the datanodes for ( int i = 0 ; i < data nodes length ; i + + ) { d f s test util reset last updates with offset ( data nodes [ i ] , 0 ) ; } list < datanode storage info > first = new array list < > ( ) ; list < datanode storage info > second = new array list < > ( ) ; replicator split nodes with rack ( replica list , replica list , rack map , first , second ) ; / / storages [ 0 ] and storages [ 1 ] are in first set as their rack has two / / replica nodes , while storages [ 2 ] and data nodes [ 5 ] are in second set assert equals ( 2 , first size ( ) ) ; assert equals ( 2 , second size ( ) ) ; list < storage type > excess types = new array list < > ( ) ; { / / test returning null excess types add ( storage type ssd ) ; assert null ( ( ( block placement policy default ) replicator ) choose replica to delete ( first , second , excess types , rack map ) ) ; } excess types add ( storage type default ) ; datanode storage info chosen = ( ( block placement policy default ) replicator ) choose replica to delete ( first , second , excess types , rack map ) ; / / within all storages , storages [ 5 ] with least free space assert equals ( chosen , storages [ 5 ] ) ; replicator adjust sets with chosen replica ( rack map , first , second , chosen ) ; assert equals ( 2 , first size ( ) ) ; assert equals ( 1 , second size ( ) ) ; / / within first set , storages [ 1 ] with less free space excess types add ( storage type default ) ; chosen = ( ( block placement policy default ) replicator ) choose replica to delete ( first , second , excess types , rack map ) ; assert equals ( chosen , storages [ 1 ] ) ; }


replace uri template variables in the target url with encoded model attributes or uri variables from the current request model attributes referenced in the url are removed from the model

protected string builder replace uri template variables ( string target url , map < string , object > model , map < string , string > current uri variables , string encoding scheme ) throws unsupported encoding exception { string builder result = new string builder ( ) ; matcher matcher = uri template variable pattern matcher ( target url ) ; int end last match = 0 ; while ( matcher find ( ) ) { string name = matcher group ( 1 ) ; object value = ( model contains key ( name ) ? model remove ( name ) : current uri variables get ( name ) ) ; if ( value = = null ) { throw new illegal argument exception ( " model has no value for key ' " + name + " ' " ) ; } result append ( target url , end last match , matcher start ( ) ) ; result append ( uri utils encode path segment ( value to string ( ) , encoding scheme ) ) ; end last match = matcher end ( ) ; } result append ( target url substring ( end last match ) ) ; return result ; }


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


public void place order ( order body , api client auth info auth info , handler < async result < order > > result handler ) { object local var body = body ; / / verify the required parameter ' body ' is set if ( body = = null ) { result handler handle ( api exception fail ( 400 , " missing the required parameter ' body ' when calling place order " ) ) ; return ; } / / create path and map variables string local var path = " / store / order " ; / / query params list < pair > local var query params = new array list < > ( ) ; / / header params multi map local var header params = multi map case insensitive multi map ( ) ; / / cookie params multi map local var cookie params = multi map case insensitive multi map ( ) ; / / form params / / todo : sending files within multipart / form - data is not supported yet ( because of vertx web - client ) map < string , object > local var form params = new hash map < > ( ) ; string [ ] local var accepts = { " application / xml " , " application / json " } ; string [ ] local var content types = { } ; string [ ] local var auth names = new string [ ] { } ; type reference < order > local var return type = new type reference < order > ( ) { } ; api client invoke a p i ( local var path , " post " , local var query params , local var body , local var header params , local var cookie params , local var form params , local var accepts , local var content types , local var auth names , auth info , local var return type , result handler ) ; }


listener is always notified asynchronously using a dedicated notification thread pool so , care should be taken to avoid leaking { @ code this } when adding a listener in a constructor additionally , it is possible notifications are observed out of order due to the asynchronous execution

public void add state change listener ( state change listener < task state > state change listener ) { task state add state change listener ( state change listener ) ; }


return whether the aop proxy will expose the aop proxy for each invocation

public boolean is expose proxy ( ) { return this expose proxy ; }


gets the filesystem instance by setting the failover configurations

public static distributed file system configure failover fs ( mini d f s cluster cluster , configuration conf ) throws i o exception , u r i syntax exception { return configure failover fs ( cluster , conf , 0 ) ; }


returns true if there is a pending change to the current sort state ( this includes a sort state that signals no sort will be applied )

public boolean is sort pending ( ) { return is sort pending ; }


set an offset in dp that allows the user to drag the chart over it ' s bounds on the y - axis

public void set drag offset y ( float offset ) { m trans offset y = utils convert dp to pixel ( offset ) ; }


get all running tools that have the same tool chest tool name as this one

private plugin tool [ ] get same named running tools ( plugin tool tool ) { string tool name = tool get tool name ( ) ; plugin tool [ ] tools = tool manager get running tools ( ) ; list < plugin tool > tool list = new array list < > ( tools length ) ; for ( plugin tool element : tools ) { if ( tool name equals ( element get tool name ( ) ) ) { tool list add ( element ) ; } } return tool list to array ( new plugin tool [ tool list size ( ) ] ) ; }


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

public static < t > find executor < t > sum async ( final class < ? > model class , final string column name , final class < t > column type ) { return sum async ( base utility change case ( d b utility get table name by class name ( model class get name ( ) ) ) , column name , column type ) ; }


returns null if the provided factory and his parents are compatible with this aggregator or the instance of the parent ' s factory that is incompatible with the composite aggregation

private aggregator factory check parent is null or nested ( aggregator factory factory ) { if ( factory = = null ) { return null ; } else if ( factory instanceof nested aggregator factory ) { return check parent is null or nested ( factory get parent ( ) ) ; } else { return factory ; } }


returns the number of times { @ link cache } lookup methods threw an exception while loading a new value this is usually incremented in conjunction with { @ code miss count } , though { @ code miss count } is also incremented when cache loading completes successfully ( see { @ link # load success count } ) multiple concurrent misses for the same key will result in a single load operation this may be incremented not in conjunction with { @ code miss count } if the load occurs as a result of a refresh or if the cache loader returned more items than was requested { @ code miss count } may also be incremented not in conjunction with this ( nor { @ link # load success count } ) on calls to { @ code get if present }

public long load exception count ( ) { return load exception count ; }


adds , to the existing information , field ( s ) that are read in the source record ( s )

public void add read fields ( field set read fields ) { if ( this read fields = = null ) { this read fields = read fields ; } else { this read fields = this read fields add fields ( read fields ) ; } }


return { @ code true } if the current instance is a subclass of delimiter based frame decoder

private boolean is subclass ( ) { return get class ( ) ! = delimiter based frame decoder class ; }


finds the next previous position of a given byte sequence in a given byte buffer , starting from the buffer ' s current position ( excluded )

static int scan backwards to ( byte [ ] target , byte buffer buffer ) { preconditions check not null ( target ) ; preconditions check not null ( buffer ) ; if ( target length = = 0 ) { return buffer position ( ) - 1 ; } int pos = buffer position ( ) - target length ; if ( pos < 0 ) { return - 1 ; } scan : while ( true ) { while ( pos > = 0 & & buffer get ( pos ) ! = target [ 0 ] ) { pos - - ; } if ( pos < 0 ) { return - 1 ; } for ( int i = 1 ; i < target length ; i + + ) { if ( buffer get ( pos + i ) ! = target [ i ] ) { pos - - ; continue scan ; } } return pos ; } }


public void parsing proc mem file ( ) throws i o exception { long mem total = 4058864l ; long mem free = 99632l ; long inactive = 567732l ; long swap total = 2096472l ; long swap free = 1818480l ; int nr huge pages = 10 ; file temp file = new file ( fake memfile ) ; temp file delete on exit ( ) ; file writer f writer = new file writer ( fake memfile ) ; f writer write ( string format ( meminfo format , mem total , mem free , inactive , swap total , swap free , nr huge pages ) ) ; f writer close ( ) ; assert equals ( plugin get available physical memory size ( ) , 1024l * ( mem free + inactive ) ) ; assert equals ( plugin get available virtual memory size ( ) , 1024l * ( mem free + inactive + swap free ) ) ; assert equals ( plugin get physical memory size ( ) , 1024l * ( mem total - ( nr huge pages * 2048 ) ) ) ; assert equals ( plugin get virtual memory size ( ) , 1024l * ( mem total - ( nr huge pages * 2048 ) + swap total ) ) ; }


all certificate types required according to the feature flags

public collection < certificate type > get all certificate types ( ) { return feature flags phone number privacy ( ) ? both certificates : regular certificate ; }


the package id of this package , in the range [ 0x 0 0 , 0xff ] the id 0x 0 0 is reserved for shared libraries , or when the id is assigned at run - time the id 0x 0 1 is reserved for the ' android ' package ( framework ) the id range [ 0x 0 2 , 0x 7f ) is reserved for auto - assignment to shared libraries at run - time the id 0x 7f is reserved for the application package i ds & gt ; 0x 7f are reserved for the application as well and are treated as feature splits < code > optional uint 3 2 package id = 1 ; < code >

public int get package id ( ) { return instance get package id ( ) ; }


determines the policy with which to handle the zip file entry with the given name and calls the appropriate method on the callback interface { @ link strategy callback } for every unique name in the set of all zip file entries , this method is called exactly once and the result is used for all entries of the same name except , if an entry is renamed , the original name is not considered as having been encountered yet implementations should use the filename to distinguish the desired processing , call one method on the callback interface and return immediately after that call there is no guarantee that the callback will perform the requested operation at the time of the invocation an implementation may choose to defer the operation to an arbitrary later time

void accept ( string filename , strategy callback callback ) throws i o exception ;


tests dynamic configuration of http principals

public void test dynamic principal discovery ( ) throws exception { string [ ] keytab users = new string [ ] { " http / host 1 " , " http / host 2 " , " http2 / host 1 " , " xhttp / host " } ; string keytab = kerberos test utils get keytab file ( ) ; get kdc ( ) create principal ( new file ( keytab ) , keytab users ) ; / / destroy handler created in set up ( ) handler destroy ( ) ; properties props = new properties ( ) ; props set property ( kerberos authentication handler keytab , keytab ) ; props set property ( kerberos authentication handler principal , " * " ) ; handler = get new authentication handler ( ) ; handler init ( props ) ; assert assert equals ( kerberos test utils get keytab file ( ) , handler get keytab ( ) ) ; set < kerberos principal > login principals = handler get principals ( ) ; for ( string user : keytab users ) { principal principal = new kerberos principal ( user + " @ " + kerberos test utils get realm ( ) ) ; boolean expected = user starts with ( " http / " ) ; assert assert equals ( " checking for " + user , expected , login principals contains ( principal ) ) ; } }


returns the function signature or prototype ( eg , " int foo ( double d ) " )

public string get signature ( ) { return signature ; }


add a single include directory to be added with " - i " it can be either relative to the exec root ( see { @ link com google devtools build lib analysis blaze directories # get exec root ( string ) } ) or absolute before it is stored , the include directory is normalized

public builder add include dir ( path fragment include dir ) { include dirs add ( include dir ) ; return this ; }


get the constructor tree of the given instruction

protected string dump constructor tree ( pseudo instruction ins ) { sleigh instruction prototype ip = ( sleigh instruction prototype ) ins get prototype ( ) ; return ip dump constructor tree ( ) ; }


the name of this entry this corresponds to the ' entry ' part of a full resource name of the form package : typeentry < code > optional string name = 2 ; < code >

public com google protobuf byte string get name bytes ( ) { return com google protobuf byte string copy from utf 8 ( name ) ; }


gets the boost a specific indices or aliases will receive when the query is executed against them

public list < index boost > index boosts ( ) { return index boosts ; }


return true iff file is a checksum file name

public static boolean is checksum file ( path file ) { string name = file get name ( ) ; return name starts with ( " " ) & & name ends with ( " crc " ) ; }


tests that the { @ link task executor } sends the initial slot report after it registered at the resource manager

public void test initial slot report ( ) throws exception { final task executor task executor = create task executor ( 1 ) ; task executor start ( ) ; try { final testing resource manager gateway testing resource manager gateway = new testing resource manager gateway ( ) ; final completable future < resource i d > initial slot report future = new completable future < > ( ) ; testing resource manager gateway set send slot report function ( resource i d instance i d slot report tuple 3 - > { initial slot report future complete ( resource i d instance i d slot report tuple 3 f 0 ) ; return completable future completed future ( acknowledge get ( ) ) ; } ) ; rpc register gateway ( testing resource manager gateway get address ( ) , testing resource manager gateway ) ; resource manager leader retriever notify listener ( testing resource manager gateway get address ( ) , testing resource manager gateway get fencing token ( ) to u u i d ( ) ) ; assert that ( initial slot report future get ( ) , equal to ( task executor get resource i d ( ) ) ) ; } finally { rpc utils terminate rpc endpoint ( task executor , timeout ) ; } }


similar to { @ link # get variable instances ( collection ) } , but only for variables local to this scope

map < string , variable instance > get variable instances local ( collection < string > variable names ) ;


this test verifies that the actual test class , not the composed annotation , is passed to the resolver

void resolve active profiles with meta annotation and test class verifying resolver ( ) { class < test class verifying active profiles resolver test case > test class = test class verifying active profiles resolver test case class ; assert resolved profiles ( test class , test class get simple name ( ) ) ; }


recover the description of the method at a specific address

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


utility function for { @ link either serializer } to support object reuse to support object reuse both subclasses of either contain a reference to an instance of the other type this method provides access to and initializes the cross - reference

public static < l , r > left < l , r > obtain left ( either < l , r > input , type serializer < l > left serializer ) { if ( input is left ( ) ) { return ( left < l , r > ) input ; } else { right < l , r > right = ( right < l , r > ) input ; if ( right left = = null ) { right left = left of ( left serializer create instance ( ) ) ; right left right = right ; } return right left ; } }


sets the default artwork to display if { @ code use artwork } is { @ code true } and no artwork is present in the media

public void set default artwork ( @ nullable drawable default artwork ) { if ( this default artwork ! = default artwork ) { this default artwork = default artwork ; update for current track selections ( / * is new player = * / false ) ; } }


returns the serializer for the values in the map

public type serializer < v > get value serializer ( ) { return value serializer ; }


return the accumulated height of component tree holders , or return the {

public static int compute linear layout wrapped height ( linear layout manager linear layout manager , int max height , list < component tree holder > component tree holders ) { final int item count = component tree holders size ( ) ; int measured height = 0 ; switch ( linear layout manager get orientation ( ) ) { case linear layout manager vertical : for ( int i = 0 ; i < item count ; i + + ) { final component tree holder holder = component tree holders get ( i ) ; measured height + = holder get measured height ( ) ; measured height + = layout info utils get top decoration height ( linear layout manager , i ) ; measured height + = layout info utils get bottom decoration height ( linear layout manager , i ) ; if ( measured height > max height ) { measured height = max height ; break ; } } return measured height ; case linear layout manager horizontal : default : throw new illegal state exception ( " this method should only be called when orientation is vertical " ) ; } }


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


invoked after the web socket connection has been closed by either side , or after a transport error has occurred although the session may technically still be open , depending on the underlying implementation , sending messages at this point is discouraged and most likely will not succeed

void after connection closed ( web socket session session , close status close status ) throws exception ;


public verify repository response verify repository ( verify repository request verify repository request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( verify repository request , snapshot request converters : : verify repository , options , verify repository response : : from x content , empty set ( ) ) ; }


the series of types defined by the package < code > repeated aapt pb type type = 3 ; < code >

public java util list < com android aapt resources type > get type list ( ) { return type ; }


append to an existing file ( optional operation ) important : the < code > progressable < code > parameter is not used

public f s data output stream append ( path f , int buffer size , progressable progress ) throws i o exception { map < string , string > params = new hash map < string , string > ( ) ; params put ( op param , operation append to string ( ) ) ; return upload data ( operation append get method ( ) , f , params , buffer size , http u r l connection http ok ) ; }


required the nonce provides a way for request change to uniquely reference a request resources < code > string nonce = 5 ; < code >

public java lang string get nonce ( ) { java lang object ref = nonce ; if ( ref instanceof java lang string ) { return ( java lang string ) ref ; } else { com google protobuf byte string bs = ( com google protobuf byte string ) ref ; java lang string s = bs to string utf 8 ( ) ; nonce = s ; return s ; } }


public void set name ( string name ) { if ( name = = null ) { throw new null pointer exception ( ) ; } this name = name ; }


sets validation method for this sort builder

public geo distance sort builder validation ( geo validation method method ) { this validation = method ; return this ; }


public void disarm ( ) { set enabled ( false ) ; }


schedule the given background command when the current command completes

public synchronized void schedule follow on command ( background command cmd , undoable domain object obj ) { if ( is processing domain object ( obj ) ) { priority queue < background command > queue = queued commands map get ( obj ) ; if ( queue = = null ) { queue = new priority queue < > ( ) ; queued commands map put ( obj , queue ) ; } / / no need to add repeated entries to the queue if ( ! merge mergeable background commands ( cmd , queue ) ) { queue add ( cmd , 1 ) ; } } else { execute command ( cmd , obj ) ; } }


returns the specified segment of this path ; index must be non - negative and less than { @ code segment count ( ) } this operation is o ( n ) on the length of the string

public string get segment ( int index ) { int n = normalized path length ( ) ; int segment count = 0 ; int i ; for ( i = drive str length ; i < n & & segment count < index ; + + i ) { if ( normalized path char at ( i ) = = separator char ) { + + segment count ; } } int starti = i ; for ( ; i < n ; + + i ) { if ( normalized path char at ( i ) = = separator char ) { break ; } } / / add last segment if one exists if ( i > drive str length ) { + + segment count ; } int endi = i ; if ( index < 0 | | index > = segment count ) { throw new illegal argument exception ( " illegal segment index : " + index ) ; } return normalized path substring ( starti , endi ) ; }


indicate that source should be returned with every hit , with an " include " andor " exclude " set which can include simple wildcard elements

public top hits aggregation builder fetch source ( @ nullable string [ ] includes , @ nullable string [ ] excludes ) { fetch source context fetch source context = this fetch source context ! = null ? this fetch source context : fetch source context fetch source ; this fetch source context = new fetch source context ( fetch source context fetch source ( ) , includes , excludes ) ; return this ; }


before each method , the thread is renamed to match the method name

public void name thread to method ( ) { thread current thread ( ) set name ( " j unit - " + get method name ( ) ) ; }


returns a { @ code tree range set } representing the union of the specified ranges this is the smallest { @ code range set } which encloses each of the specified ranges an element will be contained in this { @ code range set } if and only if it is contained in at least one { @ code range } in { @ code ranges }

public static < c extends comparable < ? > > tree range set < c > create ( iterable < range < c > > ranges ) { tree range set < c > result = create ( ) ; result add all ( ranges ) ; return result ; }


update an existing config map with the data benefit from < a href = https : kubernetes iodocsreferenceusing - apiapi - concepts # resource - versions > resource version and combined with { @ link # get config map ( string ) } , we could perform a get - check - and - update transactional operation since concurrent modification could happen on a same config map , the update operation may fail we need to retry internally in the implementation

completable future < boolean > check and update config map ( string config map name , function < kubernetes config map , optional < kubernetes config map > > update function ) ;


inserts the specified element into the queue represented by this deque ( in other words , at the tail of this deque ) , waiting if necessary for space to become available < p > this method is equivalent to { @ link # put last put last }

void put ( e e ) throws interrupted exception ;


returns the value { @ code value } associated with the given key by the most recent call to { @ code put ( key , value ) } , or { @ code null } if there was no such call


returns the set of command - line lto backend options

public immutable list < string > get lto backend options ( ) { return ltobackend options ; }


optional identification of the kind of scm being used

public string get kind ( ) { return null ; }


id for a peer recovery retention lease for the given { @ link shard routing } see { @ link replication tracker # add peer recovery retention lease }

public static string get peer recovery retention lease id ( shard routing shard routing ) { return get peer recovery retention lease id ( shard routing current node id ( ) ) ; }


determine the { @ link mime type } of a message from the given message headers

mime type resolve ( @ nullable message headers headers ) throws invalid mime type exception ;


return the name of the target bean in the spring application context

protected string get target bean name ( ) { return this target bean name ; }


get the bean - style property names for the specified object

public static set < string > get property names ( final class < ? > target class ) { hash set < string > set = new hash set < > ( ) ; matcher matcher = getter pattern matcher ( " " ) ; for ( method method : target class get methods ( ) ) { string name = method get name ( ) ; if ( method get parameter types ( ) length = = 0 & & matcher reset ( name ) matches ( ) ) { name = name replace first ( " ( get | is ) " , " " ) ; try { if ( target class get method ( " set " + name , method get return type ( ) ) ! = null ) { name = character to lower case ( name char at ( 0 ) ) + name substring ( 1 ) ; set add ( name ) ; } } catch ( exception e ) { / / fall thru ( continue ) } } } return set ; }


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


returns a human - readable text that represents this label

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


issue : add at least one assertion to this test case solution : inserted assertion to check whether the execution of the main method in { @ link app # main ( string [ ] ) } throws an exception

void should execute application without exception ( ) { assert does not throw ( ( ) - > app main ( new string [ ] { } ) ) ; }


public void signal ( ) { try { files delete ( paths get ( stop job marker file ) ) ; } catch ( final i o exception e ) { throw new runtime exception ( e ) ; } }


takes program arguments as a single string , and splits them into a list of string tokenize arguments ( " - - foo bar " ) = [ " - - foo " " bar " ] tokenize arguments ( " - - foo \ " bar baz \ " " ) = [ " - - foo " " bar baz " ] tokenize arguments ( " - - foo ' bar baz ' " ) = [ " - - foo " " bar baz " ] tokenize arguments ( null ) = [ ] warning : this method does not respect escaped quotes

static list < string > tokenize arguments ( @ nullable final string args ) { if ( args = = null ) { return collections empty list ( ) ; } final matcher matcher = arguments tokenize pattern matcher ( args ) ; final list < string > tokens = new array list < > ( ) ; while ( matcher find ( ) ) { tokens add ( matcher group ( ) trim ( ) replace ( " \ " " , " " ) replace ( " \ ' " , " " ) ) ; } return tokens ; }


compute the first offset of the given slice

private static long start offset ( int level , long slice ) { return slice < < level ; }


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

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


returns < code > true < code > iff the given index exists otherwise < code > false < code >

protected static boolean index exists ( string index ) { return index exists ( index , client ( ) ) ; }


check if any of the responses came back with an assertion error if so , it re - throws it , even if there was a quorum of responses this code only runs if assertions are enabled for this class , otherwise it should jit itself away this is done since assertion error indicates programmer confusion rather than some kind of expected issue , and thus in the context of test cases we ' d like to actually fail the test case instead of continuing through

private synchronized void check assertion errors ( ) { boolean asserts enabled = false ; assert asserts enabled = true ; / / sets to true if enabled if ( asserts enabled ) { for ( throwable t : exceptions values ( ) ) { if ( t instanceof assertion error ) { throw ( assertion error ) t ; } else if ( t instanceof remote exception & & ( ( remote exception ) t ) get class name ( ) equals ( assertion error class get name ( ) ) ) { throw new assertion error ( t ) ; } } } }


returns the class name that will be used to lookup the icon this class name will be added as a class tag to the html img tags where the icon should show up followed by a size specifier given by { @ link icon # to normalized icon size class ( string ) } the conversion of class tag to src tag is registered through { @ link icon set # add icon ( icon ) } it is both the recommended and default implementation to serve different icons based on { @ link # is offline }

public string get icon class name ( ) { / / the machine was taken offline by someone if ( is temporarily offline ( ) & & get offline cause ( ) instanceof offline cause user cause ) return " icon - computer - user - offline " ; / / there is a " technical " reason the computer will not accept new builds if ( is offline ( ) | | ! is accepting tasks ( ) ) return " icon - computer - x " ; return " icon - computer " ; }


tells whether the target was compiled with gs buffer security checks

public boolean is compiled with gs buffer security checks ( ) { return compiled with gs buffer security checks ; }


dispatch a { @ link service instances changed event }

private void dispatch service instances changed event ( string service name , list < service instance > service instances ) { if ( ! has text ( service name ) | | objects equals ( current application name , service name ) | | service instances = = null ) { return ; } service instances changed event event = new service instances changed event ( service name , service instances ) ; if ( logger is info enabled ( ) ) { logger info ( " the event of the service instances [ name : { } , size : { } ] change is about to be dispatched " , service name , service instances size ( ) ) ; } application event publisher publish event ( event ) ; }


post storeorder : place an order for a pet

com netflix hystrix hystrix command < response entity < order > > place order ( @ api param ( value = " order placed for purchasing the pet " , required = true ) @ valid @ request body order body ) ;


get number of callother errors detected when a test pass was registered this number should be subtracted from the pass count and possibly added to the failure count number does not reflect total number of callother pcodeops encountered but only the number of passed tests affected see log for all callother executions detected

public int get call other errors ( ) { return call other errors ; }


extract the full template type information from the given type ' s template parameter at the given position

public static full type info get full template type ( type type , int template position ) { if ( type instanceof parameterized type ) { return get full template type ( ( ( parameterized type ) type ) get actual type arguments ( ) [ template position ] ) ; } else { throw new illegal argument exception ( ) ; } }


make sure that when a dirty value is building , the fact that a child may no longer exist in the graph doesn ' t cause problems

public void dirty build after failed build ( ) throws exception { sky key leaf = graph tester non hermetic key ( " leaf " ) ; sky key top = graph tester to sky key ( " top " ) ; tester get or create ( top ) add dependency ( leaf ) set computed value ( copy ) ; tester set ( leaf , new string value ( " leafy " ) ) ; string value top value = ( string value ) tester eval and get ( " top " ) ; assert that ( top value get value ( ) ) is equal to ( " leafy " ) ; assert that ( tester get dirty keys ( ) ) is empty ( ) ; assert that ( tester get deleted keys ( ) ) is empty ( ) ; fail build and remove value ( leaf ) ; / / leaf should no longer exist in the graph check that this doesn ' t cause problems tester set ( leaf , null ) ; tester set ( leaf , new string value ( " crunchy " ) ) ; tester invalidate ( ) ; top value = ( string value ) tester eval and get ( " top " ) ; assert that ( top value get value ( ) ) is equal to ( " crunchy " ) ; }


simple straightforward linear aspects - on - aspects

public void aspect on aspect linear ( ) throws exception { scratch file ( " test / aspect bzl " , " a 1p = provider ( ) " , " def a 1 impl ( target , ctx ) : " , " return struct ( a 1p = a 1p ( text = ' random ' ) ) " , " a 1 = aspect ( a 1 impl , attr aspects = [ ' dep ' ] , provides = [ ' a 1p ' ] ) " , " a 2p = provider ( ) " , " def a 2 impl ( target , ctx ) : " , " value = [ ] " , " if hasattr ( ctx rule attr dep , ' a 2p ' ) : " , " value + = ctx rule attr dep a 2p value " , " if hasattr ( target , ' a 1p ' ) : " , " value append ( str ( target label ) + str ( ctx aspect ids ) + ' = yes ' ) " , " else : " , " value append ( str ( target label ) + str ( ctx aspect ids ) + ' = no ' ) " , " return struct ( a 2p = a 2p ( value = value ) ) " , " a 2 = aspect ( a 2 impl , attr aspects = [ ' dep ' ] , required aspect providers = [ ' a 1p ' ] ) " , " def r 1 impl ( ctx ) : " , " pass " , " def r 2 impl ( ctx ) : " , " return struct ( result = ctx attr dep a 2p value ) " , " r 1 = rule ( r 1 impl , attrs = { ' dep ' : attr label ( aspects = [ a 1 ] ) } ) " , " r 2 = rule ( r 2 impl , attrs = { ' dep ' : attr label ( aspects = [ a 2 ] ) } ) " ) ; scratch file ( " test / build " , " load ( ' : aspect bzl ' , ' r 1 ' , ' r 2 ' ) " , " r 1 ( name = ' r 0 ' ) " , " r 1 ( name = ' r 1 ' , dep = ' : r 0 ' ) " , " r 2 ( name = ' r 2 ' , dep = ' : r 1 ' ) " ) ; analysis result analysis result = update ( " / / test : r 2 " ) ; configured target target = iterables get only element ( analysis result get targets to build ( ) ) ; sequence < ? > result = ( sequence ) target get ( " result " ) ; / / " yes " means that aspect a 2 sees a 1 ' s providers assert that ( result ) contains exactly ( " / / test : r 0 [ \ " / / test : aspect bzl % a 1 \ " , \ " / / test : aspect bzl % a 2 \ " ] = yes " , " / / test : r 1 [ \ " / / test : aspect bzl % a 2 \ " ] = no " ) ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


get a boolean parameter , throwing an exception if it isn ' t found or isn ' t a boolean accepts " true " , " on " , " yes " ( any case ) and " 1 " as values for true ; treats every other non - empty value as false ( i e parses leniently )

public static boolean get required boolean parameter ( servlet request request , string name ) throws servlet request binding exception { return boolean parser parse boolean ( name , request get parameter ( name ) ) ; }


tells whether the function was inlined within another

public boolean was inlined within another function ( ) { return was inlined within another function ; }


check the response type against an expected response type

public static boolean is response type ( final string type , final o auth 2 0 response types expected type ) { return expected type get type ( ) equals ignore case ( type ) ; }


by my test , consul didn ' t send the service

public void check ( health check service health check request request , stream observer < health check service health check response > response observer ) { if ( logger is debug enabled ( ) ) { logger debug ( " received the g r p c server health check with the service name of { } " , request get service ( ) ) ; } health check service health check response builder response = health check service health check response new builder ( ) ; response set status ( health check service health check response serving status serving ) ; response observer on next ( response build ( ) ) ; response observer on completed ( ) ; }


flushes the underlying stream this forces any buffered output bytes to be written out to the stream

public void flush ( ) throws i o exception { out flush ( ) ; }


returns the hosts for the file system access proxyuser settings < p > the hosts are read from the java system property < code > test hadoop proxyuser hosts < code > which defaults to < code > < code > < p > this property should be set in the < code > test properties < code > file < p > this property is only used when running file system access minicluster , it is used to configure the file system access minicluster < p > when using an external file system access cluster this property is ignored

public static string get hadoop proxy user hosts ( ) { return system get property ( hadoop proxyuser hosts , " * " ) ; }


returns the transform for this group ' s coordinate system

protected matrix 4 compute transform ( ) { affine 2 world transform = this world transform ; float origin x = this origin x , origin y = this origin y ; world transform set to trn rot scl ( x + origin x , y + origin y , rotation , scale x , scale y ) ; if ( origin x ! = 0 | | origin y ! = 0 ) world transform translate ( - origin x , - origin y ) ; / / find the first parent that transforms group parent group = parent ; while ( parent group ! = null ) { if ( parent group transform ) break ; parent group = parent group parent ; } if ( parent group ! = null ) world transform pre mul ( parent group world transform ) ; computed transform set ( world transform ) ; return computed transform ; }


tests that the { @ link akka rpc actor } discards messages until the corresponding { @ link rpc endpoint } has been started

public void test message discarding ( ) throws exception { int expected value = 1337 ; dummy rpc endpoint rpc endpoint = new dummy rpc endpoint ( akka rpc service ) ; dummy rpc gateway rpc gateway = rpc endpoint get self gateway ( dummy rpc gateway class ) ; / / this message should be discarded and completed with an akka rpc exception completable future < integer > result = rpc gateway foobar ( ) ; try { result get ( timeout get size ( ) , timeout get unit ( ) ) ; fail ( " expected an akka rpc exception " ) ; } catch ( execution exception ee ) { / / expected this exception , because the endpoint has not been started assert true ( ee get cause ( ) instanceof akka rpc exception ) ; } / / set a new value which we expect to be returned rpc endpoint set foobar ( expected value ) ; / / start the endpoint so that it can process messages rpc endpoint start ( ) ; try { / / send the rpc again result = rpc gateway foobar ( ) ; / / now we should receive a result : - ) integer actual value = result get ( timeout get size ( ) , timeout get unit ( ) ) ; assert that ( " the new foobar value should have been returned " , actual value , is is ( expected value ) ) ; } finally { rpc utils terminate rpc endpoint ( rpc endpoint , timeout ) ; } }


produce concise output ( type and name ) if the current log level does not include debug if debug is enabled , produce verbose output including the hash code of the property source instance and every namevalue property pair this variable verbosity is useful as a property source such as system properties or environment variables may contain an arbitrary number of property pairs , potentially leading to difficult to read exception and log messages

public string to string ( ) { if ( logger is debug enabled ( ) ) { return get class ( ) get simple name ( ) + " @ " + system identity hash code ( this ) + " { name = ' " + get name ( ) + " ' , properties = " + get source ( ) + " } " ; } else { return get class ( ) get simple name ( ) + " { name = ' " + get name ( ) + " ' } " ; } }


unregisters all beans that this exported has exposed via jmx when the enclosing { @ code application context } is destroyed

public void destroy ( ) { logger debug ( " unregistering jmx - exposed beans on shutdown " ) ; unregister notification listeners ( ) ; unregister beans ( ) ; }


( asynchronously ) to test the collection format in query parameters

public okhttp 3 call test query parameter collection format async ( list < string > pipe , list < string > ioutil , list < string > http , list < string > url , list < string > context , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = test query parameter collection format validate before call ( pipe , ioutil , http , url , context , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


visit a parse tree produced by { @ link eql base parser # sequence term }

t visit sequence term ( eql base parser sequence term context ctx ) ;


convenience method to get this element as a number

public number get as number ( ) { return value instanceof string ? new lazily parsed number ( ( string ) value ) : ( number ) value ; }


sets the progress bar image scale type if not set , the default value center inside will be used

public generic drawee hierarchy builder set progress bar image scale type ( @ nullable scaling utils scale type progress bar image scale type ) { m progress bar image scale type = progress bar image scale type ; return this ; }


public constant get constant ( ) { return constant ; }


returns the actual class name for a class

private static string get simple name ( class < ? > klass ) { return get simple name ( klass get name ( ) ) ; }


translate overlay address spaces for a new language provider and initialize the new addr factory with the translated overlay spaces all non - overlay address spaces within the address factory should already have been mapped to the new language

void set language ( language new language , program address factory addr factory , language translator translator ) throws i o exception { table table = db get table ( table name ) ; if ( table ! = null ) { record iterator it = table iterator ( ) ; while ( it has next ( ) ) { d b record rec = it next ( ) ; string old underlying space name = rec get string ( ov space base col ) ; address space space = addr factory get address space ( old underlying space name ) ; if ( space ! = null & & space is non loaded memory space ( ) ) { / / skip overlays associated with non - loaded spaces such as other space continue ; } address space new space = translator get new address space ( old underlying space name ) ; if ( new space = = null ) { throw new i o exception ( " failed to map old address space : " + old underlying space name ) ; } rec set string ( ov space base col , new space get name ( ) ) ; table put record ( rec ) ; } } initialize overlay spaces ( addr factory ) ; }


returns all the registered { @ link tool location translator } s

public static extension list < tool location translator > all ( ) { return extension list lookup ( tool location translator class ) ; }


reads the bits in the { @ link bit matrix } representing the mapping matrix ( no alignment patterns ) in the correct order in order to reconstitute the codewords bytes contained within the data matrix code

byte [ ] read codewords ( ) throws format exception { byte [ ] result = new byte [ version get total codewords ( ) ] ; int result offset = 0 ; int row = 4 ; int column = 0 ; int num rows = mapping bit matrix get height ( ) ; int num columns = mapping bit matrix get width ( ) ; boolean corner 1 read = false ; boolean corner 2 read = false ; boolean corner 3 read = false ; boolean corner 4 read = false ; / / read all of the codewords do { / / check the four corner cases if ( ( row = = num rows ) & & ( column = = 0 ) & & ! corner 1 read ) { result [ result offset + + ] = ( byte ) read corner 1 ( num rows , num columns ) ; row - = 2 ; column + = 2 ; corner 1 read = true ; } else if ( ( row = = num rows - 2 ) & & ( column = = 0 ) & & ( ( num columns & 0x 0 3 ) ! = 0 ) & & ! corner 2 read ) { result [ result offset + + ] = ( byte ) read corner 2 ( num rows , num columns ) ; row - = 2 ; column + = 2 ; corner 2 read = true ; } else if ( ( row = = num rows + 4 ) & & ( column = = 2 ) & & ( ( num columns & 0x 0 7 ) = = 0 ) & & ! corner 3 read ) { result [ result offset + + ] = ( byte ) read corner 3 ( num rows , num columns ) ; row - = 2 ; column + = 2 ; corner 3 read = true ; } else if ( ( row = = num rows - 2 ) & & ( column = = 0 ) & & ( ( num columns & 0x 0 7 ) = = 4 ) & & ! corner 4 read ) { result [ result offset + + ] = ( byte ) read corner 4 ( num rows , num columns ) ; row - = 2 ; column + = 2 ; corner 4 read = true ; } else { / / sweep upward diagonally to the right do { if ( ( row < num rows ) & & ( column > = 0 ) & & ! read mapping matrix get ( column , row ) ) { result [ result offset + + ] = ( byte ) read utah ( row , column , num rows , num columns ) ; } row - = 2 ; column + = 2 ; } while ( ( row > = 0 ) & & ( column < num columns ) ) ; row + = 1 ; column + = 3 ; / / sweep downward diagonally to the left do { if ( ( row > = 0 ) & & ( column < num columns ) & & ! read mapping matrix get ( column , row ) ) { result [ result offset + + ] = ( byte ) read utah ( row , column , num rows , num columns ) ; } row + = 2 ; column - = 2 ; } while ( ( row < num rows ) & & ( column > = 0 ) ) ; row + = 3 ; column + = 1 ; } } while ( ( row < num rows ) | | ( column < num columns ) ) ; if ( result offset ! = version get total codewords ( ) ) { throw format exception get format instance ( ) ; } return result ; }


public string to string ( ) { / / string builder buf = new string builder ( ) ; / / for ( long l : past 5 ) { / / if ( buf length ( ) > 0 ) buf append ( ' , ' ) ; / / buf append ( l ) ; / / } / / return buf to string ( ) ; int fc = failure count ( ) ; if ( fc > 0 ) return messages response time monitor time out ( fc ) ; return get average ( ) + " ms " ; }


returns javacopts for compiling the java source files generated by the proto compiler see java toolchain compatible javacopts for the javacopts required for protos

public static immutable list < string > construct javac opts ( rule context rule context ) { java toolchain provider toolchain = java toolchain provider from ( rule context ) ; return immutable list < string > builder ( ) add all ( toolchain get javac options ( rule context ) ) add all ( toolchain get compatible javac options ( java semantics proto javacopts key ) ) build ( ) ; }


public boolean init ( string [ ] args ) throws parse exception { command line cli parser = new gnu parser ( ) parse ( opts , args ) ; if ( args length = = 0 ) { throw new illegal argument exception ( " no args specified for client to initialize " ) ; } if ( cli parser has option ( " log properties " ) ) { string log 4j path = cli parser get option value ( " log properties " ) ; try { log 4j property helper update log 4j configuration ( client class , log 4j path ) ; } catch ( exception e ) { log warn ( " can not set up custom log 4j properties " + e ) ; } } if ( cli parser has option ( " rolling log pattern " ) ) { rolling files pattern = cli parser get option value ( " rolling log pattern " ) ; } if ( cli parser has option ( " help " ) ) { print usage ( ) ; return false ; } if ( cli parser has option ( " debug " ) ) { debug flag = true ; } if ( cli parser has option ( " keep containers across application attempts " ) ) { log info ( " keep containers across application attempts " ) ; keep containers = true ; } if ( cli parser has option ( " placement spec " ) ) { placement spec = cli parser get option value ( " placement spec " ) ; / / check if it is parsable placement spec parse ( this placement spec ) ; } app name = cli parser get option value ( " appname " , " distributed shell " ) ; am priority = integer parse int ( cli parser get option value ( " priority " , " 0 " ) ) ; am queue = cli parser get option value ( " queue " , " default " ) ; am memory = integer parse int ( cli parser get option value ( " master memory " , " - 1 " ) ) ; am v cores = integer parse int ( cli parser get option value ( " master vcores " , " - 1 " ) ) ; if ( cli parser has option ( " master resources " ) ) { map < string , long > master resources = parse resources string ( cli parser get option value ( " master resources " ) ) ; for ( map entry < string , long > entry : master resources entry set ( ) ) { if ( entry get key ( ) equals ( resource information memory uri ) ) { am memory = entry get value ( ) ; } else if ( entry get key ( ) equals ( resource information vcores uri ) ) { am v cores = entry get value ( ) int value ( ) ; } else { am resources put ( entry get key ( ) , entry get value ( ) ) ; } } } am resource profile = cli parser get option value ( " master resource profile " , " " ) ; if ( ! cli parser has option ( " jar " ) ) { throw new illegal argument exception ( " no jar file specified for application master " ) ; } app master jar = cli parser get option value ( " jar " ) ; if ( ! cli parser has option ( " shell command " ) & & ! cli parser has option ( " shell script " ) ) { throw new illegal argument exception ( " no shell command or shell script specified to be executed by application master " ) ; } else if ( cli parser has option ( " shell command " ) & & cli parser has option ( " shell script " ) ) { throw new illegal argument exception ( " can not specify shell command option " + " and shell script option at the same time " ) ; } else if ( cli parser has option ( " shell command " ) ) { shell command = cli parser get option value ( " shell command " ) ; } else { shell script path = cli parser get option value ( " shell script " ) ; } if ( cli parser has option ( " shell args " ) ) { shell args = cli parser get option values ( " shell args " ) ; } if ( cli parser has option ( " shell env " ) ) { string envs [ ] = cli parser get option values ( " shell env " ) ; for ( string env : envs ) { env = env trim ( ) ; int index = env index of ( ' = ' ) ; if ( index = = - 1 ) { shell env put ( env , " " ) ; continue ; } string key = env substring ( 0 , index ) ; string val = " " ; if ( index < ( env length ( ) - 1 ) ) { val = env substring ( index + 1 ) ; } shell env put ( key , val ) ; } } shell cmd priority = integer parse int ( cli parser get option value ( " shell cmd priority " , " 0 " ) ) ; if ( cli parser has option ( " container type " ) ) { string container type str = cli parser get option value ( " container type " ) ; if ( arrays stream ( execution type values ( ) ) none match ( execution type - > execution type to string ( ) equals ( container type str ) ) ) { throw new illegal argument exception ( " invalid container type : " + container type str ) ; } container type = execution type value of ( container type str ) ; } if ( cli parser has option ( " promote opportunistic after start " ) ) { auto promote containers = true ; } if ( cli parser has option ( " enforce execution type " ) ) { enforce exec type = true ; } container memory = integer parse int ( cli parser get option value ( " container memory " , " - 1 " ) ) ; container virtual cores = integer parse int ( cli parser get option value ( " container vcores " , " - 1 " ) ) ; if ( cli parser has option ( " container resources " ) ) { map < string , long > resources = parse resources string ( cli parser get option value ( " container resources " ) ) ; for ( map entry < string , long > entry : resources entry set ( ) ) { if ( entry get key ( ) equals ( resource information memory uri ) ) { container memory = entry get value ( ) ; } else if ( entry get key ( ) equals ( resource information vcores uri ) ) { container virtual cores = entry get value ( ) int value ( ) ; } else { container resources put ( entry get key ( ) , entry get value ( ) ) ; } } } container resource profile = cli parser get option value ( " container resource profile " , " " ) ; num containers = integer parse int ( cli parser get option value ( " num containers " , " 1 " ) ) ; if ( num containers < 1 ) { throw new illegal argument exception ( " invalid no of containers specified , " + " exiting specified num container = " + num containers ) ; } node label expression = cli parser get option value ( " node label expression " , null ) ; client timeout = integer parse int ( cli parser get option value ( " timeout " , " 600000 " ) ) ; attempt failures validity interval = long parse long ( cli parser get option value ( " attempt failures validity interval " , " - 1 " ) ) ; log 4j prop file = cli parser get option value ( " log properties " , " " ) ; / / get timeline domain options if ( cli parser has option ( " domain " ) ) { domain id = cli parser get option value ( " domain " ) ; to create domain = cli parser has option ( " create " ) ; if ( cli parser has option ( " view acls " ) ) { view a c ls = cli parser get option value ( " view acls " ) ; } if ( cli parser has option ( " modify acls " ) ) { modify a c ls = cli parser get option value ( " modify acls " ) ; } } / / get container retry options if ( cli parser has option ( " container retry policy " ) ) { container retry options add ( " - - container retry policy " + cli parser get option value ( " container retry policy " ) ) ; } if ( cli parser has option ( " container retry error codes " ) ) { container retry options add ( " - - container retry error codes " + cli parser get option value ( " container retry error codes " ) ) ; } if ( cli parser has option ( " container max retries " ) ) { container retry options add ( " - - container max retries " + cli parser get option value ( " container max retries " ) ) ; } if ( cli parser has option ( " container retry interval " ) ) { container retry options add ( " - - container retry interval " + cli parser get option value ( " container retry interval " ) ) ; } if ( cli parser has option ( " container failures validity interval " ) ) { container retry options add ( " - - container failures validity interval " + cli parser get option value ( " container failures validity interval " ) ) ; } if ( cli parser has option ( " flow name " ) ) { flow name = cli parser get option value ( " flow name " ) ; } if ( cli parser has option ( " flow version " ) ) { flow version = cli parser get option value ( " flow version " ) ; } if ( cli parser has option ( " flow run id " ) ) { try { flow run id = long parse long ( cli parser get option value ( " flow run id " ) ) ; } catch ( number format exception e ) { throw new illegal argument exception ( " flow run is not a valid long value " , e ) ; } } if ( cli parser has option ( " docker client config " ) ) { docker client config = cli parser get option value ( " docker client config " ) ; } if ( cli parser has option ( " application tags " ) ) { string application tags str = cli parser get option value ( " application tags " ) ; string [ ] app tags = application tags str split ( " , " ) ; for ( string app tag : app tags ) { this application tags add ( app tag trim ( ) ) ; } } if ( cli parser has option ( " localize files " ) ) { string files str = cli parser get option value ( " localize files " ) ; if ( files str contains ( " , " ) ) { string [ ] files = files str split ( " , " ) ; files to localize = arrays as list ( files ) ; } else { files to localize add ( files str ) ; } } return true ; }


resolves the permalink by using the cache if possible

public run < ? , ? > resolve ( job < ? , ? > job ) { map < string , integer > cache = cache for ( job get build dir ( ) ) ; int n ; synchronized ( cache ) { n = cache get or default ( get id ( ) , 0 ) ; } if ( n = = resolves to none ) { return null ; } run < ? , ? > b ; if ( n > 0 ) { b = job get build by number ( n ) ; if ( b ! = null & & apply ( b ) ) { return b ; / / found it ( in the most efficient way possible ) } } else { b = null ; } / / the cache is stale start the search if ( b = = null ) { b = job get nearest old build ( n ) ; } if ( b = = null ) { / / no cache b = job get last build ( ) ; } / / start from the build ' b ' and locate the build that matches the criteria going back in time b = find ( b ) ; update cache ( job , b ) ; return b ; }


public static void main ( string [ ] args ) { var mw = new array transpose master worker ( ) ; var rows = 10 ; var columns = 20 ; var input matrix = array utility methods create random int matrix ( rows , columns ) ; var input = new array input ( input matrix ) ; var result = ( array result ) mw get result ( input ) ; if ( result ! = null ) { array utility methods print matrix ( input matrix ) ; array utility methods print matrix ( result data ) ; } else { logger info ( " please enter non - zero input " ) ; } }


returns the class with the given name , either for the program class pool or from the library class pool , or < code > null < code > if it can ' t be found

private clazz find class ( string name ) { / / first look for the class in the program class pool clazz clazz = program class pool get class ( name ) ; / / otherwise look for the class in the library class pool if ( clazz = = null ) { clazz = library class pool get class ( name ) ; } return clazz ; }


changes the names of the parameters in the array to unique names that won ' t conflict with any other names in the function ' s namespace when the parameters are used to replace the existing parameters in the function appends an integer number to the base name if necessary to create a unique name in the function ' s namespace

public static void set unique parameter names ( function function , list < parameter > parameters ) throws duplicate name exception , invalid input exception { symbol table symbol table = function get program ( ) get symbol table ( ) ; / / create a set containing all the unique parameter names determined so far so they can / / be avoided as additional parameter names are determined set < string > names so far = new hash set < > ( ) ; for ( parameter parameter : parameters ) { string base name = parameter get name ( ) ; string unique name = get unique replacement parameter name ( symbol table , function , base name , names so far ) ; names so far add ( unique name ) ; if ( ! system utilities is equal ( base name , unique name ) ) { parameter set name ( unique name , parameter get source ( ) ) ; } } }


associates a byte array with the given name

public void put bytes ( string name , byte [ ] value ) { map put ( name , value ) ; }


public void add mapping ( int old reg , int new reg , int category ) { super add mapping ( old reg , new reg , category ) ; add interfence ( new reg , old reg ) ; if ( category = = 2 ) { add interfence ( new reg + 1 , old reg ) ; } }


{ @ inherit doc } this implementation is guaranteed to throw an { @ link unsupported operation exception }

public final entry < e > poll last entry ( ) { throw new unsupported operation exception ( ) ; }


int get maximum ( ) { return maximum ; }


public void set lock key ( string lock key ) { this lock key = lock key ; }


a blocking call to wait for observer name node state id to reach to the current client state id current client state id is given by the client alignment context an assumption is that client alignment context has the state id set at this point this is become observer read proxy provider sets up the initial state id when it is being created

public void msync ( ) throws i o exception { namenode msync ( ) ; }


abstract template method that reads the actual object invoked from { @ link # read }

protected abstract t read internal ( class < ? extends t > clazz , http input message input message ) throws i o exception , http message not readable exception ;


protected static string expect success ( string message , s 3 guard tool tool , string args ) throws exception { byte array output stream buf = new byte array output stream ( ) ; exec ( exit success , message , tool , buf , args ) ; return buf to string ( ) ; }


creates a new journal that omits redundant information this replaces the current journal if it exists

private synchronized void rebuild journal ( ) throws i o exception { if ( journal writer ! = null ) { journal writer close ( ) ; } writer writer = new buffered writer ( new output stream writer ( new file output stream ( journal file tmp ) , util us ascii ) ) ; try { writer write ( magic ) ; writer write ( " \ n " ) ; writer write ( version 1 ) ; writer write ( " \ n " ) ; writer write ( integer to string ( app version ) ) ; writer write ( " \ n " ) ; writer write ( integer to string ( value count ) ) ; writer write ( " \ n " ) ; writer write ( " \ n " ) ; for ( entry entry : lru entries values ( ) ) { if ( entry current editor ! = null ) { writer write ( dirty + ' ' + entry key + ' \ n ' ) ; } else { writer write ( clean + ' ' + entry key + entry get lengths ( ) + ' \ n ' ) ; } } } finally { writer close ( ) ; } if ( journal file exists ( ) ) { rename to ( journal file , journal file backup , true ) ; } rename to ( journal file tmp , journal file , false ) ; journal file backup delete ( ) ; journal writer = new buffered writer ( new output stream writer ( new file output stream ( journal file , true ) , util us ascii ) ) ; }


return a hash code based on the contents of the specified array if { @ code array } is { @ code null } , this method returns 0

public static int null safe hash code ( @ nullable float [ ] array ) { if ( array = = null ) { return 0 ; } int hash = initial hash ; for ( float element : array ) { hash = multiplier * hash + float hash code ( element ) ; } return hash ; }


replaces the given instruction by an infinite loop

private void replace by infinite loop ( clazz clazz , int offset , instruction instruction ) { / / replace the instruction by an infinite loop instruction replacement instruction = new branch instruction ( instruction constants op goto , 0 ) ; if ( debug ) system out println ( " replacing unreachable instruction by infinite loop " + replacement instruction to string ( offset ) ) ; code attribute editor replace instruction ( offset , replacement instruction ) ; / / visit the instruction , if required if ( extra instruction visitor ! = null ) { / / note : we ' re not passing the right arguments for now , knowing that / / they aren ' t used anyway instruction accept ( clazz , null , null , offset , extra instruction visitor ) ; } }


returns all row objects corresponding to all selected rows in the table

public list < row object > get selected row objects ( ) { list < row object > items = filter panel get selected items ( ) ; return items ; }


public static string to string ( vector vector ) { if ( vector instanceof sparse vector ) { return to string ( ( sparse vector ) vector ) ; } return to string ( ( dense vector ) vector ) ; }


get the { @ link # set max in memory size configured } maximum in - memory size

public int get max in memory size ( ) { return this max in memory size ; }


clears the code units ( instructions or data ) in the specified range

public final void clear listing ( address start , address end ) throws cancelled exception { current program get listing ( ) clear code units ( start , end , false , monitor ) ; }


public static sys info new instance ( ) { if ( shell linux ) { return new sys info linux ( ) ; } if ( shell windows ) { return new sys info windows ( ) ; } throw new unsupported operation exception ( " could not determine os " ) ; }


test a { @ link decoder # decode decode } scenario where the input stream is canceled this test method will feed the first element of the { @ code input } stream to the decoder , followed by a cancel signal the result is expected to contain one " normal " element

protected void test decode cancel ( publisher < data buffer > input , resolvable type output type , @ nullable mime type mime type , @ nullable map < string , object > hints ) { flux < ? > result = this decoder decode ( input , output type , mime type , hints ) ; step verifier create ( result ) expect next count ( 1 ) then cancel ( ) verify ( ) ; }


reads a sequence of bytes from this content into the given buffer , starting at the given position

public int get ( byte buffer dst , long position ) throws i o exception { return get ( dst , null , position ) ; }


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


list of mime types for file upload ( csv )

input $ accept ( string content types ) ;


protected final servlet context get servlet context ( ) throws illegal state exception { if ( this servlet context ! = null ) { return this servlet context ; } servlet context servlet context = null ; web application context wac = get web application context ( ) ; if ( wac ! = null ) { servlet context = wac get servlet context ( ) ; } if ( servlet context = = null & & is context required ( ) ) { throw new illegal state exception ( " web application object support instance [ " + this + " ] does not run within a servlet context make sure the object is fully configured ! " ) ; } return servlet context ; }


verifies that serializers of anonymous classes can be deserialized , even if serial version u i d changes

public void test anonymous serializer class with changed serial version u i d ( ) throws exception { type serializer anonymous class serializer = new abstract int serializer ( ) { @ override public type serializer snapshot < integer > snapshot configuration ( ) { return null ; } } ; / / assert that our assumption holds assert assert true ( anonymous class serializer get class ( ) is anonymous class ( ) ) ; byte [ ] anonymous serializer bytes ; try ( byte array output stream out = new byte array output stream ( ) ) { type serializer serialization util write serializer ( new data output view stream wrapper ( out ) , anonymous class serializer ) ; anonymous serializer bytes = out to byte array ( ) ; } long new serial version u i d = 1234567l ; / / assert that we ' re actually modifying to a different serial version u i d assert assert not equals ( object stream class lookup ( anonymous class serializer get class ( ) ) get serial version u i d ( ) , new serial version u i d ) ; modify serial version u i d ( anonymous serializer bytes , anonymous class serializer get class ( ) get name ( ) , new serial version u i d ) ; try ( byte array input stream in = new byte array input stream ( anonymous serializer bytes ) ) { anonymous class serializer = type serializer serialization util try read serializer ( new data input view stream wrapper ( in ) , thread current thread ( ) get context class loader ( ) ) ; } / / serializer should have been deserialized despite serial version u i d mismatch assert assert not null ( anonymous class serializer ) ; assert assert true ( anonymous class serializer get class ( ) is anonymous class ( ) ) ; }


assert the response status code is { @ code http status created } ( 201 )

public result matcher is created ( ) { return matcher ( http status created ) ; }


this testcase tests re - replication , when data nodes [ 0 ] and data nodes [ 1 ] are already chosen so the 1st replica should be placed on a different rack of rack 1 the rest replicas can be placed randomly ,

public void test rereplicate 2 ( ) throws exception { update heartbeat with usage ( ) ; list < datanode storage info > chosen nodes = new array list < > ( ) ; chosen nodes add ( storages [ 0 ] ) ; chosen nodes add ( storages [ 1 ] ) ; datanode storage info [ ] targets ; targets = choose target ( 0 , chosen nodes ) ; assert equals ( targets length , 0 ) ; targets = choose target ( 1 , chosen nodes ) ; assert equals ( targets length , 1 ) ; assert false ( is on same rack ( data nodes [ 0 ] , targets [ 0 ] ) ) ; targets = choose target ( 2 , chosen nodes ) ; assert equals ( targets length , 2 ) ; assert false ( is on same rack ( data nodes [ 0 ] , targets [ 0 ] ) & & is on same rack ( data nodes [ 0 ] , targets [ 1 ] ) ) ; }


sets the < code > declawed < code > property

public cat all of declawed ( boolean declawed ) { this declawed = declawed ; return this ; }


checks that query results from all shards have consistent unsigned long format sort queries on a field that has long type in one index , and unsigned long in another index don ' t work correctly throw an error if this kind of sorting is detected todo : instead of throwing error , find a way to sort long and unsigned long together

private static void validate merge sort value formats ( collection < ? extends search phase result > query results ) { boolean [ ] ul formats = null ; boolean first result = true ; for ( search phase result entry : query results ) { doc value format [ ] formats = entry query result ( ) sort value formats ( ) ; if ( formats = = null ) return ; if ( first result ) { first result = false ; ul formats = new boolean [ formats length ] ; for ( int i = 0 ; i < formats length ; i + + ) { ul formats [ i ] = formats [ i ] = = doc value format unsigned long shifted ? true : false ; } } else { for ( int i = 0 ; i < formats length ; i + + ) { / / if the format is unsigned long in one shard , and something different in another shard if ( ul formats [ i ] ^ ( formats [ i ] = = doc value format unsigned long shifted ) ) { throw new illegal argument exception ( " can ' t do sort across indices , as a field has [ unsigned long ] type " + " in one index , and different type in another index ! " ) ; } } } } }


public analysis limits get analysis limits ( ) { return analysis limits ; }


public void set api client ( api client api client ) { this api client = api client ; }


create a { @ link local resource } record with all the given parameters the nm that hosts am container will upload resources to shared cache thus there is no need to ask task container ' s nm to upload the resources to shared cache set the shared cache upload policy to false

private static local resource create local resource ( file system fc , path file , string file symlink , local resource type type , local resource visibility visibility ) throws i o exception { file status fstat = fc get file status ( file ) ; / / we need to be careful when converting from path to url to add a fragment / / so that the symlink name when localized will be correct path qualified path = fc resolve path ( fstat get path ( ) ) ; uri uri with fragment = null ; boolean use fragment = file symlink ! = null & & ! file symlink equals ( " " ) ; try { if ( use fragment ) { uri with fragment = new uri ( qualified path to uri ( ) + " # " + file symlink ) ; } else { uri with fragment = qualified path to uri ( ) ; } } catch ( u r i syntax exception e ) { throw new i o exception ( " error parsing local resource path " + " path was not able to be converted to a uri : " + qualified path , e ) ; } url resource u r l = url from u r i ( uri with fragment ) ; long resource size = fstat get len ( ) ; long resource modification time = fstat get modification time ( ) ; return local resource new instance ( resource u r l , type , visibility , resource size , resource modification time , false ) ; }


send a reported block replace request to the output stream

private void send request ( data output stream out , extended block eb , token < block token identifier > access token ) throws i o exception { new sender ( out ) replace block ( eb , target storage type , access token , source get datanode info ( ) get datanode uuid ( ) , proxy source datanode , null ) ; }


rebuild database tables to resolve certain consistency problems use of this method does not recover lost data which may have occurred during original database corruption

public boolean rebuild ( task monitor monitor ) throws cancelled exception { for ( table table : get tables ( ) ) { try { table rebuild ( monitor ) ; } catch ( i o exception e ) { msg error ( this , " rebuild failed while processing table : " + table get name ( ) , e ) ; return false ; } } return true ; }


stops the stopwatch future reads will return the fixed duration that had elapsed up to this point

public stopwatch stop ( ) { long tick = ticker read ( ) ; check state ( is running , " this stopwatch is already stopped " ) ; is running = false ; elapsed nanos + = tick - start tick ; return this ; }


post fake { pet id } upload image with required file : uploads an image ( required )

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


creates an instance of { @ link timestamp data } from an instance of { @ link local date time }

public static timestamp data from local date time ( local date time date time ) { long epoch day = date time to local date ( ) to epoch day ( ) ; long nano of day = date time to local time ( ) to nano of day ( ) ; long millisecond = epoch day * millis per day + nano of day / 1 000 000 ; int nano of millisecond = ( int ) ( nano of day % 1 000 000 ) ; return new timestamp data ( millisecond , nano of millisecond ) ; }


some flags expand to other flags , either in place , or with " implicit requirements " that get added on top of the flag ' s value don ' t let these flags do too many crazy things , dealing with this is enough

private void check expansion options ( variable element option field ) throws option processor exception { option annotation = option field get annotation ( option class ) ; boolean is static expansion = annotation expansion ( ) length > 0 ; boolean has implicit requirements = annotation implicit requirements ( ) length > 0 ; annotation mirror annotation mirror = processor utils get annotation ( element utils , type utils , option field , option class ) ; type element expansion function = processor utils get class type from annotation field ( element utils , annotation mirror , " expansion function " ) ; type element default expansion function = element utils get type element ( expansion function class get canonical name ( ) ) ; boolean is functional expansion = ! type utils is same type ( expansion function as type ( ) , default expansion function as type ( ) ) ; if ( is static expansion & & is functional expansion ) { throw new option processor exception ( option field , " options cannot expand using both a static expansion list and an expansion function " ) ; } boolean is expansion = is static expansion | | is functional expansion ; if ( is expansion & & has implicit requirements ) { throw new option processor exception ( option field , " can ' t set an option to be both an expansion option and have implicit requirements " ) ; } if ( is expansion | | has implicit requirements ) { if ( annotation allow multiple ( ) ) { throw new option processor exception ( option field , " can ' t set an option to accumulate multiple values and let it expand to other flags " ) ; } } }


removes and returns the extra data record with the specified id if it exists note : does not modify the underlying storage , only marks the record as removed

public extra data remove ( short id ) { return entries remove ( id ) ; }


public response entity < void > delete pet ( @ api param ( value = " pet id to delete " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " " ) @ request header ( value = " api key " , required = false ) string api key ) { return new response entity < > ( http status not implemented ) ; }


sets the analyzer ( s ) to use at any given field

public item per field analyzer ( map < string , string > per field analyzer ) { this per field analyzer = per field analyzer ; return this ; }


returns whether the keypath resolution should propagate to children some keypaths resolve to content other than leaf contents ( such as a layer or content group transform ) so sometimes this will return false

public boolean propagate to children ( string key , int depth ) { if ( " container " equals ( key ) ) { return true ; } return depth < keys size ( ) - 1 | | keys get ( depth ) equals ( " * * " ) ; }


return the url path helper to use for the resolution of lookup paths

protected url path helper get url path helper ( ) { return this url path helper ; }


public float get float item ( ) { return float item ; }


returns true if the specified oas model has at least one operation with api key authentication

public static boolean has api key methods ( open a p i open a p i ) { final map < string , security scheme > security schemes = get security schemes ( open a p i ) ; if ( security schemes ! = null ) { for ( map entry < string , security scheme > scheme : security schemes entry set ( ) ) { if ( security scheme type apikey equals ( scheme get value ( ) get type ( ) ) ) { return true ; } } } return false ; }


public static void set byte ( memory segment [ ] segments , int offset , byte value ) { if ( in first segment ( segments , offset , 1 ) ) { segments [ 0 ] put ( offset , value ) ; } else { set byte multi segments ( segments , offset , value ) ; } }


inject broker controller for this listener

public void set broker controller ( broker controller broker controller ) { this broker controller = broker controller ; }


retrieve ( or create ) an interned hystrix command group instance for a given name

public static hystrix command group key as key ( string name ) { return intern interned ( name ) ; }


check whether the remote service interface and the methods meet with dubbo ' s requirements it mainly check , if the methods configured in the configuration file are included in the interface of remote service

public void check interface and methods ( class < ? > interface class , list < method config > methods ) { / / interface cannot be null assert not null ( interface class , new illegal state exception ( " interface not allow null ! " ) ) ; / / to verify interface class is an interface if ( ! interface class is interface ( ) ) { throw new illegal state exception ( " the interface class " + interface class + " is not a interface ! " ) ; } / / check if methods exist in the remote service interface if ( collection utils is not empty ( methods ) ) { for ( method config method bean : methods ) { method bean set service ( interface class get name ( ) ) ; method bean set service id ( this get id ( ) ) ; method bean refresh ( ) ; string method name = method bean get name ( ) ; if ( string utils is empty ( method name ) ) { throw new illegal state exception ( " < dubbo : method > name attribute is required ! please check : " + " < dubbo : service interface = \ " " + interface class get name ( ) + " \ " > " + " < dubbo : method name = \ " \ " / > < / < dubbo : reference > " ) ; } boolean has method = arrays stream ( interface class get methods ( ) ) any match ( method - > method get name ( ) equals ( method name ) ) ; if ( ! has method ) { throw new illegal state exception ( " the interface " + interface class get name ( ) + " not found method " + method name ) ; } } } }


returns true if the container file probably holds one of the currently supported filesystem types

public boolean is file filesystem container ( fsrl container f s r l , task monitor monitor ) throws cancelled exception , i o exception { file container file = get file ( container f s r l , monitor ) ; return fs factory mgr test ( container f s r l , container file , this , monitor ) ; }


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


asserts that two booleans are not the same

public static void assert not equals ( boolean b 1 , boolean b 2 ) { selenese test base assert not equals ( b 1 , b 2 ) ; }


gets an array of strings indicating what the full path would be if a symbol with the indicated name were in the specified namespace

public string [ ] get path ( string name , namespace namespace ) { string [ ] namespace path = namespace get symbol ( ) get path ( ) ; string [ ] path = new string [ namespace path length + 1 ] ; system arraycopy ( namespace path , 0 , path , 0 , namespace path length ) ; path [ namespace path length ] = name ; return path ; }


creates an instance using provided certificate chain and possibly - encrypted private key generally they should be pem - encoded and the key is a pkcs # 8 key if the private key is unencrypted , then password must be { @ code null }

public builder key manager ( file cert chain , file private key , string private key password ) throws i o exception { input stream cert chain is = new file input stream ( cert chain ) ; try { input stream private key is = new file input stream ( private key ) ; try { return key manager ( cert chain is , private key is , private key password ) ; } finally { private key is close ( ) ; } } finally { cert chain is close ( ) ; } }


public void test nested exception 9 ( ) { throwable throwable = assertions assert throws ( framework exception class , ( ) - > { message print 9 ( ) ; } ) ; assert that ( throwable ) has message ( " framework exception msg " ) ; }


factory method to create a new encrypted key version that can then be passed into { @ link # decrypt encrypted key } note that the fields of the returned encrypted key version will only partially be populated ; it is not necessarily suitable for operations besides decryption

public static encrypted key version create for decryption ( string key name , string encryption key version name , byte [ ] encrypted key iv , byte [ ] encrypted key material ) { key version encrypted key version = new key version ( null , eek , encrypted key material ) ; return new encrypted key version ( key name , encryption key version name , encrypted key iv , encrypted key version ) ; }


public void add branch test ( global session global session , branch session branch session ) throws exception { global session add branch ( branch session ) ; }


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


return the current size of this stream ' s internal buffer

public synchronized int capacity ( ) { return this buf length ; }


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


captures the end of the continuation for stolen work


returns the space between the legend entries on a vertical axis in pixels

public float get y entry space ( ) { return m y entry space ; }


helper method to determine a { @ link project } ' s collation

public static list < rel collation > project ( rel metadata query mq , rel node input , list < ? extends rex node > projects ) { final sorted set < rel collation > collations = new tree set < > ( ) ; final list < rel collation > input collations = mq collations ( input ) ; if ( input collations = = null | | input collations is empty ( ) ) { return com google common collect immutable list of ( ) ; } final com google common collect multimap < integer , integer > targets = com google common collect linked list multimap create ( ) ; final map < integer , sql monotonicity > targets with monotonicity = new hash map < > ( ) ; for ( ord < rex node > project : ord < rex node > zip ( projects ) ) { if ( project e instanceof rex input ref ) { targets put ( ( ( rex input ref ) project e ) get index ( ) , project i ) ; } else if ( project e instanceof rex call ) { final rex call call = ( rex call ) project e ; final rex call binding binding = rex call binding create ( input get cluster ( ) get type factory ( ) , call , input collations ) ; targets with monotonicity put ( project i , call get operator ( ) get monotonicity ( binding ) ) ; } } final list < rel field collation > field collations = new array list < > ( ) ; loop : for ( rel collation ic : input collations ) { if ( ic get field collations ( ) is empty ( ) ) { continue ; } field collations clear ( ) ; for ( rel field collation ifc : ic get field collations ( ) ) { final collection < integer > integers = targets get ( ifc get field index ( ) ) ; if ( integers is empty ( ) ) { continue loop ; / / cannot do this collation } field collations add ( ifc with field index ( integers iterator ( ) next ( ) ) ) ; } assert ! field collations is empty ( ) ; collations add ( rel collations of ( field collations ) ) ; } final list < rel field collation > field collations for rex calls = new array list < > ( ) ; for ( map entry < integer , sql monotonicity > entry : targets with monotonicity entry set ( ) ) { final sql monotonicity value = entry get value ( ) ; switch ( value ) { case not monotonic : case constant : break ; default : field collations for rex calls add ( new rel field collation ( entry get key ( ) , rel field collation direction of ( value ) ) ) ; break ; } } if ( ! field collations for rex calls is empty ( ) ) { collations add ( rel collations of ( field collations for rex calls ) ) ; } return com google common collect immutable list copy of ( collations ) ; }


adds an icon that is to be drawn on top of the base icon and any other icons that have been added

public void add icon ( icon icon ) { if ( icon = = null ) { return ; } icon list add ( icon ) ; }


check combine service name format the service name can ' t be blank service name = " @ @ " ; the length = 0 ; illegal service name = " group @ @ " ; the length = 1 ; illegal service name = " @ @ service name " ; the length = 2 ; legal service name = " group @ @ service name " ; the length = 2 ; legal

public static void check service name format ( string combine service name ) { string [ ] split = combine service name split ( constants service info spliter ) ; if ( split length < = 1 ) { throw new illegal argument exception ( " param ' service name ' is illegal , it should be format as ' group name @ @ service name ' " ) ; } }


get an estimated storage space used to store transaction records that will return by this iterator

long get storage size ( ) throws i o exception ;


get the next available classid this has to be released post container complete

public int get next class id ( ) throws resource handler exception { synchronized ( class id set ) { int index = class id set next clear bit ( 0 ) ; if ( index > = max container classes ) { throw new resource handler exception ( " reached max container classes : " + max container classes ) ; } class id set set ( index ) ; return ( index + min container class id ) ; } }


overridable helper method to simply call sock connect ( ) this can be overriden in tests to fake connection successfailure for connect to leader

protected void sock connect ( socket sock , inet socket address addr , int timeout ) throws i o exception { sock connect ( addr , timeout ) ; }