get the association info model by the class name

protected collection < associations info > get association info ( string class name ) { if ( m association infos = = null ) { m association infos = new hash set < > ( ) ; } m association infos clear ( ) ; analyze class fields ( class name , get association info action ) ; return m association infos ; }


test to verify that the checksum can be computed by giving two times cellsize length of file range for checksum calculation

public void test striped file checksum with missed data blocks range query 7 ( ) throws exception { test striped file checksum with missed data blocks range query ( striped file 1 , cell size * 2 ) ; }


public void direct map test ( ) { / / todo : test direct map }


private static < t > void aggregate routes ( string method , map < path pattern , t > routes , list < string > acc methods , list < string > acc patterns , list < string > acc targets ) { for ( map entry < path pattern , t > entry : routes entry set ( ) ) { acc methods add ( method ) ; acc patterns add ( " / " + entry get key ( ) pattern ( ) ) ; acc targets add ( target to string ( entry get value ( ) ) ) ; } }


returns whether the given file is a project directory

public static boolean is project dir ( file file ) { return file is directory ( ) & & file get name ( ) ends with ( project dir suffix ) ; }


public result matcher max age ( string name , int max age ) { return result - > { cookie cookie = get cookie ( result , name ) ; assert equals ( " response cookie ' " + name + " ' max age " , max age , cookie get max age ( ) ) ; } ; }


initialize the cluster , wait for it to become active , and get file system

private void init cluster ( boolean format , boolean acls enabled ) throws exception { configuration conf = new configuration ( ) ; conf set boolean ( d f s config keys dfs namenode acls enabled key , acls enabled ) ; cluster = new mini d f s cluster builder ( conf ) num data nodes ( 1 ) format ( format ) build ( ) ; cluster wait active ( ) ; fs = cluster get file system ( ) ; }


returns the elements of this enum class or null if this class object does not represent an enum type

static public object [ ] get enum constants ( class c ) { return reflection cache get type ( c ) get enum constants ( ) ; }


public string get description ( ) { return description ; }


set the service url of the remote { @ code m bean server }

public void set service url ( string url ) throws malformed u r l exception { this service url = new j m x service u r l ( url ) ; }


repeats a given user action until the context is asked to stop or meets an error

public final void do work ( ) throws exception { while ( ctx should run ( ) & & ! stopped ) { do an action ( ) ; } }


returns a collection with additional input artifacts relevant to the action by reading the dynamically - discovered dependency information from the parsed dependency set after the action has run artifacts are considered inputs but not " mandatory " inputs

nested set < artifact > discover inputs from dependencies ( path exec root , artifact resolver artifact resolver , boolean sibling repository layout ) throws action execution exception { nested set builder < artifact > inputs = nested set builder stable order ( ) ; if ( dependencies = = null ) { return inputs build ( ) ; } / / check inclusions include problems problems = new include problems ( ) ; for ( path exec path : dependencies ) { path fragment exec path fragment = exec path as fragment ( ) ; if ( exec path fragment is absolute ( ) ) { / / absolute includes from system paths are ignored if ( file system utils starts with any ( exec path , permitted system include prefixes ) ) { continue ; } / / since gcc is given only relative paths on the command line , / / non - system include paths here should never be absolute if they / / are , it ' s probably due to a non - hermetic # include , & we should stop / / the build with an error if ( exec path starts with ( exec root ) ) { exec path fragment = exec path relative to ( exec root ) ; / / funky but tolerable path } else if ( sibling repository layout & & exec path starts with ( exec root get parent directory ( ) ) ) { / / for - - experimental sibling repository layout exec path fragment = label constants experimental external path prefix get relative ( exec path relative to ( exec root get parent directory ( ) ) ) ; } else { problems add ( exec path fragment get path string ( ) ) ; continue ; } } artifact artifact = allowed derived inputs map get ( exec path fragment ) ; if ( artifact = = null ) { repository name repository = package identifier discover from exec path ( exec path fragment , false , sibling repository layout ) get repository ( ) ; artifact = artifact resolver resolve source artifact ( exec path fragment , repository ) ; } if ( artifact ! = null ) { / / we don ' t need to add the source file itself as it is a mandatory input if ( ! artifact equals ( source file ) ) { inputs add ( artifact ) ; } continue ; } artifact tree artifact = find owning tree artifact ( exec path fragment ) ; if ( tree artifact ! = null ) { inputs add ( tree artifact ) ; continue ; } / / abort if we see files that we can ' t resolve , likely caused by / / undeclared includes or illegal include constructs problems add ( exec path fragment get path string ( ) ) ; } if ( should validate inclusions ) { problems assert problem free ( action , source file ) ; } return inputs build ( ) ; }


returns the corresponding primitive type of { @ code type } if it is a wrapper type ; otherwise returns { @ code type } itself idempotent unwrap ( integer class ) = = int class unwrap ( int class ) = = int class unwrap ( string class ) = = string class

public static < t > class < t > unwrap ( class < t > type ) { if ( type = = integer class ) return ( class < t > ) int class ; if ( type = = float class ) return ( class < t > ) float class ; if ( type = = byte class ) return ( class < t > ) byte class ; if ( type = = double class ) return ( class < t > ) double class ; if ( type = = long class ) return ( class < t > ) long class ; if ( type = = character class ) return ( class < t > ) char class ; if ( type = = boolean class ) return ( class < t > ) boolean class ; if ( type = = short class ) return ( class < t > ) short class ; if ( type = = void class ) return ( class < t > ) void class ; return type ; }


given a pattern and a full path , determine the pattern - mapped part this method is supposed to find out which part of the path is matched dynamically through an actual pattern , that is , it strips off a statically defined leading path from the given full path , returning only the actually pattern - matched part of the path for example : for " myroot html " as pattern and " myrootmyfile html " as full path , this method should return " myfile html " the detailed determination rules are specified to this path matcher ' s matching strategy a simple implementation may return the given full path as - is in case of an actual pattern , and the empty string in case of the pattern not containing any dynamic parts ( i e the { @ code pattern } parameter being a static path that wouldn ' t qualify as an actual { @ link # is pattern pattern } ) a sophisticated implementation will differentiate between the static parts and the dynamic parts of the given path pattern

string extract path within pattern ( string pattern , string path ) ;


a list of alternate names to verify the subject identity in the certificate presented by the client < code > repeated string subject alt names = 6 ; < code >

public int get subject alt names count ( ) { return subject alt names size ( ) ; }


creates a { @ link paired stats } from with the given lists of { @ code x } and { @ code y } values , which must be of the same size

static paired stats create paired stats of ( list < double > x values , list < double > y values ) { return create filled paired stats accumulator ( x values , y values ) snapshot ( ) ; }


return the current bean class name of this bean definition

public string get bean class name ( ) { object bean class object = this bean class ; if ( bean class object instanceof class ) { return ( ( class < ? > ) bean class object ) get name ( ) ; } else { return ( string ) bean class object ; } }


the maximum amount of user memory ( including file cache ) if there is no limit then some linux versions return the maximum value that can be stored in an unsigned 64 bit number , and this will overflow a long , hence the result type is < code > string < code > ( the alternative would have been < code > big integer < code > but then it would not be possible to index the os stats document into elasticsearch without losing information , as < code > big integer < code > is not a supported elasticsearch type )

private string get cgroup memory limit in bytes ( final string control group ) throws i o exception { return read sys fs cgroup memory limit in bytes ( control group ) ; }


compute the platform - type - to - bitcode - mode mapping from the pairs that were passed on the command line

private static enum map < apple platform platform type , apple bitcode mode > collect bitcode modes ( list < map entry < apple platform platform type , apple bitcode mode > > platform mode mappings ) { enum map < apple platform platform type , apple bitcode mode > modes = new enum map < > ( apple platform platform type class ) ; apple platform platform type [ ] all platforms = apple platform platform type values ( ) ; / / seed the map with the default mode for every key so that there is a valid mode for every / / platform / / todo ( blaze - team ) : default to embedded markers when fully implemented arrays stream ( all platforms ) for each ( platform - > modes put ( platform , apple bitcode mode none ) ) ; / / process the entries in order if we encounter one with a null key , apply the mode to all / / platforms ; otherwise , apply it only to that specific platform this ensures that the later / / options override the earlier options for ( map entry < apple platform platform type , apple bitcode mode > entry : platform mode mappings ) { if ( entry get key ( ) = = null ) { arrays stream ( all platforms ) for each ( platform - > modes put ( platform , entry get value ( ) ) ) ; } else { modes put ( entry get key ( ) , entry get value ( ) ) ; } } return modes ; }


check that the given char sequence is neither { @ code null } nor of length 0

public static boolean has length ( char sequence str ) { return ( str ! = null & & str length ( ) > 0 ) ; }


called from a recycler binder when a component warmer instance associated with it can be used to prepare items because the recycler binder has been measured


tries to retrieve healthy channel from the pool if any or creates a new channel otherwise

private future < channel > acquire healthy from pool or new ( final promise < channel > promise ) { try { final channel ch = poll channel ( ) ; if ( ch = = null ) { / / no channel left in the pool bootstrap a new channel bootstrap bs = bootstrap clone ( ) ; bs attr ( pool key , this ) ; channel future f = connect channel ( bs ) ; if ( f is done ( ) ) { notify connect ( f , promise ) ; } else { f add listener ( new channel future listener ( ) { @ override public void operation complete ( channel future future ) throws exception { notify connect ( future , promise ) ; } } ) ; } return promise ; } event loop loop = ch event loop ( ) ; if ( loop in event loop ( ) ) { do health check ( ch , promise ) ; } else { loop execute ( new runnable ( ) { @ override public void run ( ) { do health check ( ch , promise ) ; } } ) ; } } catch ( throwable cause ) { promise try failure ( cause ) ; } return promise ; }


public pet get pet by id ( @ path param ( " pet id " ) long pet id ) ;


checks if this job submission result is also a job execution result see { @ code get job execution result } to retrieve the job execution result

public boolean is job execution result ( ) { return false ; }


see original { @ link stubber # when ( object ) }


get the fully parsed query from the semi - parsed stored { @ code map < string , object > }

public query builder get parsed query ( ) { exception exception = query provider get parsing exception ( ) ; if ( exception ! = null ) { if ( exception instanceof runtime exception ) { throw ( runtime exception ) exception ; } else { throw new elasticsearch exception ( query provider get parsing exception ( ) ) ; } } return query provider get parsed query ( ) ; }


determine a corresponding interface method for the given method handle , if possible this is particularly useful for arriving at a public exported type on jigsaw which can be reflectively invoked without an illegal access warning

public static method get interface method if possible ( method method ) { if ( ! modifier is public ( method get modifiers ( ) ) | | method get declaring class ( ) is interface ( ) ) { return method ; } return interface method cache compute if absent ( method , key - > { class < ? > current = key get declaring class ( ) ; while ( current ! = null & & current ! = object class ) { class < ? > [ ] ifcs = current get interfaces ( ) ; for ( class < ? > ifc : ifcs ) { try { return ifc get method ( key get name ( ) , key get parameter types ( ) ) ; } catch ( no such method exception ex ) { / / ignore } } current = current get superclass ( ) ; } return key ; } ) ; }


if the specified event collector contains any events , an informative assertion fails in the context of the specified test case

public static void assert no events ( iterable < event > event collector ) { string events string = events to string ( event collector ) ; assert that ( events string ) is empty ( ) ; }


is delegated client authorized for service boolean

public boolean is delegated client authorized for service ( final client client , final service service ) { return is delegated client authorized for ( client get name ( ) , service ) ; }


resets the state , preparing to parse a new frame must be called between frames

private void reset ( ) { ( ( buffer ) buffer ) clear ( ) ; is complete = false ; }


returns the empty { @ code iterator } that throws { @ link illegal state exception } instead of { @ link unsupported operation exception } on a call to { @ link iterator # remove ( ) }

static < t > iterator < t > empty modifiable iterator ( ) { return ( iterator < t > ) empty modifiable iterator instance ; }


process the bytes of the given input stream using the given processor

public static < t > t read bytes ( input stream input , byte processor < t > processor ) throws i o exception { check not null ( input ) ; check not null ( processor ) ; byte [ ] buf = create buffer ( ) ; int read ; do { read = input read ( buf ) ; } while ( read ! = - 1 & & processor process bytes ( buf , 0 , read ) ) ; return processor get result ( ) ; }


adds an encoding character to the encoded key value string - one parameter version

void metaph add ( string in ) { if ( ! ( in equals ( " a " ) & & ( m primary length ( ) > 0 ) & & ( m primary char at ( m primary length ( ) - 1 ) = = ' a ' ) ) ) { m primary append ( in ) ; } if ( ! ( in equals ( " a " ) & & ( m secondary length ( ) > 0 ) & & ( m secondary char at ( m secondary length ( ) - 1 ) = = ' a ' ) ) ) { m secondary append ( in ) ; } }


returns a { @ link playback state compat custom action } which will be published to the media session by the connector or { @ code null } if this action should not be published at the given player state

playback state compat custom action get custom action ( player player ) ;


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


adds a zip to be added to the apk and an executable that filters the zip to extract the relevant contents first

public apk actions builder set java resource zip ( artifact java resource zip , files to run provider resource extractor ) { this java resource zip = java resource zip ; this resource extractor = resource extractor ; return this ; }


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

public void test group parameters ( integer required string group , boolean required boolean group , long required int 6 4 group , integer string group , boolean boolean group , long int 6 4 group ) throws api exception { object local var post body = null ; / / verify the required parameter ' required string group ' is set if ( required string group = = null ) { throw new api exception ( 400 , " missing the required parameter ' required string group ' when calling test group parameters " ) ; } / / verify the required parameter ' required boolean group ' is set if ( required boolean group = = null ) { throw new api exception ( 400 , " missing the required parameter ' required boolean group ' when calling test group parameters " ) ; } / / verify the required parameter ' required int 6 4 group ' is set if ( required int 6 4 group = = null ) { throw new api exception ( 400 , " missing the required parameter ' required int 6 4 group ' when calling test group parameters " ) ; } / / create path and map variables string local var path = " / fake " ; / / query params list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; local var query params add all ( api client parameter to pair ( " required string group " , required string group ) ) ; local var query params add all ( api client parameter to pair ( " required int 6 4 group " , required int 6 4 group ) ) ; local var query params add all ( api client parameter to pair ( " string group " , string group ) ) ; local var query params add all ( api client parameter to pair ( " int 6 4 group " , int 6 4 group ) ) ; if ( required boolean group ! = null ) local var header params put ( " required boolean group " , api client parameter to string ( required boolean group ) ) ; if ( boolean group ! = null ) local var header params put ( " boolean group " , api client parameter to string ( boolean group ) ) ; final string [ ] local var accepts = { } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; api client invoke a p i ( local var path , " delete " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , null ) ; }


static c s queue parse queue ( capacity scheduler context cs context , capacity scheduler configuration conf , c s queue parent , string queue name , c s queue store queues , c s queue store old queues , queue hook hook ) throws i o exception { c s queue queue ; string full queue name = ( parent = = null ) ? queue name : ( parent get queue path ( ) + " " + queue name ) ; string [ ] child queue names = conf get queues ( full queue name ) ; boolean is reservable queue = conf is reservable ( full queue name ) ; boolean is auto create enabled = conf is auto create child queue enabled ( full queue name ) ; if ( child queue names = = null | | child queue names length = = 0 ) { if ( null = = parent ) { throw new illegal state exception ( " queue configuration missing child queue names for " + queue name ) ; } / / check if the queue will be dynamically managed by the reservation / / system if ( is reservable queue ) { queue = new plan queue ( cs context , queue name , parent , old queues get ( full queue name ) ) ; / / initializing the " internal " default queue , for sls compatibility string def reservation id = queue name + reservation constants default queue suffix ; list < c s queue > child queues = new array list < > ( ) ; reservation queue res queue = new reservation queue ( cs context , def reservation id , ( plan queue ) queue ) ; try { res queue set entitlement ( new queue entitlement ( 1 0f , 1 0f ) ) ; } catch ( scheduler dynamic edit exception e ) { throw new illegal state exception ( e ) ; } child queues add ( res queue ) ; ( ( plan queue ) queue ) set child queues ( child queues ) ; queues add ( res queue ) ; } else if ( is auto create enabled ) { queue = new managed parent queue ( cs context , queue name , parent , old queues get ( full queue name ) ) ; } else { queue = new leaf queue ( cs context , queue name , parent , old queues get ( full queue name ) ) ; / / used only for unit tests queue = hook hook ( queue ) ; } } else { if ( is reservable queue ) { throw new illegal state exception ( " only leaf queues can be reservable for " + full queue name ) ; } parent queue parent queue ; if ( is auto create enabled ) { parent queue = new managed parent queue ( cs context , queue name , parent , old queues get ( full queue name ) ) ; } else { parent queue = new parent queue ( cs context , queue name , parent , old queues get ( full queue name ) ) ; } / / used only for unit tests queue = hook hook ( parent queue ) ; list < c s queue > child queues = new array list < > ( ) ; for ( string child queue name : child queue names ) { c s queue child queue = parse queue ( cs context , conf , queue , child queue name , queues , old queues , hook ) ; child queues add ( child queue ) ; } parent queue set child queues ( child queues ) ; } queues add ( queue ) ; log info ( " initialized queue : " + full queue name ) ; return queue ; }


if the given uuid is null , this returns null , otherwise a resource manager id that corresponds to the uuid , via { @ link # resource manager id ( uuid ) }

public static resource manager id from uuid or null ( @ nullable uuid uuid ) { return uuid = = null ? null : new resource manager id ( uuid ) ; }


return the path segment value , decoded and sanitized , for path matching


delete user { username } : delete user this can only be done by the logged in user

response entity < void > delete user ( @ api param ( value = " the name that needs to be deleted " , required = true ) @ path variable ( " username " ) string username ) ;


gets the stream this state is associated with


create a jaxp document builder that this bean definition reader will use for parsing xml documents can be overridden in subclasses , adding further initialization of the builder

protected document builder create document builder ( document builder factory factory , @ nullable entity resolver entity resolver , @ nullable error handler error handler ) throws parser configuration exception { document builder doc builder = factory new document builder ( ) ; if ( entity resolver ! = null ) { doc builder set entity resolver ( entity resolver ) ; } if ( error handler ! = null ) { doc builder set error handler ( error handler ) ; } return doc builder ; }


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


return the uri that locates the http server

uri get server u r i ( ) { / / get http client scheme ( ) only returns https for https only policy this / / matches the behavior that the first connector is a https connector only / / for https only policy inet socket address addr = http server get connector address ( 0 ) ; return uri create ( d f s util get http client scheme ( conf ) + " : / / " + net utils get host port string ( addr ) ) ; }


guarantees that the { @ code data } is mutable for any code that needs to modify the { @ linkplain map } before using it ( e g , from singleton , immutable { @ code map } s )

private map < string , object > mutable map ( map < string , object > data ) { return data instanceof hash map ? data : new hash map < > ( data ) ; }


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


update component ordinal , offset and length during alignment

void update ( int ordinal , int offset , int length ) ;


delay returning on a latch or a specific amount of time

private void delay if necessary ( ) { / / cause current method to pause / / resume until get notified if ( latch ! = null ) { try { latch await ( ) ; return ; } catch ( interrupted exception e ) { } } if ( get groups delay ms > 0 ) { try { thread sleep ( get groups delay ms ) ; } catch ( interrupted exception e ) { throw new runtime exception ( e ) ; } } }


public static void register subtype ( class < ? > clz , string type ) { mapper register subtypes ( new named type ( clz , type ) ) ; }


get the absolute version of the path ( fully qualified ) this is public for testing purposes

public path make absolute ( path path ) { if ( path is absolute ( ) ) { return path ; } return new path ( working dir , path ) ; }


configures how to buffer elements before sending them in bulk to the cluster for efficiency sets the amount of delay between each backoff attempt when flushing bulk requests ( in milliseconds ) make sure to enable backoff by selecting a strategy ( { @ link # bulk flush backoff constant ( ) } or { @ link # bulk flush backoff exponential ( ) } )

public elasticsearch bulk flush backoff delay ( long delay ) { internal properties put long ( connector bulk flush backoff delay , delay ) ; return this ; }


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

public subchannel get subchannel ( ) { return subchannel ; }


create a single input file in the input directory

private void create input file ( path dir path , int id , int num records ) throws i o exception { final string message = " this is a line in a file : " ; path file path = new path ( dir path , " " + id ) ; configuration conf = new configuration ( ) ; file system fs = file system get local ( conf ) ; output stream os = fs create ( file path ) ; buffered writer w = new buffered writer ( new output stream writer ( os ) ) ; for ( int i = 0 ; i < num records ; i + + ) { w write ( message + id + " " + i + " \ n " ) ; } w close ( ) ; }


get an input stream attached to the configuration resource with the given < code > name < code >

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


get the supporting vertex index in the given direction

public final int get support ( final vec 2 d ) { return 0 ; }


returns the wrapped , ' dead ' event , which the system was unable to deliver to any registered subscriber

public object get event ( ) { return event ; }


obtains the log file the default implementation get this from { @ link # worker thread } , so when it ' s complete , the log could be gone any time derived classes that persist the text should override this method so that it fetches the file from disk

public annotated large text obtain log ( ) { weak reference < annotated large text > l = log ; if ( l = = null ) return null ; return l get ( ) ; }


get the values to compute percentiles from

public double [ ] values ( ) { return values ; }


intermediate data set i d get result id ( ) ;


void record time ( string name , string [ ] label values , long duration ) ;


tests if specific configs and metrics are retrieve for get entity call

public void test get entity data to retrieve ( ) throws exception { client client = create client ( ) ; try { uri uri = uri create ( " http : / / localhost : " + get server port ( ) + " / ws / v 2 / " + " timeline / clusters / cluster 1 / apps / application 1111111111 1111 / " + " entities / type 1 / entity 2 ? confstoretrieve = cfg , configuration " ) ; client response resp = get response ( client , uri ) ; timeline entity entity = resp get entity ( timeline entity class ) ; assert not null ( entity ) ; assert equals ( " entity 2 " , entity get id ( ) ) ; assert equals ( " type 1 " , entity get type ( ) ) ; assert equals ( 2 , entity get configs ( ) size ( ) ) ; for ( string config key : entity get configs ( ) key set ( ) ) { assert true ( config key starts with ( " configuration " ) | | config key starts with ( " cfg " ) ) ; } uri = uri create ( " http : / / localhost : " + get server port ( ) + " / ws / v 2 / " + " timeline / clusters / cluster 1 / apps / application 1111111111 1111 / " + " entities / type 1 / entity 2 ? confstoretrieve = ! ( cfg , configuration ) " ) ; resp = get response ( client , uri ) ; entity = resp get entity ( timeline entity class ) ; assert not null ( entity ) ; assert equals ( " entity 2 " , entity get id ( ) ) ; assert equals ( " type 1 " , entity get type ( ) ) ; assert equals ( 1 , entity get configs ( ) size ( ) ) ; for ( string config key : entity get configs ( ) key set ( ) ) { assert true ( config key starts with ( " config " ) ) ; } uri = uri create ( " http : / / localhost : " + get server port ( ) + " / ws / v 2 / " + " timeline / clusters / cluster 1 / apps / application 1111111111 1111 / " + " entities / type 1 / entity 2 ? metricstoretrieve = map1 , hdfs " ) ; resp = get response ( client , uri ) ; entity = resp get entity ( timeline entity class ) ; assert not null ( entity ) ; assert equals ( " entity 2 " , entity get id ( ) ) ; assert equals ( " type 1 " , entity get type ( ) ) ; assert equals ( 2 , entity get metrics ( ) size ( ) ) ; for ( timeline metric metric : entity get metrics ( ) ) { assert true ( metric get id ( ) starts with ( " map1 " ) | | metric get id ( ) starts with ( " hdfs " ) ) ; } uri = uri create ( " http : / / localhost : " + get server port ( ) + " / ws / v 2 / " + " timeline / clusters / cluster 1 / apps / application 1111111111 1111 / " + " entities / type 1 / entity 2 ? metricstoretrieve = ! ( map1 , hdfs ) " ) ; resp = get response ( client , uri ) ; entity = resp get entity ( timeline entity class ) ; assert not null ( entity ) ; assert equals ( " entity 2 " , entity get id ( ) ) ; assert equals ( " type 1 " , entity get type ( ) ) ; assert equals ( 1 , entity get metrics ( ) size ( ) ) ; for ( timeline metric metric : entity get metrics ( ) ) { assert true ( metric get id ( ) starts with ( " map11 " ) ) ; assert equals ( timeline metric type single value , metric get type ( ) ) ; assert equals ( 1 , metric get values ( ) size ( ) ) ; } uri = uri create ( " http : / / localhost : " + get server port ( ) + " / ws / v 2 / " + " timeline / clusters / cluster 1 / apps / application 1111111111 1111 / " + " entities / type 1 / entity 2 ? metricstoretrieve = ! ( map1 , hdfs ) & " + " metricslimit = 5 " ) ; resp = get response ( client , uri ) ; entity = resp get entity ( timeline entity class ) ; assert not null ( entity ) ; assert equals ( " entity 2 " , entity get id ( ) ) ; assert equals ( " type 1 " , entity get type ( ) ) ; assert equals ( 1 , entity get metrics ( ) size ( ) ) ; for ( timeline metric metric : entity get metrics ( ) ) { assert true ( metric get id ( ) starts with ( " map11 " ) ) ; assert equals ( timeline metric type single value , metric get type ( ) ) ; } } finally { client destroy ( ) ; } }


sets a task monitor that will be called back with messages that report the status of the initialization process

public void set task monitor ( task monitor monitor ) { this monitor = monitor ; }


adds a route to the given handler function that handles all http { @ code options } requests that match the given pattern

builder options ( string pattern , handler function < server response > handler function ) ;


public default data directory get code manager table ( ) { return code manager table ; }


returns a future that provides number of partitions in the topic when the request completes if broker version doesn ' t support replication factor in the response , throw { @ link org apache kafka common errors unsupported version exception } if broker returned an error for topic configs , throw appropriate exception for example , { @ link org apache kafka common errors topic authorization exception } is thrown if user does not have permission to describe topic configs

public kafka future < integer > num partitions ( string topic ) { return futures get ( topic ) then apply ( topic metadata and config : : num partitions ) ; }


returns the field containing the predicted probability value in [ 0 0 , 1 0 ]

public string get predicted probability field ( ) { return predicted probability field ; }


increment the count of triggered asynchronous state updates in litho components ( by one )

public static long increment component state update async count ( ) { return s component triggered async state update count add and get ( 1 ) ; }


checks if the option to only demangle known mangled patterns is set

public boolean demangle only known patterns ( ) { return demangle only known patterns ; }


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


check that the constructor without owner , group and permissions works correctly

public void constructor no owner ( ) throws i o exception { boolean isdir = true ; file status file status = new file status ( length , isdir , replication , blksize , mtime , path ) ; validate accessors ( file status , length , isdir , replication , blksize , mtime , 0 , fs permission get dir default ( ) , " " , " " , null , path ) ; }


return the associated { @ link javax servlet servlet context }

public final servlet context get servlet context ( ) { return this servlet context ; }


private static boolean is setsid supported ( ) { if ( shell windows ) { return false ; } shell command executor shexec = null ; boolean setsid supported = true ; try { string [ ] args = { " setsid " , " bash " , " - c " , " echo $ $ " } ; shexec = new shell command executor ( args ) ; shexec execute ( ) ; } catch ( i o exception ioe ) { log debug ( " setsid is not available on this machine so not using it " ) ; setsid supported = false ; } catch ( security exception se ) { log debug ( " setsid is not allowed to run by the jvm " + " security manager so not using it " ) ; setsid supported = false ; } catch ( error err ) { if ( err get message ( ) ! = null & & err get message ( ) contains ( " posix spawn is not " + " a supported process launch mechanism " ) & & ( shell freebsd | | shell mac ) ) { / / hadoop - 11924 : this is a workaround to avoid failure of class init / / by jdk issue on tr locale ( jdk - 8047340 ) log info ( " avoiding jdk - 8047340 on bsd - based systems " , err ) ; setsid supported = false ; } } finally { / / handle the exit code if ( log is debug enabled ( ) ) { log debug ( " setsid exited with exit code " + ( shexec ! = null ? shexec get exit code ( ) : " ( null executor ) " ) ) ; } } return setsid supported ; }


returns the base - 2 logarithm of { @ code x } , rounded according to the specified rounding mode

public static int log 2 ( int x , rounding mode mode ) { check positive ( " x " , x ) ; switch ( mode ) { case unnecessary : check rounding unnecessary ( is power of two ( x ) ) ; / / fall through case down : case floor : return ( integer size - 1 ) - integer number of leading zeros ( x ) ; case up : case ceiling : return integer size - integer number of leading zeros ( x - 1 ) ; case half down : case half up : case half even : / / since sqrt ( 2 ) is irrational , log 2 ( x ) - log floor cannot be exactly 0 5 int leading zeros = integer number of leading zeros ( x ) ; int cmp = max power of sqrt2 unsigned > > > leading zeros ; / / floor ( 2 ^ ( log floor + 0 5 ) ) int log floor = ( integer size - 1 ) - leading zeros ; return log floor + less than branch free ( cmp , x ) ; default : throw new assertion error ( ) ; } }


build an automaton query accepting all terms with the specified prefix , ascii case insensitive

public static automaton query case insensitive prefix query ( term prefix ) { return new automaton query ( prefix , case insensitive prefix ( prefix text ( ) ) ) ; }


sets the compressed size for this { @ code zip entry }

public void set compressed size ( long value ) { compressed size = value ; }


locks a policy to prevent concurrent execution if the policy is currently executing , this method will immediately throw without waiting this method only blocks if another thread is currently capturing the current policy execution state

public void lock policy ( string policy name ) { current state lock read lock ( ) lock ( ) ; try { semaphore run lock = policy locks compute if absent ( policy name , ( name ) - > new semaphore ( 1 ) ) ; boolean acquired = run lock try acquire ( ) ; if ( acquired = = false ) { throw new es rejected execution exception ( " could not obtain lock because policy execution for [ " + policy name + " ] is already in progress " ) ; } policy run counter increment and get ( ) ; } finally { current state lock read lock ( ) unlock ( ) ; } }


the translating method takes an element from the input data set and transforms it into exactly one element

o translate ( t value , o reuse ) throws exception ;


like { @ link # block ( ) } but allows for richer logging

public void block ( @ non null build listener listener , @ non null string waiter ) throws interrupted exception { run wait for checkpoint ( this , listener , waiter ) ; }


check equality of the advisors behind the given advised support objects

public static boolean equals advisors ( advised support a , advised support b ) { return a get advisor count ( ) = = b get advisor count ( ) & & arrays equals ( a get advisors ( ) , b get advisors ( ) ) ; }


return the description for the given resource ; if the description is empty , return the class name of the resource plus its identity hash code

private static string get name for resource ( resource resource ) { string name = resource get description ( ) ; if ( ! string utils has text ( name ) ) { name = resource get class ( ) get simple name ( ) + " @ " + system identity hash code ( resource ) ; } return name ; }


get the long array contained with this field

public long [ ] get long array ( ) { if ( long array ! = data [ data type offset ] ) { throw new illegal field access exception ( ) ; } if ( data [ data offset ] < 0 ) { return null ; } long [ ] values = new long [ ( data length - 2 ) / 8 ] ; binary data buffer buffer = new binary data buffer ( data ) ; int offset = data offset + 1 ; for ( int i = 0 ; i < values length ; i + + ) { values [ i ] = buffer get long ( offset ) ; offset + = 8 ; } return values ; }


adds an unnamed value to the formatted output it is strongly encouraged to use { @ link # add ( string , char ) } instead and give value a readable name

public to string helper add value ( char value ) { return add holder ( string value of ( value ) ) ; }


closes { @ code closeable } and if an exception is thrown , it is logged at the warn level

public static void close quietly ( auto closeable closeable , string name ) { if ( closeable ! = null ) { try { closeable close ( ) ; } catch ( throwable t ) { log warn ( " failed to close { } with type { } " , name , closeable get class ( ) get name ( ) , t ) ; } } }


waits for the j dialog with the given title < p > note : sometimes the task dialog might have the same title as the dialog you pop up and you want to get yours instead of the one for the task monitor

public static j dialog wait for j dialog ( string title ) { int total time = 0 ; while ( total time < = default window timeout ) { set < window > win list = get all windows ( ) ; iterator < window > iter = win list iterator ( ) ; while ( iter has next ( ) ) { window w = iter next ( ) ; if ( ( w instanceof j dialog ) & & w is showing ( ) ) { string window title = get title for window ( w ) ; if ( title equals ( window title ) ) { return ( j dialog ) w ; } } } total time + = sleep ( default wait delay ) ; } throw new assertion failed error ( " timed - out waiting for window with title ' " + title + " ' " ) ; }


remove dep from direct deps this should only be called if this entry is about to be committed as a cycle node , but some of its children were not checked for cycles , either because the cycle was discovered before some children were checked ; some children didn ' t have a chance to finish before the evaluator aborted ; or too many cycles were found when it came time to check the children

void remove unfinished deps ( set < sky key > unfinished deps ) ;


public date histogram interval get delay ( ) { return delay ; }


write a partition file for the given job , using the sampler provided queries the sampler for a sample keyset , sorts by the output key comparator , selects the keys for each rank , and writes to the destination returned from { @ link total order partitioner # get partition file }

public static < k , v > void write partition file ( job job , sampler < k , v > sampler ) throws i o exception , class not found exception , interrupted exception { configuration conf = job get configuration ( ) ; final input format inf = reflection utils new instance ( job get input format class ( ) , conf ) ; int num partitions = job get num reduce tasks ( ) ; k [ ] samples = ( k [ ] ) sampler get sample ( inf , job ) ; log info ( " using " + samples length + " samples " ) ; raw comparator < k > comparator = ( raw comparator < k > ) job get sort comparator ( ) ; arrays sort ( samples , comparator ) ; path dst = new path ( total order partitioner get partition file ( conf ) ) ; file system fs = dst get file system ( conf ) ; fs delete ( dst , false ) ; sequence file writer writer = sequence file create writer ( fs , conf , dst , job get map output key class ( ) , null writable class ) ; null writable null value = null writable get ( ) ; float step size = samples length / ( float ) num partitions ; int last = - 1 ; for ( int i = 1 ; i < num partitions ; + + i ) { int k = math round ( step size * i ) ; while ( last > = k & & comparator compare ( samples [ last ] , samples [ k ] ) = = 0 ) { + + k ; } writer append ( samples [ k ] , null value ) ; last = k ; } writer close ( ) ; }


returns the { @ link # sum } as a { @ code float } after a widening primitive conversion

public float float value ( ) { return ( float ) sum ( ) ; }


calculates the minimum value on a given column the value is returned with the same data type of the column lite pal min ( & quot ; person & quot ; , & quot ; age & quot ; , int class ) ; you can also specify a where clause when calculating lite pal where ( & quot ; age & gt ; ? & quot ; , & quot ; 15 & quot ; ) min ( & quot ; person & quot ; , & quot ; age & quot ; , integer type ) ;

public static < t > t min ( string table name , string column name , class < t > column type ) { return operator min ( table name , column name , column type ) ; }


public void prepare for next run ( ) { for ( int i = 0 ; i < 5 ; i + + ) { system gc ( ) ; try { thread sleep ( 20 ) ; } catch ( interrupted exception e ) { e print stack trace ( ) ; } } }


read from the block file into a buffer this function overwrites checksum buf it will increment data pos

private synchronized int fill buffer ( byte buffer buf , boolean can skip checksum ) throws i o exception { int total = 0 ; long start data pos = data pos ; int start buf pos = buf position ( ) ; while ( buf has remaining ( ) ) { int n read = block reader io provider read ( data in , buf , data pos ) ; if ( n read < 0 ) { break ; } data pos + = n read ; total + = n read ; } if ( can skip checksum ) { free checksum buf if exists ( ) ; return total ; } if ( total > 0 ) { try { buf limit ( buf position ( ) ) ; buf position ( start buf pos ) ; create checksum buf if needed ( ) ; int checksums needed = ( total + bytes per checksum - 1 ) / bytes per checksum ; checksum buf clear ( ) ; checksum buf limit ( checksums needed * checksum size ) ; long checksum pos = block metadata header get header size ( ) + ( ( start data pos / bytes per checksum ) * checksum size ) ; while ( checksum buf has remaining ( ) ) { int n read = checksum in read ( checksum buf , checksum pos ) ; if ( n read < 0 ) { throw new i o exception ( " got unexpected checksum file eof at " + checksum pos + " , block file position " + start data pos + " for block " + block + " of file " + filename ) ; } checksum pos + = n read ; } checksum buf flip ( ) ; checksum verify chunked sums ( buf , checksum buf , filename , start data pos ) ; } finally { buf position ( buf limit ( ) ) ; } } return total ; }


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


get the program location for the given program and save state object

public static program location get location ( program program , save state save state ) { string class name = save state get string ( " classname " , null ) ; if ( class name = = null ) { return null ; } try { class < ? > loc class = class for name ( class name ) ; program location loc = ( program location ) loc class get constructor ( ) new instance ( ) ; loc restore state ( program , save state ) ; if ( loc get address ( ) ! = null ) { return loc ; } / / no address , it must be in a removed block ; we can ' t use it } catch ( runtime exception e ) { / / restore state may not parse the address if it is no longer valid } catch ( class not found exception e ) { / / not sure why we are ignoring this - - if you know , then please let everyone else know } catch ( instantiation exception | illegal access exception | no such method exception e ) { msg show error ( program location class , null , " programming error " , " class " + class name + " must have public default constructor ! " , e ) ; } catch ( invocation target exception e ) { msg show error ( program location class , null , " programming error " , " class " + class name + " default constructor threw an exception ! " , e ) ; } return null ; }


returns an authenticated { @ link http u r l connection } if the delegation token is present , it will be used taking precedence over the configured < code > authenticator < code > if the < code > do as < code > parameter is not null , the request will be done on behalf of the specified < code > do as < code > user

public http u r l connection open connection ( url url , token token , string do as ) throws i o exception , authentication exception { preconditions check not null ( url , " url " ) ; preconditions check not null ( token , " token " ) ; map < string , string > extra params = new hash map < string , string > ( ) ; org apache hadoop security token token < ? extends token identifier > d token = null ; log debug ( " connecting to url { } with token { } as { } " , url , token , do as ) ; / / if we have valid auth token , it takes precedence over a delegation token / / and we don ' t even look for one if ( ! token is set ( ) ) { / / delegation token credentials creds = user group information get current user ( ) get credentials ( ) ; if ( log is debug enabled ( ) ) { log debug ( " token not set , looking for delegation token creds : { } , " + " size : { } " , creds get all tokens ( ) , creds number of tokens ( ) ) ; } if ( ! creds get all tokens ( ) is empty ( ) ) { d token = select delegation token ( url , creds ) ; if ( d token ! = null ) { if ( use query string for delegation token ( ) ) { / / delegation token will go in the query string , injecting it extra params put ( kerberos delegation token authenticator delegation param , d token encode to url string ( ) ) ; } else { / / delegation token will go as request header , setting it in the / / auth - token to ensure no authentication handshake is triggered / / ( if we have a delegation token , we are authenticated ) / / the delegation token header is injected in the connection request / / at the end of this method token delegation token = ( org apache hadoop security token token < abstract delegation token identifier > ) d token ; } } } } / / proxyuser if ( do as ! = null ) { extra params put ( do as , u r l encoder encode ( do as , " utf - 8 " ) ) ; } url = augment u r l ( url , extra params ) ; http u r l connection conn = super open connection ( url , token ) ; if ( ! token is set ( ) & & ! use query string for delegation token ( ) & & d token ! = null ) { / / injecting the delegation token header in the connection request conn set request property ( delegation token authenticator delegation token header , d token encode to url string ( ) ) ; } return conn ; }


scan the local storage directory , and return the segment containing the highest transaction

private synchronized edit log file scan storage for latest edits ( ) throws i o exception { if ( ! fjm get storage directory ( ) get current dir ( ) exists ( ) ) { return null ; } log info ( " scanning storage " + fjm ) ; list < edit log file > files = fjm get log files ( 0 ) ; while ( ! files is empty ( ) ) { edit log file latest log = files remove ( files size ( ) - 1 ) ; latest log scan log ( long max value , false ) ; log info ( " latest log is " + latest log + " ; journal id : " + journal id ) ; if ( latest log get last tx id ( ) = = hdfs server constants invalid txid ) { / / the log contains no transactions log warn ( " latest log " + latest log + " has no transactions " + " moving it aside and looking for previous log " + " ; journal id : " + journal id ) ; latest log move aside empty file ( ) ; } else { return latest log ; } } log info ( " no files in " + fjm ) ; return null ; }


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


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public test field prop generate string overloads option view model on visibility changed ( on model visibility changed listener < test field prop generate string overloads option view model , test field prop generate string overloads option view > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


triggers the load of the jni bundle in a platform - independent basis this does < b > not < b > fail if the jni bundle cannot be loaded because there are scenarios in which we want to run bazel without jni ( e g during bootstrapping ) we rely on the fact that any calls to native code will fail anyway and with a more descriptive error message if we failed to load the jni bundle callers can check if the jni bundle load succeeded by calling { @ link # is jni available ( ) }


create a parameter value from the string given in the cli

public parameter value create value ( c l i command command , string value ) throws i o exception , interrupted exception { throw new abort exception ( " cli parameter submission is not supported for the " + get class ( ) + " type please file a bug report for this " ) ; }


used to create a request and no route match is available

public static request create ( http servlet request request ) { return new request ( request ) ; }


sets if the content is being animated on the render thread , which means that the further passed are not be applied to the content , but just to be recorded

void set using render thread ( boolean using render thread ) { this m using render thread = using render thread ; }


returns human - friendly help for the generator provide the consumer with help tips , parameters here

public string get help ( ) { return " generates a gatling simulation library ( beta ) " ; }


returns the quotient of this float value and the given specific float value

public float value divide ( specific float value other ) { return divide ( ( float value ) other ) ; }


today , in yarn there are no checks of any application id submitted base scenarios : the client submits an application to the router the router selects one sub cluster to forward the request the router inserts a tuple into state store with the selected sub cluster ( e g sc1 ) and the app id the state store replies with the selected sub cluster ( e g sc1 ) the router submits the request to the selected sub cluster in case of state store failure : the client submits an application to the router the router selects one sub cluster to forward the request the router inserts a tuple into state store with the selected sub cluster ( e g sc1 ) and the app id due to the state store down the router times out and it will retry depending on the federation facade settings the router replies to the client with an error message if state store fails after inserting the tuple : identical behavior as { @ code r m web services } in case of router failure : scenario 1 – crash before submission to the resource manager the client submits an application to the router the router selects one sub cluster to forward the request the router inserts a tuple into state store with the selected sub cluster ( e g sc1 ) and the app id the router crashes the client timeouts and resubmits the application the router selects one sub cluster to forward the request the router inserts a tuple into state store with the selected sub cluster ( e g sc2 ) and the app id because the tuple is already inserted in the state store , it returns the previous selected sub cluster ( e g sc1 ) the router submits the request to the selected sub cluster ( e g sc1 ) scenario 2 – crash after submission to the resource manager the client submits an application to the router the router selects one sub cluster to forward the request the router inserts a tuple into state store with the selected sub cluster ( e g sc1 ) and the app id the router submits the request to the selected sub cluster the router crashes the client timeouts and resubmit the application the router selects one sub cluster to forward the request the router inserts a tuple into state store with the selected sub cluster ( e g sc2 ) and the app id the state store replies with the selected sub cluster ( e g sc1 ) the router submits the request to the selected sub cluster ( e g sc1 ) when a client re - submits the same application to the same rm , it does not raise an exception and replies with operation successful message in case of client failure : identical behavior as { @ code r m web services } in case of resource manager failure : the client submits an application to the router the router selects one sub cluster to forward the request the router inserts a tuple into state store with the selected sub cluster ( e g sc1 ) and the app id the router submits the request to the selected sub cluster the entire sub cluster is down – all the r ms in ha or the master rm is not reachable the router times out the router selects a new sub cluster to forward the request the router update a tuple into state store with the selected sub cluster ( e g sc2 ) and the app id the state store replies with ok answer the router submits the request to the selected sub cluster ( e g sc2 )

public response submit application ( application submission context info new app , http servlet request hsr ) throws authorization exception , i o exception , interrupted exception { long start time = clock get time ( ) ; if ( new app = = null | | new app get application id ( ) = = null ) { router metrics incr apps failed submitted ( ) ; string err msg = " missing application submission context info or " + " application submission contex information " ; return response status ( status bad request ) entity ( err msg ) build ( ) ; } application id application id = null ; try { application id = application id from string ( new app get application id ( ) ) ; } catch ( illegal argument exception e ) { router metrics incr apps failed submitted ( ) ; return response status ( status bad request ) entity ( e get localized message ( ) ) build ( ) ; } list < sub cluster id > blacklist = new array list < sub cluster id > ( ) ; for ( int i = 0 ; i < num submit retries ; + + i ) { application submission context context = r m web app util create app submission context ( new app , this get conf ( ) ) ; sub cluster id sub cluster id = null ; try { sub cluster id = policy facade get home subcluster ( context , blacklist ) ; } catch ( yarn exception e ) { router metrics incr apps failed submitted ( ) ; return response status ( status service unavailable ) entity ( e get localized message ( ) ) build ( ) ; } log info ( " submit application app id { } try # { } on sub cluster { } " , application id , i , sub cluster id ) ; application home sub cluster app home sub cluster = application home sub cluster new instance ( application id , sub cluster id ) ; if ( i = = 0 ) { try { / / persist the mapping of application id and the sub cluster id which has / / been selected as its home sub cluster id = federation facade add application home sub cluster ( app home sub cluster ) ; } catch ( yarn exception e ) { router metrics incr apps failed submitted ( ) ; string err msg = " unable to insert the application id " + application id + " into the federation state store " ; return response status ( status service unavailable ) entity ( err msg + " " + e get localized message ( ) ) build ( ) ; } } else { try { / / update the mapping of application id and the home sub cluster id to / / the new sub cluster id we have selected federation facade update application home sub cluster ( app home sub cluster ) ; } catch ( yarn exception e ) { string err msg = " unable to update the application id " + application id + " into the federation state store " ; sub cluster id sub cluster id in state store ; try { sub cluster id in state store = federation facade get application home sub cluster ( application id ) ; } catch ( yarn exception e 1 ) { router metrics incr apps failed submitted ( ) ; return response status ( status service unavailable ) entity ( e 1 get localized message ( ) ) build ( ) ; } if ( sub cluster id = = sub cluster id in state store ) { log info ( " application { } already submitted on sub cluster { } " , application id , sub cluster id ) ; } else { router metrics incr apps failed submitted ( ) ; return response status ( status service unavailable ) entity ( err msg ) build ( ) ; } } } sub cluster info sub cluster info ; try { sub cluster info = federation facade get sub cluster ( sub cluster id ) ; } catch ( yarn exception e ) { router metrics incr apps failed submitted ( ) ; return response status ( status service unavailable ) entity ( e get localized message ( ) ) build ( ) ; } response response = null ; try { response = get or create interceptor for sub cluster ( sub cluster id , sub cluster info get r m web service address ( ) ) submit application ( new app , hsr ) ; } catch ( exception e ) { log warn ( " unable to submit the application { } to sub cluster { } " , application id , sub cluster id get id ( ) , e ) ; } if ( response ! = null & & response get status ( ) = = http servlet response sc accepted ) { log info ( " application { } with app id { } submitted on { } " , context get application name ( ) , application id , sub cluster id ) ; long stop time = clock get time ( ) ; router metrics succeeded apps submitted ( stop time - start time ) ; return response ; } else { / / empty response from the resource manager / / blacklist this subcluster for this request blacklist add ( sub cluster id ) ; } } router metrics incr apps failed submitted ( ) ; string err msg = " application " + new app get application name ( ) + " with app id " + application id + " failed to be submitted " ; log error ( err msg ) ; return response status ( status service unavailable ) entity ( err msg ) build ( ) ; }


returns the raw source text of the literal

public string get raw ( ) { return raw ; }


updates the notification builder and the button icons depending on the playback state

private synchronized void update notification ( final player player ) { if ( debug ) { log d ( tag , " update notification ( ) " ) ; } / / also update content intent , in case the user switched players notification builder set content intent ( pending intent get activity ( player get context ( ) , notification id , get intent for notification ( player ) , flag update current ) ) ; notification builder set content title ( player get video title ( ) ) ; notification builder set content text ( player get uploader name ( ) ) ; notification builder set ticker ( player get video title ( ) ) ; update actions ( notification builder , player ) ; final boolean show thumbnail = player get prefs ( ) get boolean ( player get context ( ) get string ( r string show thumbnail key ) , true ) ; if ( show thumbnail ) { set large icon ( notification builder , player ) ; } }


return the text of all tokens within the specified { @ code interval } this method behaves like the following code ( including potential exceptions for violating preconditions of { @ link # get } , but may be optimized by the specific implementation token stream stream = ; string text = " " ; for ( int i = interval a ; i & lt ; = interval b ; i + + ) { text + = stream get ( i ) get text ( ) ; }

public string get text ( interval interval ) ;


returns a specialized copy of t for functioning in the given environment

t for environment ( env vars environment ) ;


gets the underlying queue that backs the executor service

public scheduled queue get scheduled queue ( ) { return scheduled queue ; }


public string get phase ( ) { return phase ; }


create a new { @ code k stream } by transforming the value of each record in this stream into zero or more values with the same key in the new stream transform the value of each input record into zero or more records with the same ( unmodified ) key in the output stream ( value type can be altered arbitrarily ) the provided { @ link value mapper with key } is applied to each input record and computes zero or more output values thus , an input record { @ code < k , v > } can be transformed into output records { @ code < k : v ' > , < k : v ' ' > , } this is a stateless record - by - record operation ( cf { @ link # transform values ( value transformer with key supplier , string ) } for stateful value transformation ) the example below splits input records { @ code < integer : string > } , with key = 1 , containing sentences as values into their words { @ code k stream < integer , string > input stream = builder stream ( " topic " ) ; k stream < integer , string > output stream = input stream flat map values ( new value mapper < integer , string , iterable < string > > { iterable < integer , string > apply ( integer read only key , string value ) { if ( read only key = = 1 ) { return arrays as list ( value split ( " " ) ) ; } else { return arrays as list ( value ) ; } } } ) ; } the provided { @ link value mapper with key } must return an { @ link iterable } ( e g , any { @ link java util collection } type ) and the return value must not be { @ code null } note that the key is read - only and should not be modified , as this can lead to corrupt partitioning so , splitting a record into multiple records with the same key preserves data co - location with respect to the key thus , no internal data redistribution is required if a key based operator ( like an aggregation or join ) is applied to the result { @ code k stream } ( cf { @ link # flat map ( key value mapper ) } )

< vr > k stream < k , vr > flat map values ( final value mapper with key < ? super k , ? super v , ? extends iterable < ? extends vr > > mapper , final named named ) ;


cast an i binder object into an i book manager interface , generating a proxy if needed

public static i book manager as interface ( i binder obj ) { if ( ( obj = = null ) ) { return null ; } android os i interface iin = obj query local interface ( descriptor ) ; if ( ( ( iin ! = null ) & & ( iin instanceof i book manager ) ) ) { return ( ( i book manager ) iin ) ; } return new book manager impl proxy ( obj ) ; }


regression test for 2014 bug : error transience value is registered before newly requested deps a value requests a child , gets it back immediately , and then throws , causing the error transience value to be registered as a dep the following build , the error is invalidated via that child

public void double dep on error transience value ( ) throws exception { sky key leaf key = graph tester non hermetic key ( " leaf " ) ; tester set ( leaf key , new string value ( " leaf " ) ) ; / / prime the graph by putting leaf in beforehand assert that ( tester eval and get ( / * keep going = * / false , leaf key ) ) is equal to ( new string value ( " leaf " ) ) ; sky key top key = graph tester to sky key ( " top " ) ; tester get or create ( top key ) add dependency ( leaf key ) set has error ( true ) ; / / build top - - it has an error tester eval and get error ( / * keep going = * / true , top key ) ; / / invalidate top via leaf , and rebuild tester set ( leaf key , new string value ( " leaf 2 " ) ) ; tester invalidate ( ) ; tester eval and get error ( / * keep going = * / true , top key ) ; }


returns an iterator of the g tree nodes in the subtree of this node

public iterator < g tree node > iterator ( boolean depth first ) { if ( depth first ) { return new depth first iterator ( this ) ; } return new breadth first iterator ( this ) ; }


allows the caller to set tooltip text on the filter ' s search label this can be used to provide an indication as to exactly how the filter text field will filter the table

public void set tool tip text ( string text ) { search label set tool tip text ( text ) ; }


parses the architecture integer out of the given architecture string

private void parse architecture ( string architecture ) throws parse exception { try { arch = integer parse int ( architecture ) ; } catch ( number format exception e ) { throw new parse exception ( " failed to parse architecture : " + architecture , 0 ) ; } }


sets the signing lineage file used to sign the apk

public apk actions builder set signing lineage file ( artifact signing lineage ) { this signing lineage = signing lineage ; return this ; }


returns a serializable converter object that converts between strings and shorts using { @ link short # decode } and { @ link short # to string ( ) } the returned converter throws { @ link number format exception } if the input string is invalid < b > warning : < b > please see { @ link short # decode } to understand exactly how strings are parsed for example , the string { @ code " 0123 " } is treated as octal and converted to the value { @ code 83 }

public static converter < string , short > string converter ( ) { return short converter instance ; }


disconnect the { @ link channel } of the { @ link channel future } and notify the { @ link channel promise } once the operation was complete

void disconnect ( channel promise promise ) ;


if this is not the first element of the streaming , use the previous not - null name as the service name

private void set service name ( log data builder builder ) { if ( string util is empty ( service name ) & & string util is not empty ( builder get service ( ) ) ) { service name = builder get service ( ) ; } else if ( string util is not empty ( service name ) ) { builder set service ( service name ) ; } }


factory method for getting a request object based on api key id and a version

public static request and size parse request ( api keys api key , short api version , byte buffer buffer ) { int buffer size = buffer remaining ( ) ; return new request and size ( do parse request ( api key , api version , buffer ) , buffer size ) ; }


adds the given statistics to the dataset , as if the individual values used to compute the statistics had been added directly

public void add all ( stats accumulator values ) { if ( values count ( ) = = 0 ) { return ; } merge ( values count ( ) , values mean ( ) , values sum of squares of deltas ( ) , values min ( ) , values max ( ) ) ; }


the integer arg of port should fit in a 1 6bit unsigned value

@ test public void new builder with port too high is invalid ( ) { thrown expect ( illegal argument exception class ) ; thrown expect message ( " invalid port 65536 " ) ; endpoint new builder ( ) port ( 65536 ) build ( ) ; }


find and add to pkg names , all packages contained within the specified package

private static void find pkgs in path ( string class path , string pkg name , hash set < string > pkg names ) { / / make sure the class path is complete file cfile = new file ( class path ) ; string absolute path = cfile get absolute path ( ) ; if ( ! class path equals ( absolute path ) ) { class path = absolute path ; } if ( ! class path ends with ( file separator ) ) { / / append the separator so the substring works correctly / / below when we build the class name to pass to the loader class path = class path + file separator ; } string pkg path = pkg name ! = null ? pkg name replace ( ' ' , file separator char ) : " " ; class path + = pkg path ; string pkg prefix = pkg name ; if ( pkg name ! = null & & pkg name length ( ) > 0 ) { pkg prefix + = ' ' ; } file dir = new file ( class path ) ; string [ ] names = dir list ( ) ; if ( names = = null ) { return ; / / not a directory } for ( string name : names ) { file f = new file ( dir , name ) ; if ( f is directory ( ) ) { string sub pkg name = pkg prefix + f get name ( ) ; if ( ! pkg names contains ( sub pkg name ) ) { pkg names add ( sub pkg name ) ; } } } }


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


identifies all wait for xxx methods , which must be called while occupying the monitor

private static boolean is wait for ( method method ) { return method get name ( ) starts with ( " wait for " ) ; }


create a service instance level meter entity

public static meter entity new service instance ( string service name , string service instance ) { return new meter entity ( scope type service instance , service name , service instance , null ) ; }


specify a conversion service which will apply to every data binder

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


public abstract void set diagnostics ( string diagnostics ) ;


public static synchronized dummy clock use dummy clock ( long time stamp mills ) { instance = new dummy clock ( time stamp mills ) ; return ( dummy clock ) instance ; }


filter the request object for all routes created by this builder with the given request processing function filters are typically used to address cross - cutting concerns , such as logging , security , etc for instance , the following example creates a filter that logs the request before the handler function executes < pre class = " code " > router function & lt ; server response & gt ; filtered route = router functions route ( ) get ( " user " , this : : list users ) before ( request - > { log ( request ) ; return request ; } ) build ( ) ;

builder before ( function < server request , server request > request processor ) ;


public window wrap < t > current window ( ) { return current window ( time util current time millis ( ) ) ; }


sets the < code > capital camel < code > property

public capitalization capital camel ( string capital camel ) { this capital camel = capital camel ; return this ; }


outputs the merged result into the given output stream this method is only called once when no further file of the same name is available

void finish ( output stream out ) throws i o exception ;


@ t c description : nacos open a p i @ test step : @ expect result :

public void nacos open a p i query beta 1 ( ) { http rest result < string > result = null ; try { final string content = " test - beta " ; map < string , string > headers = new hash map < > ( ) ; headers put ( " beta ips " , " 127 0 0 1 " ) ; map < string , string > params = new hash map < > ( ) ; params put ( " data id " , data id ) ; params put ( " group " , group ) ; params put ( " content " , content ) ; result = agent http post ( config controller path + " / " , headers , params , agent get encode ( ) , time out ) ; assert assert equals ( http u r l connection http ok , result get code ( ) ) ; assert assert equals ( " true " , result get data ( ) ) ; params clear ( ) ; params put ( " data id " , data id ) ; params put ( " group " , group ) ; params put ( " beta " , " true " ) ; result = agent http get ( config controller path + " / " , null , params , agent get encode ( ) , time out ) ; assert assert equals ( http u r l connection http ok , result get code ( ) ) ; assert assert equals ( content , jackson utils to obj ( result get data ( ) ) get ( " data " ) get ( " content " ) text value ( ) ) ; / / delete data result = agent http delete ( config controller path + " / " , null , params , agent get encode ( ) , time out ) ; assert assert equals ( http u r l connection http ok , result get code ( ) ) ; } catch ( exception e ) { assert fail ( ) ; } }


creates { @ link mapped field type } from the provided < code > job < code > for simplicity all numbers are considered as longs

private map < string , mapped field type > create field types ( rollup job config job ) { map < string , mapped field type > field types = new hash map < > ( ) ; date formatter formatter = date formatter for pattern ( random date formatter pattern ( ) ) with locale ( locale root ) ; mapped field type field type = new date field mapper date field type ( job get group config ( ) get date histogram ( ) get field ( ) , formatter ) ; field types put ( field type name ( ) , field type ) ; if ( job get group config ( ) get histogram ( ) ! = null ) { for ( string field : job get group config ( ) get histogram ( ) get fields ( ) ) { mapped field type ft = new number field mapper builder ( field , number field mapper number type long , false , false ) build ( new content path ( 0 ) ) field type ( ) ; field types put ( ft name ( ) , ft ) ; } } if ( job get group config ( ) get terms ( ) ! = null ) { for ( string field : job get group config ( ) get terms ( ) get fields ( ) ) { mapped field type ft = new keyword field mapper builder ( field ) build ( new content path ( 0 ) ) field type ( ) ; field types put ( ft name ( ) , ft ) ; } } if ( job get metrics config ( ) ! = null ) { for ( metric config metric : job get metrics config ( ) ) { mapped field type ft = new number field mapper builder ( metric get field ( ) , number field mapper number type long , false , false ) build ( new content path ( 0 ) ) field type ( ) ; field types put ( ft name ( ) , ft ) ; } } return field types ; }


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


return a control message per an encoded status code

static control message mk message ( short encoded ) { for ( control message cm : control message values ( ) ) { if ( encoded = = cm code ) return cm ; } return null ; }


i o stream pair exec container ( container exec context ctx ) throws container execution exception ;


to test enum parameters to test enum parameters

public void test enum parameters ( list < string > enum header string array , string enum header string , list < string > enum query string array , string enum query string , integer enum query integer , double enum query double , list < string > enum form string array , string enum form string , handler < async result < void > > result handler ) { delegate test enum parameters ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string , result handler ) ; }


build a { @ linkplain supplier } that can be used to build " empty " buckets those buckets will then be { @ link # update bucket updated } for each collected bucket

abstract supplier < b > empty bucket builder ( long owning bucket ord ) ;


test the property ' sc a e t h flow points '

public void sc a e t h flow points test ( ) { / / todo : test sc a e t h flow points }


compares two vector registers , first by size ( descending ) and then by offset ( ascending )

private static int compare vector registers ( register reg 1 , register reg 2 ) { if ( ! ( reg 1 is vector register ( ) & & reg 2 is vector register ( ) ) ) { throw new illegal argument exception ( " compare vector registers can only be applied to vector registers ! " ) ; } / / want registers sorted in descending order of size int size comp = integer compare ( reg 2 get bit length ( ) , reg 1 get bit length ( ) ) ; if ( size comp ! = 0 ) { return size comp ; } / / want registers sorted in ascending order of offset return integer compare ( reg 1 get offset ( ) , reg 2 get offset ( ) ) ; }


performs the actual allocation for a reservation definition within a plan

protected boolean allocate user ( reservation id reservation id , string user , plan plan , reservation definition contract , reservation allocation old reservation ) throws planning exception , contract validation exception { / / adjust the resource definition to account for system " imperfections " / / ( e g , scheduling delays for large containers ) reservation definition adjusted contract = adjust contract ( plan , contract ) ; / / compute the job allocation r l e sparse resource allocation allocation = compute job allocation ( plan , reservation id , adjusted contract , user ) ; long period = long parse long ( contract get recurrence expression ( ) ) ; / / make allocation periodic if request is periodic if ( contract get recurrence expression ( ) ! = null ) { if ( period > 0 ) { allocation = new periodic r l e sparse resource allocation ( allocation , period ) ; } } / / if no job allocation was found , fail if ( allocation = = null ) { throw new planning exception ( " the planning algorithm could not find a valid allocation " + " for your request " ) ; } / / translate the allocation to a map ( with zero paddings ) long step = plan get step ( ) ; long job arrival = step round up ( adjusted contract get arrival ( ) , step ) ; long job deadline = step round up ( adjusted contract get deadline ( ) , step ) ; map < reservation interval , resource > map allocations = allocations to padded map ( allocation , job arrival , job deadline , period ) ; / / create the reservation reservation allocation cap reservation = new in memory reservation allocation ( reservation id , / / id adjusted contract , / / contract user , / / user name plan get queue name ( ) , / / queue name adjusted contract get arrival ( ) , adjusted contract get deadline ( ) , map allocations , / / allocations plan get resource calculator ( ) , / / resource calculator plan get minimum allocation ( ) ) ; / / minimum allocation / / add ( or update ) the reservation allocation if ( old reservation ! = null ) { return plan update reservation ( cap reservation ) ; } else { return plan add reservation ( cap reservation , false ) ; } }


the task runner passes in the options as system properties set the options if the setters haven ' t already been called

private synchronized void set options from system properties ( ) { if ( is cleanup = = null ) { string prop value = system get property ( iscleanup property , " false " ) ; is cleanup = boolean value of ( prop value ) ; } if ( task id = = null ) { task id = system get property ( taskid property ) ; } if ( max events = = null ) { string prop value = system get property ( logsize property , " 0 " ) ; set total log file size ( long parse long ( prop value ) ) ; } }


public principal peer principal ( ) { return principal ; }


public string get small camel ( ) { return small camel ; }


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

public void multiple tenant group put instance ( ) throws exception { string service name = random domain name ( ) ; naming 1 register instance ( service name , " 11 11 11 11 " , 80 ) ; naming 2 register instance ( service name , test group 2 , " 22 22 22 22 " , 80 ) ; time unit seconds sleep ( 5l ) ; response entity < string > response = request ( " / nacos / v 1 / ns / instance " , params new params ( ) append param ( " service name " , service name ) append param ( " group name " , test group 2 ) append param ( " ip " , " 22 22 22 22 " ) append param ( " port " , " 80 " ) append param ( " namespace id " , " namespace - 2 " ) append param ( " weight " , " 8 0 " ) done ( ) , string class , http method put ) ; assert assert true ( response get status code ( ) is 2xx successful ( ) ) ; response = request ( " / nacos / v 1 / ns / instance / list " , params new params ( ) append param ( " service name " , service name ) / / append param ( " namespace id " , " namespace - 2 " ) append param ( " group name " , test group 2 ) done ( ) , string class ) ; assert assert true ( response get status code ( ) is 2xx successful ( ) ) ; json node json = jackson utils to obj ( response get body ( ) ) ; assert assert equals ( 1 , json get ( " hosts " ) size ( ) ) ; assert assert equals ( " 8 0 " , json get ( " hosts " ) get ( 0 ) get ( " weight " ) as text ( ) ) ; }


forward seeks are supported , but not backwards ones forward seeks are implemented using read , so means that long - distance seeks will be ( literally ) expensive

public synchronized void seek ( long new pos ) throws i o exception { long current = get pos ( ) ; long distance = new pos - current ; if ( distance < 0 ) { throw unsupported ( seek unsupported + " backwards from " + current + " to " + new pos ) ; } if ( distance = = 0 ) { log debug ( " ignoring seek to current position " ) ; } else { / / the complicated one : forward seeking useful for split files log debug ( " forward seek by reading { } bytes " , distance ) ; long bytes skipped = 0 ; / / read byte - by - byte , hoping that buffering will compensate for this / / doing it this way ensures that the seek stops at exactly the right / / place skip ( len ) can return a smaller value , at which point / / it ' s not clear what to do while ( distance > 0 ) { int r = read ( ) ; if ( r = = - 1 ) { / / reached an eof too early throw new e o f exception ( " seek to " + new pos + " reached end of file at offset " + get pos ( ) ) ; } distance - - ; bytes skipped + + ; } / / read has finished stream statistics seek forwards ( bytes skipped , bytes skipped ) ; } }


creates a symbol with the given name at the specified address the symbol will be created in a name space with the name of the memory block that contains the address

public static symbol create symbol using memory block as namespace ( program program , address address , string name , source type source type ) throws duplicate name exception , invalid input exception { symbol table symbol table = program get symbol table ( ) ; memory memory = program get memory ( ) ; memory block block = memory get block ( address ) ; string namespace name = block get name ( ) ; namespace namespace = symbol table get namespace ( namespace name , program get global namespace ( ) ) ; if ( namespace = = null ) { namespace = symbol table create name space ( program get global namespace ( ) , namespace name , source type ) ; } return symbol table create label ( address , name , namespace , source type analysis ) ; }


test to verify that the copying of pinned block to a different destination datanode will throw i o exception with error code status error block pinned

public void test block replacement with pinned blocks ( ) throws exception { final configuration conf = new hdfs configuration ( ) ; / / create only one datanode in the cluster with disk and archive storage / / types cluster = new mini d f s cluster builder ( conf ) num data nodes ( 3 ) storage types ( new storage type [ ] { storage type disk , storage type archive } ) build ( ) ; try { cluster wait active ( ) ; final distributed file system dfs = cluster get file system ( ) ; string file name = " / test block replacement with pinned blocks / file " ; final path file = new path ( file name ) ; d f s test util create file ( dfs , file , 1024 , ( short ) 1 , 1024 ) ; located block lb = dfs get client ( ) get located blocks ( file name , 0 ) get ( 0 ) ; datanode info [ ] old nodes = lb get locations ( ) ; assert equals ( " wrong block locations " , old nodes length , 1 ) ; datanode info source = old nodes [ 0 ] ; extended block b = lb get block ( ) ; datanode info [ ] datanodes = dfs get data node stats ( ) ; datanode info destin = null ; for ( datanode info datanode info : datanodes ) { / / choose different destination node if ( ! old nodes [ 0 ] equals ( datanode info ) ) { destin = datanode info ; break ; } } assert not null ( " failed to choose destination datanode ! " , destin ) ; assert false ( " source and destin datanode should be different " , source equals ( destin ) ) ; / / mock fs dataset spi # get pinning to show that the block is pinned for ( int i = 0 ; i < cluster get data nodes ( ) size ( ) ; i + + ) { data node dn = cluster get data nodes ( ) get ( i ) ; log info ( " simulate block pinning in datanode " + dn ) ; internal data node test utils mock datanode blk pinning ( dn , true ) ; } / / block movement to a different datanode should fail as the block is / / pinned assert true ( " status code mismatches ! " , replace block ( b , source , source , destin , storage type archive , status error block pinned ) ) ; } finally { cluster shutdown ( ) ; } }


construct a serde object from separate serializer and deserializer

static public < t > serde < t > serde from ( final serializer < t > serializer , final deserializer < t > deserializer ) { if ( serializer = = null ) { throw new illegal argument exception ( " serializer must not be null " ) ; } if ( deserializer = = null ) { throw new illegal argument exception ( " deserializer must not be null " ) ; } return new wrapper serde < > ( serializer , deserializer ) ; } / * * a serde for nullable { @ code long }


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


whether this status code is in the http series { @ link org springframework http http status series # successful } this is a shortcut for checking the value of { @ link # series ( ) }

public boolean is 2xx successful ( ) { return ( series ( ) = = series successful ) ; }


records cache misses this should be called when a cache request returns a value that was not found in the cache

public void record misses ( @ non negative long count ) { if ( enabled ) { misses add ( count ) ; } }


a convenience method to determine if this transferable supports the given flavor

public boolean is data flavor supported ( data flavor flavor ) { data flavor [ ] flavors = transfer handler get supported data flavors ( selected data ) ; for ( data flavor f : flavors ) { if ( f equals ( flavor ) ) { return true ; } } return false ; }


parses an access control list handler response xml document from an input stream

public access control list handler parse access control list response ( input stream input stream ) throws i o exception { access control list handler handler = new access control list handler ( ) ; parse xml input stream ( handler , input stream ) ; return handler ; }


add an edge with the the default edge weight if an edge from and to the vertices specified by the edge already exists in the graph , then the edge weight in increased by the default value

public boolean add ( edge e ) { if ( ! allow loops & & ( e from ( ) = = e to ( ) ) ) return false ; edge [ ] ft = this get edges ( e from ( ) , e to ( ) ) ; if ( ft length = = 0 ) { return super add ( e ) ; } return this set weight ( ft [ 0 ] , this get weight ( ft [ 0 ] ) + this get default edge weight ( ) ) ; }


public api response < void > add pet with http info ( pet body ) throws api exception { okhttp 3 call local var call = add pet validate before call ( body , null ) ; return local var api client execute ( local var call ) ; }


public list < string > get array of string ( ) { return array of string ; }


if given volume id already exists in the volume manager , it returns the existing volume otherwise , it creates a new volume and add that to volume manager

private volume check and get volume ( volume meta data meta data ) throws invalid volume exception { volume to add = new volume impl ( meta data ) ; csi adaptor protocol adaptor = volume manager get adaptor by driver name ( meta data get driver name ( ) ) ; if ( adaptor = = null ) { throw new invalid volume exception ( " it seems for the driver name " + " specified in the volume " + meta data get driver name ( ) + " , there is no matched driver - adaptor can be found " + " is the driver probably registered ? please check if " + " adaptors service addresses defined in " + yarn configuration nm csi adaptor addresses + " are correct and services are started " ) ; } to add set client ( adaptor ) ; return this volume manager add or get volume ( to add ) ; }


reinterprets the given { @ link data stream } as a { @ link keyed stream } , which extracts keys with the given { @ link key selector } important : for every partition of the base stream , the keys of events in the base stream must be partitioned exactly in the same way as if it was created through a { @ link data stream # key by ( key selector ) }

public static < t , k > keyed stream < t , k > reinterpret as keyed stream ( data stream < t > stream , key selector < t , k > key selector , type information < k > type info ) { partition transformation < t > partition transformation = new partition transformation < > ( stream get transformation ( ) , new forward partitioner < > ( ) ) ; return new keyed stream < > ( stream , partition transformation , key selector , type info ) ; }


kills applications with the application id as app id

private int kill application ( string [ ] application ids ) throws yarn exception , i o exception { int return code = - 1 ; for ( string application id : application ids ) { try { kill application ( application id ) ; return code = 0 ; } catch ( application not found exception e ) { / / suppress all application not found exception for now continue ; } } return return code ; }


client receives a listener with listener address and mismatched port

public void lds response with listener address port mismatch ( ) { xds client watch listener data ( port , listener watcher ) ; stream observer < discovery response > response observer = response observers poll ( ) ; stream observer < discovery request > request observer = request observers poll ( ) ; / / client sends an lds request with null in lds resource name verify ( request observer ) on next ( eq ( build discovery request ( get node to verify ( ) , " " , resource type lds type url v 2 ( ) , " " ) ) ) ; assert that ( fake clock get pending tasks ( listener resource fetch timeout task filter ) ) has size ( 1 ) ; final filter chain filter chain outbound = build filter chain ( build filter chain match ( 8000 ) , null ) ; final filter chain filter chain inbound = build filter chain ( build filter chain match ( port , cidr range new builder ( ) set address prefix ( local ip ) set prefix len ( u int 3 2 value of ( 32 ) ) build ( ) ) , / / server is still speaking xds v 2 common tls context tests util build test downstream tls context v 2 ( " google - sds - config - default " , " rootca " ) , build test filter ( " envoy http connection manager " ) ) ; list < any > listeners = immutable list of ( any pack ( build listener v 2 ( " bar googleapis com " , any pack ( http connection manager new builder ( ) set route config ( build route configuration v 2 ( " route - bar googleapis com " , immutable list of ( build virtual host v 2 ( immutable list of ( " bar googleapis com " ) , " cluster - bar googleapis com " ) ) ) ) build ( ) ) ) ) , any pack ( build listener with filter chain ( listener name , 15002 , " 0 0 0 0 " , filter chain outbound , filter chain inbound ) ) ) ; discovery response response = build discovery response v 2 ( " 0 " , listeners , resource type lds type url v 2 ( ) , " 0000 " ) ; response observer on next ( response ) ; / / client sends an ack lds request verify ( request observer ) on next ( eq ( build discovery request ( get node to verify ( ) , " 0 " , resource type lds type url v 2 ( ) , " 0000 " ) ) ) ; verify ( listener watcher , never ( ) ) on listener changed ( any ( listener update class ) ) ; verify ( listener watcher , never ( ) ) on resource does not exist ( " : " + port ) ; verify ( listener watcher , never ( ) ) on error ( any ( status class ) ) ; fake clock forward time ( server xds client initial resource fetch timeout sec , time unit seconds ) ; verify ( listener watcher ) on resource does not exist ( " : " + port ) ; assert that ( fake clock get pending tasks ( listener resource fetch timeout task filter ) ) is empty ( ) ; }


sets the < code > username < code > property

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


register a listener that will be called when this model is bound to a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public generate default layout method next parent layout $ with layout on bind ( on model bound listener < generate default layout method next parent layout $ with layout , object > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


promotes the entry to the protected region ' s mru position , demoting an entry if necessary

private void on probation hit ( node node ) { node remove ( ) ; node status = status protected ; node append to tail ( head protected ) ; size protected + + ; demote protected ( ) ; }


optional : if specified , only support the specified cipher list otherwise default to the default cipher list supported by envoy < code > repeated string cipher suites = 9 ; < code >

public builder clear cipher suites ( ) { cipher suites = com google protobuf lazy string array list empty ; bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 8 ) ; on changed ( ) ; return this ; }


updates the state with the given service transition this method performs the main logic of service manager in the following steps update the { @ link # services by state ( ) } update the { @ link # startup timers } based on the new state queue listeners to run run the listeners ( outside of the lock )

void transition service ( final service service , state from , state to ) { check not null ( service ) ; check argument ( from ! = to ) ; monitor enter ( ) ; try { transitioned = true ; if ( ! ready ) { return ; } / / update state check state ( services by state remove ( from , service ) , " service % s not at the expected location in the state map % s " , service , from ) ; check state ( services by state put ( to , service ) , " service % s in the state map unexpectedly at % s " , service , to ) ; / / update the timer stopwatch stopwatch = startup timers get ( service ) ; if ( stopwatch = = null ) { / / this means the service was started by some means other than service manager start async stopwatch = stopwatch create started ( ) ; startup timers put ( service , stopwatch ) ; } if ( to compare to ( running ) > = 0 & & stopwatch is running ( ) ) { / / n b if we miss the starting event then we may never record a startup time stopwatch stop ( ) ; if ( ! ( service instanceof no op service ) ) { logger log ( level fine , " started { 0 } in { 1 } " , new object [ ] { service , stopwatch } ) ; } } / / queue our listeners / / did a service fail ? if ( to = = failed ) { enqueue failed event ( service ) ; } if ( states count ( running ) = = number of services ) { / / this means that the manager is currently healthy n b if other threads call is healthy / / they are not guaranteed to get ' true ' , because any service could fail right now enqueue healthy event ( ) ; } else if ( states count ( terminated ) + states count ( failed ) = = number of services ) { enqueue stopped event ( ) ; } } finally { monitor leave ( ) ; / / run our executors outside of the lock dispatch listener events ( ) ; } }


returns the prefix to use for the configuration of the chain depending if it is for a mapper or a reducer

protected static string get prefix ( boolean is map ) { return ( is map ) ? chain mapper : chain reducer ; }


returns true if non - functional build stamps are enabled

public boolean stamp binaries ( ) { return options stamp binaries ; }


registers an { @ link http request handler adapter } under a well - known name unless already registered

private static void register http request handler adapter ( parser context context , @ nullable object source ) { if ( ! context get registry ( ) contains bean definition ( http request handler adapter bean name ) ) { root bean definition adapter def = new root bean definition ( http request handler adapter class ) ; adapter def set source ( source ) ; adapter def set role ( bean definition role infrastructure ) ; context get registry ( ) register bean definition ( http request handler adapter bean name , adapter def ) ; context register component ( new bean component definition ( adapter def , http request handler adapter bean name ) ) ; } }


checks if a char sequence is not empty ( " " ) and not null

public static boolean is not empty ( final char sequence cs ) { return ! is empty ( cs ) ; }


customize the given { @ link http u r l connection } , obtained in the course of an { @ link # exists ( ) } , { @ link # content length ( ) } or { @ link # last modified ( ) } call sets request method " head " by default can be overridden in subclasses

protected void customize connection ( http u r l connection con ) throws i o exception { con set request method ( " head " ) ; }


< code > optional string name = 2 ; < code >

private void set name ( java lang string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 2 ; name = value ; }


return whether to use direct field access instead of bean property access

public boolean is direct field access ( ) { return this direct field access ; }


test whether this callback method is called with correct args

protected map < string , object > query properties ( map < string , object > model ) { assert that ( this expected model equals ( model ) ) as ( " map and model must be equal " ) is true ( ) ; this query properties called = true ; return super query properties ( model ) ; }