when we can ' t find primary data , but still find replica data , we go ahead and keep it unassigned to be allocated this is today behavior , which relies on a primary corruption identified with adding a replica and having that replica actually recover and cause the corruption to be identified see corrupt file test #

public void test no primary data ( ) { routing allocation allocation = one primary on node 1 and 1 replica ( yes allocation deciders ( ) ) ; test allocator add data ( node 2 , " match " , new store file metadata ( " file 1 " , 10 , " match checksum " , min supported lucene version ) ) ; allocate all unassigned ( allocation ) ; assert that ( allocation routing nodes ( ) shards with state ( shard routing state unassigned ) size ( ) , equal to ( 1 ) ) ; assert that ( allocation routing nodes ( ) shards with state ( shard routing state unassigned ) get ( 0 ) shard id ( ) , equal to ( shard id ) ) ; }


test the state machine transition we use separate test methods instead of a single one because the mocked { @ link # fsn } is accessed concurrently by the current thread and the < code > smmthread < code > thread in the { @ link block manager safe mode } stubbing or verification of a shared mock from different threads is not the proper way of testing , which leads to intermittent behavior meanwhile , previous state transition may have side effects that should be reset before next test case for example , in { @ link block manager safe mode } , there is a safe mode monitor thread , which is created when block manager safe mode is constructed it will start the first time the safe mode enters extension stage and will stop if the safe mode leaves to off state across different test cases , this thread should be reset

public void test check safe mode 1 ( ) { / / stays in pending threshold : pending block threshold bm safe mode activate ( block total ) ; set safe mode status ( b m safe mode status pending threshold ) ; for ( long i = 0 ; i < block threshold ; i + + ) { set block safe ( i ) ; bm safe mode check safe mode ( ) ; assert equals ( b m safe mode status pending threshold , get safe mode status ( ) ) ; } }


a sensible , albeit inefficient , definition of { @ link # contains key } in terms of the { @ code iterator } method of { @ link # entry set } if you override { @ link # entry set } , you may wish to override { @ link # contains key } to forward to this implementation

protected boolean standard contains key ( @ nullable object key ) { return maps contains key impl ( this , key ) ; }


generates the prefix message for validate millisecond x x x x x x ( ) utility

public static string prepare millis check fail msg prefix ( final object value , final string name ) { return format ( millisecond validation fail msg frmt , name , value ) ; }


protected void block allocated ( ) { if ( statistics ! = null ) { statistics block allocated ( ) ; } }


registers a listener which is called whenever new slots become available

void register new slots listener ( new slots listener listener ) ;


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


public optional < replica query data source rule > find data source rule ( final string data source name ) { return optional of nullable ( data source rules get ( data source name ) ) ; }


checks the user exists with the given password

void assert user ( string username , string password ) throws i o exception { list < string > lines = files read all lines ( conf dir resolve ( " users " ) , standard charsets utf 8 ) ; for ( string line : lines ) { string [ ] username hash = line split ( " : " , 2 ) ; if ( username hash length ! = 2 ) { fail ( " corrupted users file , line : " + line ) ; } if ( username equals ( username hash [ 0 ] ) = = false ) { continue ; } string got hash = username hash [ 1 ] ; secure string expected hash = new secure string ( password to char array ( ) ) ; assert true ( " could not validate password for user " , hasher verify ( expected hash , got hash to char array ( ) ) ) ; return ; } fail ( " could not find username " + username + " in users file : \ n " + lines to string ( ) ) ; }


adds the values in the collection to the builder , each preceded by the given flag , if the collection was non - empty and the condition was true

aapt command builder then add repeated ( string flag , collection < string > values ) ;


set the configuration for this service this method is called during { @ link # init ( configuration ) } and should only be needed if for some reason a service implementation needs to override that initial setting - for example replacing it with a new subclass of { @ link configuration }

protected void set config ( configuration conf ) { this config = conf ; }


set the user - agent header ' s value ( by adding to the default header map )

public api client set user agent ( string user agent ) { add default header ( " user - agent " , user agent ) ; return this ; }


like { @ link server call # close ( status , metadata ) } , but thread - safe for internal use

private void internal close ( throwable t ) { / / todo ( ejona 8 6 ) : this is not thread - safe : ) stream close ( status unknown with cause ( t ) , new metadata ( ) ) ; }


test variants of using t ( ) and staticnon - static methodpropertyfield references

public void constructor reference spr13781 ( ) { / / static field access on a t ( ) referenced type expression = parser parse expression ( " t ( java util locale ) english " ) ; assert that ( expression get value ( ) to string ( ) ) is equal to ( " en " ) ; assert can compile ( expression ) ; assert that ( expression get value ( ) to string ( ) ) is equal to ( " en " ) ; / / the actual expression from the bug report it fails if the english reference fails / / to pop the type reference for locale off the stack ( if it isn ' t popped then / / to lower case ( ) will be called with a locale parameter ) in this situation the / / code generation for english should notice there is something on the stack that / / is not required and pop it off expression = parser parse expression ( " # user id to string ( ) to lower case ( t ( java util locale ) english ) " ) ; standard evaluation context context = new standard evaluation context ( ) ; context set variable ( " user id " , " ro dn ey " ) ; assert that ( expression get value ( context ) ) is equal to ( " rodney " ) ; assert can compile ( expression ) ; assert that ( expression get value ( context ) ) is equal to ( " rodney " ) ; / / property access on a class object expression = parser parse expression ( " t ( string ) name " ) ; assert that ( expression get value ( ) ) is equal to ( " java lang string " ) ; assert can compile ( expression ) ; assert that ( expression get value ( ) ) is equal to ( " java lang string " ) ; / / now the type reference isn ' t on the stack , and needs loading context = new standard evaluation context ( string class ) ; expression = parser parse expression ( " name " ) ; assert that ( expression get value ( context ) ) is equal to ( " java lang string " ) ; assert can compile ( expression ) ; assert that ( expression get value ( context ) ) is equal to ( " java lang string " ) ; expression = parser parse expression ( " t ( string ) get name ( ) " ) ; assert that ( expression get value ( ) ) is equal to ( " java lang string " ) ; assert can compile ( expression ) ; assert that ( expression get value ( ) ) is equal to ( " java lang string " ) ; / / these tests below verify that the chain of static accesses ( either method / property or field ) / / leave the right thing on top of the stack for processing by any outer consuming code / / here the consuming code is the string value of ( ) function if the wrong thing were on / / the stack ( for example if the compiled code for static methods wasn ' t popping the / / previous thing off the stack ) the value of ( ) would operate on the wrong value string shclass = statics helper class get name ( ) ; / / basic chain : property access then method access expression = parser parse expression ( " t ( string ) value of ( t ( string ) name value of ( 1 ) ) " ) ; assert that ( expression get value ( ) ) is equal to ( " 1 " ) ; assert can compile ( expression ) ; assert that ( expression get value ( ) ) is equal to ( " 1 " ) ; / / chain of statics ending with static method expression = parser parse expression ( " t ( string ) value of ( t ( " + shclass + " ) methoda ( ) methoda ( ) methodb ( ) ) " ) ; assert that ( expression get value ( ) ) is equal to ( " mb " ) ; assert can compile ( expression ) ; assert that ( expression get value ( ) ) is equal to ( " mb " ) ; / / chain of statics ending with static field expression = parser parse expression ( " t ( string ) value of ( t ( " + shclass + " ) fielda fielda fieldb ) " ) ; assert that ( expression get value ( ) ) is equal to ( " fb " ) ; assert can compile ( expression ) ; assert that ( expression get value ( ) ) is equal to ( " fb " ) ; / / chain of statics ending with static property access expression = parser parse expression ( " t ( string ) value of ( t ( " + shclass + " ) propertya propertya propertyb ) " ) ; assert that ( expression get value ( ) ) is equal to ( " pb " ) ; assert can compile ( expression ) ; assert that ( expression get value ( ) ) is equal to ( " pb " ) ; / / variety chain expression = parser parse expression ( " t ( string ) value of ( t ( " + shclass + " ) fielda methoda ( ) propertya fieldb ) " ) ; assert that ( expression get value ( ) ) is equal to ( " fb " ) ; assert can compile ( expression ) ; assert that ( expression get value ( ) ) is equal to ( " fb " ) ; expression = parser parse expression ( " t ( string ) value of ( fielda fieldb ) " ) ; assert that ( expression get value ( statics helper sh ) ) is equal to ( " fb " ) ; assert can compile ( expression ) ; assert that ( expression get value ( statics helper sh ) ) is equal to ( " fb " ) ; expression = parser parse expression ( " t ( string ) value of ( propertya propertyb ) " ) ; assert that ( expression get value ( statics helper sh ) ) is equal to ( " pb " ) ; assert can compile ( expression ) ; assert that ( expression get value ( statics helper sh ) ) is equal to ( " pb " ) ; expression = parser parse expression ( " t ( string ) value of ( methoda ( ) methodb ( ) ) " ) ; assert that ( expression get value ( statics helper sh ) ) is equal to ( " mb " ) ; assert can compile ( expression ) ; assert that ( expression get value ( statics helper sh ) ) is equal to ( " mb " ) ; }


resolve continuation options according to the table in ' analyze headless r e a d m e html ' ( see " multiple scripts " section )

private void resolve continuation option with ( headless continuation option opt ) { if ( opt = = null ) { return ; } switch ( current option ) { case continue : current option = opt ; break ; case continue then delete : switch ( opt ) { case abort : case abort and delete : current option = headless continuation option abort and delete ; break ; default : break ; } break ; case abort and delete : / / nothing changes break ; case abort : / / nothing changes break ; } }


given an input { @ link global group state } and a {

static @ non null advance group state result partially advance group state ( @ non null global group state input state , int maximum revision to apply ) { advance group state result group state result = process changes ( input state , maximum revision to apply ) ; return clean duplicated changes ( group state result , input state get local state ( ) ) ; }


returns { @ code true } if the element might have been put in this bloom filter , { @ code false } if this is definitely not the case

public boolean might contain ( t object ) { return strategy might contain ( object , funnel , num hash functions , bits ) ; }


tests that validates that a graph with single unconnected vertices works correctly ( v 1 ) ( v 2 ) ( v 3 )

public void test individual vertices ( ) { testing scheduling topology topology = new testing scheduling topology ( ) ; testing scheduling execution vertex v 1 = topology new execution vertex ( ) ; testing scheduling execution vertex v 2 = topology new execution vertex ( ) ; testing scheduling execution vertex v 3 = topology new execution vertex ( ) ; map < execution vertex i d , set < scheduling execution vertex > > pipelined region by vertex = compute pipelined region by vertex ( topology ) ; set < scheduling execution vertex > r 1 = pipelined region by vertex get ( v 1 get id ( ) ) ; set < scheduling execution vertex > r 2 = pipelined region by vertex get ( v 2 get id ( ) ) ; set < scheduling execution vertex > r 3 = pipelined region by vertex get ( v 3 get id ( ) ) ; assert distinct regions ( r 1 , r 2 , r 3 ) ; }


extend a constant value if it can be extended

public varnode extend value ( varnode out , varnode [ ] in , boolean sign extend , context evaluator evaluator ) throws not found exception { varnode vnode val ; vnode val = get value ( in [ 0 ] , sign extend , evaluator ) ; if ( vnode val is constant ( ) & & in [ 0 ] get size ( ) < out get size ( ) ) { / / todo : is there a better way to do this - it was not sign - extending temp values before if ( vnode val get size ( ) < = 8 ) { scalar s val = new scalar ( 8 * vnode val get size ( ) , vnode val get offset ( ) , sign extend ) ; vnode val = create constant varnode ( s val get value ( ) , out get size ( ) ) ; } else { / / too big anyway , already extended as far as it will go vnode val = create constant varnode ( vnode val get offset ( ) , out get size ( ) ) ; } } else if ( vnode val is register ( ) & & vnode val get size ( ) < out get size ( ) ) { register reg = get register ( vnode val ) ; if ( reg = = null ) { throw not found exc ; } int space i d = get address space ( reg get name ( ) ) ; vnode val = create varnode ( 0 , space i d , out get size ( ) ) ; } return vnode val ; }


use this when you don ' t want to participate in global resources and you want to customize the creation of the managed { @ code connection provider } by default , { @ code connection provider elastic ( " http " ) } is used note that this option is ignored if { @ code user global resources = false } or { @ link # set connection provider ( connection provider ) } is set

public void set connection provider supplier ( supplier < connection provider > supplier ) { this connection provider supplier = supplier ; }


parses the required attribute as a decimal number , returning its long integer value note , using { @ link long # min value } andor { @ link long # max value } as lower and upper bounds is problematic and should be avoided as the range check will become a no - op and always succeed

public static long parse optional bounded long attr ( element ele , string attr name , long default value , long min value , long max value ) throws number format exception { string value = ele get attribute value ( attr name ) ; if ( value = = null | | value is empty ( ) ) { return default value ; } try { return parse bounded long ( value , min value , max value ) ; } catch ( number format exception nfe ) { throw new number format exception ( " attribute ' " + attr name + " ' bad value : " + nfe get message ( ) + " in " + to string ( ele ) ) ; } }


public string native s q l ( string sql ) throws s q l exception { return null ; }


test cancel delegation token request p b impl test a transformation to prototype and back

public void test cancel delegation token request p b impl ( ) { token token = get delegation token ( ) ; cancel delegation token request p b impl original = new cancel delegation token request p b impl ( ) ; original set delegation token ( token ) ; cancel delegation token request proto proto type = original get proto ( ) ; cancel delegation token request p b impl copy = new cancel delegation token request p b impl ( proto type ) ; assert not null ( copy get delegation token ( ) ) ; / / compare source and converted assert equals ( token , copy get delegation token ( ) ) ; }


returns a hash code value for this object

public int hash code ( ) { return class hash ( ) ^ slop ^ term arrays hash code ( ) ^ positions hash code ( ) ; }


exit a parse tree produced by the { @ code arithmetic unary } labeled alternative in { @ link sql base parser # value expression }

void exit arithmetic unary ( sql base parser arithmetic unary context ctx ) ;


sets the parallelism for operations executed through this environment setting a parallelism of x here will cause all operators ( such as map , batch reduce ) to run with x parallel instances this method overrides the default parallelism for this environment the { @ link local stream environment } uses by default a value equal to the number of hardware contexts ( cpu cores threads ) when executing the program via the command line client from a jar file , the default degree of parallelism is the one configured for that setup

public stream execution environment set parallelism ( int parallelism ) { config set parallelism ( parallelism ) ; return this ; }


returns true if an entry with the given name may be copied over


patch fake : to test \ & quot ; client \ & quot ; model to test \ & quot ; client \ & quot ; model

default response entity < client > test client model ( client body ) { 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 = " { \ " client \ " : \ " client \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


delete lazy - persist file that has been persisted to disk both memory blocks and disk blocks are deleted

public void test delete after persist ( ) throws exception { get cluster builder ( ) build ( ) ; final string method name = generic test utils get method name ( ) ; path path = new path ( " / " + method name + " dat " ) ; make test file ( path , block size , true ) ; located blocks located blocks = ensure file replicas on storage type ( path , ram disk ) ; wait for metric ( " ram disk blocks lazy persisted " , 1 ) ; / / delete after persist client delete ( path to string ( ) , false ) ; assert assert false ( fs exists ( path ) ) ; assert that ( verify deleted blocks ( located blocks ) , is ( true ) ) ; verify ram disk j m x metric ( " ram disk blocks lazy persisted " , 1 ) ; verify ram disk j m x metric ( " ram disk bytes lazy persisted " , block size ) ; }


private void out of band deletes ( final path test file path , final boolean allow authoritative ) throws exception { try { / / create initial file string text = " hello , world ! " ; write text file ( guarded fs , test file path , text , true ) ; await file status ( raw f s , test file path ) ; / / delete the file without s 3 guard ( raw ) delete file ( raw f s , test file path ) ; / / the check is the same if s 3guard is authoritative and if it ' s not / / it should be in the ms file status status = guarded fs get file status ( test file path ) ; log info ( " authoritative : { } status path : { } " , allow authoritative , status get path ( ) ) ; final boolean versioned change detection = is versioned change detection ( ) ; if ( ! versioned change detection ) { expect exception when reading ( test file path , text ) ; expect exception when reading open file a p i ( test file path , text , null ) ; expect exception when reading open file a p i ( test file path , text , status ) ; } else { / / fnfe not expected when using a bucket with object versioning final string read 1 = read ( guarded fs , test file path ) ; assert equals ( " file read from the auth fs " , text , read 1 ) ; / / and when the status is passed in , even the raw fs will ask for it / / via the version id in the status final string read 2 = read with status ( raw f s , status ) ; assert equals ( " file read from the raw fs " , text , read 2 ) ; } } finally { guarded fs delete ( test file path , true ) ; } }


this method implements the new interface by calling the old method note that the input types are different between the new and old apis and this is a bridge between the two

public boolean is recovery supported ( ) { return false ; }


emits { @ link string } output of this class into the provided { @ link string builder }

public void emit ( string builder builder ) { builder append ( this get class ( ) get simple name ( ) ) ; }


attaches the tool tip from the gui resources that corresponds to the given key , to the given component

private static j component tip ( j component component , string message key ) { component set tool tip text ( msg ( message key ) ) ; return component ; }


sets the handle for the canceller to this pending checkpoint this method fails with an exception if a handle has already been set

public boolean set canceller handle ( scheduled future < ? > canceller handle ) { synchronized ( lock ) { if ( this canceller handle = = null ) { if ( ! disposed ) { this canceller handle = canceller handle ; return true ; } else { return false ; } } else { throw new illegal state exception ( " a canceller handle was already set " ) ; } } }


public static saml registered service get saml registered service ( final string service id ) { val registered service = new saml registered service ( ) ; registered service set id ( 100 ) ; registered service set name ( " saml " ) ; registered service set service id ( service id ) ; registered service set metadata location ( " classpath : metadata / testshib - providers xml " ) ; val request = new mock http servlet request ( ) ; request add parameter ( saml protocol constants parameter entity id , registered service get service id ( ) ) ; request context holder set request attributes ( new servlet request attributes ( request , new mock http servlet response ( ) ) ) ; return registered service ; }


tests that async code is not executed if the fencing token changes

public void test run async with fencing ( ) throws exception { final time short timeout = time milliseconds ( 100l ) ; final uuid new fencing token = uuid random u u i d ( ) ; final completable future < uuid > result future = new completable future < > ( ) ; test run async ( endpoint - > { endpoint run async ( ( ) - > result future complete ( endpoint get fencing token ( ) ) ) ; return result future ; } , new fencing token ) ; try { result future get ( short timeout to milliseconds ( ) , time unit milliseconds ) ; fail ( " the async run operation should not complete since it is filtered out due to the changed fencing token " ) ; } catch ( timeout exception ignored ) { } }


returns a view that associates each row key with the corresponding map from column keys to values changes to the returned map will update this table the returned map does not support { @ code put ( ) } or { @ code put all ( ) } , or { @ code set value ( ) } on its entries in contrast , the maps returned by { @ code row map ( ) get ( ) } have the same behavior as those returned by { @ link # row } those maps may support { @ code set value ( ) } , { @ code put ( ) } , and { @ code put all ( ) }


convenience method to get this element as a primitive short

public short get as short ( ) { return is number ( ) ? get as number ( ) short value ( ) : short parse short ( get as string ( ) ) ; }


get this volume data density please see disk balancer volume set # compute volume data density to see how this is computed

public double get volume data density ( ) { return volume data density ; }


constructs the dependency module , guaranteeing that the maps are never null ( they may be empty ) , and the default strict java deps setting is off

public dependency module build ( ) { return new dependency module ( strict java deps , fix deps tool , direct jars , strict classpath mode , deps artifacts , platform jars , target label , output deps proto file , fix message , exempt generators ) ; }


verifies bug fix for < a href = " https : jira spring iobrowse s p r - 11626 " > spr - 11626

void ensure mocks are reinjected between tests 1 ( ) { assert injected servlet request equals request in request context holder ( ) ; }


returns a { @ link dependency } of this { @ link build rule builder } using attr name

public dependency depends via ( string attr name ) { return new dependency ( this , attr name ) ; }


determine if this model is for a 64 bit program

protected final boolean is 6 4 bit ( ) { return is 6 4 bit ; }


instantiates the { @ link restart backoff time strategy }

restart backoff time strategy create ( ) ;


public void upload file ( long pet id , string additional metadata , async file file , api client auth info auth info , handler < async result < model api response > > result handler ) { delegate upload file ( pet id , additional metadata , file , auth info , result handler ) ; }


add reference to variable < code > name < code >

public builder add variable ( string name ) { builder add ( expander - > expander apply ( name ) ) ; is primitive = false ; return this ; }


protected void mark wait ( final long time ) throws exception { final long time start = system current time millis ( ) ; while ( true ) { thread sleep ( mark step ( ) ) ; measure ( ) mark ( ) ; final long time finish = system current time millis ( ) ; if ( time finish - time start > = time ) { system out print ( " + \ n " ) ; return ; } else { system out print ( " - " ) ; } } }


returns whether all known children of this node have signaled that they are done

boolean is ready ( int num direct deps ) { / / avoids calling preconditions check state because it showed up in garbage profiles due to / / boxing of the int format args if ( signaled deps > num direct deps + external deps ) { throw new illegal state exception ( string format ( " % s % s % s " , num direct deps , external deps , this ) ) ; } return signaled deps = = num direct deps + external deps ; }


number of times that the job woke up to write documents

public long get trigger count ( ) { return trigger count ; }


start matisse from an activity this activity ' s { @ link activity # on activity result ( int , int , intent ) } will be called when user finishes selecting

public static matisse from ( activity activity ) { return new matisse ( activity ) ; }


adds a affix settings consumer that accepts the settings for a group of settings the consumer is only notified if at least one of the settings change note : only settings registered in { @ link settings module } can be changed dynamically

public synchronized void add affix group update consumer ( list < setting affix setting < ? > > settings , bi consumer < string , settings > consumer ) { list < setting updater > affix updaters = new array list < > ( settings size ( ) ) ; for ( setting affix setting < ? > setting : settings ) { ensure setting is registered ( setting ) ; affix updaters add ( setting new affix updater ( ( a , b ) - > { } , logger , ( a , b ) - > { } ) ) ; } add settings updater ( new setting updater < map < string , settings > > ( ) { @ override public boolean has changed ( settings current , settings previous ) { return affix updaters stream ( ) any match ( au - > au has changed ( current , previous ) ) ; } @ override public map < string , settings > get value ( settings current , settings previous ) { set < string > namespaces = new hash set < > ( ) ; for ( setting affix setting < ? > setting : settings ) { setting updater affix updater a = setting new affix updater ( ( k , v ) - > namespaces add ( k ) , logger , ( a , b ) - > { } ) ; affix updater a apply ( current , previous ) ; } map < string , settings > namespace to settings = new hash map < > ( namespaces size ( ) ) ; for ( string namespace : namespaces ) { set < string > concrete settings = new hash set < > ( settings size ( ) ) ; for ( setting affix setting < ? > setting : settings ) { concrete settings add ( setting get concrete setting for namespace ( namespace ) get key ( ) ) ; } namespace to settings put ( namespace , current filter ( concrete settings : : contains ) ) ; } return namespace to settings ; } @ override public void apply ( map < string , settings > values , settings current , settings previous ) { for ( map entry < string , settings > entry : values entry set ( ) ) { consumer accept ( entry get key ( ) , entry get value ( ) ) ; } } } ) ; }


sets the persistent settings to be updated they will get applied cross restarts

public cluster update settings request builder set persistent settings ( settings settings ) { request persistent settings ( settings ) ; return this ; }


returns the segment ( msft says section , but we are interpreting as segment for now )

public int get segment ( ) { return section ; }


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


expand the environment variable based on client os environment variable expansion syntax ( e g $ var for linux and % var % for windows ) note : use $ $ ( ) method for cross - platform practice i e submit an application from a windows client to a linux unix server or vice versa

public string $ ( ) { if ( shell windows ) { return " % " + variable + " % " ; } else { return " $ " + variable ; } }


returns the single edge that directly connects { @ code endpoints } ( in the order , if any , specified by { @ code endpoints } ) , if one is present , or { @ code optional empty ( ) } if no such edge exists if this graph is directed , the endpoints must be ordered

optional < e > edge connecting ( endpoint pair < n > endpoints ) ;


specify whether to add path variables to the model or not path variables are commonly bound to uri template variables through the { @ code @ path variable } annotation they ' re are effectively uri template variables with type conversion applied to them to derive typed object values such values are frequently needed in views for constructing links to the same and other u r ls path variables added to the model override static attributes ( see { @ link # set attributes ( properties ) } ) but not attributes already present in the model by default this flag is set to { @ code true } concrete view types can override this

public void set expose path variables ( boolean expose path variables ) { this expose path variables = expose path variables ; }


returns true if x 1 is less than x 2 , when both values are treated as unsigned

static boolean less than unsigned ( long x 1 , long x 2 ) { return ( x 1 + long min value ) < ( x 2 + long min value ) ; }


collapsing toolbar layout sets it ' s own set on apply insets listener which consumes system insets { @ link collapsing toolbar layout # on window inset changed ( window insets compat ) } so we will not receive them in subviews with fits system windows = true override google ' s behavior

public void override listener ( ) { view compat set on apply window insets listener ( this , ( v , insets ) - > insets ) ; }


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


invokes { @ link video renderer event listener # on dropped frames ( int , long ) }

public void dropped frames ( int dropped frame count , long elapsed ms ) { if ( handler ! = null ) { handler post ( ( ) - > cast non null ( listener ) on dropped frames ( dropped frame count , elapsed ms ) ) ; } }


build a locale context for the given request , exposing the request ' s primary locale as current locale

protected locale context build locale context ( http servlet request request ) { return new simple locale context ( request get locale ( ) ) ; }


parses the specified string as a double - precision floating point value the ascii character { @ code ' - ' } ( < code > ' & # 92 ; u 0 0 2 d ' < code > ) is recognized as the minus sign unlike { @ link double # parse double ( string ) } , this method returns { @ code null } instead of throwing an exception if parsing fails valid inputs are exactly those accepted by { @ link double # value of ( string ) } , except that leading and trailing whitespace is not permitted this implementation is likely to be faster than { @ code double parse double } if many failures are expected

public static double try parse ( string string ) { if ( floating point pattern matcher ( string ) matches ( ) ) { / / todo ( lowasser ) : could be potentially optimized , but only with / / extensive testing try { return double parse double ( string ) ; } catch ( number format exception e ) { / / double parse double has changed specs several times , so fall through / / gracefully } } return null ; }


launch a jnlp agent created by { @ link # create jnlp slave ( string ) }

public channel launch jnlp slave ( slave slave ) throws exception { j create web client ( ) go to ( " computer / " + slave get node name ( ) + " / slave - agent jnlp ? encrypt = true " , " application / octet - stream " ) ; string secret = slave get computer ( ) get jnlp mac ( ) ; file slave jar = tmp new file ( ) ; file utils copy u r l to file ( new slave jnlp jar ( " slave jar " ) get u r l ( ) , slave jar ) ; / / to watch it fail : secret = secret replace ( ' 1 ' , ' 2 ' ) ; process builder pb = new process builder ( java env utils get jre executable ( " java " ) , " - jar " , slave jar get absolute path ( ) , " - jnlp url " , j get u r l ( ) + " computer / " + slave get node name ( ) + " / slave - agent jnlp " , " - secret " , secret ) ; pb inherit i o ( ) ; system err println ( " running : " + pb command ( ) ) ; jnlp = pb start ( ) ; for ( int i = 0 ; i < / * one minute * / 600 ; i + + ) { if ( slave get computer ( ) is online ( ) ) { return slave get computer ( ) get channel ( ) ; } thread sleep ( 100 ) ; } throw new assertion error ( " the jnlp agent failed to connect " ) ; }


returns the time in milliseconds when this task will be executed next

public synchronized long get execute time millis ( ) { return execute time millis ; }


get spnego keytab key from configuration

public static string get spnego keytab key ( configuration conf , string default key ) { string value = conf get ( d f s config keys dfs web authentication kerberos keytab key ) ; return ( value = = null | | value is empty ( ) ) ? default key : d f s config keys dfs web authentication kerberos keytab key ; }


web sphere won ' t shutdown a servlet until after a 60 second timeout if there is an instance of the servlet executing a request add this method to enable a hook to notify hystrix to shutdown you must invoke this method at shutdown , perhaps from some other servlet ' s destroy ( ) method

public static void shutdown ( ) { is destroyed = true ; }


public void map map of string test ( ) { / / todo : test map map of string }


public void set group ( string group ) { this group = group ; }


the node i ds are assigned in graph - traversal order ( pre - order ) , hence , each list is sorted by id in ascending order and all consecutive lists start with i ds in ascending order

protected final boolean merge lists ( list < unclosed branch descriptor > child 1open , list < unclosed branch descriptor > child 2open , list < unclosed branch descriptor > result , boolean mark joined branches as pipeline breaking ) { / / remove branches which have already been closed remove closed branches ( child 1open ) ; remove closed branches ( child 2open ) ; result clear ( ) ; / / check how many open branches we have the cases : / / 1 ) if both are null or empty , the result is null / / 2 ) if one side is null ( or empty ) , the result is the other side / / 3 ) both are set , then we need to merge if ( child 1open = = null | | child 1open is empty ( ) ) { if ( child 2open ! = null & & ! child 2open is empty ( ) ) { result add all ( child 2open ) ; } return false ; } if ( child 2open = = null | | child 2open is empty ( ) ) { result add all ( child 1open ) ; return false ; } int index 1 = child 1open size ( ) - 1 ; int index 2 = child 2open size ( ) - 1 ; boolean did close a branch = false ; / / as both lists ( child 1open and child 2open ) are sorted in ascending id order / / we can do a merge - join - like loop which preserved the order in the result list / / and eliminates duplicates while ( index 1 > = 0 | | index 2 > = 0 ) { int id 1 = - 1 ; int id 2 = index 2 > = 0 ? child 2open get ( index 2 ) get branching node ( ) get id ( ) : - 1 ; while ( index 1 > = 0 & & ( id 1 = child 1open get ( index 1 ) get branching node ( ) get id ( ) ) > id 2 ) { result add ( child 1open get ( index 1 ) ) ; index 1 - - ; } while ( index 2 > = 0 & & ( id 2 = child 2open get ( index 2 ) get branching node ( ) get id ( ) ) > id 1 ) { result add ( child 2open get ( index 2 ) ) ; index 2 - - ; } / / match : they share a common branching child if ( id 1 = = id 2 ) { did close a branch = true ; / / if this is the latest common child , remember it optimizer node curr banching node = child 1open get ( index 1 ) get branching node ( ) ; long vector 1 = child 1open get ( index 1 ) get joined paths vector ( ) ; long vector 2 = child 2open get ( index 2 ) get joined paths vector ( ) ; / / check if this is the same descriptor , ( meaning that it contains the same paths ) / / if it is the same , add it only once , otherwise process the join of the paths if ( vector 1 = = vector 2 ) { result add ( child 1open get ( index 1 ) ) ; } else { / / we merge ( re - join ) a branch / / mark the branch as a point where we break the pipeline if ( mark joined branches as pipeline breaking ) { curr banching node mark all outgoing connections as pipeline breaking ( ) ; } if ( this here joined branches = = null ) { this here joined branches = new array list < optimizer node > ( 2 ) ; } this here joined branches add ( curr banching node ) ; / / see , if this node closes the branch long joined inputs = vector 1 | vector 2 ; / / this is 2 ^ size - 1 , which is all bits set at positions 0 size - 1 long all inputs = ( 0x 1 l < < curr banching node get outgoing connections ( ) size ( ) ) - 1 ; if ( joined inputs = = all inputs ) { / / closed - we can remove it from the stack add closed branch ( curr banching node ) ; } else { / / not quite closed result add ( new unclosed branch descriptor ( curr banching node , joined inputs ) ) ; } } index 1 - - ; index 2 - - ; } } / / merged now we need to reverse the list , because we added the elements in reverse order collections reverse ( result ) ; return did close a branch ; }


if { @ code status code } is non - null , it will be used instead of the http 2 error code mapping

private status status from h 2 error ( status code status code , string context , long error code , byte [ ] debug data ) { status status = grpc util http 2 error status for code ( ( int ) error code ) ; if ( status code = = null ) { status code = status get code ( ) ; } string debug string = " " ; if ( debug data ! = null & & debug data length > 0 ) { / / if a debug message was provided , use it debug string = " , debug data : " + new string ( debug data , utf 8 ) ; } return status code to status ( ) with description ( context + " " + status get description ( ) + debug string ) ; }


public void remove ( long key ) { delete ( key ) ; }


public void test nested exception 3 ( ) { throwable throwable = assertions assert throws ( s q l exception class , ( ) - > { message print 3 ( ) ; } ) ; assert that ( throwable ) has message containing ( " message " ) ; }


standard initialisation for { @ link fair scheduler } rules , shared by all rules each rule that extends this abstract and overrides this method must call < code > super initialize ( ) < code > to run this basic initialisation

public boolean initialize ( resource scheduler scheduler ) throws i o exception { if ( ! ( scheduler instanceof fair scheduler ) ) { throw new i o exception ( get name ( ) + " rule can only be configured for the fair scheduler " ) ; } if ( get parent rule ( ) ! = null & & get parent rule ( ) get name ( ) equals ( get name ( ) ) ) { throw new i o exception ( " parent rule may not be the same type as the " + " child rule : " + get name ( ) ) ; } fair scheduler fs = ( fair scheduler ) scheduler ; queue manager = fs get queue manager ( ) ; return true ; }


indicates that the caller will pump { @ code stdout } from the child process via { @ link proc # get stdout ( ) } ( whereas by default you call { @ link # stdout ( output stream ) } and let jenkins pump stdout into your { @ link output stream } of choosing when this method is called , { @ link proc # get stdout ( ) } will read the combined output of { @ code stdoutstderr } from the child process , unless { @ link # read stderr ( ) } is called separately , which lets the caller read those two streams separately

public proc starter read stdout ( ) { reverse stdout = true ; stdout = stderr = null ; return this ; }


on a magic path , the magic tracker is returned

public void test create tracker magic path ( ) throws throwable { s 3 a file system fs = get file system ( ) ; magic commit integration integration = new magic commit integration ( fs , true ) ; string filename = " delayed txt " ; path dest file = method path ( filename ) ; string orig key = fs path to key ( dest file ) ; path pending path = make magic ( dest file ) ; verify is magic commit path ( fs , pending path ) ; string pending path key = fs path to key ( pending path ) ; assert true ( " wrong path of " + pending path key , pending path key ends with ( filename ) ) ; final list < string > elements = split path to elements ( pending path ) ; assert equals ( " split path to elements ( ) " , filename , last element ( elements ) ) ; list < string > final destination = final destination ( elements ) ; assert equals ( " final destination ( ) " , filename , last element ( final destination ) ) ; final string dest key = elements to key ( final destination ) ; assert equals ( " destination key " , orig key , dest key ) ; put tracker tracker = integration create tracker ( pending path , pending path key ) ; assert true ( " wrong type : " + tracker + " for " + pending path key , tracker instanceof magic commit tracker ) ; assert equals ( " tracker destination key " , orig key , tracker get dest key ( ) ) ; path pending suffixed path = new path ( pending path , " part - 0000 " + pending suffix ) ; assert false ( " still a delayed complete path " + pending suffixed path , fs is magic commit path ( pending suffixed path ) ) ; path pending set = new path ( pending path , " part - 0000 " + pendingset suffix ) ; assert false ( " still a delayed complete path " + pending set , fs is magic commit path ( pending set ) ) ; }


check all events for tasks not related to a process - instance

public void test standalone task events ( ) throws exception { task task = null ; try { task = task service new task ( ) ; task set category ( " 123 " ) ; task set description ( " description " ) ; task service save task ( task ) ; assert that ( listener get events received ( ) ) has size ( 3 ) ; activiti entity event event = ( activiti entity event ) listener get events received ( ) get ( 0 ) ; assert that ( event get type ( ) ) is equal to ( activiti event type entity created ) ; assert that ( event get entity ( ) ) is instance of ( task class ) ; task task from event = ( task ) event get entity ( ) ; assert that ( task from event get id ( ) ) is equal to ( task get id ( ) ) ; assert that ( event get process definition id ( ) ) is null ( ) ; assert that ( event get process instance id ( ) ) is null ( ) ; assert that ( event get execution id ( ) ) is null ( ) ; event = ( activiti entity event ) listener get events received ( ) get ( 1 ) ; assert that ( event get type ( ) ) is equal to ( activiti event type entity initialized ) ; event = ( activiti entity event ) listener get events received ( ) get ( 2 ) ; assert that ( event get type ( ) ) is equal to ( activiti event type task created ) ; listener clear events received ( ) ; / / update task task service set owner ( task get id ( ) , " owner " ) ; assert that ( listener get events received ( ) ) has size ( 1 ) ; event = ( activiti entity event ) listener get events received ( ) get ( 0 ) ; assert that ( event get type ( ) ) is equal to ( activiti event type entity updated ) ; assert that ( event get entity ( ) ) is instance of ( task class ) ; task from event = ( task ) event get entity ( ) ; assert that ( task from event get id ( ) ) is equal to ( task get id ( ) ) ; assert that ( task from event get owner ( ) ) is equal to ( " owner " ) ; assert that ( event get process definition id ( ) ) is null ( ) ; assert that ( event get process instance id ( ) ) is null ( ) ; assert that ( event get execution id ( ) ) is null ( ) ; listener clear events received ( ) ; / / assign task task service set assignee ( task get id ( ) , " kermit " ) ; assert that ( listener get events received ( ) ) has size ( 2 ) ; event = ( activiti entity event ) listener get events received ( ) get ( 0 ) ; assert that ( event get type ( ) ) is equal to ( activiti event type task assigned ) ; assert that ( event get entity ( ) ) is instance of ( task class ) ; task from event = ( task ) event get entity ( ) ; assert that ( task from event get id ( ) ) is equal to ( task get id ( ) ) ; assert that ( task from event get assignee ( ) ) is equal to ( " kermit " ) ; assert that ( event get process definition id ( ) ) is null ( ) ; assert that ( event get process instance id ( ) ) is null ( ) ; assert that ( event get execution id ( ) ) is null ( ) ; event = ( activiti entity event ) listener get events received ( ) get ( 1 ) ; assert that ( event get type ( ) ) is equal to ( activiti event type entity updated ) ; assert that ( event get entity ( ) ) is instance of ( task class ) ; task from event = ( task ) event get entity ( ) ; assert that ( task from event get id ( ) ) is equal to ( task get id ( ) ) ; assert that ( event get process definition id ( ) ) is null ( ) ; assert that ( event get process instance id ( ) ) is null ( ) ; assert that ( event get execution id ( ) ) is null ( ) ; listener clear events received ( ) ; / / complete task task service complete ( task get id ( ) ) ; assert that ( listener get events received ( ) ) has size ( 2 ) ; event = ( activiti entity event ) listener get events received ( ) get ( 0 ) ; assert that ( event get type ( ) ) is equal to ( activiti event type task completed ) ; assert that ( event get entity ( ) ) is instance of ( task class ) ; task from event = ( task ) event get entity ( ) ; assert that ( task from event get id ( ) ) is equal to ( task get id ( ) ) ; assert that ( event get process definition id ( ) ) is null ( ) ; assert that ( event get process instance id ( ) ) is null ( ) ; assert that ( event get execution id ( ) ) is null ( ) ; event = ( activiti entity event ) listener get events received ( ) get ( 1 ) ; assert that ( event get type ( ) ) is equal to ( activiti event type entity deleted ) ; assert that ( event get entity ( ) ) is instance of ( task class ) ; task from event = ( task ) event get entity ( ) ; assert that ( task from event get id ( ) ) is equal to ( task get id ( ) ) ; assert that ( event get process definition id ( ) ) is null ( ) ; assert that ( event get process instance id ( ) ) is null ( ) ; assert that ( event get execution id ( ) ) is null ( ) ; } finally { if ( task ! = null ) { string task id = task get id ( ) ; task = task service create task query ( ) task id ( task id ) single result ( ) ; if ( task ! = null ) { / / if task still exists , delete it to have a clean db after / / test task service delete task ( task id ) ; } history service delete historic task instance ( task id ) ; } } }


public void start ( ) { for ( int i = 0 ; i < num polling threads ; + + i ) { executor execute ( new monitor thread ( i ) ) ; } }


query configuration information based on data id and group

config info base find config info base ( final string data id , final string group ) ;


get the default permission for directory

public static fs permission get dir default ( ) { return new fs permission ( ( short ) 00777 ) ; }


public period set ( @ nullable object id , @ nullable object uid , int window index , long duration us , long position in window us ) { return set ( id , uid , window index , duration us , position in window us , ad playback state none ) ; }


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


the parent ' s { @ link # id } or null if this the root span in a trace this is the same encoding as { @ link # id } for example { @ code ffdc 9bb 9a 6 4 5 3df 3 }

@ nullable public string parent id ( ) { return parent id ; }


same as { @ link # format } , but with a list instead of variadic args

public static void format with list ( printer printer , string pattern , list < ? > arguments ) { / / n b missing format width exception is the only kind of illegal format exception / / whose constructor can take and display arbitrary error message , hence its use below / / todo ( adonovan ) : this suggests we ' re using the wrong exception throw iae ? int length = pattern length ( ) ; int arg length = arguments size ( ) ; int i = 0 ; / / index of next character in pattern int a = 0 ; / / index of next argument in arguments while ( i < length ) { int p = pattern index of ( ' % ' , i ) ; if ( p = = - 1 ) { printer append ( pattern , i , length ) ; break ; } if ( p > i ) { printer append ( pattern , i , p ) ; } if ( p = = length - 1 ) { throw new missing format width exception ( " incomplete format pattern ends with % : " + starlark repr ( pattern ) ) ; } char conv = pattern char at ( p + 1 ) ; i = p + 2 ; / / % % : literal % if ( conv = = ' % ' ) { printer append ( ' % ' ) ; continue ; } / / valid ? if ( " drsefg e f g " index of ( conv ) < 0 ) { throw new missing format width exception ( / / the call to starlark repr doesn ' t cause an infinite recursion because it ' s / / only used to format a string properly string format ( " unsupported format character \ " % s \ " at index % s in % s " , string value of ( conv ) , p + 1 , starlark repr ( pattern ) ) ) ; } / / get argument if ( a > = arg length ) { throw new missing format width exception ( " not enough arguments for format pattern " + starlark repr ( pattern ) + " : " + starlark repr ( tuple copy of ( arguments ) ) ) ; } object arg = arguments get ( a + + ) ; switch ( conv ) { case ' d ' : if ( arg instanceof starlark int | | arg instanceof integer ) { printer repr ( arg ) ; } else if ( arg instanceof starlark float ) { double d = ( ( starlark float ) arg ) to double ( ) ; starlark int rounded ; try { rounded = starlark int of finite double ( d ) ; } catch ( illegal argument exception unused ) { throw new missing format width exception ( " got " + arg + " , want a finite number " ) ; } printer repr ( rounded ) ; } else { throw new missing format width exception ( " invalid argument " + starlark repr ( arg ) + " for format pattern % d " ) ; } continue ; case ' e ' : case ' f ' : case ' g ' : case ' e ' : case ' f ' : case ' g ' : double v ; if ( arg instanceof integer ) { v = ( double ) ( integer ) arg ; } else if ( arg instanceof starlark int ) { v = ( ( starlark int ) arg ) to double ( ) ; } else if ( arg instanceof starlark float ) { v = ( ( starlark float ) arg ) to double ( ) ; } else { throw new missing format width exception ( " invalid argument " + starlark repr ( arg ) + " for format pattern % d " ) ; } printer str ( starlark float format ( v , conv ) ) ; continue ; case ' r ' : printer repr ( arg ) ; continue ; case ' s ' : printer str ( arg ) ; continue ; default : throw new illegal state exception ( " unreachable " ) ; } } if ( a < arg length ) { throw new missing format width exception ( " not all arguments converted during string formatting " ) ; } }


creates a { @ link leader retrieval driver factory } implemented by zoo keeper

public static zoo keeper leader retrieval driver factory create leader retrieval driver factory ( final curator framework client , final configuration configuration ) { return create leader retrieval driver factory ( client , configuration , " " ) ; }


mask out all but the lowest { @ code n } bits of the value

public masked long unknown extend ( int n ) { long new msk = zero extend ( this msk , n ) ; long new val = zero extend ( this val , n ) ; return from mask and value ( new msk , new val ) ; }


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


public synchronized quantile estimator get estimator ( ) { return estimator ; }


populates index data structures should only be called at initialization times

void init existing ( ) throws i o exception { log info ( " initializing existing jobs " ) ; list < file status > timestamped dir list = find timestamped directories ( ) ; / / sort first just so insertion is in a consistent order collections sort ( timestamped dir list ) ; log info ( " found " + timestamped dir list size ( ) + " directories to load " ) ; for ( file status fs : timestamped dir list ) { / / todo could verify the correct format for these directories add directory to serial number index ( fs get path ( ) ) ; } final double max cache size = ( double ) job list cache max size ; int prev cache size = job list cache size ( ) ; for ( int i = timestamped dir list size ( ) - 1 ; i > = 0 & & ! job list cache is full ( ) ; i - - ) { file status fs = timestamped dir list get ( i ) ; add directory to job list cache ( fs get path ( ) ) ; int curr cache size = job list cache size ( ) ; if ( ( curr cache size - prev cache size ) / max cache size > = 0 05 ) { log info ( curr cache size * 100 0 / max cache size + " % of cache is loaded " ) ; } prev cache size = curr cache size ; } final double loaded percent = max cache size = = 0 0 ? 100 : prev cache size * 100 0 / max cache size ; log info ( " existing job initialization finished " + loaded percent + " % of cache is occupied " ) ; }


reads the unicode string at the current index and then increments the current index by the length of the unicode string that was found this method expects the string to be double null - terminated ( ' \ 0 \ 0 ' )

public string read next unicode string ( ) throws i o exception { string s = read unicode string ( current index ) ; current index + = ( ( s length ( ) + 1 ) * 2 ) ; return s ; }


public list < integer > get array item ( ) { return array item ; }


private void write user list ( string current user , linked hash map < string , user > new user map , boolean allow anonymous ) throws user access exception , i o exception { user user = new user map get ( current user ) ; if ( user = = null | | ! user is admin ( ) ) { throw new user access exception ( current user + " must have admin privilege ! " ) ; } write user list ( new user map , allow anonymous ) ; }


get the id of the shard which allocation should be canceled

public int shard id ( ) { return this shard id ; }


public void parsing proc disks file ( ) throws i o exception { long num sectors readsda = 1790549l ; long num sectors writtensda = 1839071l ; long num sectors readsdc = 20541402l ; long num sectors writtensdc = 32617658l ; long num sectors readsde = 19439751l ; long num sectors writtensde = 31838072l ; long num sectors readsdf = 20334546l ; long num sectors writtensdf = 33168970l ; file temp file = new file ( fake disksfile ) ; temp file delete on exit ( ) ; file writer f writer = new file writer ( fake disksfile ) ; f writer write ( string format ( disksinfo format , num sectors readsda , num sectors writtensda , num sectors readsdc , num sectors writtensdc , num sectors readsde , num sectors writtensde , num sectors readsdf , num sectors writtensdf ) ) ; f writer close ( ) ; long expected num sectors read = num sectors readsda + num sectors readsdc + num sectors readsde + num sectors readsdf ; long expected num sectors written = num sectors writtensda + num sectors writtensdc + num sectors writtensde + num sectors writtensdf ; / / use non - default sector size int disk sector size = fake linux resource calculator plugin sectorsize ; assert equals ( expected num sectors read * disk sector size , plugin get storage bytes read ( ) ) ; assert equals ( expected num sectors written * disk sector size , plugin get storage bytes written ( ) ) ; }


registers a response received from the backend for a request allowed by should throttle this should be called for every response received from the backend ( i e , once for each request for which should throttle returned false ) this updates the internal statistics used by should throttle

void register backend response ( boolean throttled ) ;


private boolean exclude playlist ( long exclusion duration ms ) { exclude until ms = system clock elapsed realtime ( ) + exclusion duration ms ; return playlist url equals ( primary media playlist url ) & & ! maybe select new primary url ( ) ; }


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


specifies the indices options like what type of requested indices to ignore for example indices that don ' t exist

public indices options indices options ( ) { return indices options ; }


build an error message for an sql script execution failure , based on the supplied arguments

public static string build error message ( string stmt , int stmt number , encoded resource encoded resource ) { return string format ( " failed to execute sql script statement # % s of % s : % s " , stmt number , encoded resource , stmt ) ; }


verify { @ code authority } is valid for use with g r p c the syntax must be valid and it must not include userinfo

public static string check authority ( string authority ) { uri uri = authority to uri ( authority ) ; check argument ( uri get host ( ) ! = null , " no host in authority ' % s ' " , authority ) ; check argument ( uri get user info ( ) = = null , " userinfo must not be present on authority : ' % s ' " , authority ) ; return authority ; }


determine the order for this factory ' s aspect instance , either an instance - specific order expressed through implementing the { @ link org springframework core ordered } interface , or a fallback order

public int get order ( ) { if ( this aspect instance instanceof ordered ) { return ( ( ordered ) this aspect instance ) get order ( ) ; } return get order for aspect class ( this aspect instance get class ( ) ) ; }


verify that the current directory exists and that the previous directory does not exist verify that current hasn ' t been modified by comparing the checksum of all it ' s containing files with their original checksum

static void check result ( string [ ] name node dirs , string [ ] data node dirs , string bpid ) throws exception { list < file > dirs = lists new array list ( ) ; for ( int i = 0 ; i < name node dirs length ; i + + ) { file cur dir = new file ( name node dirs [ i ] , " current " ) ; dirs add ( cur dir ) ; f s image test util assert reasonable name current dir ( cur dir ) ; } f s image test util assert parallel files are identical ( dirs , collections < string > empty set ( ) ) ; file dn cur dirs [ ] = new file [ data node dirs length ] ; for ( int i = 0 ; i < data node dirs length ; i + + ) { dn cur dirs [ i ] = new file ( data node dirs [ i ] , " current " ) ; assert equals ( upgrade utilities checksum contents ( data node , dn cur dirs [ i ] , false ) , upgrade utilities checksum master data node contents ( ) ) ; } for ( int i = 0 ; i < name node dirs length ; i + + ) { assert false ( new file ( name node dirs [ i ] , " previous " ) is directory ( ) ) ; } if ( bpid = = null ) { for ( int i = 0 ; i < data node dirs length ; i + + ) { assert false ( new file ( data node dirs [ i ] , " previous " ) is directory ( ) ) ; } } else { for ( int i = 0 ; i < data node dirs length ; i + + ) { file bp root = block pool slice storage get bp root ( bpid , dn cur dirs [ i ] ) ; assert false ( new file ( bp root , " previous " ) is directory ( ) ) ; file bp cur finalize dir = new file ( bp root , " current / " + data storage storage dir finalized ) ; assert equals ( upgrade utilities checksum contents ( data node , bp cur finalize dir , true ) , upgrade utilities checksum master block pool finalized contents ( ) ) ; } } }


extracts the parameter names of a method if possible

static @ nullable list < string > extract method parameter names ( method method ) { return extract executable names ( method ) ; }


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


returns the tab font size enabled of this m t config object

public boolean is tab font size enabled ( ) { return tab font size enabled ; }


public static byte string sha 1 ( byte string s ) { try { message digest message digest = message digest get instance ( " sha - 1 " ) ; byte [ ] sha 1 bytes = message digest digest ( s to byte array ( ) ) ; return byte string of ( sha 1 bytes ) ; } catch ( no such algorithm exception e ) { throw new assertion error ( e ) ; } }


called for each failure obtained from non master nodes

public void on failure ( discovery node node ) { boolean found = pending nodes remove ( node ) ; assert found : " node [ " + node + " ] already responded or failed " ; boolean added = failed nodes add ( node ) ; assert added : " duplicate failures for " + node ; latch count down ( ) ; }


counts down the token on qualified failure and checks if it is above the threshold atomically qualified failure is a failure with a retryable or non - fatal status code or with a not - to - retry pushback

boolean on qualified failure then check is above threshold ( ) { while ( true ) { int current count = token count get ( ) ; if ( current count = = 0 ) { return false ; } int decremented = current count - ( 1 * three decimal places scale up ) ; boolean updated = token count compare and set ( current count , math max ( decremented , 0 ) ) ; if ( updated ) { return decremented > threshold ; } } }


compute the safe length given the internal block lengths

public static long get safe length ( erasure coding policy ec policy , long [ ] block lens ) { final int cell size = ec policy get cell size ( ) ; final int data blk num = ec policy get num data units ( ) ; preconditions check argument ( block lens length > = data blk num ) ; final int stripe size = data blk num * cell size ; long [ ] cpy = arrays copy of ( block lens , block lens length ) ; arrays sort ( cpy ) ; / / full stripe is a stripe has at least data blk num full cells / / last full stripe idx is the index of the last full stripe int last full stripe idx = ( int ) ( cpy [ cpy length - data blk num ] / cell size ) ; return last full stripe idx * stripe size ; / / return the safe length / / todo : include last full stripe idx + 1 stripe in safe length , if there exists / / such a stripe ( and it must be partial ) }


response signal to container ( string container id , string command , http servlet request req ) throws authorization exception ;


get the schema of the model rows that are passed to { @ link # load model ( list ) }

protected table schema get model schema ( ) { return table schema builder ( ) fields ( this model field names , this model field types ) build ( ) ; }


copies the indentation of the previous line and add a star if the sql multi - line comment just started on this line add standard method tags and close the comment

private void comment indent after new line ( i document d , document command c ) { if ( c offset = = - 1 | | d get length ( ) = = 0 ) { return ; } try { / / find start of line int p = ( c offset = = d get length ( ) ? c offset - 1 : c offset ) ; i region info = d get line information of offset ( p ) ; int start = info get offset ( ) ; / / find white spaces int end = find end of white space ( d , start , c offset ) ; string builder buf = new string builder ( c text ) ; if ( end > = start ) { string indentation = comment extract line prefix ( d , d get line of offset ( c offset ) ) ; buf append ( indentation ) ; if ( end < c offset ) { / / if it is the single line comment ' / / ' , don ' t append ' * ' if ( d get char ( end ) = = ' / ' & & d get char ( end + 1 ) ! = ' / ' ) { / / sql multi - line comment started on this line buf append ( " * " ) ; / / $ non - nls - 1 $ if ( d b workbench get platform ( ) get preference store ( ) get boolean ( s q l preference constants sqleditor close comments ) & & is new comment ( d , c offset , partitioning ) & & ! has close comment slash ( d , c , end ) ) { / / already has comment close block string line delimiter = get line delimiter ( d ) ; string end tag = line delimiter + indentation + " * / " ; / / $ non - nls - 1 $ d replace ( c offset , 0 , end tag ) ; / / $ non - nls - 1 $ } } } } c text = buf to string ( ) ; } catch ( bad location exception excp ) { / / stop work } }


return a zip entry for { @ code filename } if the provider is a { @ link zip input file provider } , the method returns the existing zip entry in order to keep its metadata , otherwise a new one is created

zip entry get zip entry ( string filename ) ;


launch and initialize an unmanaged am first , it creates a new application on the rm and negotiates a new attempt id then it waits for the rm application attempt state to reach yarn application attempt state launched after which it returns the am - rm token

protected token < a m r m token identifier > initialize unmanaged a m ( application id app id ) throws i o exception , yarn exception { try { user group information app submitter = user group information create remote user ( this submitter ) ; this rm client = create r m proxy ( application client protocol class , this conf , app submitter , null ) ; / / submit the application submit unmanaged app ( app id ) ; / / monitor the application attempt to wait for launch state monitor current app attempt ( app id , enum set of ( yarn application state accepted , yarn application state running , yarn application state killed , yarn application state failed , yarn application state finished ) , yarn application attempt state launched ) ; return get u a m token ( ) ; } finally { this rm client = null ; } }


uploads a byte array to a server which cannot move incoming files to the final blob store via the { @ link blob server } file transfers should fail

private void test put buffer fails store ( @ nullable final job i d job id , blob key blob type blob type ) throws i o exception { assume true ( ! operating system is windows ( ) ) ; / / set writable doesn ' t work on windows final configuration config = new configuration ( ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; file job store dir = null ; try ( blob server server = new blob server ( config , new void blob store ( ) ) ) { server start ( ) ; / / make sure the blob server cannot create any files in its storage dir job store dir = server get storage location ( job id , blob key create key ( blob type ) ) get parent file ( ) ; assert true ( job store dir set executable ( true , false ) ) ; assert true ( job store dir set readable ( true , false ) ) ; assert true ( job store dir set writable ( false , false ) ) ; byte [ ] data = new byte [ 2000000 ] ; rnd next bytes ( data ) ; / / upload the file to the server directly exception expect ( access denied exception class ) ; try { put ( server , job id , data , blob type ) ; } finally { / / there should be no remaining incoming files file incoming file dir = new file ( job store dir get parent ( ) , " incoming " ) ; assert array equals ( new string [ ] { } , incoming file dir list ( ) ) ; / / there should be no files in the job directory assert array equals ( new string [ ] { } , job store dir list ( ) ) ; } } finally { / / set writable again to make sure we can remove the directory if ( job store dir ! = null ) { / / noinspection result of method call ignored job store dir set writable ( true , false ) ; } } }


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

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


forms a temporary chain from the list of delegate filters supplied ( { @ link # set filters } ) and executes them in order each filter delegates to the next one in the list , achieving the normal behavior of a { @ link filter chain } , despite the fact that this is a { @ link filter }

public void do filter ( servlet request request , servlet response response , filter chain chain ) throws i o exception , servlet exception { new virtual filter chain ( chain , this filters ) do filter ( request , response ) ; }


construct the preferred type of ' raw ' sequence file writer

public static writer create writer ( configuration conf , f s data output stream out , class key class , class val class , compression type compression type , compression codec codec , metadata metadata ) throws i o exception { return create writer ( conf , writer stream ( out ) , writer key class ( key class ) , writer value class ( val class ) , writer compression ( compression type , codec ) , writer metadata ( metadata ) ) ; }


get a serializer based on the provided configuration

public static state store serializer get serializer ( configuration conf ) { if ( conf = = null ) { synchronized ( state store serializer class ) { if ( default serializer = = null ) { conf = new configuration ( ) ; default serializer = new serializer ( conf ) ; } } return default serializer ; } else { return new serializer ( conf ) ; } }


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

public void update user test ( ) { string username = null ; user body = null ; / / api update user ( username , body ) ; / / todo : test validations }


< code > optional string foo = 1 ; < code >


check if prerequisite should be allowed based on required providers on the attribute

private boolean check rule dependency mandatory providers ( configured target and data prerequisite , attribute attribute , set < string > unfulfilled requirements ) { required providers required providers = attribute get required providers ( ) ; if ( required providers accepts any ( ) ) { / / if no required providers specified , we do not know if we should accept return false ; } if ( prerequisite get configured target ( ) satisfies ( required providers ) ) { return true ; } unfulfilled requirements add ( string format ( " ' % s ' does not have mandatory providers : % s " , prerequisite get target ( ) get label ( ) , prerequisite get configured target ( ) missing providers ( required providers ) get description ( ) ) ) ; return false ; }


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

public static fields find by name ( string name ) { return by name get ( name ) ; }


records the beginning of a task as specified , and returns a { @ link silent closeable } instance that ends the task this lets the system do the work of ending the task , with the compiler giving a warning if the returned instance is not closed use of this method allows to support nested task monitoring for tasks that are known to not have any subtasks , log simple task ( ) should be used instead use like this : { @ code try ( silent closeable c = profiler instance ( ) profile ( type , " description " ) ) { your code here } }

public silent closeable profile ( profiler task type , string description ) { / / profiler info all tasks by id is supposed to be an id - > task map , but it is in fact a list , / / which means that we cannot drop tasks to which we had already assigned ids therefore , / / non - leaf tasks must not have a minimum duration however , we don ' t quite consistently / / enforce this , and blaze only works because we happen not to add child tasks to those parent / / tasks that have a minimum duration preconditions check not null ( description ) ; if ( is active ( ) & & is profiling ( type ) ) { task data task data = new task data ( task id increment and get ( ) , clock nano time ( ) , type , description ) ; return ( ) - > complete task ( task data ) ; } else { return nop ; } }


sets the color drawing borders around the bars

public void set bar border color ( int color ) { m bar border color = color ; }


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


number of bytes needed to encode an integer in variable - length format

public static int size of varint ( int value ) { return size of unsigned varint ( ( value < < 1 ) ^ ( value > > 31 ) ) ; }


public string get application data ( ) { return application data ; }


set the { @ link stream thread state listener } to be notified when state changes note this api is internal to kafka streams and is not intended to be used by an external application

public void set state listener ( final stream thread state listener listener ) { state listener = listener ; }


declare local transactions will use global lock check for updatedeleteinsertselect for update sql

public static void bind global lock flag ( ) { if ( logger is debug enabled ( ) ) { logger debug ( " local transaction global lock support enabled " ) ; } / / just put something not null context holder put ( key global lock flag , value global lock flag ) ; }


public void test delete expired data action deletes empty state indices ( ) throws exception { client ( ) admin ( ) indices ( ) prepare create ( " ml - state " ) get ( ) ; client ( ) admin ( ) indices ( ) prepare create ( " ml - state - 000001 " ) get ( ) ; client ( ) prepare index ( " ml - state - 000001 " ) set source ( " field 1 " , " value 1 " ) get ( ) ; client ( ) admin ( ) indices ( ) prepare create ( " ml - state - 000003 " ) get ( ) ; client ( ) admin ( ) indices ( ) prepare create ( " ml - state - 000005 " ) get ( ) ; client ( ) prepare index ( " ml - state - 000005 " ) set source ( " field 5 " , " value 5 " ) get ( ) ; client ( ) admin ( ) indices ( ) prepare create ( " ml - state - 000007 " ) add alias ( new alias ( " ml - state - write " ) is hidden ( true ) ) get ( ) ; refresh ( ) ; get index response get index response = client ( ) admin ( ) indices ( ) prepare get index ( ) set indices ( " ml - state * " ) get ( ) ; assert that ( strings to string ( get index response ) , get index response get indices ( ) , is ( array containing ( " ml - state " , " ml - state - 000001 " , " ml - state - 000003 " , " ml - state - 000005 " , " ml - state - 000007 " ) ) ) ; client ( ) execute ( delete expired data action instance , new delete expired data action request ( ) ) get ( ) ; refresh ( ) ; get index response = client ( ) admin ( ) indices ( ) prepare get index ( ) set indices ( " ml - state * " ) get ( ) ; assert that ( strings to string ( get index response ) , get index response get indices ( ) , / / only non - empty or current indices should survive deletion process is ( array containing ( " ml - state - 000001 " , " ml - state - 000005 " , " ml - state - 000007 " ) ) ) ; }


gets the url of the help file this help will shown next to the text area of the description , and is ideal of describing what the allowed syntax is by default , we look for colocated help - syntax html

public string get help url ( ) { return get descriptor ( ) get help file ( " syntax " ) ; }


parses and validates that the source is not empty

public static void validate ( string source ) { if ( source = = null ) { throw new elasticsearch parse exception ( " template must not be null " ) ; } if ( strings is empty ( source ) ) { throw new elasticsearch parse exception ( " template must not be empty " ) ; } try { x content helper convert to map ( json x content json x content , source , false ) ; } catch ( exception e ) { throw new elasticsearch parse exception ( " invalid template " , e ) ; } }


returns padding using the specified delimiter repeated to a given length string utils repeat ( ' e ' , 0 ) = " " string utils repeat ( ' e ' , 3 ) = " eee " string utils repeat ( ' e ' , - 2 ) = " " note : this method doesn ' t not support padding with < a href = " http : www unicode orgglossary # supplementary character " > unicode supplementary characters as they require a pair of { @ code char } s to be represented if you are needing to support full i18n of your applications consider using { @ link # repeat ( string , int ) } instead

public static string repeat ( final char ch , final int repeat ) { final char [ ] buf = new char [ repeat ] ; for ( int i = repeat - 1 ; i > = 0 ; i - - ) { buf [ i ] = ch ; } return new string ( buf ) ; }


returns the { @ link playback stats } for the currently playback session , or null if no session is active

public playback stats get playback stats ( ) { @ nullable playback stats tracker active stats tracker = active ad playback ! = null ? playback stats trackers get ( active ad playback ) : active content playback ! = null ? playback stats trackers get ( active content playback ) : null ; return active stats tracker = = null ? null : active stats tracker build ( / * is final = * / false ) ; }


get the displacement of the springs current value from its rest value

public double get current displacement distance ( ) { return get displacement distance for state ( m current state ) ; }


the response resources wrapped in the common mcp resource message < code > repeated istio mcp v 1alpha 1 resource resources = 2 ; < code >

public java util list < com alibaba nacos istio model mcp resource > get resources list ( ) { return resources ; }


read the version tag which starts the xml file

private void read version ( ) throws i o exception { try { expect tag ( " version " , false ) ; } catch ( i o exception e ) { / / handle the case where < version > does not exist / / note : fsimage xml files which are missing < version > are also missing / / many other fields that oiv needs to accurately reconstruct the / / fsimage throw new i o exception ( " no < version > section found at the top of " + " the fsimage xml this xml file is too old to be processed " + " by oiv " , e ) ; } node version = new node ( ) ; load node children ( version , " version fields " ) ; integer on disk version = version remove child int ( " on disk version " ) ; if ( on disk version = = null ) { throw new i o exception ( " the < version > section doesn ' t contain " + " the on disk version " ) ; } integer layout version = version remove child int ( " layout version " ) ; if ( layout version = = null ) { throw new i o exception ( " the < version > section doesn ' t contain " + " the layout version " ) ; } if ( layout version int value ( ) ! = name node layout version current layout version ) { throw new i o exception ( " layout version mismatch this oiv tool " + " handles layout version " + name node layout version current layout version + " , but the " + " xml file has < layout version > " + layout version + " please " + " either re - generate the xml file with the proper layout version , " + " or manually edit the xml file to be usable with this version " + " of the oiv tool " ) ; } file summary bld set ondisk version ( on disk version ) ; file summary bld set layout version ( layout version ) ; if ( log is debug enabled ( ) ) { log debug ( " loaded < version > with on disk version = " + on disk version + " , layout version = " + layout version + " " ) ; } }


fully qualified name of the resource unique in context of a collection the fully qualified name consists of a directory and basename the directory identifies the resources location in a resource hierarchy the basename identifies the specific resource name within the context of that directory the directory and basename are composed of one or more segments segments must be valid [ dns labels ] ( https : tools ietf orghtmlrfc 1 1 2 3 ) " " is the delimiter between segments the rightmost segment is the basename all segments to the left of the basename form the directory segments moving towards the left represent higher positions in the resource hierarchy , similar to reverse dns notation e g & lt ; org & gt ; & lt ; team & gt ; & lt ; subteam & gt ; & lt ; resource basename & gt ; an empty directory indicates a resource that is located at the root of the hierarchy , e g & lt ; globally scoped resource & gt ; on kubernetes the resource hierarchy is two - levels : namespaces and cluster - scoped ( i e global ) namespace resources fully qualified name is of the form : " & lt ; k 8s namespace & gt ; & lt ; k 8s resource name & gt ; " cluster scoped resources are located at the root of the hierarchy and are of the form : " & lt ; k 8s resource name & gt ; " < code > string name = 1 ; < code >

public builder set name bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } check byte string is utf 8 ( value ) ; name = value ; on changed ( ) ; return this ; }


add all paths in the other set of results to this instance

public tree scan results add ( tree scan results that ) { files add all ( that files ) ; directories add all ( that directories ) ; other add all ( that other ) ; return this ; }


instantiates a { @ link watermark generator }

watermark generator < t > create watermark generator ( context context ) ;


sets the player to be passed to { @ link # handle message ( simple exo player , int , object ) }

/ * package * / void set player ( simple exo player player ) { this player = player ; }


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


public int get int ( @ non null final string key ) { return get int ( key , - 1 ) ; }


this is for covering a case where the service manager would behave strangely if constructed with no service under management listeners would never fire because the service manager was healthy and stopped at the same time this test ensures that listeners fire and is healthy makes sense

public void test empty service manager ( ) { logger logger = logger get logger ( service manager class get name ( ) ) ; logger set level ( level finest ) ; test log handler log handler = new test log handler ( ) ; logger add handler ( log handler ) ; service manager manager = new service manager ( arrays < service > as list ( ) ) ; recording listener listener = new recording listener ( ) ; manager add listener ( listener , direct executor ( ) ) ; manager start async ( ) await healthy ( ) ; assert true ( manager is healthy ( ) ) ; assert true ( listener healthy called ) ; assert false ( listener stopped called ) ; assert true ( listener failed services is empty ( ) ) ; manager stop async ( ) await stopped ( ) ; assert false ( manager is healthy ( ) ) ; assert true ( listener stopped called ) ; assert true ( listener failed services is empty ( ) ) ; / / check that our no op service is not directly observable via any of the inspection methods or / / via logging assert equals ( " service manager { services = [ ] } " , manager to string ( ) ) ; assert true ( manager services by state ( ) is empty ( ) ) ; assert true ( manager startup times ( ) is empty ( ) ) ; formatter log formatter = new formatter ( ) { @ override public string format ( log record record ) { return format message ( record ) ; } } ; for ( log record record : log handler get stored log records ( ) ) { assert that ( log formatter format ( record ) ) does not contain ( " no op service " ) ; } }


order by the category of the models ( needs to be followed by { @ link # asc ( ) } or { @ link # desc ( ) } )

model query order by model category ( ) ;


private synchronized void close ( ) { if ( ! should close connection get ( ) ) { log error ( " the connection is not in the closed state " ) ; return ; } / / we have marked this connection as closed other thread could have / / already known it and replace this closed connection with a new one / / we should only remove this closed connection remove method accept ( this ) ; / / close the streams and therefore the socket i o utils close stream ( ipc streams ) ; dispose sasl ( ) ; / / clean up all calls if ( close exception = = null ) { if ( ! calls is empty ( ) ) { log warn ( " a connection is closed for no cause and calls are not empty " ) ; / / clean up calls anyway close exception = new i o exception ( " unexpected closed connection " ) ; cleanup calls ( ) ; } } else { / / log the newest server information if update address if ( log is debug enabled ( ) ) { log debug ( " closing ipc connection to " + server + " : " + close exception get message ( ) , close exception ) ; } / / cleanup calls cleanup calls ( ) ; } close connection ( ) ; if ( log is debug enabled ( ) ) log debug ( get name ( ) + " : closed " ) ; }


the main application allowing this client to be launched from the command line

public static void main ( string [ ] args ) { final xds test client client = new xds test client ( ) ; client parse args ( args ) ; runtime get runtime ( ) add shutdown hook ( new thread ( ) { @ override @ suppress warnings ( " catch and print stack trace " ) public void run ( ) { try { client stop ( ) ; } catch ( exception e ) { e print stack trace ( ) ; } } } ) ; client run ( ) ; }


return the transfer data with the given data flavor

public synchronized object get transfer data ( data flavor f ) throws unsupported flavor exception , i o exception { if ( f equals ( local markup item flavor ) ) { return markup item ; } throw new unsupported flavor exception ( f ) ; }


create a cookie with the given value , using the cookie descriptor settings of this generator ( except for " cookie max age " )

protected cookie create cookie ( string cookie value ) { cookie cookie = new cookie ( get cookie name ( ) , cookie value ) ; if ( get cookie domain ( ) ! = null ) { cookie set domain ( get cookie domain ( ) ) ; } cookie set path ( get cookie path ( ) ) ; return cookie ; }


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


called when an output buffer is successfully processed

protected void on processed output buffer ( long presentation time us ) { while ( pending output stream offset count ! = 0 & & presentation time us > = pending output stream switch times us [ 0 ] ) { output stream start position us = pending output stream start positions us [ 0 ] ; output stream offset us = pending output stream offsets us [ 0 ] ; pending output stream offset count - - ; system arraycopy ( pending output stream start positions us , / * src pos = * / 1 , pending output stream start positions us , / * dest pos = * / 0 , pending output stream offset count ) ; system arraycopy ( pending output stream offsets us , / * src pos = * / 1 , pending output stream offsets us , / * dest pos = * / 0 , pending output stream offset count ) ; system arraycopy ( pending output stream switch times us , / * src pos = * / 1 , pending output stream switch times us , / * dest pos = * / 0 , pending output stream offset count ) ; on processed stream change ( ) ; } }


gets the id associated with this table type


explicitly adds a new class constant for the given class in the given program class

private int add new class constant ( program class program class , string class name , clazz referenced class ) { constant pool editor constant pool editor = new constant pool editor ( program class ) ; int name index = constant pool editor add utf 8 constant ( class name ) ; int class constant index = constant pool editor add constant ( new class constant ( name index , referenced class ) ) ; return class constant index ; }


applies this function to the given argument and its index within a stream


gets the large icon for the current media item when a bitmap needs to be loaded asynchronously , a placeholder bitmap ( or null ) should be returned the actual bitmap should be passed to the { @ link bitmap callback } once it has been loaded because the adapter may be called multiple times for the same media item , bitmaps should be cached by the app and returned synchronously when possible see { @ link notification compat builder # set large icon ( bitmap ) }

bitmap get current large icon ( player player , bitmap callback callback ) ;


the entries defined for this type < code > repeated aapt pb entry entry = 3 ; < code >

private void set entry ( int index , com android aapt resources entry value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } ensure entry is mutable ( ) ; entry set ( index , value ) ; }


returns a string useful for debugging ( especially within a debugger )

public string to string ( ) { return string format ( " % s [ buffer = % s , current line pos = % s , eof = % s , ibit work area = % s , lbit work area = % s , " + " modulus = % s , pos = % s , read pos = % s ] " , this get class ( ) get simple name ( ) , arrays to string ( buffer ) , current line pos , eof , ibit work area , lbit work area , modulus , pos , read pos ) ; }


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


public list < big decimal > get array number ( ) { return array number ; }


gets all the descriptors sorted by their inheritance tree of { @ link describable } so that descriptors of similar types come nearby we sort them by { @ link extension # ordinal ( ) } but only for { @ link global configuration } s , as the value is normally used to compare similar kinds of extensions , and we needed { @ link global configuration } s to be able to position themselves in a layer above this however creates some asymmetry between regular { @ link descriptor } s and { @ link global configuration } s perhaps it is better to introduce another annotation element ? but then , extensions shouldn ' t normally concern themselves about ordering too much , and the only reason we needed this for { @ link global configuration } s are for backward compatibility

public static collection < descriptor > get sorted descriptors for global config by descriptor ( predicate < descriptor > predicate ) { extension list < descriptor > exts = extension list lookup ( descriptor class ) ; list < tag > r = new array list < > ( exts size ( ) ) ; for ( extension component < descriptor > c : exts get components ( ) ) { descriptor d = c get instance ( ) ; if ( d get global config page ( ) = = null ) continue ; if ( predicate test ( d ) ) { r add ( new tag ( c ordinal ( ) , d ) ) ; } } collections sort ( r ) ; list < descriptor > answer = new array list < > ( r size ( ) ) ; for ( tag d : r ) answer add ( d d ) ; return descriptor visibility filter apply ( jenkins get ( ) , answer ) ; }


called when the { @ link application } is resumed from a paused state , usually when it regains focus


return a string representation of this status code

public string to string ( ) { return this value + " " + name ( ) ; }


function that actually creates the { @ link reservation id } by calling the client r m service

private new reservation create new reservation ( ) throws i o exception { get new reservation request req = record factory new record instance ( get new reservation request class ) ; get new reservation response resp ; try { resp = rm get client r m service ( ) get new reservation ( req ) ; } catch ( yarn exception e ) { string msg = " unable to create new reservation from rm web service " ; log error ( msg , e ) ; throw new yarn runtime exception ( msg , e ) ; } new reservation reservation id = new new reservation ( resp get reservation id ( ) to string ( ) ) ; return reservation id ; } @ post @ path ( r m w s consts reservation submit ) @ produces ( { media type application json + " ; " + jetty utils utf 8 , media type application xml + " ; " + jetty utils utf 8 } ) @ consumes ( { media type application json , media type application xml }


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


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


public void start ( ) { emitter start ( ) ; for ( influencer influencer : influencers ) influencer start ( ) ; }


return the first complete url from the open a p i specification

public static string get host ( open a p i open a p i , final map < string , string > user defined variables ) { if ( open a p i get servers ( ) ! = null & & open a p i get servers ( ) size ( ) > 0 ) { url url = get server u r l ( open a p i get servers ( ) get ( 0 ) , user defined variables ) ; return url ! = null ? sanitize url ( url to string ( ) ) : " " ; } return local host ; }


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

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


creates a new initializing shard the shard will will be put in its proper path under the supplied node id

protected index shard new shard ( shard id shard id , boolean primary , string node id , index metadata index metadata , @ nullable checked function < directory reader , directory reader , i o exception > reader wrapper , runnable global checkpoint syncer ) throws i o exception { shard routing shard routing = test shard routing new shard routing ( shard id , node id , primary , shard routing state initializing , primary ? recovery source empty store recovery source instance : recovery source peer recovery source instance ) ; return new shard ( shard routing , index metadata , reader wrapper , new internal engine factory ( ) , global checkpoint syncer , retention lease syncer empty ) ; }


public string get tracking id ( ) { return tracking id ; }


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

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


public void request focus ( ) { text field request focus ( ) ; }


gets the declared inputs to the specified component

public map < global stream id , grouping > get sources ( string component id ) { return get component common ( component id ) get inputs ( ) ; }


starts the { @ link checkpoint i d counter } service down


set routing limiting the process to the shards that match that routing value

public update by query request set routing ( string routing ) { if ( routing ! = null ) { get search request ( ) routing ( routing ) ; } return this ; }


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


must be used with { @ code start activity for result }

public static @ non null intent get sms role intent ( @ non null context context ) { if ( build version sdk int > = 29 ) { role manager role manager = context compat get system service ( context , role manager class ) ; return role manager create request role intent ( role manager role sms ) ; } else { intent intent = new intent ( telephony sms intents action change default ) ; intent put extra ( telephony sms intents extra package name , context get package name ( ) ) ; return intent ; } }


return the position in the hashtable the element at block position should be inserted

private int get insert position ( long [ ] hashtable , int hash position , block block , int position ) { while ( true ) { long block position = hashtable [ hash position ] ; / / doesn ' t have this element if ( block position = = empty slot ) { / / does not exist return hash position ; } / / already has this element int block index = ( int ) ( ( block position & 0xffff ffff 0000 0000l ) > > 32 ) ; int position within block = ( int ) ( block position & 0xffff ffff ) ; if ( position equals position ( element type , blocks [ block index ] , position within block , block , position ) ) { return invalid position ; } hash position = get masked hash ( hash position + 1 ) ; } }


return the transaction timeout must return a number of seconds , or { @ link # timeout default } exclusively designed for use with { @ link # propagation required } or { @ link # propagation requires new } since it only applies to newly started transactions note that a transaction manager that does not support timeouts will throw an exception when given any other timeout than { @ link # timeout default } the default is { @ link # timeout default }

default int get timeout ( ) { return timeout default ; }


test that when a function throws an exception this is propagated through on error

public void function throws error ( ) { subscription s = mock ( subscription class ) ; test observable w = new test observable ( s , " one " ) ; function < throwable , observable < string > > resume = new function < throwable , observable < string > > ( ) { @ override public observable < string > apply ( throwable t 1 ) { throw new runtime exception ( " exception from function " ) ; } } ; observable < string > o = observable unsafe create ( w ) on error resume next ( resume ) ; observer < string > observer = test helper mock observer ( ) ; o subscribe ( observer ) ; try { w t join ( ) ; } catch ( interrupted exception e ) { fail ( e get message ( ) ) ; } / / we should get the " one " value before the error verify ( observer , times ( 1 ) ) on next ( " one " ) ; / / we should have received an on error call on the observer since the resume function threw an exception verify ( observer , times ( 1 ) ) on error ( any ( throwable class ) ) ; verify ( observer , times ( 0 ) ) on complete ( ) ; }


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