test that creating proxy doesn ' t ever try to dns - resolve the logical uri regression test for hdfs - 9364

public void test create proxy doesnt dns resolve logical u r i ( ) throws i o exception { final name service spy n s = spy on name service ( ) ; final configuration conf = new hdfs configuration ( ) ; final string service = " nameservice 1 " ; final string namenode = " namenode 1 1 3 " ; conf set ( d f s config keys dfs nameservices , service ) ; conf set ( file system fs default name key , " hdfs : / / " + service ) ; conf set ( hdfs client config keys failover proxy provider key prefix + " " + service , " org apache hadoop hdfs server namenode ha " + " configured failover proxy provider " ) ; conf set ( d f s config keys dfs ha namenodes key prefix + " " + service , namenode ) ; conf set ( d f s config keys dfs namenode rpc address key + " " + service + " " + namenode , " localhost : 8020 " ) ; / / call create proxy implicitly and explicitly path p = new path ( " / " ) ; p get file system ( conf ) ; name node proxies client create proxy with client protocol ( conf , file system get default uri ( conf ) , null ) ; name node proxies create proxy ( conf , file system get default uri ( conf ) , namenode protocol class , null ) ; / / ensure that the logical hostname was never resolved mockito verify ( spy n s , mockito never ( ) ) lookup all host addr ( mockito eq ( service ) ) ; }


ray - cast the world for all particles in the path of the ray your callback controls whether you get the closest point , any point , or n - points

public void raycast ( particle raycast callback particle callback , vec 2 point 1 , vec 2 point 2 ) { m particle system raycast ( particle callback , point 1 , point 2 ) ; }


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

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


returns the sasl properties resolver configured for use with data transfer protocol , or null if not configured

public sasl properties resolver get sasl props resolver ( ) { return sasl props resolver ; }


protected string extract principal id ( final credential credentials , final optional < principal > current principal ) { val ws fed credentials = ( ws federation credential ) credentials ; val attributes = ws fed credentials get attributes ( ) ; logger debug ( " credential attributes provided are : [ { } ] " , attributes ) ; val id attribute = this configuration get identity attribute ( ) ; if ( attributes contains key ( id attribute ) ) { logger debug ( " extracting principal id from attribute [ { } ] " , this configuration get identity attribute ( ) ) ; val id attribute as list = collection utils to collection ( attributes get ( this configuration get identity attribute ( ) ) ) ; if ( id attribute as list size ( ) > 1 ) { logger warn ( " found multiple values for id attribute [ { } ] " , id attribute ) ; } else { logger debug ( " found principal id attribute as [ { } ] " , id attribute as list ) ; } val result = collection utils first element ( id attribute as list ) ; if ( result is present ( ) ) { val principal id = result get ( ) to string ( ) ; logger debug ( " principal id extracted from credentials : [ { } ] " , principal id ) ; return principal id ; } } logger warn ( " credential attributes do not include an attribute for [ { } ] " + " this will prohibit cas to construct a meaningful authenticated principal " + " examine the released claims and ensure [ { } ] is allowed " , id attribute , id attribute ) ; return null ; }


overloaded version of { @ code add property value } that takes a property name and a property value note : as of spring 3 0 , we recommend using the more concise and chaining - capable variant { @ link # add }

public void add property value ( string property name , object property value ) { add property value ( new property value ( property name , property value ) ) ; }


public static void start activity ( @ non null final bundle extras , @ non null final class < ? extends activity > clz ) { context context = get top activity or app ( ) ; start activity ( context , extras , context get package name ( ) , clz get name ( ) , null ) ; }


resets the contents of sorted multiset to have entries a , c , for the navigation tests

private void reset with hole ( ) { list < e > container = new array list < e > ( ) ; container add all ( collections n copies ( a get count ( ) , a get element ( ) ) ) ; container add all ( collections n copies ( c get count ( ) , c get element ( ) ) ) ; super reset container ( get subject generator ( ) create ( container to array ( ) ) ) ; sorted multiset = ( sorted multiset < e > ) get multiset ( ) ; }


closes the given stream the same as calling { @ link output stream # close ( ) } , but errors while closing are silently ignored

public static void close silently ( output stream output stream ) { try { if ( output stream ! = null ) { output stream close ( ) ; } } catch ( i o exception ignore ) { / / exception is silently ignored } }


this run ( ) method simply sets up the default output container and adds in a data member to keep track of the number of operations that occurred

list < operation output > run ( file system fs ) { list < operation output > out = new linked list < operation output > ( ) ; out add ( new operation output ( output type long , get type ( ) , report writer op count , 1l ) ) ; return out ; }


default string service name ( ) { return application model get application ( ) ; }


public void delete pet ( long pet id , string api key , api client auth info auth info , handler < async result < void > > result handler ) { delegate delete pet ( pet id , api key , auth info , result handler ) ; }


get userlogin : logs user into the system

default response entity < string > login user ( @ not null @ api param ( value = " the user name for login " , required = true ) @ valid @ request param ( value = " username " , required = true ) string username , @ not null @ api param ( value = " the password for login in clear text " , required = true ) @ valid @ request param ( value = " password " , required = true ) string password ) { return new response entity < > ( http status not implemented ) ; }


asserts the x attrs returned by get x attrs for a specific path match an expected set of x attrs

public static void assert x attrs ( path path , file system fs , map < string , byte [ ] > expected x attrs ) throws exception { map < string , byte [ ] > x attrs = fs get x attrs ( path ) ; assert equals ( path to string ( ) , expected x attrs size ( ) , x attrs size ( ) ) ; iterator < entry < string , byte [ ] > > i = expected x attrs entry set ( ) iterator ( ) ; while ( i has next ( ) ) { entry < string , byte [ ] > e = i next ( ) ; string name = e get key ( ) ; byte [ ] value = e get value ( ) ; if ( value = = null ) { assert true ( x attrs contains key ( name ) & & x attrs get ( name ) = = null ) ; } else { assert array equals ( value , x attrs get ( name ) ) ; } } }


the position we cached is useful only when { @ code begin time ms } is > = { @ code last position second } and the index file exists and the second we cached is same as in the index file

private boolean valid position ( long begin time ms ) { if ( begin time ms / 1000 < last position second ) { return false ; } if ( last position index file name = = null ) { return false ; } / / index file dose not exits if ( ! new file ( last position index file name ) exists ( ) ) { return false ; } file input stream in = null ; try { in = new file input stream ( last position index file name ) ; in get channel ( ) position ( last position offset in index ) ; data input stream index in = new data input stream ( in ) ; / / timestamp ( second ) in the specific position = = that we cached return index in read long ( ) = = last position second ; } catch ( exception e ) { return false ; } finally { if ( in ! = null ) { try { in close ( ) ; } catch ( exception ignore ) { } } } }


test verifies that the server shouldn ' t allow minsessiontimeout greater than maxsessiontimeout

public void test with min session timeout greater than max session timeout ( ) throws exception { client base setup test env ( ) ; final int client port = port assignment unique ( ) ; final int tick time = 2000 ; final int min session timeout = 20 * tick time + 1000 ; / / min is higher final int max session timeout = tick time * 2 - 100 ; / / max is lower final string configs = " max session timeout = " + max session timeout + " \ n " + " min session timeout = " + min session timeout + " \ n " ; main thread main = new main thread ( client port , true , configs ) ; string [ ] args = new string [ 1 ] ; args [ 0 ] = main conf file to string ( ) ; try { main main initialize and run ( args ) ; fail ( " must throw exception as " + " minsessiontimeout > maxsessiontimeout " ) ; } catch ( config exception iae ) { / / expected } }


public cancellable split async ( org elasticsearch action admin indices shrink resize request resize request , request options options , action listener < org elasticsearch action admin indices shrink resize response > listener ) { return rest high level client perform request async and parse entity ( resize request , indices request converters : : split , options , org elasticsearch action admin indices shrink resize response : : from x content , listener , empty set ( ) ) ; }


make a s 3 a file status object for a directory at given path the file status only contains what s3a needs , and omits mod time since s3a uses its own implementation which returns current system time

private s 3 a file status make dir status ( string dir owner , path path ) { return new s 3 a file status ( tristate unknown , path , dir owner ) ; }


clears out the list of verification errors

public void clear verification errors ( ) { stb clear verification errors ( ) ; }


public void add pet ( pet pet ) throws timeout exception , execution exception , interrupted exception , api exception { object post body = pet ; / / verify the required parameter ' pet ' is set if ( pet = = null ) { volley error error = new volley error ( " missing the required parameter ' pet ' when calling add pet " , new api exception ( 400 , " missing the required parameter ' pet ' when calling add pet " ) ) ; } / / create path and map variables string path = " / pet " ; / / query params list < pair > query params = new array list < pair > ( ) ; / / header params map < string , string > header params = new hash map < string , string > ( ) ; / / form params map < string , string > form params = new hash map < string , string > ( ) ; string [ ] content types = { " application / json " , " application / xml " } ; string content type = content types length > 0 ? content types [ 0 ] : " application / json " ; if ( content type starts with ( " multipart / form - data " ) ) { / / file uploading multipart entity builder local var builder = multipart entity builder create ( ) ; http entity http entity = local var builder build ( ) ; post body = http entity ; } else { / / normal form params } string [ ] auth names = new string [ ] { " petstore auth " } ; try { string local var response = api invoker invoke a p i ( base path , path , " post " , query params , post body , header params , form params , content type , auth names ) ; if ( local var response ! = null ) { return ; } else { return ; } } catch ( api exception ex ) { throw ex ; } catch ( interrupted exception ex ) { throw ex ; } catch ( execution exception ex ) { if ( ex get cause ( ) instanceof volley error ) { volley error volley error = ( volley error ) ex get cause ( ) ; if ( volley error network response ! = null ) { throw new api exception ( volley error network response status code , volley error get message ( ) ) ; } } throw ex ; } catch ( timeout exception ex ) { throw ex ; } }


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

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


consider using { @ link # add ( long ) } instead for primitive long values

public void add ( long value ) { this max = math max ( this max , value ) ; }


clear all the bitmaps from the memory cache

public void evict all ( ) { cache clear ( ) ; }


sets the likelihood of a term being a misspelled even if the term exists in the dictionary the default it { @ code 0 95 } corresponding to 5 % or the real words are misspelled

public phrase suggestion builder real word error likelihood ( float real word error likelihood ) { if ( real word error likelihood < = 0 0 ) { throw new illegal argument exception ( " real word error likelihood must be > 0 0 " ) ; } this real word error likelihood = real word error likelihood ; return this ; }


asserts that for the given command , the given arguments are considered valid on windows , but invalid elsewhere

private static void assert valid arguments on windows ( fs command cmd , string args ) { if ( shell windows ) { cmd run ( args ) ; } else { assert illegal arguments ( cmd , args ) ; } }


determine if the { @ code value } ( or one of the { @ code values } ) in the supplied { @ link if profile value & # 064 ; if profile value } annotation is enabled in the current environment

private static boolean is test enabled in this environment ( profile value source profile value source , @ nullable if profile value if profile value ) { if ( if profile value = = null ) { return true ; } string environment value = profile value source get ( if profile value name ( ) ) ; string [ ] annotated values = if profile value values ( ) ; if ( string utils has length ( if profile value value ( ) ) ) { assert is true ( annotated values length = = 0 , ( ) - > " setting both the ' value ' and ' values ' attributes " + " of @ if profile value is not allowed : choose one or the other " ) ; annotated values = new string [ ] { if profile value value ( ) } ; } for ( string value : annotated values ) { if ( object utils null safe equals ( value , environment value ) ) { return true ; } } return false ; }


return a locator that points to the source of the script interpreted by the post - processor that actually creates the script typical supported locators are spring resource locations ( such as " file : c : my script bsh " or " classpath : my packagemy script bsh " ) and inline scripts ( " inline : my script text " )


returns a newly - initialized { @ link options parser impl }

public options parser impl build ( ) { return new options parser impl ( this options data , this args pre processor , this skipped prefixes , this ignore internal options , this alias flag ) ; }


creates a type by analyzing the given class it does this by using java reflection which can be supported by { @ link data type hint } annotations for nested , structured types it will throw an { @ link validation exception } in cases where the reflective extraction needs more information or simply fails see { @ link data types # of ( class ) } for further examples

< t > data type create data type ( class < t > clazz ) ;


returns an instance of this class if jaas configuration property @ link sasl configs # sasl jaas config } is specified , the configuration object is created by parsing the property value otherwise , the default configuration is returned the context name is always ` kafka client `

public static jaas context load client context ( map < string , ? > configs ) { password dynamic jaas config = ( password ) configs get ( sasl configs sasl jaas config ) ; return load ( jaas context type client , null , global context name client , dynamic jaas config ) ; }


public void notify solution set update ( ) { latch count down ( ) ; }


public swift native file system get fs ( ) { return fs ; }


byte block change manager get byte block change manager ( ) { return bbcm ; }


the number of objects available to be obtained

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


public void set begin time ( long begin time ) { this begin time = begin time ; }


public test client model oper req spec ( consumer < request spec builder > req spec customizer ) { req spec customizer accept ( req spec ) ; return this ; }


assert that the loginpass details from a uri match that expected

private s 3x login helper login assert matches login ( string user , string pass , uri uri ) { s 3x login helper login expected = new s 3x login helper login ( user , pass ) ; s 3x login helper login actual = s 3x login helper extract login details ( uri ) ; if ( ! expected equals ( actual ) ) { assert fail ( " source " + uri + " login expected = : " + to string ( expected ) + " actual = " + to string ( actual ) ) ; } return actual ; }


when all monitored jobs have completed , stop the monitoring thread upstream submitter is assumed dead

public void shutdown ( ) { synchronized ( m jobs ) { graceful = true ; shutdown = true ; } executor shutdown ( ) ; }


all the messages will be retrieved by the service executor by calling this method and process them retrieves and removes the head of this queue , or returns null if this queue is empty

public message retrieve msg ( ) { try { return blk queue poll ( ) ; } catch ( exception e ) { logger error ( e get message ( ) ) ; } return null ; }


releases the batch that this iterator iterated over this is not supposed to close the reader and its resources , but is simply a signal that this iterator is no used any more this method can be used as a hook to recyclereuse heavyweight object structures


registers a relational expression and the relational expression it became after decorrelation

frame register ( rel node rel , rel node new rel , map < integer , integer > old to new outputs , sorted map < cor def , integer > cor def outputs ) { final frame frame = new frame ( rel , new rel , cor def outputs , old to new outputs ) ; map put ( rel , frame ) ; return frame ; }


an overloaded method that uses the conversion service created at construction

public void contribute method argument ( method parameter parameter , object value , uri components builder builder , map < string , object > uri variables ) { this contribute method argument ( parameter , value , builder , uri variables , this conversion service ) ; }


internal method to set the generate to schema parameter basically we ' re generating to schema instances ( generically ) for all schemas however , if any of the contained datatypes doesn ' t have the to schema instance , we cannot generate it for its " ancestor " type this is the case with the " data aeson value " type : it doesn ' t ( and cannot ) have a swagger - compatible to schema instance so we have to detect its presence " downstream " the current schema , and if we find it we just don ' t generate any to schema instance

private void set generate to schema ( codegen model model ) { for ( codegen property var : model vars ) { if ( var data type content equals ( " value " ) | | var data type contains ( " value " ) ) { additional properties put ( " generate to schema " , false ) ; } if ( var items ! = null ) { if ( var items data type content equals ( " value " ) | | var data type contains ( " value " ) ) { additional properties put ( " generate to schema " , false ) ; } } } list < codegen model > children = model get children ( ) ; if ( children ! = null ) { for ( codegen model child : children ) { set generate to schema ( child ) ; } } }


public static int get anim id by name ( string name ) { return utils get app ( ) get resources ( ) get identifier ( name , " anim " , utils get app ( ) get package name ( ) ) ; }


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


list the statuses and block locations of the files in the given path does not guarantee to return the iterator that traverses statuses of the files in a sorted order if the path is a directory , if recursive is false , returns files in the directory ; if recursive is true , return files in the subtree rooted at the path if the path is a file , return the file ' s status and block locations

public remote iterator < located file status > list files ( final path f , final boolean recursive ) throws file not found exception , i o exception { path path = o b s common utils qualify ( this , f ) ; log debug ( " list files ( { } , { } ) " , path , recursive ) ; try { / / lookup dir triggers existence check final file status file status = get file status ( path ) ; if ( file status is file ( ) ) { / / simple case : file log debug ( " path is a file " ) ; return new o b s listing single status remote iterator ( o b s common utils to located file status ( this , file status ) ) ; } else { log debug ( " list files : doing list files of directory { } - recursive { } " , path , recursive ) ; / / directory : do a bulk operation string key = o b s common utils maybe add trailing slash ( o b s common utils path to key ( this , path ) ) ; string delimiter = recursive ? null : " / " ; log debug ( " requesting all entries under { } with delimiter ' { } ' " , key , delimiter ) ; return obs listing create located file status iterator ( obs listing create file status listing iterator ( path , o b s common utils create list objects request ( this , key , delimiter ) , o b s listing accept all , new o b s listing accept files only ( path ) ) ) ; } } catch ( obs exception e ) { throw o b s common utils translate exception ( " list files " , path , e ) ; } }


create an instance of the { @ code model m bean info support } class supplied with all jmx implementations and populates the metadata through calls to the subclass

public model m bean info get m bean info ( object managed bean , string bean key ) throws j m exception { check managed bean ( managed bean ) ; model m bean info info = new model m bean info support ( get class name ( managed bean , bean key ) , get description ( managed bean , bean key ) , get attribute info ( managed bean , bean key ) , get constructor info ( managed bean , bean key ) , get operation info ( managed bean , bean key ) , get notification info ( managed bean , bean key ) ) ; descriptor desc = info get m bean descriptor ( ) ; populate m bean descriptor ( desc , managed bean , bean key ) ; info set m bean descriptor ( desc ) ; return info ; }


creates a { @ link build info properties translator } to use for non - volatile keys

protected abstract build info properties translator create non volatile translator ( ) ;


public catalog table statistics copy ( ) { return new catalog table statistics ( this row count , this file count , this total size , this raw data size , new hash map < > ( this properties ) ) ; }


returns whether all mandatory parameters have been resolved

public final boolean is resolved ( ) { return get path parameters ( ) stream ( ) filter ( message parameter : : is mandatory ) all match ( message parameter : : is resolved ) & & get query parameters ( ) stream ( ) filter ( message parameter : : is mandatory ) all match ( message parameter : : is resolved ) ; }


load the cache from the state store called by the cache update service when the data has been reloaded

boolean load cache ( boolean force ) throws i o exception ;


construct a failed response with given exception

public static < t > command response < t > of failure ( throwable ex , t result ) { return new command response < t > ( result , false , ex ) ; }


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


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

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


public csv file line ( string line ) { out write ( line ) ; out write ( eol ) ; return this ; }


enter a parse tree produced by the { @ code numeric literal } labeled alternative in { @ link sql base parser # constant }

void enter numeric literal ( sql base parser numeric literal context ctx ) ;


returns true if the argument position corresponds to a footer

public boolean is section footer position ( int position ) { if ( is footer = = null ) { setup indices ( ) ; } return is footer [ position ] ; }


void on scroll response ( long last batch start time n s , int last batch size , scrollable hit source async response async response ) { scrollable hit source response response = async response response ( ) ; logger debug ( " [ { } ] : got scroll response with [ { } ] hits " , task get id ( ) , response get hits ( ) size ( ) ) ; if ( task is cancelled ( ) ) { logger debug ( " [ { } ] : finishing early because the task was cancelled " , task get id ( ) ) ; finish him ( null ) ; return ; } if ( / / if any of the shards failed that should abort the request ( response get failures ( ) size ( ) > 0 ) / / timeouts aren ' t shard failures but we still need to pass them back to the user | | response is timed out ( ) ) { refresh and finish ( empty list ( ) , response get failures ( ) , response is timed out ( ) ) ; return ; } long total = response get total hits ( ) ; if ( main request get max docs ( ) > 0 ) { total = min ( total , main request get max docs ( ) ) ; } worker set total ( total ) ; abstract runnable prepare bulk request runnable = new abstract runnable ( ) { @ override protected void do run ( ) throws exception { / * * it is important that the batch start time be calculated from here , scroll response to scroll response that way the time * waiting on the scroll doesn ' t count against this batch in the throttle * / prepare bulk request ( system nano time ( ) , async response ) ; } @ override public void on failure ( exception e ) { finish him ( e ) ; } } ; prepare bulk request runnable = ( abstract runnable ) thread pool get thread context ( ) preserve context ( prepare bulk request runnable ) ; worker delay prepare bulk request ( thread pool , last batch start time n s , last batch size , prepare bulk request runnable ) ; }


returns true if the data being managed by this model is of type { @ link data }

public boolean is data ( ) { return data ! = null ; }


returns the location of the start of this syntax node

public final location get start location ( ) { return locs get location ( get start offset ( ) ) ; }


sets { @ code multi window } and unsets { @ code single window }

public browser configuration options set multi window ( ) { synchronized ( options ) { options put ( multi window , " true " ) ; / / " true " string used for serialization options remove ( single window ) ; } return this ; }


approximate height of geohash tile for a specific precision in degrees

public static double lat height in degrees ( int precision ) { return precision to lat height [ precision ] ; }


sets the address of the { @ link blob server }

public void set blob server address ( inet socket address blob server address ) { server address = check not null ( blob server address ) ; }


finds the last record by the cluster parameters you can use the below way to finish a complicated query : lite pal select ( & quot ; name & quot ; ) where ( & quot ; age & gt ; ? & quot ; , & quot ; 14 & quot ; ) order ( & quot ; age & quot ; ) limit ( 10 ) offset ( 2 ) find last ( person class ) ; note that the associated models won ' t be loaded by default considering the efficiency , but you can do that by using { @ link fluent query # find last ( class , boolean ) }

public < t > t find last ( class < t > model class ) { return find last ( model class , false ) ; }


called when resuming execution after a failure and waits until the lease of the file we are resuming is free the lease of the file we are resuming writingcommitting to may still belong to the process that failed previously and whose state we are recovering

private static boolean wait until lease is revoked ( final file system fs , final path path ) throws i o exception { preconditions check state ( fs instanceof distributed file system ) ; final distributed file system dfs = ( distributed file system ) fs ; dfs recover lease ( path ) ; final deadline deadline = deadline now ( ) plus ( duration of millis ( lease timeout ) ) ; boolean is closed = dfs is file closed ( path ) ; while ( ! is closed & & deadline has time left ( ) ) { try { thread sleep ( 500l ) ; } catch ( interrupted exception e 1 ) { throw new i o exception ( " recovering the lease failed : " , e 1 ) ; } is closed = dfs is file closed ( path ) ; } return is closed ; }


public string insn comment string ( dalv insn insn , boolean note indices ) { cst literal bits value = ( cst literal bits ) ( ( cst insn ) insn ) get constant ( ) ; return literal bits comment ( value , 16 ) ; }


public method get ( int n ) { return ( method ) get 0 ( n ) ; }


protected void handle outbound message ( object msg ) { outbound messages ( ) add ( msg ) ; }


returns the list of { @ link spawn strategy } s that should be used to execute the given spawn

public list < ? extends spawn strategy > resolve ( spawn spawn , action execution context action execution context ) throws user exec exception { list < ? extends spawn strategy > strategies = action execution context get context ( spawn strategy registry class ) get strategies ( spawn , action execution context get event handler ( ) ) ; strategies = strategies stream ( ) filter ( spawn action context - > spawn action context can exec ( spawn , action execution context ) ) collect ( collectors to list ( ) ) ; if ( strategies is empty ( ) ) { string message = string format ( " no usable spawn strategy found for spawn with mnemonic % s your " + " - - spawn strategy , - - genrule strategy and / or - - strategy flags are probably too " + " strict visit https : / / github com / bazelbuild / bazel / issues / 7480 for " + " migration advice " , spawn get mnemonic ( ) ) ; throw new user exec exception ( failure detail new builder ( ) set message ( message ) set spawn ( failure details spawn new builder ( ) set code ( code no usable strategy found ) ) build ( ) ) ; } return strategies ; }


retrieve the { @ code class } of an element in the { @ code collection } the exact element for which the { @ code class } is retrieved will depend on the concrete { @ code collection } implementation

private static < e > e peek ahead ( collection < e > collection ) { iterator < e > it = collection iterator ( ) ; if ( ! it has next ( ) ) { throw new illegal state exception ( " unable to peek ahead in non - empty collection - no element found " ) ; } e value = it next ( ) ; if ( value = = null ) { throw new illegal state exception ( " unable to peek ahead in non - empty collection - only null element found " ) ; } return value ; }


sets the db access related fields in the job conf

public static void configure d b ( job conf job , string driver class , string db url ) { configure d b ( job , driver class , db url , null , null ) ; }


public restore snapshot request snapshot ( string snapshot ) { this snapshot = snapshot ; return this ; }


applies the given visitor to all type path elements

public void type path infos accept ( clazz clazz , field field , type path info visitor type path visitor ) { for ( int index = 0 ; index < type path length ; index + + ) { / / we don ' t need double dispatching here , since there is only one / / type of type path info type path visitor visit type path info ( clazz , field , this , type path [ index ] ) ; } }


check if snapshot roots are created for all existing snapshottable directories create them if not

void check and provision snapshot trash roots ( ) throws i o exception { snapshottable directory status [ ] dir status list = get snapshottable dir listing ( ) ; if ( dir status list = = null ) { return ; } for ( snapshottable directory status dir status : dir status list ) { string curr dir = dir status get full path ( ) to string ( ) ; if ( ! curr dir ends with ( path separator ) ) { curr dir + = path separator ; } string trash path = curr dir + file system trash prefix ; hdfs file status file status = get file info ( trash path , false , false , false ) ; if ( file status = = null ) { log info ( " trash doesn ' t exist for snapshottable directory { } " + " creating trash at { } " , curr dir , trash path ) ; permission status permission status = new permission status ( get remote user ( ) get short user name ( ) , null , shared trash permission ) ; mkdirs ( trash path , permission status , false ) ; } } }


converts a hex string with ' ' as wildcard characters to one that yara understands ( ' ? ' ) also makes sure all characters are uppercase

private string to yara format ( string hex string ) { return hex string replace all ( " \ \ " , " ? " ) to upper case ( ) ; }


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

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


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


this method converts dp unit to equivalent pixels , depending on device density needs utils to be initialized before usage

public static float convert dp to pixel ( float dp ) { if ( m metrics = = null ) { log e ( " m p chart lib - utils " , " utils not initialized you need to call utils init ( ) at least once before " + " calling utils convert dp to pixel ( ) otherwise conversion does not " + " take place " ) ; return dp ; } return dp * m metrics density ; }


sets the list of snapshots to be returned

public snapshots status request snapshots ( string [ ] snapshots ) { this snapshots = snapshots ; return this ; }


returns the instruction defined after the specified address or null if no instruction exists the instruction that is returned does not have to be contiguous

public final instruction get instruction after ( address address ) { return current program get listing ( ) get instruction after ( address ) ; }


test the property ' name wrapped array '

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


searches the specified list for the specified object using the binary search algorithm the list must be sorted into ascending order according to the specified comparator ( as by the { @ link collections # sort ( list , comparator ) collections sort ( list , comparator ) } method ) , prior to making this call if it is not sorted , the results are undefined if there are elements in the list which compare as equal to the key , the choice of { @ link key present behavior } decides which index is returned if no elements compare as equal to the key , the choice of { @ link key absent behavior } decides which index is returned this method runs in log ( n ) time on random - access lists , which offer near - constant - time access to each list element

public static < e > int binary search ( list < ? extends e > list , @ nullable e key , comparator < ? super e > comparator , key present behavior present behavior , key absent behavior absent behavior ) { check not null ( comparator ) ; check not null ( list ) ; check not null ( present behavior ) ; check not null ( absent behavior ) ; if ( ! ( list instanceof random access ) ) { list = lists new array list ( list ) ; } / / todo ( lowasser ) : benchmark when it ' s best to do a linear search int lower = 0 ; int upper = list size ( ) - 1 ; while ( lower < = upper ) { int middle = ( lower + upper ) > > > 1 ; int c = comparator compare ( key , list get ( middle ) ) ; if ( c < 0 ) { upper = middle - 1 ; } else if ( c > 0 ) { lower = middle + 1 ; } else { return lower + present behavior result index ( comparator , key , list sub list ( lower , upper + 1 ) , middle - lower ) ; } } return absent behavior result index ( lower ) ; }


returns a list of indices of a list of globals ; {

int [ ] get indices of globals ( list < string > globals ) { int n = globals size ( ) ; int [ ] array = new int [ n ] ; for ( int i = 0 ; i < n ; i + + ) { array [ i ] = get index of global ( globals get ( i ) ) ; } return array ; }


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

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


public int get integer ( ) { return this value ; }


test equal objects after adding multiple instances at once with a null

public void test add two equal objects at once with null ( ) { try { equals tester add equality group ( reference , equal object 1 , null ) ; fail ( " should fail on null equal object " ) ; } catch ( null pointer exception e ) { } }


set ( ) - s this tile , except it ' s synced across the network

public void set net ( block block , team team , int rotation ) { call set tile ( this , block , team , rotation ) ; }


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

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


public queue info [ ] get queues ( ) throws i o exception , interrupted exception { return client get queues ( ) ; }


sets the interpolating value value of 0 0 will produce the transform same as scale type from value of 1 0 will produce the transform same as scale type to inbetween values will produce a transform that is a linear combination between the two

public void set value ( float value ) { m interpolating value = value ; }


returns true if this is a full fetch request

public boolean is full ( ) { return ( this epoch = = initial epoch ) | | ( this epoch = = final epoch ) ; }


executes a single http operation to complete the rest operation if it fails , there may be a retry the retry count is incremented with each attempt

private boolean execute http operation ( final int retry count ) throws azure blob file system exception { abfs http operation http operation = null ; try { / / initialize the http request and open the connection http operation = new abfs http operation ( url , method , request headers ) ; increment counter ( abfs statistic connections made , 1 ) ; switch ( client get auth type ( ) ) { case custom : case o auth : log debug ( " authenticating request with o auth 2 access token " ) ; http operation get connection ( ) set request property ( http header configurations authorization , client get access token ( ) ) ; break ; case sas : / / do nothing ; the sas token should already be appended to the query string break ; case shared key : / / sign the http request log debug ( " signing request with shared key " ) ; / / sign the http request client get shared key credentials ( ) sign request ( http operation get connection ( ) , has request body ? buffer length : 0 ) ; break ; } / / dump the headers abfs io utils dump headers to debug log ( " request headers " , http operation get connection ( ) get request properties ( ) ) ; abfs client throttling intercept sending request ( operation type , abfs counters ) ; if ( has request body ) { / / http url connection requires http operation send request ( buffer , buffer offset , buffer length ) ; increment counter ( abfs statistic send requests , 1 ) ; increment counter ( abfs statistic bytes sent , buffer length ) ; } http operation process response ( buffer , buffer offset , buffer length ) ; increment counter ( abfs statistic get responses , 1 ) ; / / only increment bytes received counter when the status code is 2xx if ( http operation get status code ( ) > = http u r l connection http ok & & http operation get status code ( ) < = http u r l connection http partial ) { increment counter ( abfs statistic bytes received , http operation get bytes received ( ) ) ; } } catch ( unknown host exception ex ) { string hostname = null ; if ( http operation ! = null ) { hostname = http operation get host ( ) ; } log warn ( " unknown host name : % s retrying to resolve the host name " , hostname ) ; if ( ! client get retry policy ( ) should retry ( retry count , - 1 ) ) { throw new invalid abfs rest operation exception ( ex ) ; } return false ; } catch ( i o exception ex ) { if ( log is debug enabled ( ) ) { if ( http operation ! = null ) { log debug ( " http request failure : " + http operation to string ( ) , ex ) ; } else { log debug ( " http request failure : " + method + " , " + url , ex ) ; } } if ( ! client get retry policy ( ) should retry ( retry count , - 1 ) ) { throw new invalid abfs rest operation exception ( ex ) ; } / / once http exception is thrown by azure a d authenticator , / / it indicates the policy in azure a d authenticator determined / / retry is not needed if ( ex instanceof http exception ) { throw new abfs rest operation exception ( ( http exception ) ex ) ; } return false ; } finally { abfs client throttling intercept update metrics ( operation type , http operation ) ; } log debug ( " http request : { } : { } " , operation type , http operation to string ( ) ) ; if ( client get retry policy ( ) should retry ( retry count , http operation get status code ( ) ) ) { return false ; } result = http operation ; return true ; }


public string get storage type ( ) { return storage type ; }


establish a connection to a remote server

public i connection connect ( string storm id , string host , int port ) { i connection client = new client ( storm conf , host , port ) ; connections add ( client ) ; return client ; }


public static void put ( @ non null final string key , final j s o n object value , final int save time , @ non null final cache double utils cache double utils ) { cache double utils put ( key , value , save time ) ; }


read in the file using positioned read ( offset ) calls

public void test 040 positioned read huge file ( ) throws throwable { assume huge file exists ( ) ; final string encryption = get conf ( ) get trimmed ( server side encryption algorithm ) ; boolean encrypted = encryption ! = null ; if ( encrypted ) { log info ( " file is encrypted with algorithm { } " , encryption ) ; } string filetype = encrypted ? " encrypted file " : " file " ; describe ( " positioned reads of % s % s " , filetype , hugefile ) ; s 3 a file system fs = get file system ( ) ; file status status = fs get file status ( hugefile ) ; long size = status get len ( ) ; int ops = 0 ; final int buffer size = 8192 ; byte [ ] buffer = new byte [ buffer size ] ; long eof = size - 1 ; contract test utils nano timer timer = new contract test utils nano timer ( ) ; contract test utils nano timer read at byte 0 , read at byte 0 again , read at e o f ; try ( f s data input stream in = fs open ( hugefile , upload block size ) ) { read at byte 0 = new contract test utils nano timer ( ) ; in read fully ( 0 , buffer ) ; read at byte 0 end ( " time to read data at start of file " ) ; ops + + ; read at e o f = new contract test utils nano timer ( ) ; in read fully ( eof - buffer size , buffer ) ; read at e o f end ( " time to read data at end of file " ) ; ops + + ; read at byte 0 again = new contract test utils nano timer ( ) ; in read fully ( 0 , buffer ) ; read at byte 0 again end ( " time to read data at start of file again " ) ; ops + + ; log info ( " final stream state : { } " , in ) ; } long mb = math max ( size / 1mb , 1 ) ; log f s state ( ) ; timer end ( " time to perform positioned reads of % s of % d mb " , filetype , mb ) ; log info ( " time per positioned read = { } n s " , to human ( timer nanos per operation ( ops ) ) ) ; }


public double [ ] get column ( int col ) { assert ( col > = 0 & & col < n ) : " invalid column index " ; double [ ] column data = new double [ m ] ; system arraycopy ( this data , col * m , column data , 0 , m ) ; return column data ; }


builds a queue placement policy from a xml element

static void from xml ( element conf element , fair scheduler fs ) throws allocation configuration exception { log debug ( " reloading placement policy from allocation config " ) ; if ( conf element = = null | | ! conf element has child nodes ( ) ) { throw new allocation configuration exception ( " empty configuration for queue placement policy is not allowed " ) ; } list < placement rule > new rules = new array list < > ( ) ; list < boolean > new terminal state = new array list < > ( ) ; node list elements = conf element get child nodes ( ) ; for ( int i = 0 ; i < elements get length ( ) ; i + + ) { node node = elements item ( i ) ; if ( node instanceof element & & node get node name ( ) equals ignore case ( " rule " ) ) { string name = ( ( element ) node ) get attribute ( " name " ) ; log debug ( " creating new rule : { } " , name ) ; placement rule rule = create rule ( ( element ) node ) ; / / the only child node that we currently know is a parent rule placement rule parent rule = null ; string parent name = null ; element child = get parent rule element ( node ) ; if ( child ! = null ) { parent name = child get attribute ( " name " ) ; parent rule = get parent rule ( child , fs ) ; } / / need to make sure that the nested user queue has a parent for / / backwards compatibility if ( name equals ignore case ( " nested user queue " ) & & parent rule = = null ) { throw new allocation configuration exception ( " rule ' " + name + " ' must have a parent rule set " ) ; } new rules add ( rule ) ; if ( parent rule = = null ) { new terminal state add ( get terminal ( rules get ( name ) terminal , rule ) ) ; } else { ( ( f s placement rule ) rule ) set parent rule ( parent rule ) ; new terminal state add ( get terminal ( rules get ( name ) terminal , rule ) & & get terminal ( rules get ( parent name ) terminal , parent rule ) ) ; } } } update rule set ( new rules , new terminal state , fs ) ; }


notifies the decode loop if there exists a queued input buffer and an available output buffer to decode into should only be called whilst synchronized on the lock object

private void maybe notify decode loop ( ) { if ( can decode buffer ( ) ) { lock notify ( ) ; } }


appends the node to the tail of the list

public void append to tail ( node head ) { node tail = head prev ; head prev = this ; tail next = this ; next = head ; prev = tail ; }


reads a constant class , constant string , constant method type , constant module or constant package constant pool entry in { @ link # class file buffer } this method is intended for { @ link attribute } sub classes , and is normally not needed by class generators or adapters

private string read stringish ( final int offset , final char [ ] char buffer ) { / / get the start offset of the cp info structure ( plus one ) , and read the constant utf 8 entry / / designated by the first two bytes of this cp info return read u t f 8 ( cp info offsets [ read unsigned short ( offset ) ] , char buffer ) ; }


returns an immutable list with all alternative snapshots to restore the raw operator state , in the order in which we should attempt to restore

public list < state object collection < operator state handle > > get prioritized raw operator state ( ) { return prioritized raw operator state ; }


validate the name for an index against some static rules and a cluster state

public void validate index name ( string index , cluster state state ) { validate index or alias name ( index , invalid index name exception : : new ) ; if ( ! index to lower case ( locale root ) equals ( index ) ) { throw new invalid index name exception ( index , " must be lowercase " ) ; } / / note : dot - prefixed index names are validated after template application , not here if ( state routing table ( ) has index ( index ) ) { throw new resource already exists exception ( state routing table ( ) index ( index ) get index ( ) ) ; } if ( state metadata ( ) has index ( index ) ) { throw new resource already exists exception ( state metadata ( ) index ( index ) get index ( ) ) ; } if ( state metadata ( ) has alias ( index ) ) { throw new invalid index name exception ( index , " already exists as alias " ) ; } }


test 3 : check that simple versioned writable throws an exception

public void test simple versioned writable mismatch ( ) throws exception { test versioned writable test versioned writable ( new simple versioned writable ( ) , new simple versioned writable v 2 ( ) ) ; }


returns number of shards that should be used for routing by default this method will return the number of shards for this index

public int get routing num shards ( ) { return routing num shards = = null ? number of shards ( ) : routing num shards ; }


return the ( potentially null ) error description as per < a href = " https : tools ietf orghtmlrfc 6 7 4 9 # section - 5 2 " > rfc 6749 : the o auth 2 0 authorization framework

public string error description ( ) { return error description ; }


returns the admin interface - specific section of the configuration file

public admin factory get admin factory ( ) { return admin ; }


adds the given functions to an existing comparison provider

public void compare functions ( function source , function target , function comparison provider provider ) { if ( provider = = null ) { return ; } providers add ( provider ) ; provider set visible ( true ) ; provider get model ( ) compare functions ( source , target ) ; }


when the request resources is the first in a stream , the initial resource versions must be populated otherwise , initial resource versions must be omitted the keys are the resources names of the mcp resources known to the mcp client the values in the map are the associated resource level version info < code > map & lt ; string , string & gt ; initial resource versions = 3 ; < code >

public builder put all initial resource versions ( java util map < java lang string , java lang string > values ) { internal get mutable initial resource versions ( ) get mutable map ( ) put all ( values ) ; return this ; }


public static < t extends agent typed s p i > t get registered service ( final class < t > typed s p i class , final string type ) { optional < t > service instance = agent service loader get service loader ( typed s p i class ) new service instances ( ) stream ( ) filter ( each - > each get type ( ) equals ignore case ( type ) ) find first ( ) ; if ( service instance is present ( ) ) { return service instance get ( ) ; } throw new agent service provider not found exception ( typed s p i class , type ) ; }


create a new file or overwrite an existing file < br > once the file is create the client then allocates a new block with the next call using { @ link client protocol # add block } for description of parameters and exceptions thrown see { @ link client protocol # create }

static hdfs file status start file ( f s namesystem fsn , i nodes in path iip , permission status permissions , string holder , string client machine , enum set < create flag > flag , boolean create parent , short replication , long block size , file encryption info fe info , i node blocks map update info to remove blocks , boolean should replicate , string ec policy name , string storage policy , boolean log retry entry ) throws i o exception { assert fsn has write lock ( ) ; boolean overwrite = flag contains ( create flag overwrite ) ; boolean is lazy persist = flag contains ( create flag lazy persist ) ; final string src = iip get path ( ) ; f s directory fsd = fsn get f s directory ( ) ; if ( iip get last i node ( ) ! = null ) { if ( overwrite ) { list < i node > to remove i nodes = new chunked array list < > ( ) ; list < long > to remove u c files = new chunked array list < > ( ) ; long ret = f s dir delete op delete ( fsd , iip , to remove blocks , to remove i nodes , to remove u c files , now ( ) ) ; if ( ret > = 0 ) { iip = i nodes in path replace ( iip , iip length ( ) - 1 , null ) ; f s dir delete op incr deleted file count ( ret ) ; fsn remove leases and i nodes ( to remove u c files , to remove i nodes , true ) ; } } else { / / if lease soft limit time is expired , recover the lease fsn recover lease internal ( f s namesystem recover lease op create file , iip , src , holder , client machine , false ) ; throw new file already exists exception ( src + " for client " + client machine + " already exists " ) ; } } fsn check fs object limit ( ) ; i node file new node = null ; i nodes in path parent = f s dir mkdir op create ancestor directories ( fsd , iip , permissions ) ; if ( parent ! = null ) { iip = add file ( fsd , parent , iip get last local name ( ) , permissions , replication , block size , holder , client machine , should replicate , ec policy name , storage policy ) ; new node = iip ! = null ? iip get last i node ( ) as file ( ) : null ; } if ( new node = = null ) { throw new i o exception ( " unable to add " + src + " to namespace " ) ; } fsn lease manager add lease ( new node get file under construction feature ( ) get client name ( ) , new node get id ( ) ) ; if ( fe info ! = null ) { f s dir encryption zone op set file encryption info ( fsd , iip , fe info , x attr set flag create ) ; } set new i node storage policy ( fsd get block manager ( ) , iip , is lazy persist ) ; fsd get edit log ( ) log open file ( src , new node , overwrite , log retry entry ) ; if ( name node state change log is debug enabled ( ) ) { name node state change log debug ( " dir * name system start file : added " + src + " inode " + new node get id ( ) + " " + holder ) ; } return f s dir stat and listing op get file info ( fsd , iip , false , false ) ; }


return whether this holder currently has a { @ link connection }

protected boolean has connection ( ) { return ( this current connection ! = null ) ; }


get the { @ link annotation } from the specified { @ link annotated element the annotated element } and { @ link annotation annotation } class name

static < a extends annotation > a get annotation ( annotated element annotated element , string annotation class name ) throws class cast exception { class < ? extends annotation > annotation type = resolve annotation type ( annotated element , annotation class name ) ; if ( annotation type = = null ) { return null ; } return ( a ) annotated element get annotation ( annotation type ) ; }


puts a shared element to transitions and names

private void map shared element ( list < string > names , map < string , view > shared elements , view view ) { string transition name = view get transition name ( ) ; names add ( transition name ) ; shared elements put ( transition name , view ) ; }


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

public void test group parameters test ( ) throws api exception { integer required string group = null ; boolean required boolean group = null ; long required int 6 4 group = null ; integer string group = null ; boolean boolean group = null ; long int 6 4 group = null ; api test group parameters ( required string group , required boolean group , required int 6 4 group ) string group ( string group ) boolean group ( boolean group ) int 6 4 group ( int 6 4 group ) execute ( ) ; / / todo : test validations }


public void setup ( ) throws exception { mockito annotations init mocks ( this ) ; http 2 frame writer configuration configuration = mock ( http 2 frame writer configuration class ) ; http 2 frame size policy frame size policy = mock ( http 2 frame size policy class ) ; when ( writer configuration ( ) ) then return ( configuration ) ; when ( configuration frame size policy ( ) ) then return ( frame size policy ) ; when ( frame size policy max frame size ( ) ) then return ( default max frame size ) ; when ( writer write data ( any ( channel handler context class ) , any int ( ) , any ( byte buf class ) , any int ( ) , any boolean ( ) , any ( channel promise class ) ) ) then answer ( success answer ( ) ) ; when ( writer write rst stream ( eq ( ctx ) , any int ( ) , any long ( ) , any ( channel promise class ) ) ) then answer ( success answer ( ) ) ; when ( writer write go away ( any ( channel handler context class ) , any int ( ) , any long ( ) , any ( byte buf class ) , any ( channel promise class ) ) ) then answer ( success answer ( ) ) ; connection = new default http 2 connection ( false ) ; connection remote ( ) flow controller ( new default http 2 remote flow controller ( connection ) ) ; connection local ( ) flow controller ( new default http 2 local flow controller ( connection ) frame writer ( writer ) ) ; default http 2 connection encoder default encoder = new default http 2 connection encoder ( connection , writer ) ; encoder = new stream buffering encoder ( default encoder ) ; default http 2 connection decoder decoder = new default http 2 connection decoder ( connection , encoder , mock ( http 2 frame reader class ) ) ; http 2 connection handler handler = new http 2 connection handler builder ( ) frame listener ( mock ( http 2 frame listener class ) ) codec ( decoder , encoder ) build ( ) ; / / set life cycle manager on encoder and decoder when ( ctx channel ( ) ) then return ( channel ) ; when ( ctx alloc ( ) ) then return ( unpooled byte buf allocator default ) ; when ( channel alloc ( ) ) then return ( unpooled byte buf allocator default ) ; when ( executor in event loop ( ) ) then return ( true ) ; do answer ( new answer < channel promise > ( ) { @ override public channel promise answer ( invocation on mock invocation ) throws throwable { return new promise ( ) ; } } ) when ( ctx ) new promise ( ) ; when ( ctx executor ( ) ) then return ( executor ) ; when ( channel is active ( ) ) then return ( false ) ; when ( channel config ( ) ) then return ( config ) ; when ( channel is writable ( ) ) then return ( true ) ; when ( channel bytes before unwritable ( ) ) then return ( long max value ) ; when ( config get write buffer high water mark ( ) ) then return ( integer max value ) ; when ( config get message size estimator ( ) ) then return ( default message size estimator default ) ; channel metadata metadata = new channel metadata ( false , 16 ) ; when ( channel metadata ( ) ) then return ( metadata ) ; when ( channel unsafe ( ) ) then return ( unsafe ) ; handler handler added ( ctx ) ; }


get initial component token map to be substituted into config values

public static map < string , string > init comp tokens for substitute ( component instance instance , container container , container launch service component launch context component launch context ) { map < string , string > tokens = new hash map < > ( ) ; tokens put ( component name , component launch context get name ( ) ) ; tokens put ( component name lc , component launch context get name ( ) to lower case ( ) ) ; tokens put ( component instance name , instance get comp instance name ( ) ) ; tokens put ( container id , container get id ( ) to string ( ) ) ; tokens put ( component id , string value of ( instance get comp instance id ( ) get id ( ) ) ) ; tokens put all ( instance get component ( ) get dependency host ip tokens ( ) ) ; return tokens ; }


create hive columns from flink table schema

public static list < field schema > create hive columns ( table schema schema ) { string [ ] field names = schema get field names ( ) ; data type [ ] field types = schema get field data types ( ) ; list < field schema > columns = new array list < > ( field names length ) ; for ( int i = 0 ; i < field names length ; i + + ) { columns add ( new field schema ( field names [ i ] , hive type util to hive type info ( field types [ i ] , true ) get type name ( ) , null ) ) ; } return columns ; }


byte buffer implementation of { @ link # decode list ( byte [ ] ) } note : only use this when it is ok to modify the underlying { @ link byte buffer # array ( ) }

public abstract list < span > decode list ( byte buffer spans ) ;


ensure the configured temp directory is a valid directory

public void validate tmp file ( ) throws i o exception { if ( files exists ( tmp file ) = = false ) { throw new file not found exception ( " temporary file directory [ " + tmp file + " ] does not exist or is not accessible " ) ; } if ( files is directory ( tmp file ) = = false ) { throw new i o exception ( " configured temporary file directory [ " + tmp file + " ] is not a directory " ) ; } }


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

public void nacos add listener 2 ( ) throws exception { iconfig add listener ( data id , group , null ) ; }


meta attribute ( obtained from result set )

public d b c attribute meta data get meta attribute ( ) { return this ; }


evaluates whether the argument is an i pv 6 " compat " address an " i pv 4 compatible " , or " compat " , address is one with 96 leading bits of zero , with the remaining 32 bits interpreted as an i pv 4 address these are conventionally represented in string literals as { @ code " : : 192 168 0 1 " } , though { @ code " : : c 0a 8 : 1 " } is also considered an i pv 4 compatible address ( and equivalent to { @ code " : : 192 168 0 1 " } ) for more on i pv 4 compatible addresses see section 2 5 5 1 of < a target = " parent " href = " http : tools ietf orghtmlrfc 4 2 9 1 # section - 2 5 5 1 " > rfc 4291 note : this method is different from { @ link inet 6 address # is i pv 4 compatible address } in that it more correctly classifies { @ code " : : " } and { @ code " : : 1 " } as proper i pv 6 addresses ( which they are ) , not i pv 4 compatible addresses ( which they are generally not considered to be )

public static boolean is compat i pv 4 address ( inet 6 address ip ) { if ( ! ip is i pv 4 compatible address ( ) ) { return false ; } byte [ ] bytes = ip get address ( ) ; if ( ( bytes [ 12 ] = = 0 ) & & ( bytes [ 13 ] = = 0 ) & & ( bytes [ 14 ] = = 0 ) & & ( ( bytes [ 15 ] = = 0 ) | | ( bytes [ 15 ] = = 1 ) ) ) { return false ; } return true ; }


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

public void delete user ( @ path param ( " username " ) string username ) ;


implements the checksum verification logic with fallback to weaker algorithm for { @ link download job }

/ * package * / static void verify checksums ( with computed checksums job , update site entry entry , file file ) throws i o exception { verification result result 5 1 2 = verify checksums ( entry get sha 5 1 2 ( ) , job get computed s h a 5 1 2 ( ) , false ) ; switch ( result 5 1 2 ) { case pass : / / this has passed so no reason to check the weaker checksums return ; case fail : throw verification failure ( entry get sha 5 1 2 ( ) , job get computed s h a 5 1 2 ( ) , file , " sha - 512 " ) ; break ; case not computed : logger log ( warning , " attempt to verify a downloaded file ( " + file get name ( ) + " ) using sha - 512 failed since it could not be computed falling back to weaker algorithms update your jre " ) ; break ; case not provided : break ; default : throw new illegal state exception ( " unexpected value : " + result 5 1 2 ) ; } verification result result 2 5 6 = verify checksums ( entry get sha 2 5 6 ( ) , job get computed s h a 2 5 6 ( ) , false ) ; switch ( result 2 5 6 ) { case pass : return ; case fail : throw verification failure ( entry get sha 2 5 6 ( ) , job get computed s h a 2 5 6 ( ) , file , " sha - 256 " ) ; break ; case not computed : case not provided : break ; default : throw new illegal state exception ( " unexpected value : " + result 2 5 6 ) ; } if ( result 5 1 2 = = verification result not provided & & result 2 5 6 = = verification result not provided ) { logger log ( info , " attempt to verify a downloaded file ( " + file get name ( ) + " ) using sha - 512 or sha - 256 failed since your configured update site does not provide either of those checksums falling back to sha - 1 " ) ; } verification result result 1 = verify checksums ( entry get sha 1 ( ) , job get computed s h a 1 ( ) , true ) ; switch ( result 1 ) { case pass : return ; case fail : throw verification failure ( entry get sha 1 ( ) , job get computed s h a 1 ( ) , file , " sha - 1 " ) ; break ; case not computed : throw new i o exception ( " failed to compute sha - 1 of downloaded file , refusing installation " ) ; case not provided : throw new i o exception ( " unable to confirm integrity of downloaded file , refusing installation " ) ; } }


retrieve the given column as binary stream from the given result set might simply invoke { @ code result set get ascii stream } or work with { @ code sqlxml } or database - specific classes depending on the database and driver

input stream get xml as binary stream ( result set rs , int column index ) throws s q l exception ;


public boolean set progress ( float progress ) { return super set progress ( progress ) ; }


public synchronized type id item intern ( type type ) { if ( type = = null ) { throw new null pointer exception ( " type = = null " ) ; } throw if prepared ( ) ; type id item result = type ids get ( type ) ; if ( result = = null ) { result = new type id item ( new cst type ( type ) ) ; type ids put ( type , result ) ; } return result ; }


returns < tt > true < tt > if all splits for the requested driver group have been returned in other hands , splits returned from this and all previous invocations of { @ link # get next batch } form the complete set of splits in the requested driver group

public boolean is last batch ( ) { return last batch ; }


used during debugging mock test failures ; cranks up logging of method calls

private void set mock log level ( int level ) { wrapper f s set log events ( level ) ; }


{ @ link com alibaba nacos core code spring application run listener # context loaded }

void context prepared ( configurable application context context ) ;


{ @ inherit doc } the default implementation does nothing

@ override public void enter time unit ( eql base parser time unit context ctx ) { }


whether has one of the specified border styles

public boolean has ( int border array ) { if ( null = = border array ) { return false ; } for ( int b : border array ) { if ( ( this borders & b ) = = b ) { return true ; } } return false ; }


public void set client info ( string name , string value ) throws s q l client info exception { }


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

public string get name ( ) { return name ; }


re - encrypts the given encryption zone path if the given path is not the root of an encryption zone , an exception is thrown

list < x attr > reencrypt encryption zone ( final i nodes in path zone i i p , final string key version name ) throws i o exception { assert dir has write lock ( ) ; if ( reencryption handler = = null ) { throw new i o exception ( " no key provider configured , re - encryption " + " operation is rejected " ) ; } final list < x attr > x attrs = lists new array list with capacity ( 1 ) ; final i node inode = zone i i p get last i node ( ) ; final string zone name = zone i i p get path ( ) ; check encryption zone root ( inode , zone name ) ; if ( get reencryption status ( ) has running zone ( inode get id ( ) ) ) { throw new i o exception ( " zone " + zone name + " is already submitted for re - encryption " ) ; } log info ( " zone { } ( { } ) is submitted for re - encryption " , zone name , inode get id ( ) ) ; final x attr xattr = f s dir encryption zone op update reencryption submitted ( dir , zone i i p , key version name ) ; x attrs add ( xattr ) ; reencryption handler notify new submission ( ) ; return x attrs ; }


determines whether the given crl is expired by comparing the next update field with a given date

public static boolean is expired ( final x509crl crl , final zoned date time reference ) { return reference is after ( date time utils zoned date time of ( crl get next update ( ) ) ) ; }


attempts to retrieve the string - keyed dict named { @ code dict name } from the given { @ code module }

private static immutable map < string , object > get dict ( module module , string dict name ) throws eval exception { object value = module get global ( dict name ) ; if ( value = = null ) { throw starlark errorf ( " expected a ' % s ' dictionary to be defined " , dict name ) ; } return immutable map copy of ( dict cast ( value , string class , object class , dict name + " dict " ) ) ; }


public void remove ( @ non null final string key ) { remove ( key , false ) ; }


register a { @ link leaf reader } this is necessary so that the core cache key of this reader can be found later using { @ link # get core keys for index ( string ) }

public void add ( leaf reader reader ) { final shard id shard id = shard utils extract shard id ( reader ) ; if ( shard id = = null ) { throw new illegal argument exception ( " could not extract shard id from " + reader ) ; } final index reader cache helper cache helper = reader get core cache helper ( ) ; if ( cache helper = = null ) { throw new illegal argument exception ( " reader " + reader + " does not support caching " ) ; } final index reader cache key core key = cache helper get key ( ) ; if ( core key to shard contains key ( core key ) ) { / / do this check before entering the synchronized block in order to / / avoid taking the mutex if possible ( which should happen most of / / the time ) return ; } final string index = shard id get index name ( ) ; synchronized ( this ) { if ( core key to shard contains key ( core key ) = = false ) { set < index reader cache key > objects = index to core key get ( index ) ; if ( objects = = null ) { objects = new hash set < > ( ) ; index to core key put ( index , objects ) ; } final boolean added = objects add ( core key ) ; assert added ; index reader closed listener listener = owner core cache key - > { assert core key = = owner core cache key ; synchronized ( shard core key map this ) { core key to shard remove ( owner core cache key ) ; final set < index reader cache key > core keys = index to core key get ( index ) ; final boolean removed = core keys remove ( core key ) ; assert removed ; if ( core keys is empty ( ) ) { index to core key remove ( index ) ; } } } ; boolean added listener = false ; try { cache helper add closed listener ( listener ) ; added listener = true ; / / only add the core key to the map as a last operation so that / / if another thread sees that the core key is already in the / / map ( like the check just before this synchronized block ) , / / then it means that the closed listener has already been / / registered shard id previous = core key to shard put ( core key , shard id ) ; assert previous = = null ; } finally { if ( false = = added listener ) { try { listener on close ( core key ) ; } catch ( i o exception e ) { throw new runtime exception ( " blow up trying to recover from failure to add listener " , e ) ; } } } } } }


return { @ code true } if { @ code sun misc unsafe } was found on the classpath and can be used for accelerated direct memory access

public static boolean has unsafe ( ) { return unsafe unavailability cause = = null ; }


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


switch the using database to default with configuration by litepal xml

public static void use default ( ) { synchronized ( lite pal support class ) { lite pal attr clear instance ( ) ; connector clear lite pal open helper instance ( ) ; } }


public void 1 2 3number test ( ) { / / todo : test 1 2 3number }


converts this { @ link timestamp data } object to a { @ link instant }

public instant to instant ( ) { long epoch second = millisecond / 1000 ; int milli of second = ( int ) ( millisecond % 1000 ) ; if ( milli of second < 0 ) { - - epoch second ; milli of second + = 1000 ; } long nano adjustment = milli of second * 1 000 000 + nano of millisecond ; return instant of epoch second ( epoch second , nano adjustment ) ; }


creates a new float buffer by wrapping the given float array calling this method has the same effect as { @ code wrap ( array , 0 , array length ) }

public static float buffer wrap ( float [ ] array ) { return wrap ( array , 0 , array length ) ; }


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


sets the settings and mappings as a single source note that the mapping definition should not be nested under a type name

public create index request source ( bytes reference source , x content type x content type ) { objects require non null ( x content type ) ; source ( x content helper convert to map ( source , false , x content type ) v 2 ( ) ) ; return this ; }


gets the high state value of the catches , if there is one , in the try block map entry indicated by the ordinal

public int get catch high ( int try block ordinal ) throws invalid data type exception { check validity ( try block ordinal ) ; data type dt = get data type ( ) ; mem buffer specific mem buffer = get specific mem buffer ( try block ordinal , dt ) ; / / component 2 is the high state value of the catches return e h data type utilities get e h state value ( dt , catch high ordinal , specific mem buffer ) ; }


{ @ inherit doc } because a { @ code set multimap } has unique values for a given key , this method returns a { @ link set } , instead of the { @ link java util collection } specified in the { @ link multimap } interface


configure the instance of { @ link consumed } with a value { @ link serde }

public consumed < k , v > with value serde ( final serde < v > value serde ) { this value serde = value serde ; return this ; }


decodes an { @ link inet address } from an a or aaaa { @ link dns raw record }

static inet address decode address ( dns record record , string name , boolean decode idn ) { if ( ! ( record instanceof dns raw record ) ) { return null ; } final byte buf content = ( ( byte buf holder ) record ) content ( ) ; final int content len = content readable bytes ( ) ; if ( content len ! = inaddrsz4 & & content len ! = inaddrsz6 ) { return null ; } final byte [ ] addr bytes = new byte [ content len ] ; content get bytes ( content reader index ( ) , addr bytes ) ; try { return inet address get by address ( decode idn ? idn to unicode ( name ) : name , addr bytes ) ; } catch ( unknown host exception e ) { / / should never reach here throw new error ( e ) ; } }


sets a size multiplier that will be applied to the size provided in the constructor to put the new size of the cache if the new size is less than the current size , entries will be evicted until the current size is less than or equal to the new size

public synchronized void set size multiplier ( float multiplier ) { if ( multiplier < 0 ) { throw new illegal argument exception ( " multiplier must be > = 0 " ) ; } max size = math round ( initial max size * multiplier ) ; evict ( ) ; }


derive properties to be passed to the { @ code flink kinesis producer }

public static properties get producer properties ( map < string , string > table options ) { properties properties = new properties ( ) ; for ( map entry < string , string > entry : table options entry set ( ) ) { string source key = entry get key ( ) ; string source val = entry get value ( ) ; if ( ! table level options contains ( source key ) ) { if ( source key starts with ( aws properties prefix ) ) { properties put ( translate aws key ( source key ) , source val ) ; } else if ( source key starts with ( producer prefix ) ) { properties put ( translate producer key ( source key ) , source val ) ; } } } return properties ; }


deactivate throttling , which switches the lock to be an always - acquirable no op lock

public void deactivate ( ) { assert lock ! = noop lock : " throttling deactivated but not active " ; lock = noop lock ; assert start of throttle n s > 0 : " bad state of start of throttle n s " ; long throttle time n s = system nano time ( ) - start of throttle n s ; if ( throttle time n s > = 0 ) { / / paranoia ( system nano time ( ) is supposed to be monotonic ) : time slip may have occurred but never want / / to add a negative number throttle time millis metric inc ( time value nsec to m sec ( throttle time n s ) ) ; } }


writes the values of the snapshot to the given stream

public abstract void dump ( output stream output ) ;


resolves relative symlinks and puts them in the { @ code entries } map note that { @ code relative links } should only contain entries in { @ link relative symlink behavior # resolve } or { @ link relative symlink behavior # resolve fully } mode

private static void resolve relative symlinks ( map < path fragment , string > entries , map < path fragment , string > relative links , boolean absolute , relative symlink behavior rel symlink behavior ) throws i o exception { if ( rel symlink behavior = = relative symlink behavior resolve fully & & ! relative links is empty ( ) ) { fully resolve relative symlinks ( entries , relative links , absolute ) ; } else if ( rel symlink behavior = = relative symlink behavior resolve ) { for ( map entry < path fragment , string > e : relative links entry set ( ) ) { path fragment location = e get key ( ) ; string value = e get value ( ) ; string actual = preconditions check not null ( value , e ) ; preconditions check state ( ! actual starts with ( " / " ) , e ) ; path fragment actual location = location ; / / recursively resolve relative symlinks linked hash set < string > seen = new linked hash set < > ( ) ; int traversals = 0 ; do { actual location = actual location get parent directory ( ) get relative ( actual ) ; actual = relative links get ( actual location ) ; } while ( + + traversals < = max symlink traversals & & actual ! = null & & seen add ( actual ) ) ; if ( traversals > = max symlink traversals ) { logger at warning ( ) log ( " symlink % s is part of a chain of length at least % d " + " which exceeds blaze ' s maximum allowable symlink chain length " , location , traversals ) ; } else if ( actual ! = null ) { / / todo ( b / 113128395 ) : throw here logger at warning ( ) log ( " symlink % s forms a symlink cycle : % s " , location , seen ) ; } else if ( ! entries contains key ( actual location ) ) { / / we ' ve found a relative symlink that points out of the fileset we should really always / / throw here , but current behavior is that we tolerate such symlinks when they occur in / / runfiles , which is the only time this code is hit / / todo ( b / 113128395 ) : throw here logger at warning ( ) log ( " symlink % s ( transitively ) points to % s " + " that is not in this fileset ( or was pruned because of a cycle ) " , location , actual location ) ; } else { / / we have successfully resolved the symlink entries put ( location , entries get ( actual location ) ) ; } } } }


public void to string test ( ) { branch register request branch register request = new branch register request ( ) ; branch register request set xid ( " 127 0 0 1 : 8091 : 1249853 " ) ; branch register request set branch type ( branch type at ) ; branch register request set resource id ( " resource 1 " ) ; branch register request set lock key ( " lock key 1 " ) ; assertions assert equals ( " xid = 127 0 0 1 : 8091 : 1249853 , branch type = at , resource id = resource 1 , lock key = lock key 1 " , branch register request to string ( ) ) ; }


public nodes info request builder set settings ( boolean settings ) { add or remove metric ( settings , nodes info request metric settings ) ; return this ; }


mocks the asynchronous request execution by calling the { @ link # mock perform request ( request ) } method

private void mock perform request async ( request request , response listener response listener ) { try { response listener on success ( mock perform request ( request ) ) ; } catch ( i o exception e ) { response listener on failure ( e ) ; } return null ; }


tests that track selector will prefer audio tracks with lower channel count over tracks with lower sample rate when other factors are the same , and tracks are within renderer ' s capabilities

public void select tracks exceeding capabilities prefer lower num channel before sample rate ( ) throws exception { format builder format builder = audio format build upon ( ) ; format lower channel higher sample rate format = format builder set channel count ( 2 ) set sample rate ( 44100 ) build ( ) ; format higher channel lower sample rate format = format builder set channel count ( 6 ) set sample rate ( 22050 ) build ( ) ; track group array track groups = wrap formats ( higher channel lower sample rate format , lower channel higher sample rate format ) ; track selector result result = track selector select tracks ( new renderer capabilities [ ] { all audio format exceeded renderer capabilities } , track groups , period id , timeline ) ; assert fixed selection ( result selections get ( 0 ) , track groups , lower channel higher sample rate format ) ; }


returns the set of all options ( including those inherited directly and transitively ) for this abstract command ' s @ command annotation why does metaprogramming always seem like such a bright idea in the beginning ?

public static immutable list < class < ? extends options base > > get options ( class < ? extends blaze command > clazz , iterable < blaze module > modules , configured rule class provider rule class provider ) { command command annotation = clazz get annotation ( command class ) ; if ( command annotation = = null ) { throw new illegal state exception ( " @ command missing for " + clazz get name ( ) ) ; } set < class < ? extends options base > > options = new hash set < > ( ) ; options add all ( get common options ( modules ) ) ; collections add all ( options , command annotation options ( ) ) ; if ( command annotation uses configuration options ( ) ) { options add all ( rule class provider get configuration options ( ) ) ; } for ( blaze module blaze module : modules ) { iterables add all ( options , blaze module get command options ( command annotation ) ) ; } for ( class < ? extends blaze command > base : command annotation inherits ( ) ) { options add all ( get options ( base , modules , rule class provider ) ) ; } return immutable list copy of ( options ) ; }


returns a new symbol path in which invalid characters are replaced with underscores

public symbol path replace invalid chars ( ) { list < string > mod list = new array list < > ( ) ; for ( string str : as list ( ) ) { mod list add ( symbol utilities replace invalid chars ( str , true ) ) ; } return new symbol path ( mod list ) ; }


returns whether or not this drawable rounds as circle

public boolean is circle ( ) { return m is circle ; }


append specified length of bytes to a given file , starting with new block

public static void append file new block ( distributed file system fs , path p , int length ) throws i o exception { assert length > = 0 ; byte [ ] to append = new byte [ length ] ; random random = new random ( ) ; random next bytes ( to append ) ; append file new block ( fs , p , to append ) ; }


return the blur bitmap fast zoom out , blur , zoom in

public static bitmap fast blur ( final bitmap src , @ float range ( from = 0 , to = 1 , from inclusive = false ) final float scale , @ float range ( from = 0 , to = 25 , from inclusive = false ) final float radius , final boolean recycle ) { return fast blur ( src , scale , radius , recycle , false ) ; }


turns off the gui displays for errors this does not change the " is use error g u i ( ) " value for other tests in the test case

public static void dispose error g u i ( ) { msg set error display ( new console error display ( ) ) ; }


returns a new authorization result that is granted and auditable

public static authorization result granted ( ) { return new authorization result ( true ) ; }


get the dwarf - encoded integer value as stored by the context

public final long decode ( dwarf decode context context ) throws memory access exception { long val = do decode ( context ) ; return resolve relative offset ( val , context ) ; }


asks all the { @ link section } in the tree to refresh themselves the refresh is by default a no - op { @ link section } s that need a refresh behaviour should implement a method annotated with { @ link com facebook litho sections annotations on refresh }

public void refresh ( ) { final section section ; synchronized ( this ) { if ( m released ) { throw new illegal state exception ( " calling refresh on a released tree " ) ; } section = m current section ; } if ( section = = null ) { return ; } refresh recursive ( section ) ; }


asserts that two { @ link module } s have the same structure needed because { @ link module } doesn ' t override { @ link object # equals }

public static void assert modules equal ( module module 1 , module module 2 ) { assert that ( module 1 get client data ( ) ) is equal to ( module 2 get client data ( ) ) ; assert that ( module 1 get globals ( ) ) contains exactly entries in ( module 2 get globals ( ) ) in order ( ) ; assert that ( module 1 get predeclared bindings ( ) ) contains exactly entries in ( module 2 get predeclared bindings ( ) ) in order ( ) ; }


public long get $ special property name ( ) { return $ special property name ; }


read an unsigned integer from the given position without modifying the buffers position

public static long read unsigned int ( byte buffer buffer , int index ) { return buffer get int ( index ) & 0xffffffff l ; }


gets a state handle from zoo keeper and optionally locks it

private retrievable state handle < t > get ( string path in zoo keeper , boolean lock ) throws exception { check not null ( path in zoo keeper , " path in zoo keeper " ) ; final string path = normalize path ( path in zoo keeper ) ; if ( lock ) { / / try to lock the node try { client create ( ) with mode ( create mode ephemeral ) for path ( get lock path ( path ) ) ; } catch ( keeper exception node exists exception ignored ) { / / we have already created the lock } catch ( keeper exception no node exception ex ) { / / we could run into this exception because the parent node does not exist when we / / are trying to lock / / we wrap the exception here so that it could be caught in default job graph store throw new not exist exception ( " zoo keeper node " + path + " does not exist " , ex ) ; } } boolean success = false ; try { byte [ ] data = client get data ( ) for path ( path ) ; retrievable state handle < t > retrievable state handle = instantiation util deserialize object ( data , thread current thread ( ) get context class loader ( ) ) ; success = true ; return retrievable state handle ; } catch ( keeper exception no node exception ex ) { / / we wrap the exception here so that it could be caught in default job graph store throw new not exist exception ( " zoo keeper node " + path + " does not exist " , ex ) ; } catch ( i o exception | class not found exception e ) { throw new i o exception ( " failed to deserialize state handle from zoo keeper data from " + path + ' ' , e ) ; } finally { if ( ! success & & lock ) { / / release the lock release ( path ) ; } } }


windows this { @ code keyed stream } into sliding count windows

public windowed stream < t , key , global window > count window ( long size , long slide ) { return window ( global windows create ( ) ) evictor ( count evictor of ( size ) ) trigger ( count trigger of ( slide ) ) ; }


public double bandwidth bytes ( long bytes ) { double duration = duration ( ) ; return duration > 0 ? bytes / duration : 0 ; }


public string get description ( ) { return description ; }


returns the underlying short buffer if you modify the buffer contents they wil be uploaded on the call to { @ link # bind ( ) } if you need immediate uploading use { @ link # set indices ( short [ ] , int , int ) }

public short buffer get buffer ( ) { is dirty = true ; return buffer ; }


determine whether the original request is still active

protected final boolean is request active ( ) { return this request active ; }


returns true if this deframer has already been closed or scheduled to close

private boolean is closed or scheduled to close ( ) { return is closed ( ) | | close when complete ; }


renames the given java element to the given new name currently only supports renaming packages and compilation units

private static void rename java element ( i java element element , string new name , i progress monitor monitor ) throws core exception , illegal argument exception { string id ; if ( element get element type ( ) = = i java element package fragment ) { id = i java refactorings rename package ; } else if ( element get element type ( ) = = i java element compilation unit ) { id = i java refactorings rename compilation unit ; } else { throw new illegal argument exception ( " can only rename packages and compilation units ! " ) ; } refactoring contribution contribution = refactoring core get refactoring contribution ( id ) ; rename java element descriptor descriptor = ( rename java element descriptor ) contribution create descriptor ( ) ; descriptor set project ( element get resource ( ) get project ( ) get name ( ) ) ; descriptor set new name ( new name ) ; descriptor set java element ( element ) ; refactoring status status = new refactoring status ( ) ; refactoring refactoring = descriptor create refactoring ( status ) ; refactoring check initial conditions ( monitor ) ; refactoring check final conditions ( monitor ) ; change change = refactoring create change ( monitor ) ; change perform ( monitor ) ; }


private int recursive tokens ( int depth ) throws bad location exception { int new lines = 0 ; while ( c next pos < f range end ) { while ( c next pos < f range end ) { char ch = document get char ( c next pos + + ) ; switch ( ch ) { case ' < ' : int start offset = c next pos - 1 ; int start new lines = new lines ; int classification = classify tag ( ) ; / / string tag string = f document get ( start offset , math min ( c next pos - start offset , f range end - start offset ) ) ; / / this is to see where we are in the debugger new lines + = c new lines ; / / c new lines is written by / / classify tag ( ) switch ( classification ) { case start tag : new lines + = recursive tokens ( depth + 1 ) ; if ( new lines > start new lines + 1 ) { emit position ( start offset , c next pos - start offset ) ; } break ; case leaf tag : if ( new lines > start new lines + 1 ) { emit position ( start offset , c next pos - start offset ) ; } break ; case comment tag : if ( new lines > start new lines + 1 ) { emit position ( start offset , c next pos - start offset ) ; } break ; case pi tag : break ; case end tag : case eor tag : return new lines ; default : break ; } break ; case ' \ n ' : case ' \ r ' : if ( ( ch = = c last n l char ) | | ( ' ' = = c last n l char ) ) { new lines + + ; c last n l char = ch ; } break ; default : break ; } } } return new lines ; }


update the intermediate hash value for the next input { @ code value }

public static int update ( int hash , int value ) { final int c 1 = 0x c c 9 e 2 d 5 1 ; final int c 2 = 0x 1 b 8 7 3 5 9 3 ; final int r 1 = 15 ; final int r 2 = 13 ; final int m = 5 ; final int n = 0x e 6 5 4 6 b 6 4 ; int k = value ; k = k * c 1 ; k = ( k < < r 1 ) | ( k > > > ( 32 - r 1 ) ) ; k = k * c 2 ; hash = hash ^ k ; hash = ( hash < < r 2 ) | ( hash > > > ( 32 - r 2 ) ) ; hash = hash * m + n ; return hash ; }


called by the { @ link transport } implementation after an exception was sent as a response to an incoming request

public void on response sent ( long request id , string action , exception e ) { if ( tracer log is trace enabled ( ) & & should trace action ( action ) ) { tracer log trace ( ( ) - > new parameterized message ( " [ { } ] [ { } ] sent error response " , request id , action ) , e ) ; } message listener on response sent ( request id , action , e ) ; }


adds the map value to the provided map under the provided field name , if it should be included the supplier is only invoked if the field is to be included

public map builder add map ( string field name , boolean include , supplier < map < string , ? > > supplier ) { if ( include ) { map < string , ? > value = supplier get ( ) ; if ( value ! = null & & ! value is empty ( ) ) { map put ( get field name ( field name ) , value ) ; } } return this ; }


public int get port ( ) { return address get port ( ) ; }


make sure the i ds of striped blocks do not conflict

public void test allocate block id ( ) throws exception { path test path = new path ( " / testfile " ) ; / / create a file while allocates a new block d f s test util write file ( dfs , test path , " hello , world ! " ) ; located blocks lb = dfs get client ( ) get located blocks ( test path to string ( ) , 0 ) ; final long first id = lb get ( 0 ) get block ( ) get block id ( ) ; / / delete the file dfs delete ( test path , true ) ; / / allocate a new block , and make sure the new block ' s id does not conflict / / with the previous one d f s test util write file ( dfs , test path , " hello again " ) ; lb = dfs get client ( ) get located blocks ( test path to string ( ) , 0 ) ; final long second id = lb get ( 0 ) get block ( ) get block id ( ) ; assert equals ( first id + hdfs server constants max blocks in group , second id ) ; }


process the search response and return a stream of index requests as well as the cursor

tuple < stream < index request > , map < string , object > > process search response ( search response search response , string destination index , string destination pipeline , map < string , string > field mappings , transform indexer stats stats ) ;


sets the < code > array array number < code > property

public void set array array number ( list < list < big decimal > > array array number ) { this array array number = array array number ; }


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


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


this is purely to allow unit tests to inspect the partial grok pattern after testing implementation details it should not be used in production code

string builder get overall grok pattern builder ( ) { return overall grok pattern builder ; }


< code > map & lt ; string , bytes & gt ; bytes map = 11 ; < code >

public com google protobuf byte string get bytes map or default ( java lang string key , com google protobuf byte string default value ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } java util map < java lang string , com google protobuf byte string > map = internal get bytes map ( ) get map ( ) ; return map contains key ( key ) ? map get ( key ) : default value ; }