we need to hold the returning name at this level for argument binding calculations , this method allows the after returning advice subclass to set the name

protected void set returning name no check ( string name ) { / / name could be a variable or a type if ( is variable name ( name ) ) { this returning name = name ; } else { / / assume a type try { this discovered returning type = class utils for name ( name , get aspect class loader ( ) ) ; } catch ( throwable ex ) { throw new illegal argument exception ( " returning name ' " + name + " ' is neither a valid argument name nor the fully - qualified " + " name of a java type on the classpath root cause : " + ex ) ; } } }


parse a string into a consumer group state

public static consumer group state parse ( string name ) { consumer group state state = name to enum get ( name ) ; return state = = null ? unknown : state ; }


get the object performs galois field arithmetic with default setting

public static galois field get instance ( ) { return get instance ( default field size , default primitive polynomial ) ; }


parses the output of the workspace status action the output is a text file with each line representing a workspace status info key the key is the part of the line before the first space and should consist of the characters [ a - z ] ( although this is not checked ) everything after the first space is the value

public static map < string , string > parse values ( path file ) throws i o exception { hash map < string , string > result = new hash map < > ( ) ; splitter line splitter = splitter on ( ' ' ) limit ( 2 ) ; for ( string line : splitter on ( ' \ n ' ) split ( new string ( file system utils read content as latin 1 ( file ) ) ) ) { list < string > items = line splitter split to list ( line ) ; if ( items size ( ) ! = 2 ) { continue ; } result put ( items get ( 0 ) , items get ( 1 ) ) ; } return immutable map copy of ( result ) ; }


the subchannel if this result was created by { @ link # with subchannel with subchannel ( ) } , or null otherwise

public subchannel get subchannel ( ) { return subchannel ; }


get the current generation state , regardless of whether it is currently stable note that the generation information can be updated while we are still in the middle of a rebalance , after the join - group response is received

protected synchronized generation generation ( ) { return generation ; }


return whether the config value is sensitive the value is always set to null by the broker if the config value is sensitive

public boolean is sensitive ( ) { return is sensitive ; }


get the number of operations rejected due to lack of permits


acquire the read lock when using get mappings and get mappings by url

public void acquire read lock ( ) { this read write lock read lock ( ) lock ( ) ; }


mono < entity response < t > > build ( ) ;


indicates whether the sax feature { @ code http : xml orgsaxfeaturesnamespaces } is turned on

protected boolean has namespaces feature ( ) { return this namespaces feature ; }


public void set left offset ( float left offset ) { this left offset = left offset ; }


insert 2 lfu keys , and 1 mfu key make sure when adding a new lfu key , the cache evicts the lfu lfu key and not the lru mfu key

public void test evict l f uand not m f u keys ( ) { / / cache has 4 entries ; 2 for lfu and 2 for mfu / / key is considered as mfu , if its access count > 1 m cache = create dummy adaptive counting memory cache ( m params supplier , m cache trim strategy , m value descriptor , 100 , 1 , 2 , initial l f u cache fraction promil ) ; / / insert item 1 to mfu closeable reference < integer > original ref 1 = new reference ( 10 ) ; closeable reference < integer > value ref 1a = m cache cache ( keys [ 1 ] , original ref 1 ) ; closeable reference < integer > value ref 1b = m cache get ( keys [ 1 ] ) ; original ref 1 close ( ) ; value ref 1a close ( ) ; value ref 1b close ( ) ; / / item 1 is in the mfu cache assert m f u exclusively owned ( keys [ 1 ] , 10 ) ; / / insert item 2 to lfu closeable reference < integer > original ref 2 = new reference ( 20 ) ; closeable reference < integer > value ref 2a = m cache cache ( keys [ 2 ] , original ref 2 ) ; original ref 2 close ( ) ; value ref 2a close ( ) ; / / insert item 3 to lfu closeable reference < integer > original ref 3 = new reference ( 30 ) ; closeable reference < integer > value ref 3a = m cache cache ( keys [ 3 ] , original ref 3 ) ; original ref 3 close ( ) ; value ref 3a close ( ) ; assert m f u exclusively owned ( keys [ 1 ] , 10 ) ; assert l f u exclusively owned ( keys [ 2 ] , 20 ) ; assert l f u exclusively owned ( keys [ 3 ] , 30 ) ; / / insert item 4 to lfu , the cache should evict item 2 closeable reference < integer > original ref 4 = new reference ( 40 ) ; closeable reference < integer > value ref 4a = m cache cache ( keys [ 4 ] , original ref 4 ) ; original ref 4 close ( ) ; value ref 4a close ( ) ; assert m f u exclusively owned ( keys [ 1 ] , 10 ) ; assert l f u exclusively owned ( keys [ 3 ] , 30 ) ; assert l f u exclusively owned ( keys [ 4 ] , 40 ) ; }


public closeable image decode gif ( final encoded image encoded image , final int length , final quality info quality info , final image decode options options ) { if ( encoded image get width ( ) = = encoded image unknown width | | encoded image get height ( ) = = encoded image unknown height ) { throw new decode exception ( " image width or height is incorrect " , encoded image ) ; } if ( ! options force static image & & m animated gif decoder ! = null ) { return m animated gif decoder decode ( encoded image , length , quality info , options ) ; } return decode static image ( encoded image , options ) ; }


provide a abstract configuration implementation instance


initialize the user transaction as well as the transaction manager handle

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


test a point for containment in this fixture

public boolean test point ( float x , float y ) { tmp set ( x , y ) ; return fixture test point ( tmp ) ; }


return the comments for the add to version control

string get comments ( ) { return comments text area get text ( ) ; }


public static void notify system to scan ( final string file path ) { notify system to scan ( get file by path ( file path ) ) ; }


computes the path to the sandbox base tree for the given running command

private static path compute sandbox base ( sandbox options options , command environment env ) throws i o exception { if ( options sandbox base is empty ( ) ) { return env get output base ( ) get relative ( " sandbox " ) ; } else { string dir name = string format ( " % s - sandbox % s " , env get runtime ( ) get product name ( ) , fingerprint get hex digest ( env get output base ( ) to string ( ) ) ) ; file system file system = env get runtime ( ) get file system ( ) ; path resolved sandbox base = file system get path ( options sandbox base ) resolve symbolic links ( ) ; return resolved sandbox base get relative ( dir name ) ; } }


sets the field delimiter character ( ' , ' by default )

public csv field delimiter ( char delimiter ) { internal properties put character ( format field delimiter , delimiter ) ; return this ; }


the next time to update the cluster info is the maximum of the time the current info will expire and the time the current info can be updated ( i e backoff time has elapsed ) ; if an update has been request then the expiry time is now

public synchronized long time to next update ( long now ms ) { long time to expire = update requested ( ) ? 0 : math max ( this last successful refresh ms + this metadata expire ms - now ms , 0 ) ; return math max ( time to expire , time to allow update ( now ms ) ) ; }


test that server trash configuration is respected even when the client configuration is set

public void test server config respected with client ( ) throws exception { delete file using trash ( true , true ) ; }


if a value of 0 is set then this attribute will revert to its default value optional : default value is ( char sequence ) null

public test many types view model title ( @ string res int string res , object format args ) { on mutation ( ) ; title string attribute data set value ( string res , format args ) ; return this ; }


called by the filter after it decides that the request is a potential csrf attack and therefore must be rejected

void send error ( int code , string message ) throws i o exception ;


get the time taken by the last task in nanoseconds

public long get last task time nanos ( ) throws illegal state exception { if ( this last task info = = null ) { throw new illegal state exception ( " no tasks run : can ' t get last task interval " ) ; } return this last task info get time nanos ( ) ; }


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


download < code > fsimage < code > and < code > edits < code > files from the name - node

static boolean download checkpoint files ( final url nn host port , final f s image dst image , final checkpoint signature sig , final remote edit log manifest manifest ) throws i o exception { / / sanity check manifest - these could happen if , eg , someone on the / / nn side accidentally rmed the storage directories if ( manifest get logs ( ) is empty ( ) ) { throw new i o exception ( " found no edit logs to download on nn since txid " + sig most recent checkpoint tx id ) ; } long expected tx id = sig most recent checkpoint tx id + 1 ; if ( manifest get logs ( ) get ( 0 ) get start tx id ( ) ! = expected tx id ) { throw new i o exception ( " bad edit log manifest ( expected txid = " + expected tx id + " : " + manifest ) ; } try { boolean b = user group information get current user ( ) do as ( new privileged exception action < boolean > ( ) { @ override public boolean run ( ) throws exception { dst image get storage ( ) c time = sig c time ; / / get fsimage if ( sig most recent checkpoint tx id = = dst image get storage ( ) get most recent checkpoint tx id ( ) ) { log info ( " image has not changed will not download image " ) ; } else { log info ( " image has changed downloading updated image from nn " ) ; m d 5 hash downloaded hash = transfer fs image download image to storage ( nn host port , sig most recent checkpoint tx id , dst image get storage ( ) , true , false ) ; dst image save digest and rename checkpoint image ( name node file image , sig most recent checkpoint tx id , downloaded hash ) ; } / / get edits file for ( remote edit log log : manifest get logs ( ) ) { transfer fs image download edits to storage ( nn host port , log , dst image get storage ( ) ) ; } / / true if we haven ' t loaded all the transactions represented by the / / downloaded fsimage return dst image get last applied tx id ( ) < sig most recent checkpoint tx id ; } } ) ; return b boolean value ( ) ; } catch ( interrupted exception e ) { throw new runtime exception ( e ) ; } }


returns the negotiated protocol , or null if no protocol was negotiated

public string get selected protocol ( s s l socket socket ) { return null ; }


tests that { @ link configured attribute mapper # get } only gets the configuration - appropriate value

public void test get attribute ( ) throws exception { write config rules ( ) ; scratch file ( " a / build " , " genrule ( " , " name = ' gen ' , " , " srcs = [ ] , " , " outs = [ ' out ' ] , " , " cmd = select ( { " , " ' / / conditions : a ' : ' a command ' , " , " ' / / conditions : b ' : ' b command ' , " , " ' " + build type selector default condition key + " ' : ' default command ' , " , " } ) ) " ) ; use configuration ( " - - define " , " mode = a " ) ; assert that ( get mapper ( " / / a : gen " ) get ( " cmd " , type string ) ) is equal to ( " a command " ) ; use configuration ( " - - define " , " mode = b " ) ; assert that ( get mapper ( " / / a : gen " ) get ( " cmd " , type string ) ) is equal to ( " b command " ) ; use configuration ( " - - define " , " mode = c " ) ; assert that ( get mapper ( " / / a : gen " ) get ( " cmd " , type string ) ) is equal to ( " default command " ) ; }


check if the given array contains the given value ( with case - insensitive comparison )

public static boolean contains ignore case ( string [ ] array , string value ) { for ( string str : array ) { if ( value = = null & & str = = null ) { return true ; } if ( value ! = null & & value equals ignore case ( str ) ) { return true ; } } return false ; }


get the total number of active clients holding lease in the system

public long get num active clients ( ) { return lease manager count lease ( ) ; }


bind the side , making it active to render on should be called in between a call to { @ link # begin ( ) } and { @ link # end ( ) }

protected void bind side ( final cubemap cubemap side side ) { gdx gl 2 0 gl framebuffer texture 2 d ( gl20 gl framebuffer , gl20 gl color attachment0 , side gl enum , get color buffer texture ( ) get texture object handle ( ) , 0 ) ; }


returns the actual data bytes from the file for this section

public byte [ ] get data ( ) throws i o exception { if ( sh type = = elf section header constants sht nobits ) { return new byte [ 0 ] ; } if ( data ! = null ) { return data ; } if ( reader = = null ) { throw new unsupported operation exception ( " this elf section header does not have a reader " ) ; } return reader read byte array ( sh offset , ( int ) sh size ) ; }


specify a custom traversable resolver to use for this validator factory and its exposed default validator

public void set traversable resolver ( traversable resolver traversable resolver ) { this traversable resolver = traversable resolver ; }


public int chunk size ( ) { return allocator chunk size ( ) ; }


public double get timing ( long time ) ;


get the content of the response body as a { @ code string } , using the charset specified for the response by the application , either through { @ link http servlet response } methods or through a charset parameter on the { @ code content - type }

public string get content as string ( ) throws unsupported encoding exception { return ( this character encoding ! = null ? this content to string ( this character encoding ) : this content to string ( ) ) ; }


add token stats to the owner to token count mapping

private void add token for owner stats ( token ident id ) { string real owner = get token real owner ( id ) ; token owner stats put ( real owner , token owner stats get or default ( real owner , 0l ) + 1 ) ; }


gets single logout service for the requested binding

public single logout service get single logout service ( final string binding ) { return get single logout services ( ) stream ( ) filter ( acs - > acs get binding ( ) equals ignore case ( binding ) ) find first ( ) or else ( null ) ; }


trusted manager for verifying the remote endpoint ' s certificate { @ code null } uses the system default

public ssl context builder trust manager ( trust manager factory trust manager factory ) { trust cert collection = null ; this trust manager factory = trust manager factory ; return this ; }


return the string of decode html - encode string

public static char sequence html decode ( final string input ) { if ( input = = null | | input length ( ) = = 0 ) return " " ; if ( build version sdk int > = build version codes n ) { return html from html ( input , html from html mode legacy ) ; } else { return html from html ( input ) ; } }


public integer get integer ( ) { return integer ; }


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


attempting to use h d r percentile aggregation on a string field throws illegal argument exception

public void test string field ( ) throws i o exception { final string field name = " string " ; mapped field type field type = new keyword field mapper keyword field type ( field name ) ; expect throws ( illegal argument exception class , ( ) - > test case ( new doc values field exists query ( field name ) , iw - > { iw add document ( singleton ( new sorted set doc values field ( " string " , new bytes ref ( " bogus " ) ) ) ) ; iw add document ( singleton ( new sorted set doc values field ( " string " , new bytes ref ( " zwomp " ) ) ) ) ; iw add document ( singleton ( new sorted set doc values field ( " string " , new bytes ref ( " foobar " ) ) ) ) ; } , hdr - > { } , field type , field name ) ) ; }


visits an instruction which has a local variable index argument

public void visit local ( int opcode , int offset , int length , int idx , type type , int value ) ;


create a size - constrained buffer in terms of the maximum number of keys it will store

static eager buffer config max records ( final long record limit ) { return new eager buffer config impl ( record limit , long max value ) ; }


add new profile keys from a group change if the change came from the member whose profile key is changing then it is regarded as authoritative

public void add keys from group change ( @ non null decrypted group change change ) { uuid editor = uuid util from byte string or null ( change get editor ( ) ) ; for ( decrypted member member : change get new members list ( ) ) { add member key ( member , editor ) ; } for ( decrypted member member : change get promote pending members list ( ) ) { add member key ( member , editor ) ; } for ( decrypted member member : change get modified profile keys list ( ) ) { add member key ( member , editor ) ; } for ( decrypted requesting member member : change get new requesting members list ( ) ) { add member key ( editor , member get uuid ( ) , member get profile key ( ) ) ; } }


public static string get o s s access key ( ) { if ( access key ! = null ) { return access key ; } else { throw new illegal state exception ( " oss access key is not available " ) ; } }


convert the received jdom element to an element

private static element to dom ( final org jdom 2 element element ) { return objects require non null ( to dom ( element get document ( ) ) ) get document element ( ) ; }


write the keystore to the given config directory

public synchronized void save ( path config dir , char [ ] password ) throws exception { ensure open ( ) ; simple f s directory directory = new simple f s directory ( config dir ) ; / / write to tmp file first , then overwrite string tmp file = keystore filename + " tmp " ; try ( index output output = directory create output ( tmp file , i o context default ) ) { codec util write header ( output , keystore filename , format version ) ; output write byte ( password length = = 0 ? ( byte ) 0 : ( byte ) 1 ) ; / / new cipher params secure random random = randomness create secure ( ) ; / / use 64 bytes salt , which surpasses that recommended by owasp / / see https : / / www owasp org / index php / password storage cheat sheet byte [ ] salt = new byte [ 64 ] ; random next bytes ( salt ) ; / / use 96 bits ( 12 bytes ) for iv as recommended by nist / / see http : / / nvlpubs nist gov / nistpubs / legacy / sp / nistspecialpublication 8 0 0 - 3 8d pdf section 5 2 1 1 byte [ ] iv = new byte [ 12 ] ; random next bytes ( iv ) ; / / encrypted data byte [ ] encrypted bytes = encrypt ( password , salt , iv ) ; / / size of data block output write int ( 4 + salt length + 4 + iv length + 4 + encrypted bytes length ) ; output write int ( salt length ) ; output write bytes ( salt , salt length ) ; output write int ( iv length ) ; output write bytes ( iv , iv length ) ; output write int ( encrypted bytes length ) ; output write bytes ( encrypted bytes , encrypted bytes length ) ; codec util write footer ( output ) ; } catch ( final access denied exception e ) { final string message = string format ( locale root , " unable to create temporary keystore at [ % s ] , write permissions required for [ % s ] or run [ elasticsearch - keystore upgrade ] " , config dir resolve ( tmp file ) , config dir ) ; throw new user exception ( exit codes config , message , e ) ; } path keystore file = keystore path ( config dir ) ; files move ( config dir resolve ( tmp file ) , keystore file , standard copy option replace existing , standard copy option atomic move ) ; posix file attribute view attrs = files get file attribute view ( keystore file , posix file attribute view class ) ; if ( attrs ! = null ) { / / don ' t rely on umask : ensure the keystore has minimal permissions attrs set permissions ( posix file permissions from string ( " rw - rw - - - - " ) ) ; } }


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


when the request resources is an ack or nack message in response to a previous request resources , the response nonce must be the nonce in the request resources otherwise response nonce must be omitted < code > string response nonce = 4 ; < code >

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


look for real blocks by counting meta files in all the storage dirs

private int count real blocks ( map < string , block locs > map ) { int total = 0 ; final string bpid = cluster get namesystem ( ) get block pool id ( ) ; for ( int i = 0 ; i < dn num ; i + + ) { for ( int j = 0 ; j < = 1 ; j + + ) { file storage dir = cluster get instance storage dir ( i , j ) ; file dir = mini d f s cluster get finalized dir ( storage dir , bpid ) ; if ( dir = = null ) { system out println ( " dir is null for dn = " + i + " and data dir = " + j ) ; continue ; } list < file > res = mini d f s cluster get all block metadata files ( dir ) ; if ( res = = null ) { system out println ( " res is null for dir = " + dir + " i = " + i + " and j = " + j ) ; continue ; } / / system out println ( " for dn " + i + " " + j + " : " + dir + " = " + res length + " files " ) ; / / int ii = 0 ; for ( file f : res ) { string s = f get name ( ) ; / / cut off " blk - " at the beginning and " meta " at the end assert not null ( " block file name should not be null " , s ) ; string bid = s substring ( s index of ( " " ) + 1 , s last index of ( " " ) ) ; / / system out println ( ii + + + " block " + s + " ; id = " + bid ) ; block locs val = map get ( bid ) ; if ( val = = null ) { val = new block locs ( ) ; } val num files + + ; / / one more file for the block map put ( bid , val ) ; } / / system out println ( " dir 1 = " + dir get path ( ) + " blocks = " + res length ) ; / / system out println ( " dir 2 = " + dir 2 get path ( ) + " blocks = " + res 2 length ) ; total + = res size ( ) ; } } return total ; }


public static compressor type get by code ( int code ) { for ( compressor type b : compressor type values ( ) ) { if ( code = = b code ) { return b ; } } throw new illegal argument exception ( " unknown codec : " + code ) ; }


the symbol status of this entry , which includes visibility information < code > optional aapt pb symbol status symbol status = 3 ; < code >

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


test that { @ link put mapping request # simple mapping ( string ) } rejects inputs where the { @ code object } varargs of field name and properties are not paired correctly

public void test build from simplified def ( ) { illegal argument exception e = expect throws ( illegal argument exception class , ( ) - > put mapping request simple mapping ( " only field " ) ) ; assert equals ( " mapping source must be pairs of fieldnames and properties definition " , e get message ( ) ) ; }


public void replace s s l hostname verifier ( hostname verifier hostname verifier ) { if ( hostname verifier ! = null ) { https u r l connection set default hostname verifier ( hostname verifier ) ; } }


public static void put ( @ non null final string key , final parcelable value ) { put ( key , value , get default cache double utils ( ) ) ; }


specify a conversion service which will apply to every data binder

public final void set conversion service ( @ nullable conversion service conversion service ) { this conversion service = conversion service ; }


asynchronously get the status of index lifecycle management see https : www elastic coguideenelasticsearchclientjava - restcurrent java - rest - high - ilm - ilm - status html for more

public cancellable lifecycle management status async ( lifecycle management status request request , request options options , action listener < lifecycle management status response > listener ) { return rest high level client perform request async and parse entity ( request , index lifecycle request converters : : lifecycle management status , options , lifecycle management status response : : from x content , listener , empty set ( ) ) ; }


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


validate the given response as contained in the { @ link http u r l connection } object , throwing an exception if it does not correspond to a successful http response default implementation rejects any http status code beyond 2xx , to avoid parsing the response body and trying to deserialize from a corrupted stream

protected void validate response ( http invoker client configuration config , http u r l connection con ) throws i o exception { if ( con get response code ( ) > = 300 ) { throw new i o exception ( " did not receive successful http response : status code = " + con get response code ( ) + " , status message = [ " + con get response message ( ) + " ] " ) ; } }


public void set proxy ( @ check for null proxy configuration proxy ) { this proxy = proxy ; }


returns the length of continuously cached data starting from { @ code position } , up to a maximum of { @ code max length } , of a resource if { @ code position } isn ' t cached then { @ code - hole length } is returned , where { @ code hole length } is the length of continuously uncached data starting from { @ code position } , up to a maximum of { @ code max length }

long get cached length ( string key , long position , long length ) ;


always returns { @ code false } since jaxb 2 collection http message converter does not convert collections to xml

public boolean can write ( @ nullable type type , @ nullable class < ? > clazz , @ nullable media type media type ) { return false ; }


returns the contents of this instance as a { @ code dex } file , in a { @ link byte array annotated output } instance

private byte array annotated output to dex 0 ( boolean annotate , boolean verbose ) { / * * the following is ordered so that the prepare ( ) calls which * add items happen before the calls to the sections that get * added to * / class defs prepare ( ) ; class data prepare ( ) ; word data prepare ( ) ; byte data prepare ( ) ; method ids prepare ( ) ; field ids prepare ( ) ; proto ids prepare ( ) ; type lists prepare ( ) ; type ids prepare ( ) ; string ids prepare ( ) ; string data prepare ( ) ; header prepare ( ) ; / / place the sections within the file int count = sections length ; int offset = 0 ; for ( int i = 0 ; i < count ; i + + ) { section one = sections [ i ] ; int placed at = one set file offset ( offset ) ; if ( placed at < offset ) { throw new runtime exception ( " bogus placement for section " + i ) ; } try { if ( one = = map ) { / * * inform the map of all the sections , and add it * to the file this can only be done after all * the other items have been sorted and placed * / map item add map ( sections , map ) ; map prepare ( ) ; } if ( one instanceof mixed item section ) { / * * place the items of a mixed item section that just * got placed * / ( ( mixed item section ) one ) place items ( ) ; } offset = placed at + one write size ( ) ; } catch ( runtime exception ex ) { throw exception with context with context ( ex , " while writing section " + i ) ; } } / / write out all the sections file size = offset ; byte [ ] barr = new byte [ file size ] ; byte array annotated output out = new byte array annotated output ( barr ) ; if ( annotate ) { out enable annotations ( dump width , verbose ) ; } for ( int i = 0 ; i < count ; i + + ) { try { section one = sections [ i ] ; int zero count = one get file offset ( ) - out get cursor ( ) ; if ( zero count < 0 ) { throw new exception with context ( " excess write of " + ( - zero count ) ) ; } out write zeroes ( one get file offset ( ) - out get cursor ( ) ) ; one write to ( out ) ; } catch ( runtime exception ex ) { exception with context ec ; if ( ex instanceof exception with context ) { ec = ( exception with context ) ex ; } else { ec = new exception with context ( ex ) ; } ec add context ( " while writing section " + i ) ; throw ec ; } } if ( out get cursor ( ) ! = file size ) { throw new runtime exception ( " foreshortened write " ) ; } / / perform final bookkeeping calc signature ( barr ) ; calc checksum ( barr ) ; if ( annotate ) { word data write index annotation ( out , item type type code item , " \ nmethod code index : \ n \ n " ) ; get statistics ( ) write annotation ( out ) ; out finish annotating ( ) ; } return out ; }


get the size of the content that the url is pointing by firing a head request

public long get content length ( final string url ) throws i o exception { try { final response response = head ( url ) ; return long parse long ( response get header ( " content - length " ) ) ; } catch ( final number format exception e ) { throw new i o exception ( " invalid content length " , e ) ; } catch ( final re captcha exception e ) { throw new i o exception ( e ) ; } }


test on the deny engine and allow engine pair the deny engine has unknown policies , so the g r p c authorization returns unknown

public void test engine pair with unknown deny engine ( ) throws interpreter exception { setup engine rbac pair ( ) ; / / policy 4 - unmatched ; policy 5 - unknown ; policy 6 - unknown / / policy 1 - matched ; policy 2 - matched ; policy 3 - matched do return ( true ) when ( spy engine ) matches ( eq ( condition 1 ) , any ( activation class ) ) ; do return ( true ) when ( spy engine ) matches ( eq ( condition 2 ) , any ( activation class ) ) ; do return ( true ) when ( spy engine ) matches ( eq ( condition 3 ) , any ( activation class ) ) ; do return ( false ) when ( spy engine ) matches ( eq ( condition 4 ) , any ( activation class ) ) ; do throw ( new interpreter exception builder ( " unknown result " ) build ( ) ) when ( spy engine ) matches ( eq ( condition 5 ) , any ( activation class ) ) ; do throw ( new interpreter exception builder ( " unknown result " ) build ( ) ) when ( spy engine ) matches ( eq ( condition 6 ) , any ( activation class ) ) ; evaluate result = spy engine evaluate ( args ) ; assert that ( evaluate result get decision ( ) ) is equal to ( authorization decision output unknown ) ; assert that ( evaluate result get policy names ( ) ) has size ( 2 ) ; assert that ( evaluate result get policy names ( ) ) contains ( " policy 5 " ) ; assert that ( evaluate result get policy names ( ) ) contains ( " policy 6 " ) ; }


return a " mock " controller instance when an { @ code @ request mapping } method on the controller is invoked , the supplied argument values are remembered and the result can then be used to create a { @ code uri components builder } via { @ link # from method call ( object ) } note that this is a shorthand version of { @ link # controller ( class ) } intended for inline use ( with a static import ) , for example : < pre class = " code " > mvc uri components builder from method call ( on ( foo controller class ) get foo ( 1 ) ) build ( ) ; note : this method extracts values from " forwarded " and " x - forwarded - " headers if found see class - level docs

public static < t > t on ( class < t > controller type ) { return controller ( controller type ) ; }


returns the linker input artifacts from a collection of { @ link linker input } objects

public static iterable < artifact > to library artifacts ( iterable < ? extends linker input > artifacts ) { return iterables transform ( artifacts , linker input : : get artifact ) ; }


this tests whether timestamps are properly extracted in the timestamp extractor and whether watermarks are also correctly forwarded from this with the auto watermark interval

public void test timestamp extractor with auto interval ( ) throws exception { final int num elements = 10 ; stream execution environment env = stream execution environment get execution environment ( ) ; env get config ( ) set auto watermark interval ( 10 ) ; env set parallelism ( 1 ) ; data stream < integer > source 1 = env add source ( new source function < integer > ( ) { @ override public void run ( source context < integer > ctx ) throws exception { int index = 1 ; while ( index < = num elements ) { ctx collect ( index ) ; latch await ( ) ; index + + ; } } @ override public void cancel ( ) { } } ) ; data stream < integer > extract op = source 1 assign timestamps and watermarks ( new ascending timestamp extractor < integer > ( ) { @ override public long extract ascending timestamp ( integer element ) { return element ; } } ) ; extract op transform ( " watermark check " , basic type info int type info , new custom operator ( true ) ) transform ( " timestamp check " , basic type info int type info , new timestamp checking operator ( ) ) ; / / verify that extractor picks up source parallelism assert assert equals ( extract op get transformation ( ) get parallelism ( ) , source 1 get transformation ( ) get parallelism ( ) ) ; env execute ( ) ; / / verify that we get num elements watermarks for ( int j = 0 ; j < num elements ; j + + ) { if ( ! custom operator final watermarks [ 0 ] get ( j ) equals ( new watermark ( j ) ) ) { long wm = custom operator final watermarks [ 0 ] get ( j ) get timestamp ( ) ; assert fail ( " wrong watermark expected : " + j + " found : " + wm + " all : " + custom operator final watermarks [ 0 ] ) ; } } / / the input is finite , so it should have a max watermark assert equals ( watermark max watermark , custom operator final watermarks [ 0 ] get ( custom operator final watermarks [ 0 ] size ( ) - 1 ) ) ; }


get the ' value ' corresponding to the last read ' key '

public synchronized object get current value ( object val ) throws i o exception { if ( val instanceof configurable ) { ( ( configurable ) val ) set conf ( this conf ) ; } / / position stream to ' current ' value seek to current value ( ) ; if ( ! block compressed ) { val = deserialize value ( val ) ; if ( val in read ( ) > 0 ) { log info ( " available bytes : " + val in available ( ) ) ; throw new i o exception ( val + " read " + ( val buffer get position ( ) - key length ) + " bytes , should read " + ( val buffer get length ( ) - key length ) ) ; } } else { / / get the value int val length = writable utils read v int ( val len in ) ; val = deserialize value ( val ) ; / / read another compressed ' value ' - - no buffered values ; / / sanity check if ( ( val length < 0 ) & & log is debug enabled ( ) ) { log debug ( val + " is a zero - length value " ) ; } } return val ; }


create and initialize a new s3a file system instance this instance is always created without s 3 guard , so allowing a previously created metastore to be patched in note : this is a bit convoluted as it needs to also handle the situation of a per - bucket option in core - site xml , which isn ' t easily overridden the new config and the setting of the values before any { @ code configuration get ( ) } calls are critical

protected void init s 3 a file system ( string path ) throws i o exception { log debug ( " initializing s3a fs to { } " , path ) ; uri uri = to uri ( path ) ; / / make sure that s 3 a file system does not hold an actual metadata store / / implementation configuration conf = new configuration ( get conf ( ) ) ; string null store = null metadata store class get name ( ) ; conf set ( s3 metadata store impl , null store ) ; string bucket = uri get host ( ) ; s 3 a utils set bucket option ( conf , bucket , s3 metadata store impl , s3guard metastore null ) ; string updated bucket option = s 3 a utils get bucket option ( conf , bucket , s3 metadata store impl ) ; log debug ( " updated bucket store option { } " , updated bucket option ) ; preconditions check state ( s3guard metastore null equals ( updated bucket option ) , " expected bucket option to be % s but was % s " , s3guard metastore null , updated bucket option ) ; bind filesystem ( file system new instance ( uri , conf ) ) ; }


return the cci template used by this operation

public org springframework jca cci core cci template get cci template ( ) { return this cci template ; }


skips checks for existing keys , doesn ' t increment size

private void put resize ( k key , float value ) { k [ ] key table = this key table ; for ( int i = place ( key ) ; ; i = ( i + 1 ) & mask ) { if ( key table [ i ] = = null ) { key table [ i ] = key ; value table [ i ] = value ; return ; } } }


creates a specific variant for a method entry

private void write method variant ( type spec builder class builder , method entry method entry , boolean to all , boolean forwarded ) { executable element elem = method entry element ; / / create builder method spec builder method = method spec method builder ( elem get simple name ( ) to string ( ) + ( forwarded ? " forward " : " " ) ) / / add except suffix when forwarding add modifiers ( modifier static ) returns ( void class ) ; / / forwarded methods aren ' t intended for use , and are not public if ( ! forwarded ) { method add modifiers ( modifier public ) ; } / / validate client methods to make sure if ( method entry where is client ) { if ( elem get parameters ( ) is empty ( ) ) { base processor err ( " client invoke methods must have a first parameter of type player " , elem ) ; return ; } if ( ! elem get parameters ( ) get ( 0 ) as type ( ) to string ( ) contains ( " player " ) ) { base processor err ( " client invoke methods should have a first parameter of type player " , elem ) ; return ; } } / / if to all is false , it ' s a ' send to one player ' variant , so add the player as a parameter if ( ! to all ) { method add parameter ( class name best guess ( " mindustry net net connection " ) , " player connection " ) ; } / / add sender to ignore if ( forwarded ) { method add parameter ( class name best guess ( " mindustry net net connection " ) , " except connection " ) ; } / / call local method if applicable , shouldn ' t happen when forwarding method as that already happens by default if ( ! forwarded & & method entry local ! = loc none ) { / / add in local checks if ( method entry local ! = loc both ) { method begin control flow ( " if ( " + get check string ( method entry local ) + " | | ! mindustry vars net active ( ) ) " ) ; } / / concatenate parameters int index = 0 ; string builder results = new string builder ( ) ; for ( variable element var : elem get parameters ( ) ) { / / special case : calling local - only methods uses the local player if ( index = = 0 & & method entry where = = loc client ) { results append ( " mindustry vars player " ) ; } else { results append ( var get simple name ( ) ) ; } if ( index ! = elem get parameters ( ) size ( ) - 1 ) results append ( " , " ) ; index + + ; } / / add the statement to call it method add statement ( " $ n " + elem get simple name ( ) + " ( " + results to string ( ) + " ) " , ( ( type element ) elem get enclosing element ( ) ) get qualified name ( ) to string ( ) ) ; if ( method entry local ! = loc both ) { method end control flow ( ) ; } } / / start control flow to check if it ' s actually client / server so no netcode is called method begin control flow ( " if ( " + get check string ( method entry where ) + " ) " ) ; / / add statement to create packet from pool method add statement ( " $ 1n packet = $ 2n obtain ( $ 1n class , $ 1n : : new ) " , " mindustry net packets invoke packet " , " arc util pooling pools " ) ; / / assign priority method add statement ( " packet priority = ( byte ) " + method entry priority ordinal ( ) ) ; / / assign method id method add statement ( " packet type = ( byte ) " + method entry id ) ; / / reset stream method add statement ( " out reset ( ) " ) ; method add type variables ( seq with ( elem get type parameters ( ) ) map ( base processor : : get t v n ) ) ; for ( int i = 0 ; i < elem get parameters ( ) size ( ) ; i + + ) { / / first argument is skipped as it is always the player caller if ( ( ! method entry where is server / * | | method entry mode = = loc both * / ) & & i = = 0 ) { continue ; } variable element var = elem get parameters ( ) get ( i ) ; try { / / add parameter to method method add parameter ( type name get ( var as type ( ) ) , var get simple name ( ) to string ( ) ) ; } catch ( throwable t ) { throw new runtime exception ( " error parsing method " + method entry target method ) ; } / / name of parameter string var name = var get simple name ( ) to string ( ) ; / / name of parameter type string type name = var as type ( ) to string ( ) ; / / captialized version of type name for writing primitives string cap name = type name equals ( " byte " ) ? " " : character to upper case ( type name char at ( 0 ) ) + type name substring ( 1 ) ; / / special case : method can be called from anywhere to anywhere / / thus , only write the player when the server is writing data , since the client is the only one who reads it boolean write player skip check = method entry where = = loc both & & i = = 0 ; if ( write player skip check ) { / / write begin check method begin control flow ( " if ( mindustry vars net server ( ) ) " ) ; } if ( base processor is primitive ( type name ) ) { / / check if it ' s a primitive , and if so write it method add statement ( " write $ l ( $ l ) " , type name equals ( " boolean " ) ? " bool " : type name char at ( 0 ) + " " , var name ) ; } else { / / else , try and find a serializer string ser = serializers writers get ( type name replace ( " mindustry gen " , " " ) , serializer resolver locate ( elem , var as type ( ) , true ) ) ; if ( ser = = null ) { / / make sure a serializer exists ! base processor err ( " no @ write class method to write class type : ' " + type name + " ' " , var ) ; return ; } / / add statement for writing it method add statement ( ser + " ( write , " + var name + " ) " ) ; } if ( write player skip check ) { / / write end check method end control flow ( ) ; } } / / assign packet bytes method add statement ( " packet bytes = out get bytes ( ) " ) ; / / assign packet length method add statement ( " packet length = out size ( ) " ) ; string send string ; if ( forwarded ) { / / forward packet if ( ! method entry local is client ) { / / if the client doesn ' t get it called locally , forward it back after validation send string = " mindustry vars net send ( " ; } else { send string = " mindustry vars net send except ( except connection , " ; } } else if ( to all ) { / / send to all players / to server send string = " mindustry vars net send ( " ; } else { / / send to specific client from server send string = " player connection send ( " ; } / / send the actual packet method add statement ( send string + " packet , " + ( method entry unreliable ? " mindustry net net send mode udp " : " mindustry net net send mode tcp " ) + " ) " ) ; / / end check for server / client method end control flow ( ) ; / / add method to class , finally class builder add method ( method build ( ) ) ; }


keys which the output stream must support

public list < string > output stream statistic keys ( ) { return arrays as list ( stream write bytes , stream write exceptions ) ; }


the operation primary term of the primary note : { @ link sequence numbers # unassigned primary term } indicates primary term was not assigned by primary

public long get term ( ) { return term ; }


set the ( new ) value of the { @ code access - control - max - age } response header

public void set access control max age ( long max age ) { set ( access control max age , long to string ( max age ) ) ; }


returns { @ code true } if this entry should replace all other entries that are already cached for the hostname

protected abstract boolean should replace all ( e entry ) ;


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


rewinds the read position to the first sample in the queue

private synchronized void rewind ( ) { read position = 0 ; sample data queue rewind ( ) ; }


fetch a list of r rs corresponding to the extent the app is starved ( fairshare and minshare ) this method considers the number of containers in a rr and also only one locality - level ( the first encountered resource name )

list < resource request > get starved resource requests ( ) { / / list of r rs we build in this method to return list < resource request > ret = new array list < > ( ) ; / / track visited r rs to avoid the same rr at multiple locality levels visited resource request tracker visited r rs = new visited resource request tracker ( scheduler get node tracker ( ) ) ; / / start with current starvation and track the pending amount resource pending = get starvation ( ) ; for ( resource request rr : app scheduling info get all resource requests ( ) ) { if ( resources is none ( pending ) ) { / / found enough r rs to match the starvation break ; } / / see if we have already seen this rr if ( ! visited r rs visit ( rr ) ) { continue ; } / / a rr can have multiple containers of a capability we need to / / compute the number of containers that fit in " pending " int num containers that fit = ( int ) math floor ( resources ratio ( scheduler get resource calculator ( ) , pending , rr get capability ( ) ) ) ; if ( num containers that fit = = 0 ) { / / this rr ' s capability is too large to fit in pending continue ; } / / if the rr is only partially being satisfied , include only the / / partial number of containers if ( num containers that fit < rr get num containers ( ) ) { rr = resource request new instance ( rr get priority ( ) , rr get resource name ( ) , rr get capability ( ) , num containers that fit ) ; } / / add the rr to return list and adjust " pending " accordingly ret add ( rr ) ; resources subtract from non negative ( pending , resources multiply ( rr get capability ( ) , rr get num containers ( ) ) ) ; } return ret ; }


returns the number of nanoseconds since this source ' s epoch


checks that the given argument is not null if it is , throws { @ link null pointer exception } otherwise , returns the argument

public static < t > t check not null ( t arg , string text ) { if ( arg = = null ) { throw new null pointer exception ( text ) ; } return arg ; }


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

response entity < list < pet > > find pets by tags ( @ not null @ api param ( value = " tags to filter by " , required = true ) @ valid @ request param ( value = " tags " , required = true ) list < string > tags , @ api ignore final pageable pageable ) ;


where the entry was defined < code > optional aapt pb source source = 1 ; < code >


test if we compute the maximum am resource correctly

public void test compute max a m resource ( ) throws i o exception { conf set ( fair scheduler configuration allocation file , alloc file ) ; allocation file writer create ( ) add queue ( new allocation file queue builder ( " queue f s zero with max " ) weight ( 0 ) max a m share ( 0 5 ) max resources ( " 4096 mb 4 vcores " ) build ( ) ) add queue ( new allocation file queue builder ( " queue f s zero with a v l " ) weight ( 0 0f ) max a m share ( 0 5 ) build ( ) ) add queue ( new allocation file queue builder ( " queue f s non zero " ) weight ( 1 ) max a m share ( 0 5 ) build ( ) ) drf default queue scheduling policy ( ) write to file ( alloc file ) ; scheduler init ( conf ) ; scheduler start ( ) ; scheduler reinitialize ( conf , resource manager get r m context ( ) ) ; long mem capacity = 20 * gb ; int cpu capacity = 20 ; r m node node = mock nodes new node info ( 1 , resources create resource ( mem capacity , cpu capacity ) , 0 , " 127 0 0 1 " ) ; node added scheduler event node event = new node added scheduler event ( node ) ; node update scheduler event update event = new node update scheduler event ( node ) ; scheduler handle ( node event ) ; scheduler update ( ) ; resource am resource = resource new instance ( 1 * gb , 1 ) ; int am priority = r m app attempt impl am container priority get priority ( ) ; / / queue f s zero with max f s leaf queue queue f s zero with max = scheduler get queue manager ( ) get leaf queue ( " queue f s zero with max " , true ) ; application attempt id att id 1 = create app attempt id ( 1 , 1 ) ; create application with a m resource ( att id 1 , " queue f s zero with max " , " user 1 " , am resource ) ; create scheduling request existing application ( 1 * gb , 1 , am priority , att id 1 ) ; scheduler update ( ) ; scheduler handle ( update event ) ; / / queue f s zero with max ' s weight is 0 0 , so its fair share should be 0 , we use / / the min ( max share , available resource ) to compute max a m share , in this / / case , we use max share , since it is smaller than available resource assert equals ( " queue f s zero with max ' s fair share should be zero " , 0 , queue f s zero with max get fair share ( ) get memory size ( ) ) ; resource expected a m resource = resources multiply and round up ( queue f s zero with max get max share ( ) , queue f s zero with max get max a m share ( ) ) ; assert equals ( " queue f s zero with max ' s maximum am resource should be " + " max share * max a m share " , expected a m resource get memory size ( ) , queue f s zero with max get metrics ( ) get max a m share m b ( ) ) ; assert equals ( " queue f s zero with max ' s maximum am resource should be " + " max share * max a m share " , expected a m resource get virtual cores ( ) , queue f s zero with max get metrics ( ) get max a m share v cores ( ) ) ; assert equals ( " queue f s zero with max ' s am resource usage should be the same to " + " am resource request " , am resource get memory size ( ) , queue f s zero with max get metrics ( ) get a m resource usage m b ( ) ) ; / / queue f s zero with a v l am resource = resources create resource ( 1 * gb , 1 ) ; f s leaf queue queue f s zero with a v l = scheduler get queue manager ( ) get leaf queue ( " queue f s zero with a v l " , true ) ; application attempt id att id 2 = create app attempt id ( 2 , 1 ) ; create application with a m resource ( att id 2 , " queue f s zero with a v l " , " user 1 " , am resource ) ; create scheduling request existing application ( 1 * gb , 1 , am priority , att id 2 ) ; scheduler update ( ) ; scheduler handle ( update event ) ; / / queue f s zero with a v l ' s weight is 0 0 , so its fair share is 0 , and we use / / the min ( max share , available resource ) to compute max a m share , in this / / case , we use available resource since it is smaller than the / / default max share expected a m resource = resources multiply and round up ( resources create resource ( mem capacity - am resource get memory size ( ) , cpu capacity - am resource get virtual cores ( ) ) , queue f s zero with a v l get max a m share ( ) ) ; assert equals ( " queue f s zero with a v l ' s fair share should be zero " , 0 , queue f s zero with a v l get fair share ( ) get memory size ( ) ) ; assert equals ( " queue f s zero with a v l ' s maximum am resource should be " + " available resource * max a m share " , expected a m resource get memory size ( ) , queue f s zero with a v l get metrics ( ) get max a m share m b ( ) ) ; assert equals ( " queue f s zero with a v l ' s maximum am resource should be " + " available resource * max a m share " , expected a m resource get virtual cores ( ) , queue f s zero with a v l get metrics ( ) get max a m share v cores ( ) ) ; assert equals ( " queue f s zero with max ' s am resource usage should be the same to " + " am resource request " , am resource get memory size ( ) , queue f s zero with a v l get metrics ( ) get a m resource usage m b ( ) ) ; / / queue f s non zero am resource = resources create resource ( 1 * gb , 1 ) ; f s leaf queue queue f s non zero = scheduler get queue manager ( ) get leaf queue ( " queue f s non zero " , true ) ; application attempt id att id 3 = create app attempt id ( 3 , 1 ) ; create application with a m resource ( att id 3 , " queue f s non zero " , " user 1 " , am resource ) ; create scheduling request existing application ( 1 * gb , 1 , am priority , att id 3 ) ; scheduler update ( ) ; scheduler handle ( update event ) ; / / queue f s non zero ' s weight is 1 , so its fair share is not 0 , and we use the / / fair share to compute max a m share assert not equals ( " queue f s non zero ' s fair share shouldn ' t be zero " , 0 , queue f s non zero get fair share ( ) get memory size ( ) ) ; expected a m resource = resources multiply and round up ( queue f s non zero get fair share ( ) , queue f s non zero get max a m share ( ) ) ; assert equals ( " queue f s non zero ' s maximum am resource should be " + " fair share * max a m share " , expected a m resource get memory size ( ) , queue f s non zero get metrics ( ) get max a m share m b ( ) ) ; assert equals ( " queue f s non zero ' s maximum am resource should be " + " fair share * max a m share " , expected a m resource get virtual cores ( ) , queue f s non zero get metrics ( ) get max a m share v cores ( ) ) ; assert equals ( " queue f s non zero ' s am resource usage should be the same to " + " am resource request " , am resource get memory size ( ) , queue f s non zero get metrics ( ) get a m resource usage m b ( ) ) ; }


create { @ link annotation type mappings } for the specified annotation type

static annotation type mappings for annotation type ( class < ? extends annotation > annotation type , annotation filter annotation filter ) { return for annotation type ( annotation type , repeatable containers standard repeatables ( ) , annotation filter ) ; }


a 3 wants a 1 , a 1 wants a 2 , path is a 1 , a 2 , a 3 , so a 2 comes after a 1

public void validate order ( ) throws exception { aspect a 1 = create aspect ( " a 1 " , " a 2 " ) ; aspect a 2 = create aspect ( " a 2 " ) ; aspect a 3 = create aspect ( " a 3 " , " a 1 " ) ; aspect collection collection = aspect collection create ( immutable list of ( a 1 , a 2 , a 3 ) ) ; validate aspect collection ( collection , immutable list of ( a 1 , a 2 , a 3 ) , expect deps ( a 1 ) , expect deps ( a 2 ) , expect deps ( a 3 , a 1 ) ) ; }


returns a new address inside the specified program as indicated by the string

public final address to addr ( string address string ) { return address evaluator evaluate ( current program , address string ) ; }


protected void restore next in edge ( xml pull parser parser , block map resolver ) throws pcode x m l exception { block edge in edge = new block edge ( ) ; intothis add ( in edge ) ; in edge restore xml ( parser , resolver ) ; while ( in edge point outofthis size ( ) < = in edge reverse index ) { in edge point outofthis add ( null ) ; } block edge out edge = new block edge ( this , 0 , intothis size ( ) - 1 ) ; in edge point outofthis set ( in edge reverse index , out edge ) ; }


public final cancellable scroll async ( search scroll request search scroll request , request options options , action listener < search response > listener ) { return perform request async and parse entity ( search scroll request , request converters : : search scroll , options , search response : : from x content , listener , empty set ( ) ) ; }


joins the specified multicast group at the specified interface and notifies the { @ link channel future } once the operation completes

channel future join group ( inet socket address multicast address , network interface network interface ) ;


expected distance is the expected distance between client and dn 0 means local host 2 means same rack 4 means remote rack of first degree invalid script mapping config is used to test

private void test read file system statistics ( int expected distance , boolean use script mapping , boolean invalid script mapping file ) throws i o exception { mini d f s cluster cluster = null ; static mapping add node to rack ( net utils get local hostname ( ) , " / rack client " ) ; final configuration conf = get test configuration ( ) ; conf set boolean ( fs client topology resolution enabled , true ) ; / / client context is cached globally by default thus we will end up using / / the network distance computed by other test cases / / use different value for dfs client context in each test case so that it / / can compute network distance independently conf set ( dfs client context , " test context " + expected distance ) ; / / create a cluster with a dn with the expected distance / / mini d f s cluster by default uses static mapping unless the test / / overrides it if ( use script mapping ) { conf set class ( d f s config keys net topology node switch mapping impl key , script based mapping class , d n s to switch mapping class ) ; if ( invalid script mapping file ) { conf set ( d f s config keys net topology script file name key , " invalid script file txt " ) ; } cluster = new mini d f s cluster builder ( conf ) use configured topology mapping class ( true ) build ( ) ; } else if ( expected distance = = 0 ) { cluster = new mini d f s cluster builder ( conf ) hosts ( new string [ ] { net utils get local hostname ( ) } ) build ( ) ; } else if ( expected distance = = 2 ) { cluster = new mini d f s cluster builder ( conf ) racks ( new string [ ] { " / rack client " } ) build ( ) ; } else if ( expected distance = = 4 ) { cluster = new mini d f s cluster builder ( conf ) racks ( new string [ ] { " / rack foo " } ) build ( ) ; } / / create a file , read the file and verify the metrics try { final file system fs = cluster get file system ( ) ; d f s test util get statistics ( fs ) reset ( ) ; path dir = new path ( " / test " ) ; path file = new path ( dir , " file " ) ; string input = " hello world " ; d f s test util write file ( fs , file , input ) ; f s data input stream stm = fs open ( file ) ; byte [ ] actual = new byte [ 4096 ] ; stm read ( actual ) ; check read statistics ( fs , expected distance , input length ( ) ) ; } finally { if ( cluster ! = null ) cluster shutdown ( ) ; } }


method indicating whether the free page map is a " big " free page map currently , we have at least two types extending this class one is " big " ( the newer v 7 00 ) and the other is not the { @ link # dump ( ) } method makes use of this method


tests that label extraction works as expected - disallowed label characters are resolved to themselves

public void test label extraction ( ) throws exception { setup dummy ( ) ; assert expansion ( " ( foo / " + allowed chars + " ) " , " ( / / foo : " + allowed chars + " ) " , immutable map < label , iterable < artifact > > of ( label for ( allowed chars ) , immutable list of ( artifact for ( allowed chars ) ) ) ) ; assert expansion ( " foo / x 1 , foo / x 2 = foo / bar / x 3 " , " x 1 , x 2 = bar / x 3 " , immutable map < label , iterable < artifact > > of ( label for ( " x 1 " ) , immutable list of ( artifact for ( " x 1 " ) ) , label for ( " x 2 " ) , immutable list of ( artifact for ( " x 2 " ) ) , label for ( " bar / x 3 " ) , immutable list of ( artifact for ( " bar / x 3 " ) ) ) ) ; }


method to actually perform the action logic for this action

public void action performed ( action context context ) ;


public void prefix string test ( ) { / / todo : test prefix string }


no calls expected at all , i e min = 0 and max = 0

public static expected count never ( ) { return new expected count ( 0 , 0 ) ; }


resource definitions corresponding to an android package < code > repeated aapt pb package package = 2 ; < code >

private void add package ( int index , com android aapt resources package builder builder for value ) { ensure package is mutable ( ) ; package add ( index , builder for value build ( ) ) ; }


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


waits for the given condition to return true most of the < code > wait for condition ( ) < code > methods throw an { @ link assertion failed error } if the timeout period expires this method allows you to setup a longer wait period by repeatedly calling this method < p > most clients should use { @ link # wait for condition ( boolean supplier ) }

public static void wait for condition without failing ( boolean supplier supplier ) { wait for condition ( supplier , false / * fail on timeout * / , ( ) - > null / * failure message * / ) ; }


public static varnode simplify ( pcode op pcode op , varnode [ ] values , address factory addr factory , task monitor monitor ) throws cancelled exception { sequence number seq = pcode op get seqnum ( ) ; varnode output = pcode op get output ( ) ; varnode result = null ; switch ( pcode op get opcode ( ) ) { case pcode op copy : / / copy one operand to another result = values [ 0 ] ; break ; case pcode op int equal : / / return true if operand 1 = = operand 2 if ( values [ 0 ] equals ( values [ 1 ] ) ) { result = new varnode ( addr factory get constant address ( 1 ) , 1 ) ; } else if ( values [ 0 ] is constant ( ) & & values [ 1 ] is constant ( ) ) { int b = ( get unsigned offset ( values [ 0 ] , values [ 0 ] get size ( ) ) = = get unsigned offset ( values [ 1 ] , values [ 1 ] get size ( ) ) ) ? 1 : 0 ; result = new varnode ( addr factory get constant address ( b ) , 1 ) ; } break ; case pcode op int notequal : / / return true if operand 1 ! = operand 2 if ( values [ 0 ] equals ( values [ 1 ] ) ) { result = new varnode ( addr factory get constant address ( 0 ) , 1 ) ; } else if ( values [ 0 ] is constant ( ) & & values [ 1 ] is constant ( ) ) { int b = ( get unsigned offset ( values [ 0 ] , values [ 0 ] get size ( ) ) ! = get unsigned offset ( values [ 1 ] , values [ 1 ] get size ( ) ) ) ? 1 : 0 ; result = new varnode ( addr factory get constant address ( b ) , 1 ) ; } break ; case pcode op int sless : / / return true if signed op 1 < signed op 2 if ( values [ 0 ] is constant ( ) & & values [ 1 ] is constant ( ) ) { int b = ( get signed offset ( values [ 0 ] ) < get signed offset ( values [ 1 ] ) ) ? 1 : 0 ; result = new varnode ( addr factory get constant address ( b ) , 1 ) ; } break ; case pcode op int slessequal : / / return true if signed op 1 < = signed op 2 if ( values [ 0 ] is constant ( ) & & values [ 1 ] is constant ( ) ) { int b = ( get signed offset ( values [ 0 ] ) < = get signed offset ( values [ 1 ] ) ) ? 1 : 0 ; result = new varnode ( addr factory get constant address ( b ) , 1 ) ; } break ; case pcode op int less : / / return true if unsigned op 1 < unsigned op 2 / / also indicates borrow on unsigned substraction if ( values [ 0 ] is constant ( ) & & values [ 1 ] is constant ( ) ) { int b = ( get unsigned offset ( values [ 0 ] , values [ 0 ] get size ( ) ) < get unsigned offset ( values [ 1 ] , values [ 1 ] get size ( ) ) ) ? 1 : 0 ; result = new varnode ( addr factory get constant address ( b ) , 1 ) ; } break ; case pcode op int lessequal : / / return true if unsigned op 1 < = unsigned op 2 if ( values [ 0 ] is constant ( ) & & values [ 1 ] is constant ( ) ) { int b = ( get unsigned offset ( values [ 0 ] , values [ 0 ] get size ( ) ) < = get unsigned offset ( values [ 1 ] , values [ 1 ] get size ( ) ) ) ? 1 : 0 ; result = new varnode ( addr factory get constant address ( b ) , 1 ) ; } break ; case pcode op int zext : / / zero extend operand if ( values [ 0 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( get unsigned offset ( values [ 0 ] , values [ 0 ] get size ( ) ) ) , output get size ( ) ) ; } break ; case pcode op int sext : / / sign extend operand if ( values [ 0 ] is constant ( ) ) { long signed offset = get signed offset ( values [ 0 ] ) & value mask [ output get size ( ) ] ; result = new varnode ( addr factory get constant address ( signed offset ) , output get size ( ) ) ; } break ; case pcode op int add : / / unsigned addition of operands of same size if ( values [ 0 ] is constant ( ) ) { varnode operation op = flip inputs ( pcode op , values ) ; pcode op = op get p code op ( ) ; } if ( values [ 1 ] is constant ( ) ) { if ( values [ 0 ] is constant ( ) ) { long signed offset = ( get signed offset ( values [ 1 ] ) + get signed offset ( values [ 0 ] ) ) & value mask [ output get size ( ) ] ; result = new varnode ( addr factory get constant address ( signed offset ) , output get size ( ) ) ; } else if ( values [ 1 ] get offset ( ) = = 0 ) { result = values [ 0 ] ; } else if ( values [ 0 ] instanceof varnode operation ) { / / result = combine int add offset ( pcode op , ( varnode operation ) values [ 0 ] , get signed offset ( values [ 1 ] , output get size ( ) ) , monitor ) ; result = push down int add offset ( ( varnode operation ) values [ 0 ] , get signed offset ( values [ 1 ] ) , addr factory , monitor ) ; } } break ; case pcode op int sub : / / unsigned subtraction of operands of same size if ( values [ 0 ] equals ( values [ 1 ] ) ) { result = new varnode ( addr factory get constant address ( 0 ) , output get size ( ) ) ; } else if ( values [ 1 ] is constant ( ) ) { if ( values [ 0 ] is constant ( ) ) { long signed offset = ( get signed offset ( values [ 0 ] ) - get signed offset ( values [ 1 ] ) ) & value mask [ output get size ( ) ] ; result = new varnode ( addr factory get constant address ( signed offset ) , output get size ( ) ) ; } else if ( values [ 1 ] get offset ( ) = = 0 ) { result = values [ 0 ] ; } else if ( values [ 0 ] instanceof varnode operation ) { / / result = combine int add offset ( pcode op , ( varnode operation ) values [ 0 ] , - get signed offset ( values [ 1 ] , output get size ( ) ) , monitor ) ; result = push down int add offset ( ( varnode operation ) values [ 0 ] , - get signed offset ( values [ 1 ] ) , addr factory , monitor ) ; } } break ; case pcode op int carry : / / true if adding two operands has overflow ( carry ) return eillimnate carry op ( pcode op , values , addr factory , monitor ) ; case pcode op int scarry : / / true if carry in signed addition of 2 ops / / todo : implement constant case case pcode op int sborrow : / / true if borrow in signed subtraction of 2 ops if ( ( values [ 1 ] is constant ( ) & & values [ 1 ] get offset ( ) = = 0 ) | | ( values [ 0 ] is constant ( ) & & values [ 0 ] get offset ( ) = = 0 ) ) { result = new varnode ( addr factory get constant address ( 0 ) , 1 ) ; } break ; case pcode op int 2comp : / / twos complement ( for subtracting ) of operand if ( values [ 0 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( - values [ 0 ] get offset ( ) ) , output get size ( ) ) ; } break ; case pcode op int negate : if ( values [ 0 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( ~ values [ 0 ] get offset ( ) ) , output get size ( ) ) ; } break ; case pcode op int xor : / / exclusive or of two operands of same size if ( values [ 0 ] equals ( values [ 1 ] ) ) { / / anything xor ' d with itself is zero result = new varnode ( addr factory get constant address ( 0 ) , output get size ( ) ) ; } else if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( values [ 0 ] get offset ( ) ^ values [ 1 ] get offset ( ) ) , output get size ( ) ) ; } else if ( values [ 0 ] is constant ( ) ) { if ( values [ 0 ] get offset ( ) = = 0 ) { result = values [ 1 ] ; } else { varnode operation op = flip inputs ( pcode op , values ) ; result = combine logic or operation ( op , addr factory ) ; } } else if ( values [ 1 ] is constant ( ) ) { if ( values [ 1 ] get offset ( ) = = 0 ) { result = values [ 0 ] ; } else { varnode operation op = new varnode operation ( pcode op , values ) ; result = combine logic or operation ( op , addr factory ) ; } } break ; case pcode op int and : if ( ( values [ 1 ] is constant ( ) & & values [ 1 ] get offset ( ) = = 0 ) | | ( values [ 0 ] is constant ( ) & & values [ 0 ] get offset ( ) = = 0 ) ) { / / zero and ' d with anything is zero result = new varnode ( addr factory get constant address ( 0 ) , output get size ( ) ) ; } else if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( values [ 0 ] get offset ( ) & values [ 1 ] get offset ( ) ) , output get size ( ) ) ; } else if ( values [ 0 ] is constant ( ) ) { result = simplify with int and mask ( seq , values [ 1 ] , get unsigned offset ( values [ 0 ] , output get size ( ) ) , addr factory , monitor ) ; } else if ( values [ 1 ] is constant ( ) ) { result = simplify with int and mask ( seq , values [ 0 ] , get unsigned offset ( values [ 1 ] , output get size ( ) ) , addr factory , monitor ) ; } break ; case pcode op int or : if ( values [ 0 ] equals ( values [ 1 ] ) ) { result = values [ 0 ] ; } else if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( values [ 0 ] get offset ( ) | values [ 1 ] get offset ( ) ) , output get size ( ) ) ; } else if ( values [ 0 ] is constant ( ) ) { if ( values [ 0 ] get offset ( ) = = 0 ) { result = values [ 1 ] ; } else { varnode operation op = flip inputs ( pcode op , values ) ; result = combine logic or operation ( op , addr factory ) ; } } else if ( values [ 1 ] is constant ( ) ) { if ( values [ 1 ] get offset ( ) = = 0 ) { result = values [ 0 ] ; } else { varnode operation op = new varnode operation ( pcode op , values ) ; result = combine logic or operation ( op , addr factory ) ; } } break ; case pcode op int left : / / left shift if ( values [ 1 ] is constant ( ) & & values [ 1 ] get offset ( ) < 64 ) { if ( values [ 0 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( values [ 0 ] get offset ( ) < < values [ 1 ] get offset ( ) ) , output get size ( ) ) ; } else { result = combine double shift operation ( pcode op , values , addr factory ) ; } } break ; case pcode op int right : / / right shift zero fill if ( values [ 1 ] is constant ( ) & & values [ 1 ] get offset ( ) < 64 ) { if ( values [ 0 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( values [ 0 ] get offset ( ) > > > values [ 1 ] get offset ( ) ) , output get size ( ) ) ; } else { result = combine double shift operation ( pcode op , values , addr factory ) ; } } break ; case pcode op int sright : / / signed right shift if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) & & values [ 1 ] get offset ( ) < 64 ) { result = new varnode ( addr factory get constant address ( values [ 0 ] get offset ( ) > > values [ 1 ] get offset ( ) ) , output get size ( ) ) ; } break ; case pcode op int mult : / / integer multiplication if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( values [ 0 ] get offset ( ) * values [ 1 ] get offset ( ) ) , output get size ( ) ) ; } break ; case pcode op int div : / / unsigned integer division if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { if ( values [ 1 ] get offset ( ) = = 0 ) { msg warn ( results state class , " divide by zero encounteerd during emulation at " + pcode op get seqnum ( ) get target ( ) ) ; } else { result = new varnode ( addr factory get constant address ( get unsigned offset ( values [ 0 ] , output get size ( ) ) / get unsigned offset ( values [ 1 ] , output get size ( ) ) ) , output get size ( ) ) ; } } break ; case pcode op int sdiv : / / signed integer division if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { if ( values [ 1 ] get offset ( ) = = 0 ) { msg warn ( results state class , " divide by zero encounteerd during emulation at " + pcode op get seqnum ( ) get target ( ) ) ; } else { result = new varnode ( addr factory get constant address ( values [ 0 ] get offset ( ) / values [ 1 ] get offset ( ) ) , output get size ( ) ) ; } } break ; case pcode op int rem : / / unsigned mod ( remainder ) if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { if ( values [ 1 ] get offset ( ) = = 0 ) { msg warn ( results state class , " divide by zero encounteerd during emulation at " + pcode op get seqnum ( ) get target ( ) ) ; } else { result = new varnode ( addr factory get constant address ( get unsigned offset ( values [ 0 ] , output get size ( ) ) % get unsigned offset ( values [ 1 ] , output get size ( ) ) ) , output get size ( ) ) ; } } break ; case pcode op int srem : / / signed mod ( remainder ) if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { if ( values [ 1 ] get offset ( ) = = 0 ) { msg warn ( results state class , " divide by zero encounteerd during emulation at " + pcode op get seqnum ( ) get target ( ) ) ; } else { result = new varnode ( addr factory get constant address ( values [ 0 ] get offset ( ) % values [ 1 ] get offset ( ) ) , output get size ( ) ) ; } } break ; case pcode op bool negate : / / boolean negate or not if ( values [ 0 ] is constant ( ) ) { int b = values [ 0 ] get offset ( ) ! = 0 ? 0 : 1 ; result = new varnode ( addr factory get constant address ( b ) , 1 ) ; } else if ( values [ 0 ] instanceof varnode operation ) { varnode operation op val = ( varnode operation ) values [ 0 ] ; if ( op val get p code op ( ) get opcode ( ) = = pcode op bool negate ) { result = op val get input values ( ) [ 0 ] ; / / double - negative case } } break ; case pcode op bool xor : / / boolean xor if ( values [ 0 ] equals ( values [ 1 ] ) ) { result = new varnode ( addr factory get constant address ( 0 ) , 1 ) ; } else if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { boolean v 0 = ( values [ 0 ] get offset ( ) ! = 0 ) ; boolean v 1 = ( values [ 1 ] get offset ( ) ! = 0 ) ; int b = ( v 0 ! = v 1 ) ? 1 : 0 ; result = new varnode ( addr factory get constant address ( b ) , 1 ) ; } break ; case pcode op bool and : / / boolean and ( & & ) if ( values [ 0 ] is constant ( ) ) { if ( values [ 0 ] get offset ( ) = = 0 ) { result = new varnode ( addr factory get constant address ( 0 ) , 1 ) ; } else if ( values [ 1 ] is constant ( ) ) { result = new varnode ( addr factory get constant address ( values [ 1 ] get offset ( ) = = 0 ? 0 : 1 ) , 1 ) ; } else { result = values [ 1 ] ; } } else if ( values [ 1 ] is constant ( ) ) { if ( values [ 1 ] get offset ( ) = = 0 ) { result = new varnode ( addr factory get constant address ( 0 ) , 1 ) ; } else { result = values [ 0 ] ; } } break ; case pcode op bool or : / / boolean or ( | | ) if ( values [ 0 ] is constant ( ) & & values [ 0 ] get offset ( ) ! = 0 ) { result = new varnode ( addr factory get constant address ( 1 ) , 1 ) ; } else if ( values [ 1 ] is constant ( ) & & values [ 1 ] get offset ( ) ! = 0 ) { result = new varnode ( addr factory get constant address ( 1 ) , 1 ) ; } else if ( values [ 1 ] is constant ( ) & & values [ 0 ] is constant ( ) ) { / / both values are zero result = new varnode ( addr factory get constant address ( 0 ) , 1 ) ; } break ; case pcode op subpiece : / / output is a subpiece of input 0 , input 1 = offset into input 0 if ( values [ 0 ] is constant ( ) ) { long val = get unsigned offset ( values [ 0 ] , values [ 0 ] get size ( ) ) ; val = ( val > > ( 8 * values [ 1 ] get offset ( ) ) ) & value mask [ output get size ( ) ] ; result = new varnode ( addr factory get constant address ( val ) , output get size ( ) ) ; } else if ( values [ 1 ] get offset ( ) = = 0 ) { if ( values [ 0 ] get size ( ) = = output get size ( ) ) { / / unnecessary subpiece result = values [ 0 ] ; } else if ( values [ 0 ] instanceof varnode operation ) { varnode operation input op = ( varnode operation ) values [ 0 ] ; pcode op input pcode op = input op get p code op ( ) ; varnode [ ] sub input values = input op get input values ( ) ; if ( input pcode op get opcode ( ) = = pcode op int zext & & sub input values [ 0 ] get size ( ) = = output get size ( ) ) { / / combine subpiece and zext result = sub input values [ 0 ] ; } } } break ; / / floating point instructions : no floating point data format is specified here , / / although the exact operation of these instructions obviously depends on the / / format for simulation , a " mode " variable specifying the floating point format / / will be necessary case pcode op float equal : / / return true if operand 1 = = operand 2 case pcode op float notequal : / / return true if operand 1 ! = operand 2 case pcode op float less : / / return true if op 1 < op 2 case pcode op float lessequal : / / return true if op 1 < = op 2 case pcode op float nan : / / return true if neither op 1 is na n case pcode op float add : / / float addition case pcode op float div : / / float division case pcode op float mult : / / float multiplication case pcode op float sub : / / float subtraction case pcode op float neg : / / float negation case pcode op float abs : / / float absolute value case pcode op float sqrt : / / float square root case pcode op float int2float : / / convert int type to float type case pcode op float float2float : / / convert between float sizes case pcode op float trunc : / / round towards zero case pcode op float ceil : / / round towards + infinity case pcode op float floor : / / round towards - infinity case pcode op float round : / / round towards nearest } if ( result = = null ) { varnode operation op = new varnode operation ( pcode op , values ) ; op set simplified ( true ) ; result = op ; } return result ; }


create the f s data output stream to write on the file system

public abstract s build ( ) throws illegal argument exception , i o exception ;


returns the name for this symlink in the workspace note that this is independent of the target configuration ( s ) that may help determine the symlink ' s destination

string get link name ( string symlink prefix , string product name , string workspace base name ) ;


sets the formatter to be used for formatting the axis labels if no formatter is set , the chart will automatically determine a reasonable formatting ( concerning decimals ) for all the values that are drawn inside the chart use chart get default value formatter ( ) to use the formatter calculated by the chart

public void set value formatter ( i axis value formatter f ) { if ( f = = null ) m axis value formatter = new default axis value formatter ( m decimals ) ; else m axis value formatter = f ; }


set a value in the webapp context these values are available to the jsp pages as " application get attribute ( name ) "

public void set attribute ( string name , object value ) { web app context set attribute ( name , value ) ; }


public string get table name ( int offset len ) { return name prefix + top address add wrap ( offset len * addr size ) to string ( ) ; }


public < t extends socket address > t destination address ( ) { return ( t ) destination address ; }


the algorithm is expected to compute the placement of the provided constraint placement algorithm input and use the collector to aggregate any output

void place ( constraint placement algorithm input algorithm input , constraint placement algorithm output collector collector ) ;


remove the record identified by index this will never be the last record within the node

public void remove ( int index ) throws i o exception { if ( index < 0 | | index > = key count ) throw new assert exception ( ) ; if ( has indirect storage ( index ) ) { remove chained buffer ( buffer get int ( get record data offset ( index ) ) ) ; enable indirect storage ( index , false ) ; } int len = get full record length ( index ) ; move records ( index + 1 , len ) ; int start = header size + ( ( index + 1 ) * entry size ) ; len = ( key count - index - 1 ) * entry size ; buffer move ( start , start - entry size , len ) ; set key count ( key count - 1 ) ; }


completes the join operation with the user function that is executed for each combination of elements with the same key in a window < b > note : < b > this is a temporary workaround while the { @ link # apply ( flat join function , type information ) } method has the wrong return type and hence does not allow one to set an operator - specific parallelism

public < t > single output stream operator < t > with ( join function < t1 , t2 , t > function , type information < t > result type ) { return ( single output stream operator < t > ) apply ( function , result type ) ; }


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

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


stubbings in ascending order , most recent last

public collection < stubbing > get stubbings ascending ( ) { list < stubbing > result = new linked list < stubbing > ( stubbed ) ; collections reverse ( result ) ; return result ; }


creates lazy proxies for the { @ code j m x connector } and { @ code m bean server connection }

private void create lazy connection ( ) { this connector target source = new j m x connector lazy init target source ( ) ; target source connection target source = new m bean server connection lazy init target source ( ) ; this connector = ( j m x connector ) new proxy factory ( j m x connector class , this connector target source ) get proxy ( this bean class loader ) ; this connection = ( m bean server connection ) new proxy factory ( m bean server connection class , connection target source ) get proxy ( this bean class loader ) ; }


only select executions which have a local string variable which is not the given value , case insensitive this method only works if your database has encodingcollation that supports case - sensitive queries for example , use " collate utf - 8 " on my s q l and for mssql , select one of the case - sensitive collations available ( < a href = " http : msdn microsoft comen - uslibraryms 1 4 4 2 5 0 ( v = sql 105 ) aspx " > msdn server collation reference )

execution query variable value not equals ignore case ( string name , string value ) ;


compute the bits required to represent pth percentile value

static int percentile bits ( long [ ] data , int offset , int length , double percentile ) { check argument ( percentile < = 1 0 & & percentile > 0 0 ) ; / / histogram that store the encoded bit requirement for each values / / maximum number of bits that can encoded is 32 ( refer fixed bit sizes ) int [ ] hist = new int [ 32 ] ; / / compute the histogram for ( int i = offset ; i < ( offset + length ) ; i + + ) { int idx = encode bit width ( find closest num bits ( data [ i ] ) ) ; hist [ idx ] + = 1 ; } int per len = ( int ) ( length * ( 1 0 - percentile ) ) ; / / return the bits required by pth percentile length for ( int i = hist length - 1 ; i > = 0 ; i - - ) { per len - = hist [ i ] ; if ( per len < 0 ) { return decode bit width ( i ) ; } } return 0 ; }


generate repository change event following the movement of an item

public void item moved ( string parent path , string item name , string new parent path , string new name ) { repository change event event = new repository change event ( repository change event rep item moved , parent path , item name , new parent path , new name ) ; send change event ( event ) ; }


public void just symbol test ( ) { / / todo : test just symbol }


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


converts a relational tree of { @ link modify operation } s into a set of runnable { @ link transformation } s this method accepts a list of { @ link modify operation } s to allow reusing common subtrees of multiple relational queries each query ' s top node should be a { @ link modify operation } in order to pass the expected properties of the output { @ link transformation } such as output mode ( append , retract , upsert ) or the expected output type

list < transformation < ? > > translate ( list < modify operation > modify operations ) ;


this implementation returns a url for the underlying class path resource

public url get u r l ( ) throws i o exception { url url ; if ( this clazz ! = null ) { url = this clazz get resource ( this path ) ; } else { url = this class loader get resource ( this path ) ; } if ( url = = null ) { throw new file not found exception ( get description ( ) + " cannot be resolved to url because it does not exist " ) ; } return url ; }


by default , a consumer will be built from properties derived from builder defaults , as well as " auto offset reset " - > " earliest " any properties set here will override the consumer config for example : only consume spans since you connected by setting the below { @ code map < string , string > overrides = new linked hash map < > ( ) ; overrides put ( consumer config auto offset reset config , " latest " ) ; builder overrides ( overrides ) ; }

public final builder overrides ( map < string , ? > overrides ) { if ( overrides = = null ) throw new null pointer exception ( " overrides = = null " ) ; properties put all ( overrides ) ; return this ; }


public void builder defaults ( ) throws exception { / / transitive sources is mandatory , so create a dummy value but no need to assert on it nested set < artifact > sources = nested set builder create ( order compile order , dummy artifact ) ; struct impl info = py struct utils builder ( ) set transitive sources ( sources ) build ( ) ; / / assert using struct operations , not py struct utils accessors , which aren ' t necessarily trusted / / to be correct assert that ( ( boolean ) info get value ( py struct utils uses shared libraries ) ) is false ( ) ; assert has order and contains exactly ( ( ( depset ) info get value ( py struct utils imports ) ) get set ( string class ) , order compile order ) ; assert that ( ( boolean ) info get value ( py struct utils has py2 only sources ) ) is false ( ) ; assert that ( ( boolean ) info get value ( py struct utils has py3 only sources ) ) is false ( ) ; }


returns whether or not the { @ code octet } is in the base 3 2 alphabet

public boolean is in alphabet ( final byte octet ) { return octet > = 0 & & octet < decode table length & & decode table [ octet ] ! = - 1 ; }


option to skip dwarf import if the dwarf record count is too large

public int get import limit d i e count ( ) { return import limit d i e count ; }


returns a { @ link map } mapping each unique element in the given { @ link collection } to an { @ link integer } representing the number of occurrences of that element in the { @ link collection } only those elements present in the collection will appear as keys in the map

public static map get cardinality map ( final collection coll ) { map count = new hash map ( coll size ( ) ) ; for ( iterator it = coll iterator ( ) ; it has next ( ) ; ) { object obj = it next ( ) ; integer c = ( integer ) ( count get ( obj ) ) ; if ( c = = null ) { count put ( obj , integer one ) ; } else { count put ( obj , c + 1 ) ; } } return count ; }


public void write to ( filer filer ) throws i o exception { string file name = package name is empty ( ) ? type spec name : package name + " " + type spec name ; list < element > originating elements = type spec originating elements ; java file object filer source file = filer create source file ( file name , originating elements to array ( new element [ originating elements size ( ) ] ) ) ; try ( writer writer = filer source file open writer ( ) ) { write to ( writer ) ; } catch ( exception e ) { try { filer source file delete ( ) ; } catch ( exception ignored ) { } throw e ; } }


given two object instances of the same type , this method accesses all their internal fields , including the fields of state container if the class type is component , to check if they are equivalent there ' s special equality code to handle special class types e g components , event handlers , etc

public static boolean has equivalent fields ( final object obj 1 , final object obj 2 ) { if ( obj 1 = = null | | obj 2 = = null | | obj 1 get class ( ) ! = obj 2 get class ( ) ) { throw new illegal argument exception ( " the input is invalid " ) ; } for ( field field : obj 1 get class ( ) get declared fields ( ) ) { if ( ! field is annotation present ( comparable class ) ) { continue ; } final class < ? > class type = field get type ( ) ; final object val 1 ; final object val 2 ; try { field set accessible ( true ) ; val 1 = field get ( obj 1 ) ; val 2 = field get ( obj 2 ) ; field set accessible ( false ) ; } catch ( illegal access exception e ) { throw new illegal state exception ( " unable to get fields by reflection " , e ) ; } boolean intermediate result = components configuration disable get annotation usage ? is equivalent util without get annotation ( field , class type , val 1 , val 2 ) : is equivalent util ( field , class type , val 1 , val 2 ) ; if ( ! intermediate result ) { return intermediate result ; } } return true ; }


constructs certificate validation context from pem file path and sets contents as inline - bytes

private static final certificate validation context get cert context from path as inline bytes ( string pem file path ) throws i o exception , certificate exception { x 5 0 9 certificate x 5 0 9 cert = test utils load x 5 0 9 cert ( pem file path ) ; return certificate validation context new builder ( ) set trusted ca ( data source new builder ( ) set inline bytes ( byte string copy from ( x 5 0 9 cert get encoded ( ) ) ) ) build ( ) ; }


test { @ link n m audit logger } without ip set

public void test n m audit logger without i p ( ) throws exception { / / test without ip test success log format ( false ) ; test failure log format ( false ) ; }


public static string get chinese zodiac ( final date date ) { calendar cal = calendar get instance ( ) ; cal set time ( date ) ; return chinese zodiac [ cal get ( calendar year ) % 12 ] ; }


set the list of choices legal arguments are string ( in which case the arguments gets split into lines ) and collection which sets the list of legal parameters to the string representations of the argument ' s non - null entries see jenkins - 26143 for background this retains the compatibility with the legacy string ' choices ' parameter , while supporting the list type as generated by the snippet generator

public void set choices ( object choices ) { if ( choices instanceof string ) { set choices text ( ( string ) choices ) ; return ; } if ( choices instanceof list ) { array list < string > new choices = new array list < > ( ) ; for ( object o : ( list ) choices ) { if ( o ! = null ) { new choices add ( o to string ( ) ) ; } } this choices = new choices ; return ; } throw new illegal argument exception ( " expected string or list , but got " + choices get class ( ) get name ( ) ) ; }


returns a ready transport that will be used to create new streams returns { @ code null } if the state is not ready will try to connect if state is idle

client transport obtain active transport ( ) ;


public task attempt i d get task attempt id ( ) { return task attempt i d for name ( datum get attempt id ( ) to string ( ) ) ; }


block ( class < ? extends sub view > cls ) ;


public string get user email ( final authentication authentication , final acceptto multifactor properties acceptto ) { val attributes = authentication get principal ( ) get attributes ( ) ; logger debug ( " current principal attributes are [ { } ] " , attributes ) ; return collection utils first element ( attributes get ( acceptto get email attribute ( ) ) ) map ( object : : to string ) or else ( null ) ; }


adds mapping that will be added when the index gets created note that the definition should not be nested under a type name

public create index request mapping ( map < string , ? > source ) { try { x content builder builder = x content factory content builder ( x content type json ) ; builder map ( source ) ; return mapping ( bytes reference bytes ( builder ) , builder content type ( ) ) ; } catch ( i o exception e ) { throw new elasticsearch generation exception ( " failed to generate [ " + source + " ] " , e ) ; } }


public string host ( ) { return host ; }


public void test service parser ( ) { tcc action impl tcc action = new tcc action impl ( ) ; boolean result = local t c c remoting parser is service ( tcc action , " a " ) ; assertions assert true ( result ) ; }


adds a new header with the specified name and values this method is equivalent to for ( object v : values ) { headers add object ( name , v ) ; }

t add object ( k name , object values ) ;


public static void create file ( file system fs , path path , boolean overwrite , byte [ ] data ) throws i o exception { f s data output stream stream = fs create ( path , overwrite ) ; try { if ( data ! = null & & data length > 0 ) { stream write ( data ) ; } stream close ( ) ; } finally { i o utils close stream ( stream ) ; } }


return the appropriate implementation of the zlib compressor

public static compressor get zlib compressor ( configuration conf ) { return ( is native zlib loaded ( conf ) ) ? new zlib compressor ( conf ) : new built in zlib deflater ( zlib factory get compression level ( conf ) compression level ( ) ) ; }


determines whether two { @ code rule class name predicate } s should be considered incompatible as rule class predicate and rule class warning predicate specifically , if both list sets of explicit rule class names to permit , those two sets must be disjoint , so the restriction only applies when both predicates have been created by { @ link # only }

boolean considered overlapping ( rule class name predicate that ) { return this overlappable ! = null & & that overlappable ! = null & & ! collections disjoint ( this overlappable , that overlappable ) ; }


test for hdfs - 14557 to ensure that a edit file that failed to fully allocate and has a header byte of - 1 is moved aside to allow startup to progress

public void test empty edits in progress moved aside ( ) throws exception { / / first , write 5 transactions to the journal journal start log segment ( make r i ( 1 ) , 1 , name node layout version current layout version - 1 ) ; final int num txns = 5 ; byte [ ] ops = q j m test util create txn data ( 1 , 5 ) ; journal journal ( make r i ( 2 ) , 1 , 1 , num txns , ops ) ; / / now close the segment journal finalize log segment ( make r i ( 3 ) , 1 , num txns ) ; / / create a new segment creating a new edits inprogress file journal start log segment ( make r i ( 4 ) , 6 , name node layout version current layout version - 1 ) ; ops = q j m test util create txn data ( 6 , 5 ) ; journal journal ( make r i ( 5 ) , 6 , 6 , num txns , ops ) ; file eip = journal get storage ( ) get in progress edit log ( 6 ) ; / / now stop the journal without finalizing the segment journal close ( ) ; / / now " zero out " the eip file with - 1 bytes , similar to how it would / / appear if the pre - allocation failed random access file rwf = new random access file ( eip , " rw " ) ; for ( int i = 0 ; i < rwf length ( ) ; i + + ) { rwf write ( - 1 ) ; } rwf close ( ) ; / / finally start the journal again , and ensure the " zeroed out " file / / is renamed with a empty extension journal = new journal ( conf , test log dir , jid , startup option regular , mock error reporter ) ; file moved to = new file ( eip get absolute path ( ) + " empty " ) ; assert true ( moved to exists ( ) ) ; }


prepare the given criteria object , applying cache settings andor a transaction timeout

protected void prepare criteria ( criteria criteria ) { if ( is cache queries ( ) ) { criteria set cacheable ( true ) ; if ( get query cache region ( ) ! = null ) { criteria set cache region ( get query cache region ( ) ) ; } } if ( get fetch size ( ) > 0 ) { criteria set fetch size ( get fetch size ( ) ) ; } if ( get max results ( ) > 0 ) { criteria set max results ( get max results ( ) ) ; } resource holder support session holder = ( resource holder support ) transaction synchronization manager get resource ( obtain session factory ( ) ) ; if ( session holder ! = null & & session holder has timeout ( ) ) { criteria set timeout ( session holder get time to live in seconds ( ) ) ; } }


copies the content of this string to a byte array

public void copy ( int src idx , byte [ ] dst , int dst idx , int length ) { if ( is out of bounds ( src idx , length , length ( ) ) ) { throw new index out of bounds exception ( " expected : " + " 0 < = src idx ( " + src idx + " ) < = src idx + length ( " + length + " ) < = src len ( " + length ( ) + ' ) ' ) ; } system arraycopy ( value , src idx + offset , check not null ( dst , " dst " ) , dst idx , length ) ; }


string initiate multi part upload ( final string dest key ) throws i o exception { log debug ( " initiating multipart upload " ) ; final initiate multipart upload request initiate m p u request = new initiate multipart upload request ( bucket , dest key ) ; initiate m p u request set acl ( owner get canned a c l ( ) ) ; initiate m p u request set metadata ( new object metadata ( - 1 ) ) ; if ( owner get sse ( ) is sse c enable ( ) ) { initiate m p u request set sse c header ( owner get sse ( ) get sse c header ( ) ) ; } else if ( owner get sse ( ) is sse kms enable ( ) ) { initiate m p u request set sse kms header ( owner get sse ( ) get sse kms header ( ) ) ; } try { return obs initiate multipart upload ( initiate m p u request ) get upload id ( ) ; } catch ( obs exception ace ) { throw o b s common utils translate exception ( " initiate multi part upload " , dest key , ace ) ; } }


returns an array of locations that have values that will flow to this location

public address [ ] get known flow to addresses ( address to addr ) { / / does this have a no adress from flow to the to addr ? map < register , register value > map = no address future register state map get ( to addr ) ; boolean has no address flow = map ! = null ; int extra for no addr = ( has no address flow ? 1 : 0 ) ; address [ ] flows to = new address [ 0 + extra for no addr ] ; if ( to addr ! = null & & to addr ! = address no address ) { map < address , map < register , register value > > future register state map = future flow register state maps get ( to addr ) ; if ( future register state map ! = null ) { set < address > key set = future register state map key set ( ) ; flows to = key set to array ( new address [ key set size ( ) + extra for no addr ] ) ; } } if ( has no address flow ) { flows to [ flows to length - 1 ] = address no address ; } return flows to ; }


check safe mode stays in extension pending extension period

public void test check safe mode 5 ( ) { bm safe mode activate ( block total ) ; whitebox set internal state ( bm safe mode , " extension " , integer max value ) ; set safe mode status ( b m safe mode status extension ) ; set block safe ( block threshold ) ; bm safe mode check safe mode ( ) ; assert equals ( b m safe mode status extension , get safe mode status ( ) ) ; }