deserialize a remote invocation result object from the given input stream gives { @ code decorate input stream } a chance to decorate the stream first ( for example , for custom encryption or compression ) creates an { @ code object input stream } via { @ code create object input stream } and calls { @ code do read remote invocation result } to actually read the object can be overridden for custom serialization of the invocation

protected remote invocation result read remote invocation result ( input stream is , @ nullable string codebase url ) throws i o exception , class not found exception { try ( object input stream ois = create object input stream ( decorate input stream ( is ) , codebase url ) ) { return do read remote invocation result ( ois ) ; } }


turns this descriptor into a builder , replacing the request and response marshallers

public < new req t , new resp t > builder < new req t , new resp t > to builder ( marshaller < new req t > request marshaller , marshaller < new resp t > response marshaller ) { return method descriptor < new req t , new resp t > new builder ( ) set request marshaller ( request marshaller ) set response marshaller ( response marshaller ) set type ( type ) set full method name ( full method name ) set idempotent ( idempotent ) set safe ( safe ) set sampled to local tracing ( sampled to local tracing ) set schema descriptor ( schema descriptor ) ; }


returns the column table filter that has been set on this g table filter panel or null if there is none

public column based table filter < row object > get column table filter ( ) { return column table filter ; }


returns true if field supervisors is set ( has been assigned a value ) and false otherwise

public boolean is set supervisors ( ) { return this supervisors ! = null ; }


gets the { @ link user } object by its id or full name creates a user on - demand use { @ link # get by id } when you know you have an id in this method jenkins will try to resolve the { @ link user } by full name with help of various { @ link hudson tasks user name resolver } this is slow ( see jenkins - 23281 )

public static @ non null user get ( string id or full name ) { return get or create by id or full name ( id or full name ) ; }


public static byte buf to byte buf ( input stream input ) throws i o exception { byte buf buf = unpooled buffer ( ) ; int n = 0 ; do { n = buf write bytes ( input , block size ) ; } while ( n > 0 ) ; return buf ; }


returns the content of the input source callers must not modify the result

char [ ] get content ( ) { return content ; }


determine whether the given method is an " equals " method

public static boolean is equals method ( @ nullable method method ) { if ( method = = null ) { return false ; } if ( method get parameter count ( ) ! = 1 ) { return false ; } if ( ! method get name ( ) equals ( " equals " ) ) { return false ; } return method get parameter types ( ) [ 0 ] = = object class ; }


return the name of the currently proxied bean instance

public static string get current proxied bean name ( ) { return current proxied bean name get ( ) ; }


boolean encode gn ( ) { if ( char at ( m current + 1 ) = = ' n ' ) { / / ' align ' ' sign ' , ' resign ' but not ' resignation ' / / also ' impugn ' , ' impugnable ' , but not ' repugnant ' if ( ( ( m current > 1 ) & & ( ( string at ( ( m current - 1 ) , 1 , " i " , " u " , " e " , " " ) | | string at ( ( m current - 3 ) , 9 , " lorgnette " , " " ) | | string at ( ( m current - 2 ) , 9 , " lagniappe " , " " ) | | string at ( ( m current - 2 ) , 6 , " cognac " , " " ) | | string at ( ( m current - 3 ) , 7 , " chagnon " , " " ) | | string at ( ( m current - 5 ) , 9 , " compagnie " , " " ) | | string at ( ( m current - 4 ) , 6 , " bologn " , " " ) ) / / exceptions : following are cases where ' g ' is pronounced / / in " assign " ' g ' is silent , but not in " assignation " & & ! ( string at ( ( m current + 2 ) , 5 , " ation " , " " ) | | string at ( ( m current + 2 ) , 4 , " ator " , " " ) | | string at ( ( m current + 2 ) , 3 , " ate " , " ity " , " " ) / / exception to exceptions , not pronounced : | | ( string at ( ( m current + 2 ) , 2 , " an " , " ac " , " ia " , " um " , " " ) & & ! ( string at ( ( m current - 3 ) , 8 , " poignant " , " " ) | | string at ( ( m current - 2 ) , 6 , " cognac " , " " ) ) ) | | string at ( 0 , 7 , " spigner " , " stegner " , " " ) | | ( string at ( 0 , 5 , " signe " , " " ) & & ( m length = = 5 ) ) | | string at ( ( m current - 2 ) , 5 , " ligni " , " ligno " , " regna " , " digni " , " wegne " , " tigne " , " rigne " , " regne " , " tigno " , " " ) | | string at ( ( m current - 2 ) , 6 , " signal " , " signif " , " signat " , " " ) | | string at ( ( m current - 1 ) , 5 , " ignit " , " " ) ) & & ! string at ( ( m current - 2 ) , 6 , " signet " , " ligneo " , " " ) ) ) / / not e g ' cagney ' , ' magna ' | | ( ( ( m current + 2 ) = = m last ) & & string at ( m current , 3 , " gne " , " gna " , " " ) & & ! string at ( ( m current - 2 ) , 5 , " signa " , " magna " , " signe " , " " ) ) ) { metaph add exact approx ( " n " , " gn " , " n " , " kn " ) ; } else { metaph add exact approx ( " gn " , " kn " ) ; } m current + = 2 ; return true ; } return false ; }


returns the { @ code short } value that is equal to { @ code value } , if possible

public static short checked cast ( long value ) { short result = ( short ) value ; check argument ( result = = value , " out of range : % s " , value ) ; return result ; }


corners bug spr - 9273 , which reported the fact that following the changes made in spr - 7591 , { @ link http status code exception } and subtypes became no longer serializable due to the addition of a non - serializable { @ code charset } field

public void test serializability ( ) throws i o exception , class not found exception { http status code exception ex 1 = new http client error exception ( http status bad request , null , null , standard charsets us ascii ) ; byte array output stream out = new byte array output stream ( ) ; new object output stream ( out ) write object ( ex 1 ) ; byte array input stream in = new byte array input stream ( out to byte array ( ) ) ; http status code exception ex 2 = ( http status code exception ) new object input stream ( in ) read object ( ) ; assert that ( ex 2 get response body as string ( ) ) is equal to ( ex 1 get response body as string ( ) ) ; }


private < t > boolean write to data source ( writable data source < t > data source , t value ) { if ( data source ! = null ) { try { data source write ( value ) ; } catch ( exception e ) { record log warn ( " write data source failed " , e ) ; return false ; } } return true ; }


< code > required uint 6 4 client protocol version = 3 ; < code > protocol version of class declaring the called method


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


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

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


returns the { @ link dns server addresses } that yields the specified { @ code addresses } sequentially once the last address is yielded , it will start again from the first address

public static dns server addresses sequential ( inet socket address addresses ) { return sequential 0 ( sanitize ( addresses ) ) ; }


test that if client connects to active it does not try to find observer on next calls during some period of time

public void test sticky active ( ) throws exception { path test file = new path ( test path , " test sticky active " ) ; configuration new conf = new configuration ( conf ) ; / / observer probe retry period set to 5 sec new conf set long ( observer probe retry period key , 5000 ) ; / / disable cache , so that a new client actually gets created with new conf new conf set boolean ( " fs hdfs impl disable cache " , true ) ; distributed file system new fs = ( distributed file system ) file system get ( new conf ) ; new fs create ( test file , ( short ) 1 ) close ( ) ; assert sent to ( 0 ) ; dfs cluster roll edit log and tail ( 0 ) ; / / no observers present , should still go to active dfs cluster transition to standby ( 2 ) ; assert equals ( " nn [ 2 ] should be standby " , h a service state standby , get service state ( dfs cluster get name node ( 2 ) ) ) ; new fs open ( test file ) close ( ) ; assert sent to ( 0 ) ; / / restore observer int new observer = 1 ; dfs cluster transition to observer ( new observer ) ; assert equals ( " nn [ " + new observer + " ] should be observer " , h a service state observer , get service state ( dfs cluster get name node ( new observer ) ) ) ; long start time = time monotonic now ( ) ; try { while ( time monotonic now ( ) - start time < = 5000 ) { new fs open ( test file ) close ( ) ; / / client should still talk to active assert sent to ( 0 ) ; thread sleep ( 200 ) ; } } catch ( assertion error ae ) { if ( time monotonic now ( ) - start time < = 5000 ) { throw ae ; } assert sent to ( new observer ) ; } finally { dfs cluster transition to standby ( 1 ) ; dfs cluster transition to observer ( 2 ) ; } }


the configuration for which the resource is defined < code > optional aapt pb config description config = 2 ; < code >

public boolean has config ( ) { return instance has config ( ) ; }


returns the current { @ link record context }

processor record context record context ( ) ;


static boolean enforce limits ( final bound transport address bound transport address , final string discovery type ) { final predicate < transport address > is loopback address = t - > t address ( ) get address ( ) is loopback address ( ) ; final boolean bound = ! ( arrays stream ( bound transport address bound addresses ( ) ) all match ( is loopback address ) & & is loopback address test ( bound transport address publish address ( ) ) ) ; return bound & & ! " single - node " equals ( discovery type ) ; }


this method only exists for compatibility with unusual commons logging api usage like e g { @ code log factory get factory ( ) get instance ( class string ) }

public static log factory get factory ( ) { return new log factory ( ) { } ; }


codify the contents of the collector to be iterated over when this is called , all record readers registered for this key should have added resetable iterators

public void reset ( k key ) { this key = key ; first = true ; pos = iters length - 1 ; for ( int i = 0 ; i < iters length ; + + i ) { iters [ i ] reset ( ) ; } }


return the number of checks skipped because the minimum gap since the last check had not elapsed

public long get num skipped checks ( ) { return num skipped checks get ( ) ; }


look up a sub - schema ( database ) by the given sub - schema name

public schema get sub schema ( string schema name ) { if ( catalog manager schema exists ( catalog name , schema name ) ) { return new database calcite schema ( schema name , catalog name , catalog manager , is streaming mode ) ; } else { return null ; } }


public string get a t t n a m e ( ) { return att name ; }


tests that two equal simple mail messages have equal hash codes

public final void test hash code ( ) { simple mail message message 1 = new simple mail message ( ) ; message 1 set from ( " from @ somewhere " ) ; message 1 set reply to ( " reply to @ somewhere " ) ; message 1 set to ( " to @ somewhere " ) ; message 1 set cc ( " cc @ somewhere " ) ; message 1 set bcc ( " bcc @ somewhere " ) ; message 1 set sent date ( new date ( ) ) ; message 1 set subject ( " subject " ) ; message 1 set text ( " text " ) ; / / copy the message simple mail message message 2 = new simple mail message ( message 1 ) ; assert that ( message 2 ) is equal to ( message 1 ) ; assert that ( message 2 hash code ( ) ) is equal to ( message 1 hash code ( ) ) ; }


public synchronized void end thread ( ) { live = false ; interrupt ( ) ; try { wait ( ) ; } catch ( interrupted exception e ) { if ( log is debug enabled ( ) ) { log debug ( " ignoring " + e , e ) ; } } }


return the { @ link byte buf } which contains the written content

byte buf get buffer ( ) { return buffer ; }


public void process event ( plugin event event ) { if ( event instanceof program activated plugin event ) { hello program action set enabled ( ( ( program activated plugin event ) event ) get active program ( ) ! = null ) ; } }


request the specified amount of elements from upstream this method can be called before the upstream calls { @ link # on subscribe ( subscription ) } when the subscription happens , all missed requests are requested

protected final void request ( long n ) { subscription helper deferred request ( upstream , missed requested , n ) ; }


the set of arityplural mappings < code > repeated aapt pb plural entry entry = 1 ; < code >


returns every possible list that can be formed by choosing one element from each of the given lists in order ; the " n - ary < a href = " http : en wikipedia orgwiki cartesian product " > cartesian product " of the lists for example : { @ code lists cartesian product ( immutable list of ( immutable list of ( 1 , 2 ) , immutable list of ( " a " , " b " , " c " ) ) ) } returns a list containing six lists in the following order : { @ code immutable list of ( 1 , " a " ) } { @ code immutable list of ( 1 , " b " ) } { @ code immutable list of ( 1 , " c " ) } { @ code immutable list of ( 2 , " a " ) } { @ code immutable list of ( 2 , " b " ) } { @ code immutable list of ( 2 , " c " ) } the result is guaranteed to be in the " traditional " , lexicographical order for cartesian products that you would get from nesting for loops : { @ code for ( b b 0 : lists get ( 0 ) ) { for ( b b 1 : lists get ( 1 ) ) { immutable list < b > tuple = immutable list of ( b 0 , b 1 , ) ; operate on tuple } } } note that if any input list is empty , the cartesian product will also be empty if no lists at all are provided ( an empty list ) , the resulting cartesian product has one element , an empty list ( counter - intuitive , but mathematically consistent ) performance notes : while the cartesian product of lists of size { @ code m , n , p } is a list of size { @ code m x n x p } , its actual memory consumption is much smaller when the cartesian product is constructed , the input lists are merely copied only as the resulting list is iterated are the individual lists created , and these are not retained after iteration

public static < b > list < list < b > > cartesian product ( list < ? extends list < ? extends b > > lists ) { return cartesian list create ( lists ) ; }


creates a { @ link runnable } that invokes the given listener with { @ code null } after the given runnable has executed

public static < t > action runnable < t > run ( action listener < t > listener , checked runnable < exception > runnable ) { return new action runnable < > ( listener ) { @ override protected void do run ( ) throws exception { runnable run ( ) ; listener on response ( null ) ; } } ; }


public t get next ( ) throws i o exception { try { return mapper read value ( json parser , clazz ) ; } catch ( json mapping exception e ) { return null ; } }


main entry point of the cas web application

public static void main ( final string [ ] args ) { val banner = cas embedded container utils get cas banner instance ( ) ; new spring application builder ( cas web application class ) banner ( banner ) web ( web application type servlet ) log startup info ( true ) context class ( cas web application context class ) run ( args ) ; }


public static void check param ( string data id , string group , string datum id , string content ) throws nacos exception { if ( string utils is blank ( data id ) | | ! is valid ( data id trim ( ) ) ) { throw new nacos exception ( nacos exception invalid param , " invalid data id : " + data id ) ; } else if ( string utils is blank ( group ) | | ! is valid ( group ) ) { throw new nacos exception ( nacos exception invalid param , " invalid group : " + group ) ; } else if ( string utils is blank ( datum id ) | | ! is valid ( datum id ) ) { throw new nacos exception ( nacos exception invalid param , " invalid datum id : " + datum id ) ; } else if ( string utils is blank ( content ) ) { throw new nacos exception ( nacos exception invalid param , " content is blank : " + content ) ; } else if ( content length ( ) > property util get max content ( ) ) { throw new nacos exception ( nacos exception invalid param , " invalid content , over " + property util get max content ( ) ) ; } }


public static string format ( float value , boolean is grouping , int fraction digits , boolean is half up ) { return format ( value , is grouping , 1 , fraction digits , is half up ) ; }


called when the { @ link node provisioner planned node # future } completes

public void on complete ( node provisioner planned node planned node , node node ) { }


public void delete pet ( long pet id , string api key ) { / / todo : implement }


public void test type holder example ( ) { / / todo : test type holder example }


called by { @ link com google devtools build lib analysis extra extra action } at execution time to extract information from this action into a protocol buffer to be used by extra action rules as this method is called from the extra action , make sure it is ok to call this method from a different thread than the one this action is executed on

extra action info builder get extra action info ( action key context action key context ) throws command line expansion exception , interrupted exception ;


sets the instance field by the given name on the given object instance note : if the field is static , then the < code > owner instance < code > field can be the class of the object that contains the variable

public static void set instance field ( string field name , object owner instance , object value ) throws runtime exception { test utils set instance field ( field name , owner instance , value ) ; }


sets the < code > namespace array < code > property

public void set namespace array ( list < integer > namespace array ) { this namespace array = namespace array ; }


synchronized old function iterator d b get functions ( ) { try { return new old function iterator d b ( ) ; } catch ( i o exception e ) { err handler db error ( e ) ; } return null ; }


install material theme ui components some components will only be installed if the material components option is set , while others depend on other options , such as compact statusbars , arrow styles , title bar and so on

static void install m t defaults ( final u i defaults defaults ) { replace status bar ( defaults ) ; replace tree ( defaults ) ; replace selected indicator ( defaults ) ; replace dropdowns ( defaults ) ; replace table headers ( defaults ) ; replace root pane ( defaults ) ; replace menus ( defaults ) ; replace tabbed panes ( defaults ) ; replace labels ( defaults ) ; replace default buttons ( defaults ) ; replace buttons ( defaults ) ; replace text fields ( defaults ) ; replace progress bar ( defaults ) ; replace tables ( defaults ) ; replace spinners ( defaults ) ; replace checkboxes ( defaults ) ; replace radio buttons ( defaults ) ; replace sliders ( defaults ) ; replace text areas ( defaults ) ; modify registry ( ) ; }


close all open files then submit the distcp with - diff

void final dist cp ( ) throws i o exception , retry exception { / / close all open files then do the final distcp close all open files ( src fs , src ) ; / / final distcp running job status job = get current job ( ) ; if ( job ! = null ) { / / the distcp has been submitted if ( job is complete ( ) ) { job id = null ; / / unset job id because the job is done if ( job is successful ( ) ) { update stage ( stage finish ) ; return ; } else { throw new i o exception ( " final dist cp failed failure : " + job get failure info ( ) ) ; } } else { throw new retry exception ( ) ; } } else { submit diff dist cp ( ) ; } }


pops the given number of stack entries at or after the given offset the instructions are marked as necessary

private void insert pop instructions ( int offset , boolean replace , boolean before , instruction old instruction , int pop count ) { / / collect the pop opcodes int pop opcodes = pop count % 2 = = 1 ? instruction constants op pop : 0 ; for ( int counter = 1 ; counter < pop count ; counter + = 2 ) { pop opcodes = ( pop opcodes < < 8 ) | instruction constants op pop2 ; } / / replace or insert them insert instructions ( offset , replace , before , old instruction , pop opcodes ) ; }


an input stream to the public key of the signing key

input stream get public key ( ) { return install plugin command class get resource as stream ( " / public key asc " ) ; }


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

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


stop the previous animation and start a new one

public void start and cancel previous ( atomic reference < animator > animator ref ) { animator old animator = animator ref get ( ) ; if ( old animator ! = null ) { old animator cancel ( ) ; } animator new animator = start ( ) ; animator ref set ( new animator ) ; }


all registered { @ link extension filter } instances

public static extension list < extension filter > all ( ) { return extension list lookup ( extension filter class ) ; }


set up hdfs to run securely in secure mode , hdfs goes out of its way to refuse to start if it doesn ' t consider the configuration safe this is good in production , and it stops an hdfs cluster coming up where things can ' t reliably talk to each other but it does complicate test setup look at { @ code org apache hadoop hdfs test d f s inotify event input stream kerberized } and { @ code org apache hadoop hdfs qjournal test secure n n with q j m } for the details on what options to set here

protected void patch config with h d f s bindings ( final configuration conf ) { preconditions check state ( is in state ( state started ) ) ; enable kerberos ( conf ) ; string path = get keytab path ( ) ; string spnego principal = " * " ; string localhost = localhost name ; string instance = get krb instance ( ) ; string hdfs principal = get login principal ( ) ; patch config at init ( conf ) ; conf set long ( common configuration keys fs du interval key , long max value ) ; conf set ( dfs namenode kerberos principal key , hdfs principal ) ; conf set ( dfs namenode keytab file key , path ) ; conf set ( dfs datanode kerberos principal key , hdfs principal ) ; conf set ( dfs datanode keytab file key , path ) ; conf set ( dfs web authentication kerberos principal key , spnego principal ) ; conf set ( dfs journalnode keytab file key , path ) ; conf set ( dfs journalnode kerberos principal key , hdfs principal ) ; conf set ( dfs journalnode kerberos internal spnego principal key , spnego principal ) ; conf set boolean ( dfs block access token enable key , true ) ; conf set ( dfs data transfer protection key , " authentication " ) ; conf set ( dfs http policy key , http config policy https only name ( ) ) ; conf set ( dfs namenode https address key , " localhost : 0 " ) ; conf set ( dfs datanode https address key , " localhost : 0 " ) ; conf set ( dfs http policy key , http config policy https only name ( ) ) ; conf set ( dfs client https keystore resource key , key store test util get client s s l config file name ( ) ) ; conf set ( dfs server https keystore resource key , key store test util get server s s l config file name ( ) ) ; }


store a batch of messages in async manner

default completable future < put message result > async put messages ( final message ext batch message ext batch ) { return completable future completed future ( put messages ( message ext batch ) ) ; }


ingest level statistics see { @ link ingest stats # to x content ( x content builder , params ) } for fields and format if there are no ingest pipelines referencing the model , then the ingest statistics could be null

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


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

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


sets the stroke width to be drawn around the circular image view during click events when the selector is enabled

public void set selector stroke width ( int selector stroke width ) { this selector stroke width = selector stroke width ; this request layout ( ) ; this invalidate ( ) ; }


private void initialize ( ) { create fields ( ) ; set cursor on ( true ) ; edit color = byte viewer component provider default edit color ; current cursor color = byte viewer component provider default current cursor color ; set non focus cursor color ( byte viewer component provider default nonfocus cursor color ) ; set focused cursor color ( current cursor color ) ; update color runner = ( ) - > update color ( ) ; add mouse listener ( new mouse adapter ( ) { @ override public void mouse released ( mouse event e ) { if ( e get button ( ) = = mouse event button3 ) { / / hack to make sure that a right - clicked component becomes the active / / component panel set current view ( byte viewer component this ) ; } } } ) ; enable help ( ) ; }


utility to generate the documentation for the connect metrics

public static void main ( string [ ] args ) { connect metrics registry metrics = new connect metrics registry ( ) ; system out println ( metrics to html table ( jmx prefix , metrics get all templates ( ) ) ) ; }


configures the maximum weight and returns if set

private boolean configure maximum weight ( ) { if ( config get maximum weight ( ) is present ( ) ) { caffeine maximum weight ( config get maximum weight ( ) get as long ( ) ) ; weigher < k , v > weigher = config get weigher factory ( ) map ( factory : : create ) or else throw ( ( ) - > new illegal state exception ( " weigher not configured " ) ) ; caffeine weigher ( ( k key , expirable < v > expirable ) - > { return weigher weigh ( key , expirable get ( ) ) ; } ) ; } return config get maximum weight ( ) is present ( ) ; }


public static string byte to hex string ( byte b ) { return byte to hex string ( new byte [ ] { b } ) ; }


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

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


ask the user if they want to apply the filter changes before closing if they agree , then apply the filter

private boolean prompt to apply filter ( ) { int choice = option dialog show option dialog ( null , " unapplied changes " , " you have unapplied changes that will be lost ! \ n " + " do you want to apply them before you exit ? " , " apply changes " , " discard changes " , option dialog question message ) ; if ( choice = = option dialog option one ) { apply filter ( ) ; } return choice ! = option dialog cancel option ; }


extracts application secondary dexes into files in the application data directory

static list < ? extends file > load ( context context , file source apk , file dex dir , string prefs key prefix , boolean force reload ) throws i o exception { log i ( tag , " multi dex extractor load ( " + source apk get path ( ) + " , " + force reload + " , " + prefs key prefix + " ) " ) ; long current crc = get zip crc ( source apk ) ; / / validity check and extraction must be done only while the lock file has been taken file lock file = new file ( dex dir , lock filename ) ; random access file lock raf = new random access file ( lock file , " rw " ) ; file channel lock channel = null ; file lock cache lock = null ; list < extracted dex > files ; i o exception release lock exception = null ; try { lock channel = lock raf get channel ( ) ; log i ( tag , " blocking on lock " + lock file get path ( ) ) ; cache lock = lock channel lock ( ) ; log i ( tag , lock file get path ( ) + " locked " ) ; if ( ! force reload & & ! is modified ( context , source apk , current crc , prefs key prefix ) ) { try { files = load existing extractions ( context , source apk , dex dir , prefs key prefix ) ; } catch ( i o exception ioe ) { log w ( tag , " failed to reload existing extracted secondary dex files , " + " falling back to fresh extraction " , ioe ) ; files = perform extractions ( source apk , dex dir ) ; put stored apk info ( context , prefs key prefix , get time stamp ( source apk ) , current crc , files ) ; } } else { log i ( tag , " detected that extraction must be performed " ) ; files = perform extractions ( source apk , dex dir ) ; put stored apk info ( context , prefs key prefix , get time stamp ( source apk ) , current crc , files ) ; } } finally { if ( cache lock ! = null ) { try { cache lock release ( ) ; } catch ( i o exception e ) { log e ( tag , " failed to release lock on " + lock file get path ( ) ) ; / / exception while releasing the lock is bad , we want to report it , but not at / / the price of overriding any already pending exception release lock exception = e ; } } if ( lock channel ! = null ) { close quietly ( lock channel ) ; } close quietly ( lock raf ) ; } if ( release lock exception ! = null ) { throw release lock exception ; } log i ( tag , " load found " + files size ( ) + " secondary dex files " ) ; return files ; }


sets the failure this method will return { @ code true } if the failure was successfully set , or { @ code false } if the data source has already been set , failed or closed if the failure was successfully set , state of the data source will be set to { @ link abstract data source data source status # failure } this will also notify the subscribers if the failure was successfully set

public boolean set failure ( throwable throwable ) { return super set failure ( preconditions check not null ( throwable ) ) ; }


return the configured argument resolvers

public list < sync handler method argument resolver > get resolvers ( ) { return this delegate get resolvers ( ) stream ( ) map ( resolver - > ( sync handler method argument resolver ) resolver ) collect ( collectors to list ( ) ) ; }


this method always creates a { @ link buffer consumer } starting from position 0 of { @ link memory segment }

public buffer consumer create buffer consumer from beginning ( ) { return create buffer consumer ( 0 ) ; }


sets the color in which to highlight the match character

public void set color ( color color ) { f color = color ; }


public static long int to long ( int i ) { return ( i & int mask ) ; }


returns the number of times a client presented a ticket that did not match any key in the list

public long ticket key fail ( ) { lock reader lock = context ctx lock read lock ( ) ; reader lock lock ( ) ; try { return s s l context session ticket key fail ( context ctx ) ; } finally { reader lock unlock ( ) ; } }


returns path to the cache directory path must be inside output base to ensure that users can run concurrent instances of blaze in different clients without attempting to concurrently write to the same action cache on disk , which might not be safe

path get cache directory ( ) { return get output base ( ) get child ( " action cache " ) ; }


public immutable set < class < ? > > get builtin providers ( ) { return builtin providers ; }


public void put counters ( map < string , long > counters ) { this counters map = counters ; }


derives options to use in dex file merger actions from the given context and dx flags , where the latter typically come from a { @ code dexopts } attribute on a top - level target

static immutable set < string > merger dexopts ( rule context rule context , iterable < string > tokenized dexopts ) { / / we don ' t need an ordered set but might as well note we don ' t need to worry about coverage / / builds since the merger doesn ' t use - - no - locals return normalize dexopts ( iterables filter ( tokenized dexopts , new flag matcher ( get android config ( rule context ) get dexopts supported in dex merger ( ) ) ) ) ; }


helper method to implement the tests of consistent list files ( ) the file structure has dir num subdirectories , and each directory ( including the test base directory itself ) has normal file num normal files and delayed file num delayed files

private void do test list files ( s 3 a file system fs , int dir num , int normal file num , int delayed file num , boolean recursive ) throws exception { describe ( " testing dir num = % d , normal file = % d , delayed file = % d , " + " recursive = % s " , dir num , normal file num , delayed file num , recursive ) ; final path base test dir = path ( " do test list files - " + dir num + " - " + normal file num + " - " + delayed file num + " - " + recursive ) ; / / delete the old test path ( if any ) so that when we call mkdirs ( ) later , / / the to delay sub directories will be tracked via put object ( ) request fs delete ( base test dir , true ) ; / / make subdirectories ( if any ) final list < path > test dirs = new array list < > ( dir num + 1 ) ; assert true ( fs mkdirs ( base test dir ) ) ; test dirs add ( base test dir ) ; for ( int i = 0 ; i < dir num ; i + + ) { final path subdir = path ( base test dir + " / dir - " + i ) ; assert true ( fs mkdirs ( subdir ) ) ; test dirs add ( subdir ) ; } final collection < string > file names = new array list < > ( normal file num + delayed file num ) ; int index = 0 ; for ( ; index < normal file num ; index + + ) { file names add ( " file - " + index ) ; } for ( ; index < normal file num + delayed file num ; index + + ) { / / any s3 keys that contain delay key substring will be delayed / / in list objects ( ) results via inconsistent s 3 client file names add ( " file - " + index + " - " + default delay key substring ) ; } int files and empty directories = 0 ; / / create files under each test directory for ( path dir : test dirs ) { for ( string file name : file names ) { write text file ( fs , new path ( dir , file name ) , " i , " + file name , false ) ; files and empty directories + + ; } } / / this should return the union data from s3 and metadata store final remote iterator < located file status > status iterator = fs list files ( base test dir , recursive ) ; final collection < path > listed files = new hash set < > ( ) ; for ( ; status iterator has next ( ) ; ) { final file status status = status iterator next ( ) ; assert true ( " file status " + status + " is not a file ! " , status is file ( ) ) ; listed files add ( status get path ( ) ) ; } log info ( " s 3 a file system : : list files ( ' { } ' , { } ) - > { } " , base test dir , recursive , listed files ) ; / / this should fail without s 3 guard , and succeed with it because part of the / / files to list are delaying visibility if ( ! recursive ) { / / in this case only the top level files are listed verify file is listed ( listed files , base test dir , file names ) ; assert equals ( " unexpected number of files returned by list files ( ) call " , normal file num + delayed file num , listed files size ( ) ) ; } else { for ( path dir : test dirs ) { verify file is listed ( listed files , dir , file names ) ; } assert equals ( " unexpected number of files returned by list files ( ) call " , files and empty directories , listed files size ( ) ) ; } }


returns index of palette color closest to c

private int find closest ( int color ) { if ( color tab = = null ) return - 1 ; int r = color red ( color ) ; int g = color green ( color ) ; int b = color blue ( color ) ; int minpos = 0 ; int dmin = 256 * 256 * 256 ; int len = color tab length ; for ( int i = 0 ; i < len ; ) { int dr = r - ( color tab [ i + + ] & 0xff ) ; int dg = g - ( color tab [ i + + ] & 0xff ) ; int db = b - ( color tab [ i ] & 0xff ) ; int d = dr * dr + dg * dg + db * db ; int index = i / 3 ; if ( used entry [ index ] & & ( d < dmin ) ) { dmin = d ; minpos = index ; } i + + ; } return minpos ; }


public void add servlet listeners ( event listener listeners ) { for ( event listener listener : listeners ) { handler add event listener ( listener ) ; } }


return the current { @ link state } of this { @ code kafka streams } instance

public state state ( ) { return state ; }


this is a way to know about updates from the table

public void add threaded table model listener ( threaded table model listener listener ) { listeners add ( listener ) ; }


compute if absent does not add if function returns null

public void test compute if absent 3 ( ) { concurrent map map = map 5 ( ) ; map compute if absent ( six , ( x ) - > null ) ; assert false ( map contains key ( six ) ) ; }


verify if the correct visit method is called on the mock , depending on the tested instance

abstract void verify visit ( final u unit , final unit visitor mocked visitor ) ;


takes a { @ link char sequence } and parses it to see if it is a valid ipv4 address

public static boolean is valid ip v 4 address ( char sequence ip ) { return is valid ip v 4 address ( ip , 0 , ip length ( ) ) ; }


notifies the owning { @ link single input gate } that this channel became non - empty this is guaranteed to be called only when a buffer was added to a previously empty input channel the notion of empty is atomically consistent with the flag { @ link buffer and availability # more available ( ) } when polling the next buffer from this channel < b > note : < b > when the input channel observes an exception , this method is called regardless of whether the channel was empty before that ensures that the parent input gate will always be notified about the exception

protected void notify channel non empty ( ) { input gate notify channel non empty ( this ) ; }


append a string to a string builder with a newline constant

private static void append canonicalized element ( final string builder builder , final string element ) { builder append ( " \ n " ) ; builder append ( element ) ; }


blob cache is configured in ha mode and the cache can download files from the file system directly and does not need to download b l o bs from the blob server which remains active after the blob upload using job - related b l o bs

public void test blob for job cache ha ( ) throws i o exception { configuration config = new configuration ( ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; config set string ( high availability options ha mode , " zookeeper " ) ; config set string ( high availability options ha storage path , temporary folder new folder ( ) get path ( ) ) ; upload file get test ( config , new job i d ( ) , true , true , permanent blob ) ; }


get the { @ link application events } for the current thread

public static application events get required application events ( ) { application events events = application events get ( ) ; assert state ( events ! = null , " failed to retrieve application events for the current thread " + " ensure that your test class is annotated with @ record application events " + " and that the application events test execution listener is registered " ) ; return events ; }


sets whether the time bar should show all windows , as opposed to just the current one if the timeline has a period with unknown duration or more than { @ link # max windows for multi window time bar } windows the time bar will fall back to showing a single window

public void set show multi window time bar ( boolean show multi window time bar ) { this show multi window time bar = show multi window time bar ; update timeline ( ) ; }


sets if the < a href = " https : tools ietf orghtmlrfc 7 5 4 0 # section - 6 5 2 " > settings max header list size should be ignored when encoding headers

protected b encoder ignore max header list size ( boolean ignore max header list size ) { enforce non codec constraints ( " encoder ignore max header list size " ) ; this encoder ignore max header list size = ignore max header list size ; return self ( ) ; }


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

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


test the property ' prefix wrapped array '

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


enabledisable checking return for constant references

public void set return ref check ( boolean check return refs option ) { check for return refs = check return refs option ; }


calculates the local and world transform of all { @ link node } instances in this model , recursively first each { @ link node # local transform } transform is calculated based on the translation , rotation and scale of each node then each { @ link node # calculate world transform ( ) } is calculated , based on the parent ' s world transform and the local transform of each node finally , the animation bone matrices are updated accordingly this method can be used to recalculate all transforms if any of the node ' s local properties ( translation , rotation , scale ) was modified

public void calculate transforms ( ) { final int n = nodes size ; for ( int i = 0 ; i < n ; i + + ) { nodes get ( i ) calculate transforms ( true ) ; } for ( int i = 0 ; i < n ; i + + ) { nodes get ( i ) calculate bone transforms ( true ) ; } }


called to get the id of the job , used for logging

protected abstract string get job id ( ) ;


serializes and deserializes the specified object ( a no - op under gwt )

static < t > t reserialize ( t object ) { return check not null ( object ) ; }


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


should this body be treated like a bullet for continuous collision detection ?

public final void set bullet ( boolean flag ) { if ( flag ) { m flags | = e bullet flag ; } else { m flags & = ~ e bullet flag ; } }


get the token identifier ' s byte representation

public byte [ ] get identifier ( ) { return identifier ; }


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

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


visible for testing this returns the first element parsed from the serialized object or null

@ nullable t decode one ( byte [ ] serialized ) ;


public string get catalog ( ) { return catalog ; }


declare that the path represents a directory , which in the swift native file system means " is a directory or a 0 byte file "

public boolean is directory ( ) { return super is directory ( ) | | get len ( ) = = 0 ; }


void put data ( string table name , string row key , string column family , string column qualifier , string value ) throws i o exception ;


adjust any program context needed on symbols

private void set entry point context ( elf load helper elf load helper , task monitor monitor ) throws cancelled exception { program program = elf load helper get program ( ) ; if ( get ppc 6 4 a b i version ( elf load helper get elf header ( ) ) = = 2 ) { monitor set message ( " assuming r 1 2 for global functions " ) ; function manager function mgr = program get function manager ( ) ; for ( address addr : program get symbol table ( ) get external entry point iterator ( ) ) { monitor check canceled ( ) ; if ( function mgr get function at ( addr ) ! = null ) { / / assume r 1 2 set to function entry for all global functions set p p c 6 4v 2 global function r 1 2 context ( program , addr ) ; } } / / ensure that r 1 2 context has been set on global entry function symbol entry symbol = symbol utilities get label or function symbol ( elf load helper get program ( ) , elf loader elf entry function name , err - > elf load helper get log ( ) error ( " power p c 6 4 elf " , err ) ) ; if ( entry symbol ! = null & & entry symbol get symbol type ( ) = = symbol type function ) { set p p c 6 4v 2 global function r 1 2 context ( program , entry symbol get address ( ) ) ; } } }


check that the possible post rules are satisfied

public boolean check post rules ( long streamoffset ) { long curoffset = streamoffset + offset ; pattern pattern = ( pattern ) sequence ; post rule [ ] post rules = pattern get post rules ( ) ; for ( post rule post rule : post rules ) { if ( ! post rule apply ( pattern , curoffset ) ) { return false ; } } return true ; }


check whether this exception contains an exception of the given type : either it is of the given class itself or it contains a nested cause of the given type

public boolean contains ( @ nullable class < ? > ex type ) { if ( ex type = = null ) { return false ; } if ( ex type is instance ( this ) ) { return true ; } throwable cause = get cause ( ) ; if ( cause = = this ) { return false ; } if ( cause instanceof nested checked exception ) { return ( ( nested checked exception ) cause ) contains ( ex type ) ; } else { while ( cause ! = null ) { if ( ex type is instance ( cause ) ) { return true ; } if ( cause get cause ( ) = = cause ) { break ; } cause = cause get cause ( ) ; } return false ; } }


this also verifies that the timestamps ouf side - emitted records is correct

public void test side output ( ) throws exception { keyed process operator < integer , integer , string > operator = new keyed process operator < > ( new side output process function ( ) ) ; one input stream operator test harness < integer , string > test harness = new keyed one input stream operator test harness < > ( operator , new identity key selector < > ( ) , basic type info int type info ) ; test harness setup ( ) ; test harness open ( ) ; test harness process element ( new stream record < > ( 42 , 17l / * timestamp * / ) ) ; concurrent linked queue < object > expected output = new concurrent linked queue < > ( ) ; expected output add ( new stream record < > ( " in : 42 " , 17l / * timestamp * / ) ) ; test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; concurrent linked queue < stream record < integer > > expected int side output = new concurrent linked queue < > ( ) ; expected int side output add ( new stream record < > ( 42 , 17l / * timestamp * / ) ) ; concurrent linked queue < stream record < integer > > int side output = test harness get side output ( side output process function integer output tag ) ; test harness util assert output equals ( " side output was not correct " , expected int side output , int side output ) ; concurrent linked queue < stream record < long > > expected long side output = new concurrent linked queue < > ( ) ; expected long side output add ( new stream record < > ( 42l , 17l / * timestamp * / ) ) ; concurrent linked queue < stream record < long > > long side output = test harness get side output ( side output process function long output tag ) ; test harness util assert output equals ( " side output was not correct " , expected long side output , long side output ) ; test harness close ( ) ; }


returns the generation filters that this map uses on load

public seq < generate filter > filters ( ) { if ( tags get int ( " build " , - 1 ) < 83 & & tags get int ( " build " , - 1 ) ! = - 1 & & tags get ( " genfilters " , " " ) is empty ( ) ) { return seq with ( ) ; } return maps read filters ( tags get ( " genfilters " , " " ) ) ; }


returns a comparison of the two given objects

public static int compare ( comparable object 1 , comparable object 2 ) { return object 1 = = null ? object 2 = = null ? 0 : - 1 : object 2 = = null ? 1 : object 1 compare to ( object 2 ) ; }


validates the result of a get operation by comparing the data from the retrieved input stream to the content of the specified buffer

static void validate get and close ( final input stream actual input stream , final byte [ ] expected buf ) throws i o exception { try { byte [ ] received buffer = new byte [ expected buf length ] ; int bytes received = 0 ; while ( true ) { final int read = actual input stream read ( received buffer , bytes received , received buffer length - bytes received ) ; if ( read < 0 ) { throw new e o f exception ( ) ; } bytes received + = read ; if ( bytes received = = received buffer length ) { assert equals ( - 1 , actual input stream read ( ) ) ; assert array equals ( expected buf , received buffer ) ; return ; } } } finally { actual input stream close ( ) ; } }


lists all available schemas in the given catalog it is not equivalent to listing databases within the given catalog as it includes also different database parts of the temporary objects identifiers < b > note : < b > it is primarily used for interacting with calcite ' s schema

public set < string > list schemas ( string catalog name ) { return stream concat ( optional of nullable ( catalogs get ( catalog name ) ) map ( catalog : : list databases ) or else ( collections empty list ( ) ) stream ( ) , temporary tables key set ( ) stream ( ) filter ( i - > i get catalog name ( ) equals ( catalog name ) ) map ( object identifier : : get database name ) ) collect ( collectors to set ( ) ) ; }


public void get pet by id test ( ) { long pet id = null ; / / pet response = api get pet by id ( pet id ) ; / / assert not null ( response ) ; / / todo : test validations }


public void int 6 4 test ( ) { / / todo : test int 6 4 }


encodes a byte array into base 6 4 format no blanks or line breaks are inserted in the output

public static char [ ] encode ( byte [ ] in , int i off , int i len , char [ ] char map ) { int o data len = ( i len * 4 + 2 ) / 3 ; / / output length without padding int o len = ( ( i len + 2 ) / 3 ) * 4 ; / / output length including padding char [ ] out = new char [ o len ] ; int ip = i off ; int i end = i off + i len ; int op = 0 ; while ( ip < i end ) { int i 0 = in [ ip + + ] & 0xff ; int i 1 = ip < i end ? in [ ip + + ] & 0xff : 0 ; int i 2 = ip < i end ? in [ ip + + ] & 0xff : 0 ; int o 0 = i 0 > > > 2 ; int o 1 = ( ( i 0 & 3 ) < < 4 ) | ( i 1 > > > 4 ) ; int o 2 = ( ( i 1 & 0xf ) < < 2 ) | ( i 2 > > > 6 ) ; int o 3 = i 2 & 0x 3 f ; out [ op + + ] = char map [ o 0 ] ; out [ op + + ] = char map [ o 1 ] ; out [ op ] = op < o data len ? char map [ o 2 ] : ' = ' ; op + + ; out [ op ] = op < o data len ? char map [ o 3 ] : ' = ' ; op + + ; } return out ; }


returns the string representation of the current value

public string to string ( ) { return double to string ( get ( ) ) ; }


creates { @ link environment } implementation that just sets the variables as given in the parameter

public static environment create ( final env vars env vars ) { return new environment ( ) { @ override public void build env vars ( map < string , string > env ) { env put all ( env vars ) ; } } ; }


validate if the capability is present or not

private static void check capability ( string capability ) throws federation state store invalid input exception { if ( capability = = null | | capability is empty ( ) ) { string message = " invalid capability information " + " please try again by specifying valid capability information " ; log warn ( message ) ; throw new federation state store invalid input exception ( message ) ; } }


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


public int get register count ( ) { return 3 ; }


format url template using default server variables

public string url ( ) { return url ( null ) ; }


returns the type for the return value type

public abstract ms type get return type ( ) { return pdb get type record ( return value record number ) ; }


public abstract void set reservation definition ( reservation definition reservation definition ) ;


public static void put ( @ non null final string key , final object value , int save time ) { put ( key , value , save time , get default cache memory utils ( ) ) ; }


list of node locations on which this scheduling request can be placed the size of this list = scheduling request resource sizing num allocations

public list < scheduler node > get nodes ( ) { return nodes ; }


update the router state and heartbeat to the state store

public void update router state ( router service state new state ) { this state = new state ; if ( this router heartbeat service ! = null ) { this router heartbeat service update state async ( ) ; } }


public build rule builder add multi value attributes ( string attr name , string value ) { multi value attributes put all ( attr name , lists new array list ( value ) ) ; return this ; }


get the { @ code tcp notsent lowat } option on the socket see { @ code man 7 tcp } for more details

public long get tcp not sent low at ( ) { try { return ( ( epoll socket channel ) channel ) socket get tcp not sent low at ( ) ; } catch ( i o exception e ) { throw new channel exception ( e ) ; } }


the subset of the replicas that are offline

public node [ ] offline replicas ( ) { return offline replicas ; }


static map < string , object > decode attributes ( final map < string , object > attributes , final registered service registered service , final web application service web application service ) { val final attributes = maps < string , object > new hash map with expected size ( attributes size ( ) ) ; attributes for each ( ( k , v ) - > { val attribute name = protocol attribute encoder decode attribute ( k ) ; logger debug ( " decoded saml attribute [ { } ] to [ { } ] with value ( s ) [ { } ] " , k , attribute name , v ) ; final attributes put ( attribute name , v ) ; } ) ; return final attributes ; }


public static transaction manager get ( ) { if ( singleton holder instance = = null ) { throw new should never happen exception ( " transaction manager is not ready ! " ) ; } return singleton holder instance ; }


a version of { @ link # copy dir ( file , file , file filter , task monitor ) } that does not alter the progress value of the given monitor , only the status text this allows this recursive method to send status updates while the caller of this method controls the progress

private static int do copy dir ( file original dir , file copy dir , file filter filter , task monitor monitor ) throws i o exception , cancelled exception { if ( ! original dir exists ( ) ) { return 0 ; / / nothing to do } file [ ] original dir files = original dir list files ( filter ) ; if ( original dir files = = null | | original dir files length = = 0 ) { return 0 ; / / nothing to do } int copied files count = 0 ; for ( file file : original dir files ) { monitor check canceled ( ) ; monitor set message ( " copying " + file get absolute path ( ) ) ; file destination file = new file ( copy dir , file get name ( ) ) ; if ( file is directory ( ) ) { copied files count + = do copy dir ( file , destination file , filter , monitor ) ; } else { destination file get parent file ( ) mkdirs ( ) ; / / use a dummy monitor as not to ruin the progress copy file ( file , destination file , false , monitor ) ; copied files count + + ; } } return copied files count ; }


helper method to configure the oauth access codeimplicit flow parameters

public void configure authorization flow ( string client id , string client secret , string redirect u r i ) { for ( request interceptor api authorization : api authorizations values ( ) ) { if ( api authorization instanceof o auth ) { o auth oauth = ( o auth ) api authorization ; oauth get token request builder ( ) set client id ( client id ) set client secret ( client secret ) set redirect u r i ( redirect u r i ) ; oauth get authentication request builder ( ) set client id ( client id ) set redirect u r i ( redirect u r i ) ; return ; } } }


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


public factory method with which the appropriate copy listing implementation may be retrieved

public static copy listing get copy listing ( configuration configuration , credentials credentials , dist cp context context ) throws i o exception { string copy listing class name = configuration get ( dist cp constants conf label copy listing class , " " ) ; class < ? extends copy listing > copy listing class ; try { if ( ! copy listing class name is empty ( ) ) { copy listing class = configuration get class ( dist cp constants conf label copy listing class , globbed copy listing class , copy listing class ) ; } else { if ( context get source file listing ( ) = = null ) { copy listing class = globbed copy listing class ; } else { copy listing class = file based copy listing class ; } } copy listing class name = copy listing class get name ( ) ; constructor < ? extends copy listing > constructor = copy listing class get declared constructor ( configuration class , credentials class ) ; return constructor new instance ( configuration , credentials ) ; } catch ( exception e ) { throw new i o exception ( " unable to instantiate " + copy listing class name , e ) ; } }


public static field get declared field ( object object , string field name ) { field field = null ; class < ? > clazz = object get class ( ) ; for ( ; clazz ! = object class ; clazz = clazz get superclass ( ) ) { try { field = clazz get declared field ( field name ) ; return field ; } catch ( exception e ) { } } return null ; }


record that the output of this blaze command depended on the contents of a build file or source file with the specified time stamp

public void notify dependence on file time ( path fragment path , long ctime millis ) { if ( ! this wait a millisecond & & ctime millis = = this command start time millis ) { if ( path ! = null ) { logger at info ( ) log ( " will have to wait for a millisecond on completion because of % s " , path ) ; } this wait a millisecond = true ; } if ( ! this wait a second & & ctime millis = = this command start time millis rounded ) { if ( path ! = null ) { logger at info ( ) log ( " will have to wait for a second on completion because of % s " , path ) ; } this wait a second = true ; } }


creates a session logs map , with session logs mapped to session i ds , given a raw session log map as a json object

public static map < string , session logs > get session logs ( map < string , object > raw session map ) { map < string , session logs > session logs map = new hash map < > ( ) ; for ( map entry < string , object > entry : raw session map entry set ( ) ) { string session id = entry get key ( ) ; if ( ! ( entry get value ( ) instanceof map ) ) { throw new invalid argument exception ( " expected value to be an object : " + entry get value ( ) ) ; } @ suppress warnings ( " unchecked " ) map < string , object > value = ( map < string , object > ) entry get value ( ) ; session logs session logs = session logs from j s o n ( value ) ; session logs map put ( session id , session logs ) ; } return session logs map ; }


get petfind by status : finds pets by status multiple status values can be provided with comma separated strings

default response entity < list < pet > > find pets by status ( @ not null @ api param ( value = " status values that need to be considered for filter " , required = true , allowable values = " available , pending , sold " ) @ valid @ request param ( value = " status " , required = true ) list < string > status ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " photo urls \ " : [ \ " photo urls \ " , \ " photo urls \ " ] , \ " name \ " : \ " doggie \ " , \ " id \ " : 0 , \ " category \ " : { \ " name \ " : \ " default - name \ " , \ " id \ " : 6 } , \ " tags \ " : [ { \ " name \ " : \ " name \ " , \ " id \ " : 1 } , { \ " name \ " : \ " name \ " , \ " id \ " : 1 } ] , \ " status \ " : \ " available \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < pet > < id > 123456789 < / id > < name > doggie < / name > < photo urls > < photo urls > aeiou < / photo urls > < / photo urls > < tags > < / tags > < status > aeiou < / status > < / pet > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


returns the allocation commands to execute

public allocation commands get commands ( ) { return commands ; }


clears the current header entries and copies all header entries of the specified { @ code headers }

t set ( headers < ? extends k , ? extends v , ? > headers ) ;


returns true if the value is zero ( using the default tolerance as upper bound )

static public boolean is zero ( float value ) { return math abs ( value ) < = float rounding error ; }


retrieves and removes the first element of this deque this method differs from { @ link # poll first poll first } only in that it throws an exception if this deque is empty


utility method to subtract a { @ link resource } from the { @ link resource utilization }

static void decrease resource utilization ( containers monitor containers monitor , resource utilization resource util , resource resource ) { float v cores = ( float ) resource get virtual cores ( ) ; int vmem = ( int ) ( resource get memory size ( ) * containers monitor get vmem ratio ( ) ) ; resource util subtract from ( ( int ) resource get memory size ( ) , vmem , v cores ) ; }


the number of error - free flow events that were passed to plugins

public int flow events ( ) { return flow events ; }


when relocating a primary shard , there is a cluster state update at the end of relocation where the active primary is switched from the relocation source to the relocation target if relocation source receives and processes this cluster state before the relocation target , there is a time span where relocation source believes active primary to be on relocation target and relocation target believes active primary to be on relocation source this results in replication requests being sent back and forth this test checks that replication request is not routed back from relocation target to relocation source in case of stale index routing table on relocation target

public void test no reroute on stale cluster state ( ) { final string index = " test " ; final shard id shard id = new shard id ( index , " na " , 0 ) ; cluster state state = state ( index , true , shard routing state relocating ) ; string relocation target node = state get routing table ( ) shard routing table ( shard id ) primary shard ( ) relocating node id ( ) ; state = cluster state builder ( state ) nodes ( discovery nodes builder ( state nodes ( ) ) local node id ( relocation target node ) ) build ( ) ; set state ( cluster service , state ) ; logger debug ( " - - > relocation ongoing state : \ n { } " , cluster service state ( ) ) ; request request = new request ( shard id ) timeout ( " 1ms " ) routed based on cluster version ( cluster service state ( ) version ( ) + 1 ) ; plain action future < test response > listener = new plain action future < > ( ) ; test action reroute phase reroute phase = action new reroute phase ( null , request , listener ) ; reroute phase run ( ) ; assert listener throws ( " cluster state too old didn ' t cause a timeout " , listener , unavailable shards exception class ) ; assert true ( request is retry set compare and set ( true , false ) ) ; request = new request ( shard id ) routed based on cluster version ( cluster service state ( ) version ( ) + 1 ) ; listener = new plain action future < > ( ) ; reroute phase = action new reroute phase ( null , request , listener ) ; reroute phase run ( ) ; assert false ( " cluster state too old didn ' t cause a retry " , listener is done ( ) ) ; assert true ( request is retry set get ( ) ) ; / / finish relocation shard routing relocation target = cluster service state ( ) get routing table ( ) shard routing table ( shard id ) shards with state ( shard routing state initializing ) get ( 0 ) ; allocation service allocation service = e s allocation test case create allocation service ( ) ; cluster state updated state = e s allocation test case start shards and reroute ( allocation service , state , relocation target ) ; set state ( cluster service , updated state ) ; logger debug ( " - - > relocation complete state : \ n { } " , cluster service state ( ) ) ; index shard routing table shard routing table = cluster service state ( ) routing table ( ) index ( index ) shard ( shard id id ( ) ) ; final string primary node id = shard routing table primary shard ( ) current node id ( ) ; final list < capturing transport captured request > captured requests = transport get captured requests by target node and clear ( ) get ( primary node id ) ; assert that ( captured requests , not null value ( ) ) ; assert that ( captured requests size ( ) , equal to ( 1 ) ) ; assert that ( captured requests get ( 0 ) action , equal to ( " internal : test action [ p ] " ) ) ; assert index shard counter ( 0 ) ; }


helper method to create a message indicating a invalid decoding result

private m invalid message ( exception cause ) { state = state bad message ; m message = build invalid message ( ) ; message set decoder result ( decoder result failure ( cause ) ) ; return message ; }


public void add ( register tree tree ) { children add ( tree ) ; tree parent = this ; }


combines two patterns into a new pattern that is returned the full algorithm used for combining the two pattern depends on the underlying implementation

string combine ( string pattern 1 , string pattern 2 ) ;


returns the simple exo player ' s shuffle mode for the given shuffle mode

public static boolean get exo player shuffle mode ( int shuffle mode ) { switch ( shuffle mode ) { case session player shuffle mode all : case session player shuffle mode group : return true ; case session player shuffle mode none : return false ; default : throw new illegal argument exception ( ) ; } }


returns the { @ code path fragment } which represents a directory where the generated obj c files reside

public path fragment get objc file path ( ) { return objc file path ; }


verify quota for rename operation where src inodes [ src inodes length - 1 ] moves dst inodes [ dst inodes length - 1 ]

private static void verify quota for rename ( f s directory fsd , i nodes in path src , i nodes in path dst ) throws quota exceeded exception { if ( ! fsd get f s namesystem ( ) is image loaded ( ) | | fsd should skip quota checks ( ) ) { / / do not check quota if edits log is still being processed return ; } int i = 0 ; while ( src get i node ( i ) = = dst get i node ( i ) ) { i + + ; } / / src [ i - 1 ] is the last common ancestor block storage policy suite bsps = fsd get block storage policy suite ( ) ; / / assume dst parent existence check done by callers i node dst parent = dst get i node ( - 2 ) ; / / use the destination parent ' s storage policy for quota delta verify final quota counts delta = src get last i node ( ) compute quota usage ( bsps , dst parent get storage policy i d ( ) , false , snapshot current state id ) ; / / reduce the required quota by dst that is being removed final i node dst i node = dst get last i node ( ) ; if ( dst i node ! = null ) { delta subtract ( dst i node compute quota usage ( bsps ) ) ; } f s directory verify quota ( dst , dst length ( ) - 1 , delta , src get i node ( i - 1 ) ) ; }


returns a new method spec builder that overrides { @ code method } this will copy its visibility modifiers , type parameters , return type , name , parameters , and throws declarations an { @ link override } annotation will be added note that in java poet 1 2 through 1 7 this method retained annotations from the method and parameters of the overridden method since java poet 1 8 annotations must be added separately

public static builder overriding ( executable element method ) { check not null ( method , " method = = null " ) ; element enclosing class = method get enclosing element ( ) ; if ( enclosing class get modifiers ( ) contains ( modifier final ) ) { throw new illegal argument exception ( " cannot override method on final class " + enclosing class ) ; } set < modifier > modifiers = method get modifiers ( ) ; if ( modifiers contains ( modifier private ) | | modifiers contains ( modifier final ) | | modifiers contains ( modifier static ) ) { throw new illegal argument exception ( " cannot override method with modifiers : " + modifiers ) ; } string method name = method get simple name ( ) to string ( ) ; method spec builder method builder = method spec method builder ( method name ) ; method builder add annotation ( override class ) ; modifiers = new linked hash set < > ( modifiers ) ; modifiers remove ( modifier abstract ) ; modifiers remove ( modifier default ) ; method builder add modifiers ( modifiers ) ; for ( type parameter element type parameter element : method get type parameters ( ) ) { type variable var = ( type variable ) type parameter element as type ( ) ; method builder add type variable ( type variable name get ( var ) ) ; } method builder returns ( type name get ( method get return type ( ) ) ) ; method builder add parameters ( parameter spec parameters of ( method ) ) ; method builder varargs ( method is var args ( ) ) ; for ( type mirror thrown type : method get thrown types ( ) ) { method builder add exception ( type name get ( thrown type ) ) ; } return method builder ; }


threadpools can swallow exceptions make sure they don ' t get lost

public void await latch and track exceptions ( count down latch latch , string error message ) { try { wait and maybe throw interrupt ( latch , error message ) ; } catch ( throwable e ) { / / we would expect e to be interrupted exception or assertion error , but we leave it open so / / that any throwable gets recorded exceptions thrown add ( pair of ( error message , e ) ) ; / / caller will assert exceptions thrown is empty at end of test and fail , even if this is / / swallowed throwables propagate ( e ) ; } }


adds the given listener to the provided directory reader the reader must contain an { @ link elasticsearch directory reader } in it ' s hierarchy otherwise we can ' t safely install the listener

public static void add reader close listener ( directory reader reader , index reader closed listener listener ) { elasticsearch directory reader elasticsearch directory reader = get elasticsearch directory reader ( reader ) ; if ( elasticsearch directory reader = = null ) { throw new illegal argument exception ( " can ' t install close listener reader is not an elasticsearch directory reader / elasticsearch leaf reader " ) ; } index reader cache helper cache helper = elasticsearch directory reader get reader cache helper ( ) ; if ( cache helper = = null ) { throw new illegal argument exception ( " reader " + elasticsearch directory reader + " does not support caching " ) ; } assert cache helper get key ( ) = = reader get reader cache helper ( ) get key ( ) ; cache helper add closed listener ( listener ) ; }


maps different exceptions thrown by http f s server to http status codes security exception : http unauthorized file not found exception : http not found i o exception : internal http server error unsupporte operation exception : http bad request all other exceptions : http internal server error

public response to response ( throwable throwable ) { response status status ; if ( throwable instanceof file system access exception ) { throwable = throwable get cause ( ) ; } if ( throwable instanceof container exception ) { throwable = throwable get cause ( ) ; } if ( throwable instanceof security exception ) { status = response status unauthorized ; } else if ( throwable instanceof file not found exception ) { status = response status not found ; } else if ( throwable instanceof i o exception ) { status = response status internal server error ; log error fully ( status , throwable ) ; } else if ( throwable instanceof unsupported operation exception ) { status = response status bad request ; log error fully ( status , throwable ) ; } else if ( throwable instanceof illegal argument exception ) { status = response status bad request ; log error fully ( status , throwable ) ; } else { status = response status internal server error ; log error fully ( status , throwable ) ; } return create response ( status , throwable ) ; }


variant of { @ link # body ( publisher , parameterized type reference ) } that allows using any producer that can be resolved to { @ link publisher } via { @ link reactive adapter registry }

mono < server response > body ( object producer , parameterized type reference < ? > element type ref ) ;


closes the ghidra project , closing ( without saving ! ) any open programs in that project also deletes the project if created as a temporary project

public void close ( ) { iterator < program > it = open programs key set ( ) iterator ( ) ; while ( it has next ( ) ) { program p = it next ( ) ; int id = ( open programs get ( p ) ) int value ( ) ; if ( id > = 0 ) { p end transaction ( id , true ) ; } p release ( this ) ; } open programs clear ( ) ; if ( project ! = null ) { project close ( ) ; project = null ; } if ( delete on close ) { project locator project locator = project data get project locator ( ) ; if ( project locator get marker file ( ) exists ( ) ) { project manager delete project ( project locator ) ; } } }


inserts z nodes for every node that needs a new successor

private static void edge split successors ( ssa method result ) { array list < ssa basic block > blocks = result get blocks ( ) ; / * * new blocks are added to the end of the block list during * this iteration * / for ( int i = blocks size ( ) - 1 ; i > = 0 ; i - - ) { ssa basic block block = blocks get ( i ) ; / / successors list is modified in loop below bit set successors = ( bit set ) block get successors ( ) clone ( ) ; for ( int j = successors next set bit ( 0 ) ; j > = 0 ; j = successors next set bit ( j + 1 ) ) { ssa basic block succ = blocks get ( j ) ; if ( needs new successor ( block , succ ) ) { block insert new successor ( succ ) ; } } } }


adds a transport implementation that can be selected by setting { @ link # transport type key }

private void register transport ( string key , supplier < transport > factory ) { if ( transport factories put if absent ( key , factory ) ! = null ) { throw new illegal argument exception ( " transport for name : " + key + " is already registered " ) ; } }


add the { @ code owning bucket ord , value } pair return the ord for their bucket if they have yet to be added , or { @ code - 1 - ord } if they were already present

public abstract long add ( long owning bucket ord , long value ) ;


this method checks all the things that need to be checked after each test

public void assert after test ( ) throws exception { ensure estimated stats ( ) ; }


modify a configuration to use kerberos as the auth method

public static void enable kerberos ( configuration conf ) { conf set ( hadoop security authentication , user group information authentication method kerberos name ( ) ) ; }


attempts to cancel the { @ link timer task } associated with this handle if the task has been executed or cancelled already , it will return with no side effect


creates a config option with the given default value

public config option < t > default value ( t value ) { return new config option < > ( key , clazz , config option empty description , value , false ) ; }


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

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


test if configuring a router to monitor particular namenodes actually takes effect

private void test config ( collection < string > expected n ns , string conf ns ids ) { / / setup and start the router configuration conf = get namenodes config ( ) ; configuration router conf = new router config builder ( conf ) heartbeat ( true ) build ( ) ; router conf set ( r b f config keys dfs router rpc address key , " 0 0 0 0 : 0 " ) ; router conf set ( r b f config keys dfs router monitor namenode , conf ns ids ) ; router = new router ( ) ; router init ( router conf ) ; / / test the heartbeat services of the router collection < namenode heartbeat service > heartbeat services = router get namenode heartbeat services ( ) ; assert namenode heartbeat service ( expected n ns , heartbeat services ) ; }


creates a new { @ link object pool } which will use the given { @ link object creator } to create the { @ link object } that should be pooled

public static < t > object pool < t > new pool ( final object creator < t > creator ) { return new recycler object pool < t > ( object util check not null ( creator , " creator " ) ) ; }


parses a tfdt atom ( defined in 14496 - 12 )

private static long parse tfdt ( parsable byte array tfdt ) { tfdt set position ( atom header size ) ; int full atom = tfdt read int ( ) ; int version = atom parse full atom version ( full atom ) ; return version = = 1 ? tfdt read unsigned long to long ( ) : tfdt read unsigned int ( ) ; }


public static node status new instance ( node id node id , int response id , list < container status > container statuses , list < application id > keep alive applications , node health status node health status , resource utilization containers utilization , resource utilization node utilization , list < container > increased containers ) { node status node status = records new record ( node status class ) ; node status set response id ( response id ) ; node status set node id ( node id ) ; node status set containers statuses ( container statuses ) ; node status set keep alive applications ( keep alive applications ) ; node status set node health status ( node health status ) ; node status set containers utilization ( containers utilization ) ; node status set node utilization ( node utilization ) ; node status set increased containers ( increased containers ) ; return node status ; }


verifies that { @ link metric options # reporters list } is correctly used to filter configured reporters

public void test activate one reporter among two declared ( ) { final configuration config = new configuration ( ) ; configure reporter 1 ( config ) ; configure reporter 2 ( config ) ; config set string ( metric options reporters list , " reporter 2 " ) ; final list < reporter setup > reporter setups = reporter setup from configuration ( config , null ) ; assert assert equals ( 1 , reporter setups size ( ) ) ; final reporter setup setup = reporter setups get ( 0 ) ; assert reporter 2 configured ( setup ) ; }


a description of the binding in human readable form ( e g , " field ' foo ' " )


static byte [ ] build part handle payload ( final string path , final string upload id , final int part number , final string etag , final long len ) throws i o exception { return new part handle payload ( path , upload id , part number , len , etag ) to bytes ( ) ; }


tests that changing a config setting invalidates the rule that uses it

public void config key invalidation ( ) throws exception { write hello rules ( / * include default condition = * / true ) ; write config rules ( ) ; / / iteration 1 : - - test args = a should apply / / conditions : a use configuration ( " - - test arg = a " ) ; check rule ( " / / java / hello : hello " , " - - test arg = a " , / * expected : * / immutable list of ( adep input ) , / * not expected : * / immutable list of ( bdep input , defaultdep input ) ) ; / / rewrite the condition for / / conditions : a scratch overwrite file ( " conditions / build " , " config setting ( " , " name = ' a ' , " , " values = { ' test arg ' : ' c ' } ) " , " config setting ( " , " name = ' b ' , " , " values = { ' test arg ' : ' b ' } ) " ) ; / / iteration 2 : same exact analysis should now apply the default condition invalidate packages ( ) ; check rule ( " / / java / hello : hello " , " - - test arg = a " , / * expected : * / immutable list of ( defaultdep input ) , / * not expected : * / immutable list of ( adep input , bdep input ) ) ; }


create and return a new instance of a view for this model by default a view is created by inflating the layout resource

protected view build view ( @ non null view group parent ) { return layout inflater from ( parent get context ( ) ) inflate ( get layout ( ) , parent , false ) ; }


public void test find pdb 3 ( ) throws exception { created files = create files ( pdb location symbols subdir , pdb xml location same as pdb ) ; file pdb = pdb parser find p d b ( test program , false , symbols folder ) ; assert not null ( pdb ) ; if ( pdb parser on windows ) { assert equals ( pdb file , pdb ) ; } else { assert equals ( pdb xml file , pdb ) ; } }


public static map < string , channel > get rm channels ( ) { if ( rm channels is empty ( ) ) { return null ; } map < string , channel > channels = new hash map < > ( rm channels size ( ) ) ; rm channels for each ( ( resource id , value ) - > { channel channel = try other app ( value , null ) ; if ( channel = = null ) { return ; } channels put ( resource id , channel ) ; } ) ; return channels ; }


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

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


returns the number of distinct ordinals in this builder

public long get value count ( ) { return current ord + 1 ; }


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 a field value this is roughly equivalent to { @ link field # get ( object ) } if the wrapped object is a { @ link class } , then this will get a value from a static member field if the wrapped object is any other { @ link object } , then this will get a value from an instance member field if you want to " navigate " to a wrapped version of the field , use { @ link # field ( string ) } instead

public < t > t get ( string name ) throws reflect exception { return field ( name ) < t > get ( ) ; }


gets whether the query builder will ignore unmapped types ( and run a { @ link match no docs query } in place of this query ) or throw an exception if the type is unmapped

public boolean ignore unmapped ( ) { return ignore unmapped ; }


validate a test where each result has the same values

private static < t > void validate ( graph < t , null value , null value > graph , long count , double score ) throws exception { data set < result < t > > hits = new hits < t , null value , null value > ( accuracy ) run ( graph ) ; list < result < t > > results = hits collect ( ) ; assert equals ( count , results size ( ) ) ; for ( result < t > result : results ) { assert equals ( score , result get hub score ( ) get value ( ) , accuracy ) ; assert equals ( score , result get authority score ( ) get value ( ) , accuracy ) ; } }


converts { @ link i o exception } on body reading to { @ link push network exception } { @ link i o exception } during json parsing is converted to a { @ link non successful response code exception } with response code detail

private static < t > t read response json ( response response , class < t > clazz ) throws push network exception , non successful response code exception { try { return read body json ( response body ( ) , clazz ) ; } catch ( non successful response code exception e ) { throw new non successful response code exception ( " bad response : " + response code ( ) + " " + response message ( ) ) ; } }


uses reflection to create a new instance of the given type

private object new instance ( class < ? > clazz ) { try { return class reflection new instance ( clazz ) ; } catch ( throwable ex ) { throw new gdx runtime exception ( ex ) ; } }


return the raw request body content written through the request note : if the request content has not been consumed for any reason yet , use of this method will trigger consumption

public byte [ ] get request body content ( ) { return this request body block ( this timeout ) ; }


inserts the specified number of items at the specified index the new items will have values equal to the values at those indices before the insertion

public void insert range ( int index , int count ) { if ( index > size ) throw new index out of bounds exception ( " index can ' t be > size : " + index + " > " + size ) ; int size needed = size + count ; if ( size needed > items length ) items = resize ( math max ( math max ( 8 , size needed ) , ( int ) ( size * 1 7 5f ) ) ) ; system arraycopy ( items , index , items , index + count , size - index ) ; size = size needed ; }


executes { @ code callable } on the specified { @ code executor } , returning a { @ code future }

public static < o > listenable future < o > submit ( callable < o > callable , executor executor ) { trusted listenable future task < o > task = trusted listenable future task create ( callable ) ; executor execute ( task ) ; return task ; }


declare the expected cost on a guarded auth fs

protected operation cost validator expected probe when authoritative ( operation cost cost ) { return expect ( is authoritative ( ) , cost ) ; }


looks up the encryption zone int for a path within an encryption zone returns null if path is not within an ez called while holding the f s directory lock

private encryption zone int get encryption zone for path ( i nodes in path iip ) throws i o exception { assert dir has read lock ( ) ; preconditions check not null ( iip ) ; if ( ! has created encryption zone ( ) ) { return null ; } int snapshot i d = iip get path snapshot id ( ) ; for ( int i = iip length ( ) - 1 ; i > = 0 ; i - - ) { final i node inode = iip get i node ( i ) ; if ( inode = = null | | ! inode is directory ( ) ) { / / not found or not a directory , encryption zone is supported on / / directory only continue ; } if ( snapshot i d = = snapshot current state id ) { final encryption zone int ezi = encryption zones get ( inode get id ( ) ) ; if ( ezi ! = null ) { return ezi ; } } else { x attr x attr = f s dir x attr op unprotected get x attr by prefixed name ( inode , snapshot i d , crypto xattr encryption zone ) ; if ( x attr ! = null ) { try { final hdfs protos zone encryption info proto ez proto = hdfs protos zone encryption info proto parse from ( x attr get value ( ) ) ; return new encryption zone int ( inode get id ( ) , p b helper client convert ( ez proto get suite ( ) ) , p b helper client convert ( ez proto get crypto protocol version ( ) ) , ez proto get key name ( ) ) ; } catch ( invalid protocol buffer exception e ) { throw new i o exception ( " could not parse encryption zone for inode " + iip get path ( ) , e ) ; } } } } return null ; }


set whether to ignore invalid fields , that is , whether to ignore bind parameters that have corresponding fields in the target object which are not accessible ( for example because of null values in the nested path ) default is " false " turn this on to ignore bind parameters for nested objects in non - existing parts of the target object graph note that this setting only applies to binding operations on this data binder , not to retrieving values via its { @ link # get binding result ( ) binding result }

public void set ignore invalid fields ( boolean ignore invalid fields ) { this ignore invalid fields = ignore invalid fields ; }


fills a triangle with vertices at x 1 , y 1 and x 2 , y 2 and x 3 , y 3 using the current color

public void fill triangle ( int x 1 , int y 1 , int x 2 , int y 2 , int x 3 , int y 3 ) { pixmap fill triangle ( x 1 , y 1 , x 2 , y 2 , x 3 , y 3 , color ) ; }


reconstruct the project metadata on a best efforts basis the name is gone , so build something descriptive from the column names recover the creation and modification times based on whatever files are available

static public project metadata recover ( file project dir , long id ) { project metadata pm = null ; project p = project utilities load ( project dir , id ) ; if ( p ! = null ) { list < string > column names = p column model get column names ( ) ; string temp name = " < recovered project > - " + column names size ( ) + " cols x " + p rows size ( ) + " rows - " + string utils join ( column names , ' | ' ) ; p dispose ( ) ; long ctime = system current time millis ( ) ; long mtime = 0 ; file data file = new file ( project dir , " data zip " ) ; ctime = mtime = data file last modified ( ) ; file history dir = new file ( project dir , " history " ) ; file [ ] files = history dir list files ( ) ; if ( files ! = null ) { for ( file f : files ) { long time = f last modified ( ) ; ctime = math min ( ctime , time ) ; mtime = math max ( mtime , time ) ; } } pm = new project metadata ( local date time of instant ( instant of epoch milli ( ctime ) , zone id system default ( ) ) , local date time of instant ( instant of epoch milli ( mtime ) , zone id system default ( ) ) , temp name ) ; logger error ( " partially recovered missing metadata project in directory " + project dir + " - " + temp name ) ; } return pm ; }


get a { @ link reader } attached to the configuration resource with the given < code > name < code >

public reader get conf resource as reader ( string name ) { try { url url = get resource ( name ) ; if ( url = = null ) { log info ( name + " not found " ) ; return null ; } else { log info ( " found resource " + name + " at " + url ) ; } return new input stream reader ( url open stream ( ) , charsets utf 8 ) ; } catch ( exception e ) { return null ; } }


get federation policy configuration from state store , using default queue and configuration as fallback

public static sub cluster policy configuration load policy configuration ( string queue , configuration conf , federation state store facade federation facade ) { / / the facade might cache this request , based on its parameterization sub cluster policy configuration configuration = null ; if ( queue ! = null ) { try { configuration = federation facade get policy configuration ( queue ) ; } catch ( yarn exception e ) { log warn ( " failed to get policy from federation facade with queue " + queue + " : " + e get message ( ) ) ; } } / / if there is no policy configured for this queue , fallback to the baseline / / policy that is configured either in the store or via xml config if ( configuration = = null ) { log info ( " no policy configured for queue { } in state store , " + " fallback to default queue " , queue ) ; queue = yarn configuration default federation policy key ; try { configuration = federation facade get policy configuration ( queue ) ; } catch ( yarn exception e ) { log warn ( " no fallback behavior defined in store , defaulting to xml " + " configuration fallback behavior " ) ; } } / / or from xml conf otherwise if ( configuration = = null ) { log info ( " no policy configured for default queue { } in state store , " + " fallback to local config " , queue ) ; string default federation policy manager = conf get ( yarn configuration federation policy manager , yarn configuration default federation policy manager ) ; string default policy param string = conf get ( yarn configuration federation policy manager params , yarn configuration default federation policy manager params ) ; byte buffer default policy param = byte buffer wrap ( default policy param string get bytes ( standard charsets utf 8 ) ) ; configuration = sub cluster policy configuration new instance ( queue , default federation policy manager , default policy param ) ; } return configuration ; }


parses all pre " - - " residue for starlark options

public void parse ( extended event handler event handler ) throws options parsing exception { immutable list builder < string > residue = new immutable list builder < > ( ) ; / / map of < option name ( label ) , < unparsed option value , loaded option > > multimap < string , pair < string , target > > unparsed options = linked list multimap create ( ) ; / / sort the old residue into starlark flags and legitimate residue for ( string arg : native options parser get pre double dash residue ( ) ) { / / todo ( bazel - team ) : support single dash options ? if ( ! arg starts with ( " - - " ) ) { residue add ( arg ) ; continue ; } parse arg ( arg , unparsed options , event handler ) ; } list < string > post double dash residue = native options parser get post double dash residue ( ) ; residue add all ( post double dash residue ) ; native options parser set residue ( residue build ( ) , post double dash residue ) ; if ( unparsed options is empty ( ) ) { return ; } / / map of flag label as a string to its loaded target and set value after parsing hash map < string , pair < target , object > > build setting with target and value = new hash map < > ( ) ; for ( map entry < string , pair < string , target > > option : unparsed options entries ( ) ) { string loaded flag = option get key ( ) ; string unparsed value = option get value ( ) first ; target build setting target = option get value ( ) second ; build setting build setting = build setting target get associated rule ( ) get rule class object ( ) get build setting ( ) ; / / do not recognize internal options , which are treated as if they did not exist if ( ! build setting is flag ( ) ) { throw new options parsing exception ( string format ( " unrecognized option : % s = % s " , loaded flag , unparsed value ) ) ; } type < ? > type = build setting get type ( ) ; converter < ? > converter = build setting converters get ( type ) ; object value ; try { value = converter convert ( unparsed value ) ; } catch ( options parsing exception e ) { throw new options parsing exception ( string format ( " while parsing option % s = % s : ' % s ' is not a % s " , loaded flag , unparsed value , unparsed value , type ) , e ) ; } if ( build setting allows multiple ( ) ) { list < object > new value ; if ( build setting with target and value contains key ( loaded flag ) ) { new value = new array list < > ( ( collection < ? > ) build setting with target and value get ( loaded flag ) get second ( ) ) ; } else { new value = new array list < > ( ) ; } new value add ( value ) ; value = new value ; } build setting with target and value put ( loaded flag , pair of ( build setting target , value ) ) ; } map < string , object > parsed options = new hash map < > ( ) ; for ( string build setting : build setting with target and value key set ( ) ) { pair < target , object > build setting and final value = build setting with target and value get ( build setting ) ; target build setting target = build setting and final value get first ( ) ; boolean allows multiple = build setting target get associated rule ( ) get rule class object ( ) get build setting ( ) allows multiple ( ) ; object value = build setting and final value get second ( ) ; if ( allows multiple ) { list < ? > default value = immutable list of ( objects require non null ( build setting target get associated rule ( ) get attr ( starlark build setting default attr name ) ) ) ; list < ? > new value = ( list < ? > ) value ; if ( ! new value equals ( default value ) ) { parsed options put ( build setting , value ) ; } } else { if ( ! value equals ( build setting target get associated rule ( ) get attr ( starlark build setting default attr name ) ) ) { parsed options put ( build setting , build setting and final value get second ( ) ) ; } } } native options parser set starlark options ( immutable map copy of ( parsed options ) ) ; }


return a specified persistence unit for the given unit name , as defined through the " persistence units " map

protected entity manager factory get persistence unit ( @ nullable string unit name ) { if ( this persistence units ! = null ) { string unit name for lookup = ( unit name ! = null ? unit name : " " ) ; if ( unit name for lookup is empty ( ) ) { unit name for lookup = this default persistence unit name ; } string jndi name = this persistence units get ( unit name for lookup ) ; if ( jndi name = = null & & unit name for lookup is empty ( ) & & this persistence units size ( ) = = 1 ) { jndi name = this persistence units values ( ) iterator ( ) next ( ) ; } if ( jndi name ! = null ) { try { return lookup ( jndi name , entity manager factory class ) ; } catch ( exception ex ) { throw new illegal state exception ( " could not obtain entity manager factory [ " + jndi name + " ] from jndi " , ex ) ; } } } return null ; }


reads the unsigned integer at the current index and then increments the current index by < code > sizeof int < code >

public long read next unsigned int ( ) throws i o exception { return read next int ( ) & number util unsigned int mask ; }