tests that with { @ link high availability mode # zookeeper } distributed j a rs are recoverable from any participating blob server when uploaded via a blob cache

public void test blob cache recovery ( ) throws exception { org apache flink configuration configuration config = new org apache flink configuration configuration ( ) ; config set string ( high availability options ha mode , " zookeeper " ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; config set string ( high availability options ha storage path , hdfs u r i ) ; blob store service blob store service = blob utils create blob store from config ( config ) ; try { blob cache recovery test test blob cache recovery ( config , blob store service ) ; } finally { blob store service close and cleanup all data ( ) ; } }


collect all partitioned paths , aggregate according to partition spec

static map < linked hash map < string , string > , list < path > > collect part spec to paths ( file system fs , list < path > task paths , int part col size ) { map < linked hash map < string , string > , list < path > > spec to paths = new hash map < > ( ) ; for ( path task path : task paths ) { search part spec and paths ( fs , task path , part col size ) for each ( tuple 2 - > spec to paths compute ( tuple 2 f 0 , ( spec , paths ) - > { paths = paths = = null ? new array list < > ( ) : paths ; paths add ( tuple 2 f 1 ) ; return paths ; } ) ) ; } return spec to paths ; }


gets the number of items currently in the adapter attached to this binder ( i e the number of items the underlying recycler view knows about )

public int get item count ( ) { return m internal adapter get item count ( ) ; }


creates a file system based storage location for a savepoint this methods implements the logic that decides which location to use ( given optional parameters for a configured location and a location passed for this specific savepoint ) and how to name and initialize the savepoint directory

public checkpoint storage location initialize location for savepoint ( @ suppress warnings ( " unused " ) long checkpoint id , @ nullable string external location pointer ) throws i o exception { / / determine where to write the savepoint to final path savepoint base path ; if ( external location pointer ! = null ) { savepoint base path = new path ( external location pointer ) ; } else if ( default savepoint directory ! = null ) { savepoint base path = default savepoint directory ; } else { throw new illegal argument exception ( " no savepoint location given and no default location configured " ) ; } / / generate the savepoint directory final file system fs = savepoint base path get file system ( ) ; final string prefix = " savepoint - " + job id to string ( ) substring ( 0 , 6 ) + ' - ' ; exception latest exception = null ; for ( int attempt = 0 ; attempt < 10 ; attempt + + ) { final path path = new path ( savepoint base path , file utils get random filename ( prefix ) ) ; try { if ( fs mkdirs ( path ) ) { / / we make the path qualified , to make it independent of default schemes and / / authorities final path qp = path make qualified ( fs ) ; return create savepoint location ( fs , qp ) ; } } catch ( exception e ) { latest exception = e ; } } throw new i o exception ( " failed to create savepoint directory at " + savepoint base path , latest exception ) ; }


public int get exit code ( ) { return code ; }


adds an encoding character to the encoded key value string - exact approx version

void metaph add exact approx ( string main exact , string alt exact , string main , string alt ) { if ( m encode exact ) { metaph add ( main exact , alt exact ) ; } else { metaph add ( main , alt ) ; } }


converts name to valid my s q l column name produced name must be used with backticks only , eg ` table name `

public string to table name ( string name ) { string identifier = to mysql identifier ( name , table name prefix , table name suffix ) ; if ( identifier naming convention equals ( " snake case " ) ) { identifier = underscore ( identifier ) ; } if ( identifier length ( ) > identifier max length ) { logger warn ( " table name cannot exceed 64 chars name ' " + name + " ' will be truncated " ) ; identifier = identifier substring ( 0 , identifier max length ) ; } return identifier ; }


constructs a mapping of configuration and includes all properties that start with the specified configuration prefix property names in the mapping are trimmed to remove the configuration prefix

public map < string , string > get props with prefix ( string conf prefix ) { properties props = get props ( ) ; enumeration e = props property names ( ) ; map < string , string > config map = new hash map < > ( ) ; string name = null ; while ( e has more elements ( ) ) { name = ( string ) e next element ( ) ; if ( name starts with ( conf prefix ) ) { string value = props get property ( name ) ; name = name substring ( conf prefix length ( ) ) ; config map put ( name , value ) ; } } return config map ; }


any comments associated with the element < code > optional string comment = 2 ; < code >

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


compares two objects with proper ( nested ) equality semantics this method supports all external and most internal conversion classes of the table ecosystem

static boolean deep equals row ( row kind kind 1 , @ nullable object [ ] field by position 1 , @ nullable map < string , object > field by name 1 , @ nullable linked hash map < string , integer > position by name 1 , row kind kind 2 , @ nullable object [ ] field by position 2 , @ nullable map < string , object > field by name 2 , @ nullable linked hash map < string , integer > position by name 2 ) { if ( kind 1 ! = kind 2 ) { return false ; } / / positioned = = positioned else if ( field by position 1 ! = null & & field by position 2 ! = null ) { / / position by name is not included return deep equals internal ( field by position 1 , field by position 2 ) ; } / / named = = named else if ( field by name 1 ! = null & & field by name 2 ! = null ) { return deep equals internal ( field by name 1 , field by name 2 ) ; } / / named positioned = = named else if ( position by name 1 ! = null & & field by name 2 ! = null ) { return deep equals named rows ( field by position 1 , position by name 1 , field by name 2 ) ; } / / named = = named positioned else if ( position by name 2 ! = null & & field by name 1 ! = null ) { return deep equals named rows ( field by position 2 , position by name 2 , field by name 1 ) ; } return false ; }


adds the entry at the tail of the bucket ' s list

void link ( node < k , v > sentinel , node < k , v > node ) { node set previous in variable order ( sentinel get previous in variable order ( ) ) ; node set next in variable order ( sentinel ) ; sentinel get previous in variable order ( ) set next in variable order ( node ) ; sentinel set previous in variable order ( node ) ; }


starts the fetcher after starting the fetcher , it can only be stopped by calling { @ link kinesis data fetcher # shutdown fetcher ( ) }

public void run fetcher ( ) throws exception { / / check that we are running before proceeding if ( ! running ) { return ; } this main thread = thread current thread ( ) ; / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / procedures before starting the infinite while loop : / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / 1 check that there is at least one shard in the subscribed streams to consume from ( can / / be done by / / checking if at least one value in subscribed streams to last discovered shard ids is not / / null ) boolean has shards = false ; string builder streams with no shards found = new string builder ( ) ; for ( map entry < string , string > stream to last discovered shard entry : subscribed streams to last discovered shard ids entry set ( ) ) { if ( stream to last discovered shard entry get value ( ) ! = null ) { has shards = true ; } else { streams with no shards found append ( stream to last discovered shard entry get key ( ) ) append ( " , " ) ; } } if ( streams with no shards found length ( ) ! = 0 & & log is warn enabled ( ) ) { log warn ( " subtask { } has failed to find any shards for the following subscribed streams : { } " , index of this consumer subtask , streams with no shards found to string ( ) ) ; } if ( ! has shards ) { throw new runtime exception ( " no shards can be found for all subscribed streams : " + streams ) ; } / / 2 start consuming any shard state we already have in the subscribed shard state up to / / this point ; the / / subscribed shard state may already be seeded with values due to step 1 , or explicitly / / added by the / / consumer using a restored state checkpoint for ( int seeded state index = 0 ; seeded state index < subscribed shards state size ( ) ; seeded state index + + ) { kinesis stream shard state seeded shard state = subscribed shards state get ( seeded state index ) ; / / only start a consuming thread if the seeded subscribed shard has not been completely / / read already if ( ! seeded shard state get last processed sequence num ( ) equals ( sentinel sequence number sentinel shard ending sequence num get ( ) ) ) { if ( log is info enabled ( ) ) { log info ( " subtask { } will start consuming seeded shard { } from sequence number { } with shard consumer { } " , index of this consumer subtask , seeded shard state get stream shard handle ( ) to string ( ) , seeded shard state get last processed sequence num ( ) , seeded state index ) ; } stream shard handle stream shard handle = subscribed shards state get ( seeded state index ) get stream shard handle ( ) ; kinesis deserialization schema < t > shard deserialization schema = get cloned deserialization schema ( ) ; shard deserialization schema open ( runtime context initialization context adapters deserialization adapter ( runtime context , / / ignore the provided metric group metric group - > consumer metric group add group ( " subtask id " , string value of ( index of this consumer subtask ) ) add group ( " shard id " , stream shard handle get shard ( ) get shard id ( ) ) add group ( " user " ) ) ) ; shard consumers executor submit ( create shard consumer ( seeded state index , stream shard handle , subscribed shards state get ( seeded state index ) get last processed sequence num ( ) , register shard metric group ( consumer metric group , subscribed shards state get ( seeded state index ) ) , shard deserialization schema ) ) ; } } / / start periodic watermark emitter , if a watermark assigner was configured if ( periodic watermark assigner ! = null ) { long periodic watermark interval millis = runtime context get execution config ( ) get auto watermark interval ( ) ; if ( periodic watermark interval millis > 0 ) { processing time service timer service = ( ( streaming runtime context ) runtime context ) get processing time service ( ) ; log info ( " starting periodic watermark emitter with interval { } " , periodic watermark interval millis ) ; new periodic watermark emitter ( timer service , periodic watermark interval millis ) start ( ) ; if ( watermark tracker ! = null ) { / / setup global watermark tracking long watermark sync millis = long parse long ( get consumer configuration ( ) get property ( consumer config constants watermark sync millis , long to string ( consumer config constants default watermark sync millis ) ) ) ; watermark tracker set update timeout millis ( watermark sync millis * 3 ) ; / / synchronization latency watermark tracker open ( runtime context ) ; new watermark sync callback ( timer service , watermark sync millis ) start ( ) ; / / emit records ahead of watermark to offset synchronization latency long lookahead millis = long parse long ( get consumer configuration ( ) get property ( consumer config constants watermark lookahead millis , long to string ( 0 ) ) ) ; record emitter set max lookahead millis ( math max ( lookahead millis , watermark sync millis * 3 ) ) ; / / record emitter depends on periodic watermark / / it runs in a separate thread since main thread is used for discovery runnable record emitter runnable = new runnable ( ) { @ override public void run ( ) { try { record emitter run ( ) ; } catch ( throwable error ) { / / report the error that terminated the emitter loop to / / source thread stop with error ( error ) ; } } } ; thread thread = new thread ( record emitter runnable ) ; thread set name ( " record emitter - " + runtime context get task name with subtasks ( ) ) ; thread set daemon ( true ) ; thread start ( ) ; } } this shard idle interval millis = long parse long ( get consumer configuration ( ) get property ( consumer config constants shard idle interval millis , long to string ( consumer config constants default shard idle interval millis ) ) ) ; } / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / finally , start the infinite shard discovery and consumer launching loop ; / / we will escape from this loop only when shutdown fetcher ( ) or stop with error ( ) is called / / todo : have this thread emit the records for tracking backpressure final long discovery interval millis = long parse long ( config props get property ( consumer config constants shard discovery interval millis , long to string ( consumer config constants default shard discovery interval millis ) ) ) ; if ( this number of active shards get ( ) = = 0 ) { log info ( " subtask { } has no active shards to read on startup ; marking the subtask as temporarily idle " , index of this consumer subtask ) ; source context mark as temporarily idle ( ) ; } while ( running ) { if ( log is debug enabled ( ) ) { log debug ( " subtask { } is trying to discover new shards that were created due to resharding " , index of this consumer subtask ) ; } list < stream shard handle > new shards due to resharding = discover new shards to subscribe ( ) ; for ( stream shard handle shard : new shards due to resharding ) { / / since there may be delay in discovering a new shard , all new shards due to / / resharding should be read starting from the earliest record possible kinesis stream shard state new shard state = new kinesis stream shard state ( convert to stream shard metadata ( shard ) , shard , sentinel sequence number sentinel earliest sequence num get ( ) ) ; int new state index = register new subscribed shard state ( new shard state ) ; if ( log is info enabled ( ) ) { log info ( " subtask { } has discovered a new shard { } due to resharding , and will start consuming " + " the shard from sequence number { } with shard consumer { } " , index of this consumer subtask , new shard state get stream shard handle ( ) to string ( ) , new shard state get last processed sequence num ( ) , new state index ) ; } stream shard handle stream shard handle = new shard state get stream shard handle ( ) ; kinesis deserialization schema < t > shard deserialization schema = get cloned deserialization schema ( ) ; shard deserialization schema open ( runtime context initialization context adapters deserialization adapter ( runtime context , / / ignore the provided metric group metric group - > consumer metric group add group ( " subtask id " , string value of ( index of this consumer subtask ) ) add group ( " shard id " , stream shard handle get shard ( ) get shard id ( ) ) add group ( " user " ) ) ) ; shard consumers executor submit ( create shard consumer ( new state index , new shard state get stream shard handle ( ) , new shard state get last processed sequence num ( ) , register shard metric group ( consumer metric group , new shard state ) , shard deserialization schema ) ) ; } / / we also check if we are running here so that we won ' t start the discovery sleep / / interval if the running flag was set to false during the middle of the while loop if ( running & & discovery interval millis ! = 0 ) { try { thread sleep ( discovery interval millis ) ; } catch ( interrupted exception iex ) { / / the sleep may be interrupted by shutdown fetcher ( ) } } } / / make sure all resources have been terminated before leaving try { await termination ( ) ; } catch ( interrupted exception ie ) { / / if there is an original exception , preserve it , since that ' s more important / useful this error compare and set ( null , ie ) ; } / / any error thrown in the shard consumer threads will be thrown to the main thread throwable throwable = this error get ( ) ; if ( throwable ! = null ) { if ( throwable instanceof exception ) { throw ( exception ) throwable ; } else if ( throwable instanceof error ) { throw ( error ) throwable ; } else { throw new exception ( throwable ) ; } } }


rebuilds the label - to - index mapping after a { @ code shrink to fit ( ) } note : this assumes that the labels that are in the list are the same , although the indicies may have changed

private void rebuild label to index ( ) { int sz items = size ( ) ; for ( int i = 0 ; i < sz items ; i + + ) { labeled item li = ( labeled item ) get 0 ( i ) ; if ( li ! = null ) { label to index set ( li get label ( ) , i ) ; } } }


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


creates a projection list that removes given columns < b > note : < b > resulting expression are still unresolved

static list < expression > drop fields ( list < string > input fields , list < expression > drop expressions ) { set < string > columns to drop = drop expressions stream ( ) map ( expr - > expr accept ( drop columns extractor ) ) collect ( collectors to set ( ) ) ; columns to drop for each ( c - > { if ( ! input fields contains ( c ) ) { throw new validation exception ( format ( " field % s does not exist in source table " , c ) ) ; } } ) ; return input fields stream ( ) filter ( old name - > ! columns to drop contains ( old name ) ) map ( api expression utils : : unresolved ref ) collect ( collectors to list ( ) ) ; }


return < code > shutdown hook manager < code > singleton

public static shutdown hook manager get ( ) { return mgr ; }


creates a { @ link extension file filter } in a varargs friendly way

public static extension file filter for extensions ( string description , string exts ) { extension file filter eff = new extension file filter ( exts , description ) ; return eff ; }


a timeout value in case the master has not been discovered yet or disconnected

public final request master node timeout ( time value timeout ) { this master node timeout = timeout ; return ( request ) this ; }


subclasses can override this if they want to return a specific commons pool they should apply any configuration properties to the pool here default is a generic object pool instance with the given pool size

protected object pool create object pool ( ) { generic object pool config config = new generic object pool config ( ) ; config set max total ( get max size ( ) ) ; config set max idle ( get max idle ( ) ) ; config set min idle ( get min idle ( ) ) ; config set max wait millis ( get max wait ( ) ) ; config set time between eviction runs millis ( get time between eviction runs millis ( ) ) ; config set min evictable idle time millis ( get min evictable idle time millis ( ) ) ; config set block when exhausted ( is block when exhausted ( ) ) ; return new generic object pool ( this , config ) ; }


refresh the plugins in the ghidra project window based on what is contained in the given xml element

private void refresh ( tool template tc ) { listeners = weak data structure factory create copy on write weak set ( ) ; list < plugin > list = get managed plugins ( ) ; list remove ( plugin ) ; plugin [ ] plugins = new plugin [ list size ( ) ] ; plugins = list to array ( plugins ) ; remove plugins ( plugins ) ; element root = tc save to xml ( ) ; element elem = root get child ( " tool " ) ; restore options from xml ( elem ) ; try { restore plugins from xml ( elem ) ; } catch ( plugin exception e ) { msg show error ( this , get tool frame ( ) , " error restoring front - end plugins " , e get message ( ) , e ) ; } win mgr restore from x m l ( tc get tool element ( ) ) ; set config changed ( false ) ; }


creates cpp pic compile action builder from the given builder by adding necessary copt and changing output and dotd file names

private cpp compile action builder copy as pic builder ( cpp compile action builder builder , string output name , artifact category output category ) throws rule error exception { cpp compile action builder pic builder = new cpp compile action builder ( builder ) ; pic builder set pic mode ( true ) set outputs ( action construction context , rule error consumer , label , output category , output name ) ; return pic builder ; }


< code > optional second msg blah = 2 ; < code >

public builder clear blah ( ) { if ( blah builder = = null ) { blah = second msg get default instance ( ) ; on changed ( ) ; } else { blah builder clear ( ) ; } bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 2 ) ; return this ; }


void setup ( configuration job conf ) { string prefix = get prefix ( is map ) ; int index = job conf get int ( prefix + chain mapper size , 0 ) ; for ( int i = 0 ; i < index ; i + + ) { class < ? extends mapper > klass = job conf get class ( prefix + chain mapper class + i , null , mapper class ) ; configuration m conf = get chain element conf ( job conf , prefix + chain mapper config + i ) ; conf list add ( m conf ) ; mapper mapper = reflection utils new instance ( klass , m conf ) ; mappers add ( mapper ) ; } class < ? extends reducer > klass = job conf get class ( prefix + chain reducer class , null , reducer class ) ; if ( klass ! = null ) { r conf = get chain element conf ( job conf , prefix + chain reducer config ) ; reducer = reflection utils new instance ( klass , r conf ) ; } }


ignore bundle progress if flink metric container is null the flink metric container will be set to null if metric is configured to be turned off

private bundle progress handler get progress handler ( flink metric container flink metric container ) { if ( flink metric container = = null ) { return bundle progress handler ignored ( ) ; } else { return new bundle progress handler ( ) { @ override public void on progress ( beam fn api process bundle progress response progress ) { flink metric container update metrics ( task name , progress get monitoring infos list ( ) ) ; } @ override public void on completed ( beam fn api process bundle response response ) { flink metric container update metrics ( task name , response get monitoring infos list ( ) ) ; } } ; } }


breaks specified label into array of lines

protected void new label ( string label ) { if ( label = = null ) { label = " no label given for this dialog \ n this was likely due to an " + " exception with no message from the line of code below : \ n \ n " + get caller string ( ) ; msg debug ( label , label , new throwable ( ) ) ; } string tokenizer t = new string tokenizer ( label , " \ n " ) ; num lines = t count tokens ( ) ; lines = new string [ num lines ] ; line widths = new int [ num lines ] ; for ( int i = 0 ; i < num lines ; i + + ) { lines [ i ] = t next token ( ) ; } }


public string cluster alias ( ) { return cluster alias ; }


creates a new blocking - style stub that supports unary and streaming output calls on the service

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


set whether to include the probability distribution of each character in the results

public string stats aggregation builder show distribution ( boolean show distribution ) { this show distribution = show distribution ; return this ; }


convenience method to dispatch to converters for individual message types

private object convert to object ( message message , java type target java type ) throws j m s exception , i o exception { if ( message instanceof text message ) { return convert from text message ( ( text message ) message , target java type ) ; } else if ( message instanceof bytes message ) { return convert from bytes message ( ( bytes message ) message , target java type ) ; } else { return convert from message ( message , target java type ) ; } }


adds an entry to the program tree for this mach - o

public void add to program tree ( dyld cache macho info next ) throws exception { program fragment fragment = listing get default root module ( ) create fragment ( path ) ; if ( next ! = null ) { fragment move ( header addr , next header addr subtract ( 1 ) ) ; } else { / / this is the last mach - o , so we ' ll assume it ends where the mapping that contains / / it ends for ( dyld cache mapping info mapping info : dyld cache header get mapping infos ( ) ) { address mapping addr = space get address ( mapping info get address ( ) ) ; if ( header addr compare to ( mapping addr ) > = 0 & & header addr compare to ( mapping addr add ( mapping info get size ( ) - 1 ) ) < = 0 ) { fragment move ( header addr , mapping addr add ( mapping info get size ( ) - 1 ) ) ; } } } }


stop this connector this method does not block , it only triggers shutdown use # { @ link # await shutdown } to block until completion

public synchronized void shutdown ( ) { log info ( " scheduled shutdown for { } " , this ) ; stopping = true ; notify ( ) ; }


convert a { @ code collection } into a delimited { @ code string } ( e g csv ) useful for { @ code to string ( ) } implementations

public static string collection to delimited string ( @ nullable collection < ? > coll , string delim ) { return collection to delimited string ( coll , delim , " " , " " ) ; }


constructs and returns a quota filter that matches all provided components matching entities with entity types that are not specified by a component will not be included in the result

public static client quota filter contains only ( collection < client quota filter component > components ) { return new client quota filter ( components , true ) ; }


test the property ' array array of model '

public void array array of model test ( ) { / / todo : test array array of model }


< code > optional int 3 2 blah = 1 ; < code >


for cases where an array of this type exists , get the array value as a string when data corresponds to character data it should generally be expressed as a string a null value is returned if not supported or memory is uninitialized

public default string get array string ( mem buffer buf , settings settings , int length ) { if ( has string value ( settings ) & & buf is initialized memory ( ) ) { return new string data instance ( this , settings , buf , length , true ) get string value ( ) ; } return null ; }


public chunk get ( int index ) { if ( index > = 0 & & index < chunks size ( ) ) { return chunks get ( index ) ; } return null ; }


start the multipart upload process retry policy : retrying , translated

string initiate multi part upload ( string dest key ) throws i o exception ;


process the result of the asynchronous call

void process result ( int rc , string path , object ctx , string name , stat stat ) ;


public void test replace value 2 null pointer exception ( ) { concurrent map c = map ( ) ; try { c replace ( " whatever " , null , " a " ) ; should throw ( ) ; } catch ( null pointer exception success ) { } }


public string insn arg string ( dalv insn insn ) { return branch string ( insn ) ; }


this thread will receive packets from the peer and process them and also listen to new connections from new peers

public void run ( ) { try { learner master add learner handler ( this ) ; tick of next ack deadline = learner master get tick of initial ack deadline ( ) ; ia = binary input archive get archive ( buffered input ) ; buffered output = new buffered output stream ( sock get output stream ( ) ) ; oa = binary output archive get archive ( buffered output ) ; quorum packet qp = new quorum packet ( ) ; ia read record ( qp , " packet " ) ; message tracker track received ( qp get type ( ) ) ; if ( qp get type ( ) ! = leader followerinfo & & qp get type ( ) ! = leader observerinfo ) { log error ( " first packet { } is not followerinfo or observerinfo ! " , qp to string ( ) ) ; return ; } if ( learner master instanceof observer master & & qp get type ( ) ! = leader observerinfo ) { throw new i o exception ( " non observer attempting to connect to observer master type = " + qp get type ( ) ) ; } byte [ ] learner info data = qp get data ( ) ; if ( learner info data ! = null ) { byte buffer bbsid = byte buffer wrap ( learner info data ) ; if ( learner info data length > = 8 ) { this sid = bbsid get long ( ) ; } if ( learner info data length > = 12 ) { this version = bbsid get int ( ) ; / / protocol version } if ( learner info data length > = 20 ) { long config version = bbsid get long ( ) ; if ( config version > learner master get quorum verifier version ( ) ) { throw new i o exception ( " follower is ahead of the leader ( has a later activated configuration ) " ) ; } } } else { this sid = learner master get and decrement follower counter ( ) ; } string follower info = learner master get peer info ( this sid ) ; if ( follower info is empty ( ) ) { log info ( " follower sid : { } not in the current config { } " , this sid , long to hex string ( learner master get quorum verifier version ( ) ) ) ; } else { log info ( " follower sid : { } : info : { } " , this sid , follower info ) ; } if ( qp get type ( ) = = leader observerinfo ) { learner type = learner type observer ; } learner master register learner handler bean ( this , sock ) ; long last accepted epoch = zxid utils get epoch from zxid ( qp get zxid ( ) ) ; long peer last zxid ; state summary ss = null ; long zxid = qp get zxid ( ) ; long new epoch = learner master get epoch to propose ( this get sid ( ) , last accepted epoch ) ; long new leader zxid = zxid utils make zxid ( new epoch , 0 ) ; if ( this get version ( ) < 0x 1 0 0 0 0 ) { / / we are going to have to extrapolate the epoch information long epoch = zxid utils get epoch from zxid ( zxid ) ; ss = new state summary ( epoch , zxid ) ; / / fake the message learner master wait for epoch ack ( this get sid ( ) , ss ) ; } else { byte [ ] ver = new byte [ 4 ] ; byte buffer wrap ( ver ) put int ( 0x 1 0 0 0 0 ) ; quorum packet new epoch packet = new quorum packet ( leader leaderinfo , new leader zxid , ver , null ) ; oa write record ( new epoch packet , " packet " ) ; message tracker track sent ( leader leaderinfo ) ; buffered output flush ( ) ; quorum packet ack epoch packet = new quorum packet ( ) ; ia read record ( ack epoch packet , " packet " ) ; message tracker track received ( ack epoch packet get type ( ) ) ; if ( ack epoch packet get type ( ) ! = leader ackepoch ) { log error ( " { } is not ackepoch " , ack epoch packet to string ( ) ) ; return ; } byte buffer bbepoch = byte buffer wrap ( ack epoch packet get data ( ) ) ; ss = new state summary ( bbepoch get int ( ) , ack epoch packet get zxid ( ) ) ; learner master wait for epoch ack ( this get sid ( ) , ss ) ; } peer last zxid = ss get last zxid ( ) ; / / take any necessary action if we need to send trunc or diff / / start forwarding ( ) will be called in all cases boolean need snap = sync follower ( peer last zxid , learner master ) ; / / syncs between followers and the leader are exempt from throttling because it / / is importatnt to keep the state of quorum servers up - to - date the exempted syncs / / are counted as concurrent syncs though boolean exempt from throttle = get learner type ( ) ! = learner type observer ; / * if we are not truncating or sending a diff just send a snapshot * / if ( need snap ) { sync throttler = learner master get learner snap sync throttler ( ) ; sync throttler begin sync ( exempt from throttle ) ; server metrics get metrics ( ) inflight snap count add ( sync throttler get sync in progress ( ) ) ; try { long zxid to send = learner master get z k database ( ) get data tree last processed zxid ( ) ; oa write record ( new quorum packet ( leader snap , zxid to send , null , null ) , " packet " ) ; message tracker track sent ( leader snap ) ; buffered output flush ( ) ; log info ( " sending snapshot last zxid of peer is 0x { } , zxid of leader is 0x { } , " + " send zxid of db as 0x { } , { } concurrent snapshot sync , " + " snapshot sync was { } from throttle " , long to hex string ( peer last zxid ) , long to hex string ( leader last zxid ) , long to hex string ( zxid to send ) , sync throttler get sync in progress ( ) , exempt from throttle ? " exempt " : " not exempt " ) ; / / dump data to peer learner master get z k database ( ) serialize snapshot ( oa ) ; oa write string ( " ben was here " , " signature " ) ; buffered output flush ( ) ; } finally { server metrics get metrics ( ) snap count add ( 1 ) ; } } else { sync throttler = learner master get learner diff sync throttler ( ) ; sync throttler begin sync ( exempt from throttle ) ; server metrics get metrics ( ) inflight diff count add ( sync throttler get sync in progress ( ) ) ; server metrics get metrics ( ) diff count add ( 1 ) ; } log debug ( " sending newleader message to { } " , sid ) ; / / the version of this quorum verifier will be set by leader lead ( ) in case / / the leader is just being established wait for epoch ack makes sure that ready to start is true if / / we got here , so the version was set if ( get version ( ) < 0x 1 0 0 0 0 ) { quorum packet new leader q p = new quorum packet ( leader newleader , new leader zxid , null , null ) ; oa write record ( new leader q p , " packet " ) ; } else { quorum packet new leader q p = new quorum packet ( leader newleader , new leader zxid , learner master get quorum verifier bytes ( ) , null ) ; queued packets add ( new leader q p ) ; } buffered output flush ( ) ; / / start thread that blast packets in the queue to learner start sending packets ( ) ; / * * have to wait for the first ack , wait until * the learner master is ready , and only then we can * start processing messages * / qp = new quorum packet ( ) ; ia read record ( qp , " packet " ) ; message tracker track received ( qp get type ( ) ) ; if ( qp get type ( ) ! = leader ack ) { log error ( " next packet was supposed to be an ack , but received packet : { } " , packet to string ( qp ) ) ; return ; } log debug ( " received newleader - ack message from { } " , sid ) ; learner master wait for new leader ack ( get sid ( ) , qp get zxid ( ) ) ; sync limit check start ( ) ; / / sync ends when newleader - ack is received sync throttler end sync ( ) ; if ( need snap ) { server metrics get metrics ( ) inflight snap count add ( sync throttler get sync in progress ( ) ) ; } else { server metrics get metrics ( ) inflight diff count add ( sync throttler get sync in progress ( ) ) ; } sync throttler = null ; / / now that the ack has been processed expect the sync limit sock set so timeout ( learner master sync timeout ( ) ) ; / * * wait until learner master starts up * / learner master wait for startup ( ) ; / / mutation packets will be queued during the serialize , / / so we need to mark when the peer can actually start / / using the data / / log debug ( " sending uptodate message to { } " , sid ) ; queued packets add ( new quorum packet ( leader uptodate , - 1 , null , null ) ) ; while ( true ) { qp = new quorum packet ( ) ; ia read record ( qp , " packet " ) ; message tracker track received ( qp get type ( ) ) ; long trace mask = zoo trace server packet trace mask ; if ( qp get type ( ) = = leader ping ) { trace mask = zoo trace server ping trace mask ; } if ( log is trace enabled ( ) ) { zoo trace log quorum packet ( log , trace mask , ' i ' , qp ) ; } tick of next ack deadline = learner master get tick of next ack deadline ( ) ; packets received increment and get ( ) ; byte buffer bb ; long session id ; int cxid ; int type ; switch ( qp get type ( ) ) { case leader ack : if ( this learner type = = learner type observer ) { log debug ( " received ack from observer { } " , this sid ) ; } sync limit check update ack ( qp get zxid ( ) ) ; learner master process ack ( this sid , qp get zxid ( ) , sock get local socket address ( ) ) ; break ; case leader ping : / / process the touches byte array input stream bis = new byte array input stream ( qp get data ( ) ) ; data input stream dis = new data input stream ( bis ) ; while ( dis available ( ) > 0 ) { long sess = dis read long ( ) ; int to = dis read int ( ) ; learner master touch ( sess , to ) ; } break ; case leader revalidate : server metrics get metrics ( ) revalidate count add ( 1 ) ; learner master revalidate session ( qp , this ) ; break ; case leader request : bb = byte buffer wrap ( qp get data ( ) ) ; session id = bb get long ( ) ; cxid = bb get int ( ) ; type = bb get int ( ) ; bb = bb slice ( ) ; request si ; if ( type = = op code sync ) { si = new learner sync request ( this , session id , cxid , type , bb , qp get authinfo ( ) ) ; } else { si = new request ( null , session id , cxid , type , bb , qp get authinfo ( ) ) ; } si set owner ( this ) ; learner master submit learner request ( si ) ; requests received increment and get ( ) ; break ; default : log warn ( " unexpected quorum packet , type : { } " , packet to string ( qp ) ) ; break ; } } } catch ( i o exception e ) { log error ( " unexpected exception in learner handler : " , e ) ; close socket ( ) ; } catch ( interrupted exception e ) { log error ( " unexpected exception in learner handler " , e ) ; } catch ( sync throttle exception e ) { log error ( " too many concurrent sync " , e ) ; sync throttler = null ; } catch ( exception e ) { log error ( " unexpected exception in learner handler " , e ) ; throw e ; } finally { if ( sync throttler ! = null ) { sync throttler end sync ( ) ; sync throttler = null ; } string remote addr = get remote address ( ) ; log warn ( " * * * * * * * goodbye { } * * * * * * * * " , remote addr ) ; message tracker dump to log ( remote addr ) ; shutdown ( ) ; } }


verify that hex data entered into the manual input field is processed properly note , all bytes must be input in hex format

public void test manual insert ( ) { load bytes ( " 8d 45 08 50 " ) ; instruction table = dialog get table panel ( ) get table ( ) ; preview table = dialog get preview table panel ( ) get table ( ) ; assert equals ( 2 , dialog get search data ( ) get instructions ( ) size ( ) ) ; assert equals ( 2 , instruction table get row count ( ) ) ; assert equals ( 3 , instruction table get column count ( ) ) ; instruction table data object obj 0 0 = ( instruction table data object ) instruction table get model ( ) get value at ( 0 , 0 ) ; instruction table data object obj 1 0 = ( instruction table data object ) instruction table get model ( ) get value at ( 1 , 0 ) ; instruction table data object obj 0 1 = ( instruction table data object ) instruction table get model ( ) get value at ( 0 , 1 ) ; instruction table data object obj 1 1 = ( instruction table data object ) instruction table get model ( ) get value at ( 1 , 1 ) ; instruction table data object obj 0 2 = ( instruction table data object ) instruction table get model ( ) get value at ( 0 , 2 ) ; assert equals ( " lea " , obj 0 0 get data ( ) ) ; assert equals ( " push " , obj 1 0 get data ( ) ) ; assert equals ( " eax " , obj 0 1 get data ( ) ) ; assert equals ( " eax " , obj 1 1 get data ( ) ) ; assert equals ( " [ ebp + 0x 8 ] " , obj 0 2 get data ( ) ) ; }


public boolean contains value ( object value ) { return false ; }


returns dividend % divisor , where the dividend and divisor are treated as unsigned 32 - bit quantities < b > java 8 users : < b > use { @ link integer # remainder unsigned ( int , int ) } instead

public static int remainder ( int dividend , int divisor ) { return ( int ) ( to long ( dividend ) % to long ( divisor ) ) ; }


returns true if ' options remote cache ' uses ' grpc ' or an empty scheme

public static boolean is remote cache options ( remote options options ) { if ( is null or empty ( options remote cache ) ) { return false ; } / / todo ( ishikhman ) : add proper uri validation / parsing for remote options return ! ( ascii to lower case ( options remote cache ) starts with ( " http : / / " ) | | ascii to lower case ( options remote cache ) starts with ( " https : / / " ) ) ; }


returns true if this parser is liberal in what it accepts

public final boolean is lenient ( ) { return lenient ; }


creates a heartbeat manager which actively sends heartbeats to monitoring targets

public < i , o > heartbeat manager < i , o > create heartbeat manager sender ( resource i d resource id , heartbeat listener < i , o > heartbeat listener , scheduled executor main thread executor , logger log ) { return new heartbeat manager sender impl < > ( heartbeat interval , heartbeat timeout , resource id , heartbeat listener , main thread executor , log ) ; }


public int get max row ( ) { return max row ; }


the total number of executors that are currently on - line

public int get online executors ( ) { return online executors ; }


initializes the input format implementation and configuration

private void init input format ( ) { class loader user code class loader = get user code class loader ( ) ; / / obtain task configuration ( including stub parameters ) configuration task conf = get task configuration ( ) ; this config = new task config ( task conf ) ; final pair < operator i d , input format < ot , input split > > operator id and input format ; input output format container format container = new input output format container ( config , user code class loader ) ; try { operator id and input format = format container get unique input format ( ) ; this format = operator id and input format get value ( ) ; / / check if the class is a subclass , if the check is required if ( ! input format class is assignable from ( this format get class ( ) ) ) { throw new runtime exception ( " the class ' " + this format get class ( ) get name ( ) + " ' is not a subclass of ' " + input format class get name ( ) + " ' as is required " ) ; } } catch ( class cast exception ccex ) { throw new runtime exception ( " the stub class is not a proper subclass of " + input format class get name ( ) , ccex ) ; } thread thread = thread current thread ( ) ; class loader original = thread get context class loader ( ) ; / / configure the stub catch exceptions here extra , to report them as originating from the / / user code try { thread set context class loader ( user code class loader ) ; this format configure ( format container get parameters ( operator id and input format get key ( ) ) ) ; } catch ( throwable t ) { throw new runtime exception ( " the user defined ' configure ( ) ' method caused an error : " + t get message ( ) , t ) ; } finally { thread set context class loader ( original ) ; } / / get the factory for the type serializer this serializer factory = this config get output serializer ( user code class loader ) ; }


public integer get snake case ( ) { return snake case ; }


see { @ link recycler binder # insert item at ( int , render info ) }

public final void insert item at ( int position , component component ) { insert item at ( position , component render info create ( ) component ( component ) build ( ) ) ; }


the interface used by clients to obtain a new { @ link application id } for submitting new applications the < code > resource manager < code > responds with a new , monotonically increasing , { @ link application id } which is used by the client to submit a new application the < code > resource manager < code > also responds with details such as maximum resource capabilities in the cluster as specified in { @ link get new application response }

public get new application response get new application ( get new application request request ) throws yarn exception , i o exception ;


public boolean remove ( @ non null final string key ) { disk cache manager disk cache manager = get disk cache manager ( ) ; if ( disk cache manager = = null ) return true ; return disk cache manager remove by key ( type byte + key ) & & disk cache manager remove by key ( type string + key ) & & disk cache manager remove by key ( type json object + key ) & & disk cache manager remove by key ( type json array + key ) & & disk cache manager remove by key ( type bitmap + key ) & & disk cache manager remove by key ( type drawable + key ) & & disk cache manager remove by key ( type parcelable + key ) & & disk cache manager remove by key ( type serializable + key ) ; }


tests that the method { @ code put edge } will silently add the missing nodes to the graph , then add the edge connecting them we are not using the proxy methods here as we want to test { @ code put edge } when the end - points are not elements of the graph

public void put edge nodes not in graph ( ) { assume ( ) that ( graph is mutable ( ) ) is true ( ) ; graph as mutable graph add node ( n1 ) ; assert true ( graph as mutable graph put edge ( n1 , n5 ) ) ; assert true ( graph as mutable graph put edge ( n4 , n1 ) ) ; assert true ( graph as mutable graph put edge ( n2 , n3 ) ) ; assert that ( graph nodes ( ) ) contains exactly ( n1 , n5 , n4 , n2 , n3 ) in order ( ) ; assert that ( graph adjacent nodes ( n1 ) ) contains exactly ( n4 , n5 ) ; assert that ( graph adjacent nodes ( n2 ) ) contains exactly ( n3 ) ; assert that ( graph adjacent nodes ( n3 ) ) contains exactly ( n2 ) ; assert that ( graph adjacent nodes ( n4 ) ) contains exactly ( n1 ) ; assert that ( graph adjacent nodes ( n5 ) ) contains exactly ( n1 ) ; }


public mutable gauge int new gauge ( string name , string desc , int i val ) { return new gauge ( interns info ( name , desc ) , i val ) ; }


static < t , r > r execute ( t t , throwable function < t , r > function ) { return function execute ( t ) ; }


public int read bits ( int num bits ) { int temp byte offset = byte offset ; int bits read = min ( num bits , 8 - bit offset ) ; int return value = ( ( data [ temp byte offset + + ] & 0x f f ) > > bit offset ) & ( 0x f f > > ( 8 - bits read ) ) ; while ( bits read < num bits ) { return value | = ( data [ temp byte offset + + ] & 0x f f ) < < bits read ; bits read + = 8 ; } return value & = 0x f f f f f f f f > > > ( 32 - num bits ) ; skip bits ( num bits ) ; return return value ; }


returns the base 2 logarithm of a double value , rounded with the specified rounding mode to an { @ code int } regardless of the rounding mode , this is faster than { @ code ( int ) log 2 ( x ) }

public static int log 2 ( double x , rounding mode mode ) { check argument ( x > 0 0 & & is finite ( x ) , " x must be positive and finite " ) ; int exponent = get exponent ( x ) ; if ( ! is normal ( x ) ) { return log 2 ( x * implicit bit , mode ) - significand bits ; / / do the calculation on a normal value } / / x is positive , finite , and normal boolean increment ; switch ( mode ) { case unnecessary : check rounding unnecessary ( is power of two ( x ) ) ; / / fall through case floor : increment = false ; break ; case ceiling : increment = ! is power of two ( x ) ; break ; case down : increment = exponent < 0 & ! is power of two ( x ) ; break ; case up : increment = exponent > = 0 & ! is power of two ( x ) ; break ; case half down : case half even : case half up : double x scaled = scale normalize ( x ) ; / / sqrt ( 2 ) is irrational , and the spec is relative to the " exact numerical result , " / / so log 2 ( x ) is never exactly exponent + 0 5 increment = ( x scaled * x scaled ) > 2 0 ; break ; default : throw new assertion error ( ) ; } return increment ? exponent + 1 : exponent ; }


public static string [ ] get strings ( string str , string delim ) { collection < string > values = get string collection ( str , delim ) ; if ( values size ( ) = = 0 ) { return null ; } return values to array ( new string [ values size ( ) ] ) ; }


called when a { @ link counter } is removed from the registry

void on counter removed ( string name ) ;


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

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


determine if a copy must be made after an immediate send happens an example of this use case is if a request is received with a ' expect : 100 - continue ' header the message will be sent immediately , and the data will be queued and sent at the end of the stream

full http message copy if needed ( byte buf allocator allocator , full http message msg ) ;


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


windows this { @ code data stream } into tumbling count windows note : this operation is inherently non - parallel since all elements have to pass through the same operator instance

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


retrieves the version information of netty artifacts using the current { @ linkplain thread # get context class loader ( ) context class loader }

public static map < string , version > identify ( ) { return identify ( null ) ; }


gets the { @ link user code class loader } to load classes that are not in system ' s classpath , but are part of the jar file of a user job

user code class loader get user code class loader ( ) ;


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

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


public synchronized int find number ( @ non null string id ) { integer number = id to number get ( id ) ; return number ! = null ? number : 0 ; }


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

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


performs the work of matching the given paths against the hints and returns the matching files this is semantically different from { @ link # get hinted inclusions legacy } in that it will not cross package boundaries

private collection < artifact > get hinted inclusions with skyframe ( rule type type , immutable list < path fragment > paths , environment env ) throws interrupted exception { immutable list < string > path strings = paths stream ( ) map ( path fragment : : get path string ) filter ( ( p ) - > p starts with ( allowed prefix ) ) collect ( immutable list to immutable list ( ) ) ; if ( path strings is empty ( ) ) { return immutable list of ( ) ; } / / delay creation until we know we need one use a tree set to make sure that the results are / / sorted with a stable order and unique set < artifact > hints = null ; list < containing package lookup value key > rule paths = new array list < > ( rules size ( ) ) ; list < string > find filters = new array list < > ( rules size ( ) ) ; for ( rule rule : rules ) { if ( type ! = rule type ) { continue ; } string first match path string = null ; matcher m = null ; for ( string path string : path strings ) { m = rule pattern matcher ( path string ) ; if ( m matches ( ) ) { first match path string = path string ; break ; } } if ( first match path string = = null ) { continue ; } if ( hints = = null ) { hints = sets new tree set ( artifact exec path comparator ) ; } path fragment relative path = path fragment create ( m replace first ( rule find root ) ) ; logger at fine ( ) log ( " hint for % s % s root : % s " , rule type , first match path string , relative path ) ; if ( ! relative path get path string ( ) starts with ( allowed prefix ) ) { logger at warning ( ) log ( " path % s to search after substitution does not start with % s " , relative path get path string ( ) , allowed prefix ) ; continue ; } rule paths add ( containing package lookup value key ( package identifier create in main repo ( relative path ) ) ) ; find filters add ( rule find filter ) ; } map < sky key , value or exception < no such package exception > > containing package lookup values = env get values or throw ( rule paths , no such package exception class ) ; if ( env values missing ( ) ) { return null ; } list < glob descriptor > glob keys = new array list < > ( rule paths size ( ) ) ; for ( int i = 0 ; i < rule paths size ( ) ; i + + ) { containing package lookup value containing package lookup value ; containing package lookup value key relative path key = rule paths get ( i ) ; path fragment relative path = relative path key argument ( ) get package fragment ( ) ; try { containing package lookup value = ( containing package lookup value ) containing package lookup values get ( relative path key ) get ( ) ; } catch ( no such package exception e ) { logger at warning ( ) with cause ( e ) log ( " unexpected exception when looking up containing package for % s " + " ( prodaccess expired ? ) " , relative path ) ; continue ; } if ( ! containing package lookup value has containing package ( ) ) { logger at warning ( ) log ( " % s not contained in any package : skipping " , relative path ) ; continue ; } path fragment package fragment = containing package lookup value get containing package name ( ) get package fragment ( ) ; string pattern = find filters get ( i ) ; try { glob keys add ( glob value key ( containing package lookup value get containing package name ( ) , containing package lookup value get containing package root ( ) , pattern , / * exclude dirs = * / true , relative path relative to ( package fragment ) ) ) ; } catch ( invalid glob pattern exception e ) { env get listener ( ) handle ( event warn ( " error parsing pattern " + pattern + " for " + relative path ) ) ; continue ; } } map < sky key , value or exception < i o exception > > glob results = env get values or throw ( glob keys , i o exception class ) ; if ( env values missing ( ) ) { return null ; } for ( map entry < sky key , value or exception < i o exception > > glob entry : glob results entry set ( ) ) { glob value glob value ; glob descriptor glob key = ( glob descriptor ) glob entry get key ( ) ; path fragment package fragment = glob key get package id ( ) get package fragment ( ) ; try { glob value = ( glob value ) glob entry get value ( ) get ( ) ; } catch ( i o exception e ) { logger at warning ( ) with cause ( e ) log ( " error getting hints for % s " , package fragment ) ; continue ; } for ( path fragment file : glob value get matches ( ) to list ( ) ) { hints add ( artifact factory get source artifact ( package fragment get relative ( file ) , glob key get package root ( ) ) ) ; } } return hints = = null | | hints is empty ( ) ? immutable list < artifact > of ( ) : hints ; }


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

public long get cached bytes length ( long position , long length ) { check argument ( position > = 0 ) ; check argument ( length > = 0 ) ; simple cache span span = get span ( position , length ) ; if ( span is hole span ( ) ) { / / we don ' t have a span covering the start of the queried region return - min ( span is open ended ( ) ? long max value : span length , length ) ; } long query end position = position + length ; if ( query end position < 0 ) { / / the calculation rolled over ( length is probably long max value ) query end position = long max value ; } long current end position = span position + span length ; if ( current end position < query end position ) { for ( simple cache span next : cached spans tail set ( span , false ) ) { if ( next position > current end position ) { / / there ' s a hole in the cache within the queried region break ; } / / we expect current end position to always equal ( next position + next length ) , but / / perform a max check anyway to guard against the existence of overlapping spans current end position = max ( current end position , next position + next length ) ; if ( current end position > = query end position ) { / / we ' ve found spans covering the queried region break ; } } } return min ( current end position - position , length ) ; }


set a given key with value as address , for all the name service ids

private string [ ] setup address ( hdfs configuration conf , string key , int name service id count , int port offset ) { string [ ] values = new string [ name service id count ] ; for ( int i = 0 ; i < name service id count ; i + + , port offset + + ) { string ns i d = get name service id ( i ) ; string specific key = d f s util add key suffixes ( key , ns i d ) ; values [ i ] = " nn " + i + " : " + port offset ; conf set ( specific key , values [ i ] ) ; } return values ; }


disable the connect tools if 1 or less than 1 tool is running

void enable connect tools ( ) { project project = plugin get active project ( ) ; if ( project = = null ) { connect tools action set enabled ( false ) ; return ; } / / only enable if project has more than 1 running tool tool manager tm = project get tool manager ( ) ; plugin tool [ ] running tools = tm get running tools ( ) ; connect tools action set enabled ( running tools length > 1 ) ; }


returns an instance of { @ link no transition }

public static < r > transition < r > get ( ) { return ( transition < r > ) no animation ; }


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

default mono < response entity < void > > update user ( @ api param ( value = " name that need to be deleted " , required = true ) @ path variable ( " username " ) string username , @ api param ( value = " updated user object " , required = true ) @ valid @ request body mono < user > body , @ api ignore final server web exchange exchange ) { return get delegate ( ) update user ( username , body , exchange ) ; }


this method creates and returns reference of the first intercepter in the chain of request intercepter instances

protected request interceptor create request interceptor chain ( ) { configuration conf = get config ( ) ; list < string > interceptor class names = get interceptor class names ( conf ) ; request interceptor pipeline = null ; request interceptor current = null ; for ( string interceptor class name : interceptor class names ) { try { class < ? > interceptor class = conf get class by name ( interceptor class name ) ; if ( request interceptor class is assignable from ( interceptor class ) ) { request interceptor interceptor instance = ( request interceptor ) reflection utils new instance ( interceptor class , conf ) ; if ( pipeline = = null ) { pipeline = interceptor instance ; current = interceptor instance ; continue ; } else { current set next interceptor ( interceptor instance ) ; current = interceptor instance ; } } else { throw new yarn runtime exception ( " class : " + interceptor class name + " not instance of " + request interceptor class get canonical name ( ) ) ; } } catch ( class not found exception e ) { throw new yarn runtime exception ( " could not instantiate application master request interceptor : " + interceptor class name , e ) ; } } if ( pipeline = = null ) { throw new yarn runtime exception ( " request interceptor pipeline is not configured in the system " ) ; } return pipeline ; }


return and access condition for this lease , or else null if there ' s no lease

private access condition get lease condition ( self renewing lease lease ) { access condition lease condition = null ; if ( lease ! = null ) { lease condition = access condition generate lease condition ( lease get lease i d ( ) ) ; } return lease condition ; }


returns the { @ link android input } object associated with this { @ link android application base }


hex encodes the input as the { @ link span # id ( ) } or throws illegal argument exception if the input is zero

public builder id ( long id ) { if ( id = = 0l ) throw new illegal argument exception ( " empty id " ) ; this id = to lower hex ( id ) ; return this ; }


sets a listener for program location changes for the left side ' s listing panel

public void set left program location listener ( program location listener program location listener ) { listing panels [ left ] set program location listener ( program location listener ) ; }


public static void main ( string [ ] args ) { system out println ( ( byte ) 5 < ( byte ) 250 ) ; system out println ( unsigned less than ( ( byte ) 5 , ( byte ) 250 ) ) ; system out println ( 0x 5 < 0x 8 7 6 5 4 3 2 1 ) ; system out println ( unsigned less than ( 0x 5 , 0x 8 7 6 5 4 3 2 1 ) ) ; }


recursively run through this structured block graph finding the block copy leaves using the block copy altindex , lookup the original block copy in - ingraph - and transfer the object ref and address into the leaf

public void transfer object ref ( block graph ingraph ) { array list < block graph > queue = new array list < block graph > ( ) ; int pos = 0 ; queue add ( this ) ; while ( pos < queue size ( ) ) { block graph curgraph = queue get ( pos ) ; pos + = 1 ; int sz = curgraph get size ( ) ; for ( int i = 0 ; i < sz ; + + i ) { pcode block block = curgraph get block ( i ) ; if ( block instanceof block copy ) { block copy copyblock = ( block copy ) block ; int altindex = copyblock get alt index ( ) ; if ( altindex < ingraph get size ( ) ) { pcode block block 2 = ingraph get block ( altindex ) ; if ( block 2 instanceof block copy ) { block copy copyblock 2 = ( block copy ) block 2 ; copyblock set ( copyblock 2 get ref ( ) , copyblock 2 get start ( ) ) ; / / transfer the object reference } } } else if ( block instanceof block graph ) queue add ( ( block graph ) block ) ; } } }


returns the ( unordered , immutable ) set of output artifacts that this action generates ( it would not make sense for this to be empty )

immutable set < artifact > get outputs ( ) ;


removes all touch focus listeners , sending a touch up event to each listener listeners typically expect to receive a touch up event when they have touch focus the location of the touch up is { @ link integer # min value } listeners can use { @ link input event # is touch focus cancel ( ) } to ignore this event if needed

public void cancel touch focus ( ) { cancel touch focus except ( null , null ) ; }


override this to replace the animation text with something dynamic this can be used for translations or custom data

private string get text ( string input ) { return input ; }


associate the specified value with the specified key in this cache if the cache previously contained a mapping for this key , the old value is replaced by the specified value actual registration may be performed in an asynchronous or deferred fashion , with subsequent lookups possibly not seeing the entry yet this may for example be the case with transactional cache decorators use { @ link # put if absent } for guaranteed immediate registration

void put ( object key , @ nullable object value ) ;


get the style used to render the given symbol

public int get style ( symbol s ) { return get style ( get screen element ( s ) ) ; }


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


returns current size + 1 , after resizing the entries storage if necessary

private void resize me maybe ( int new size ) { int entries size = entries length ; if ( new size > entries size ) { int new capacity = entries size + math max ( 1 , entries size > > > 1 ) ; if ( new capacity < 0 ) { new capacity = integer max value ; } if ( new capacity ! = entries size ) { resize entries ( new capacity ) ; } } }


this method is only called by tests and by event - deserialization , like checkpoint barriers because such events are not used for bounded intermediate results , this method currently executes only in tests

public byte buffer get nio buffer readable ( ) { try { final byte buffer buffer = byte buffer allocate direct ( buffer size ( ) ) ; buffer reader writer util read byte buffer fully ( file channel , buffer , position ( ) ) ; buffer flip ( ) ; return buffer ; } catch ( i o exception e ) { / / this is not very pretty , but given that this code runs only in tests / / the exception wrapping here is simpler than updating the method signature / / to declare i o exceptions , as would be necessary for a proper " lazy buffer " throw new flink runtime exception ( e get message ( ) , e ) ; } }


test whether the override rule have a high priority scene : first push override , then push invoker

public void test notifyoverride urls before invoker ( ) { registry directory registry directory = get registry directory ( ) ; list < url > override urls = new array list < url > ( ) ; override urls add ( url value of ( " override : / / 0 0 0 0 ? timeout = 1 & connections = 5 " ) ) ; registry directory notify ( override urls ) ; / / the registry is initially pushed to override only , and the dirctory state should be false because there is no invoker assertions assert false ( registry directory is available ( ) ) ; / / after pushing two provider , the directory state is restored to true list < url > service urls = new array list < url > ( ) ; service urls add ( serviceurl add parameter ( " timeout " , " 1000 " ) ) ; service urls add ( serviceurl2 add parameter ( " timeout " , " 1000 " ) add parameter ( " connections " , " 10 " ) ) ; registry directory notify ( service urls ) ; assertions assert true ( registry directory is available ( ) ) ; / / start validation of parameter values invocation = new rpc invocation ( ) ; list < invoker < ? > > invokers = registry directory list ( invocation ) ; assertions assert equals ( 2 , invokers size ( ) ) ; assertions assert equals ( " 1 " , invokers get ( 0 ) get url ( ) get parameter ( " timeout " ) , " override rute must be first priority " ) ; assertions assert equals ( " 5 " , invokers get ( 0 ) get url ( ) get parameter ( " connections " ) , " override rute must be first priority " ) ; }


expect a " content - length " header with the given value

public web test client response spec content length ( long content length ) { return assert header ( " content - length " , content length , get headers ( ) get content length ( ) ) ; }


create a new bean shell - scripted object from the given script source with this { @ code create bsh object } variant , the script needs to declare a full class or return an actual instance of the scripted object

public static object create bsh object ( string script source ) throws eval error { return create bsh object ( script source , null , null ) ; }


verifies that the { @ code set } returned by { @ code edges } has the expected mutability property ( see the { @ code network } documentation for more information )

public abstract void edges check returned set mutability ( ) ;


public object get anytype 2 ( ) { return anytype 2 ; }


public void update n clob ( int column index , reader reader ) throws s q l exception { }


returns the count of { @ code node } ' s incident edges , counting self - loops twice ( equivalently , the number of times an edge touches { @ code node } ) for directed graphs , this is equal to { @ code in degree ( node ) + out degree ( node ) } for undirected graphs , this is equal to { @ code incident edges ( node ) size ( ) } + ( number of self - loops incident to { @ code node } ) if the count is greater than { @ code integer max value } , returns { @ code integer max value }


prepare the { @ code media type } to use by adding " boundary " and " charset " parameters to the given { @ code media type } or " mulitpartform - data " otherwise by default

protected media type get multipart media type ( @ nullable media type media type , byte [ ] boundary ) { map < string , string > params = new hash map < > ( ) ; if ( media type ! = null ) { params put all ( media type get parameters ( ) ) ; } params put ( " boundary " , new string ( boundary , standard charsets us ascii ) ) ; charset charset = get charset ( ) ; if ( ! charset equals ( standard charsets utf 8 ) & & ! charset equals ( standard charsets us ascii ) ) { params put ( " charset " , charset name ( ) ) ; } media type = ( media type ! = null ? media type : media type multipart form data ) ; media type = new media type ( media type , params ) ; return media type ; }


configure a { @ code content negotiation manager } to help determine the media types for resources being served if the manager contains a path extension strategy it will be checked for registered file extension

public void set content negotiation manager ( @ nullable content negotiation manager content negotiation manager ) { this content negotiation manager = content negotiation manager ; }


tests that we can edit a tag in latest , delete it in my , and correctly resolve the conflict to keep the edited version

public void test edit latest delete my keep latest ( ) throws exception { mtf initialize ( notepad , new original program modifier listener ( ) { @ override public void modify latest ( program d b program ) throws exception { int transaction i d = program start transaction ( " latest " ) ; try { edit tag name ( program , tag name a , tag name a latest ) ; } finally { program end transaction ( transaction i d , true ) ; } } @ override public void modify private ( program d b program ) throws exception { int transaction i d = program start transaction ( " my " ) ; try { delete tag ( program , tag name a ) ; } finally { program end transaction ( transaction i d , true ) ; } } @ override public void modify original ( program d b program ) throws exception { int transaction i d = program start transaction ( " original " ) ; try { function tag manager tag manager = get tag manager ( program ) ; tag manager create function tag ( tag name a , " " ) ; } finally { program end transaction ( transaction i d , true ) ; } } } ) ; execute merge ( ask user ) ; choose function tag button ( latest button , false ) ; wait for merge completion ( ) ; / / get the result program and check that : / / 1 the edited tag is still in result / / 2 the original version is not in result assert true ( is tag in program ( tag name a latest , mtf get result program ( ) ) ) ; assert true ( ! is tag in program ( tag name a , mtf get result program ( ) ) ) ; }


waits until the given predicate returns true , invoking the garbage collector as necessary to try to ensure that this will happen

public static void await done ( finalization predicate predicate ) { if ( predicate is done ( ) ) { return ; } final long timeout seconds = timeout seconds ( ) ; final long deadline = system nano time ( ) + seconds to nanos ( timeout seconds ) ; do { system run finalization ( ) ; if ( predicate is done ( ) ) { return ; } count down latch done = new count down latch ( 1 ) ; create unreachable latch finalizer ( done ) ; await ( done ) ; if ( predicate is done ( ) ) { return ; } } while ( system nano time ( ) - deadline < 0 ) ; throw format runtime exception ( " predicate did not become true within % d second timeout " , timeout seconds ) ; }


checks that the graph rooted at ' target node ' has been completely built ; fails if not callers of { @ link # get transitive closure } must ensure that { @ link # build transitive closure } has been called before it would be inefficient and failure - prone to make get transitive closure call build transitive closure directly also , it would cause nondeterministic behavior of the operators , since the set of packages loaded ( and hence errors reported ) would depend on the ordering details of the query operators ' implementations

private void check built ( target target node ) { preconditions check state ( label visitor has visited ( target node get label ( ) ) , " get transitive closure ( % s ) called without prior call to build transitive closure ( ) " , target node ) ; }


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


add an " s - maxage " directive this directive indicates that , in shared caches , the maximum age specified by this directive overrides the maximum age specified by other directives

public cache control s max age ( long s max age , time unit unit ) { return s max age ( duration of seconds ( unit to seconds ( s max age ) ) ) ; }


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


sets the ssl session ticket keys of this context depending on the underlying native library you may omit the argument or pass an empty array and so let the native library handle the key generation and rotating for you if this is supported by the underlying native library should be checked in this case for example < a href = " https : commondatastorage googleapis comchromium - boringssl - docsssl h html # session - tickets " > boring s s l is known to support this

public void set ticket keys ( open ssl session ticket key keys ) { object util check not null ( keys , " keys " ) ; session ticket key [ ] ticket keys = new session ticket key [ keys length ] ; for ( int i = 0 ; i < ticket keys length ; i + + ) { ticket keys [ i ] = keys [ i ] key ; } lock writer lock = context ctx lock write lock ( ) ; writer lock lock ( ) ; try { s s l context clear options ( context ctx , ssl ssl op no ticket ) ; if ( ticket keys length > 0 ) { s s l context set session ticket keys ( context ctx , ticket keys ) ; } } finally { writer lock unlock ( ) ; } }


query using a prepared statement , reading the result set with a result set extractor

< t > t query ( string sql , @ nullable prepared statement setter pss , result set extractor < t > rse ) throws data access exception ;


returns the default i value formatter that has been determined by the chart considering the provided minimum and maximum values

public i value formatter get default value formatter ( ) { return m default value formatter ; }


from { @ code a | b | | z } alternative block build o - & gt ; o - a - & gt ; o - & gt ; o ( last a t n state is block end state pointed to by all alts ) | ^ | - & gt ; o - b - & gt ; o - - | | | | | | | - & gt ; o - z - & gt ; o - - | so start node points at every alternative with epsilon transition and every alt right side points at a block end a t n state special case : only one alternative : don ' t make a block with alt beginend special case : if just a list of tokenscharssets , then collapse to a single edged o - set - & gt ; o graph todo : set alt number ( 1 n ) in the states ?

public handle block ( block a s t blk a s t , grammar a s t ebnf root , list < handle > alts ) { if ( ebnf root = = null ) { if ( alts size ( ) = = 1 ) { handle h = alts get ( 0 ) ; blk a s t atn state = h left ; return h ; } block start state start = new state ( basic block start state class , blk a s t ) ; if ( alts size ( ) > 1 ) atn define decision state ( start ) ; return make block ( start , blk a s t , alts ) ; } switch ( ebnf root get type ( ) ) { case a n t l r parser optional : block start state start = new state ( basic block start state class , blk a s t ) ; atn define decision state ( start ) ; handle h = make block ( start , blk a s t , alts ) ; return optional ( ebnf root , h ) ; case a n t l r parser closure : block start state star = new state ( star block start state class , ebnf root ) ; if ( alts size ( ) > 1 ) atn define decision state ( star ) ; h = make block ( star , blk a s t , alts ) ; return star ( ebnf root , h ) ; case a n t l r parser positive closure : plus block start state plus = new state ( plus block start state class , ebnf root ) ; if ( alts size ( ) > 1 ) atn define decision state ( plus ) ; h = make block ( plus , blk a s t , alts ) ; return plus ( ebnf root , h ) ; } return null ; }


set bucket steps , the minimal values of every buckets besides the { @ link # min value }

public builder steps ( list < double > steps ) { this steps = new array list < > ( steps ) ; return this ; }


public static string get zodiac ( final date date ) { calendar cal = calendar get instance ( ) ; cal set time ( date ) ; int month = cal get ( calendar month ) + 1 ; int day = cal get ( calendar day of month ) ; return get zodiac ( month , day ) ; }


true if there are unknown fields anywhere inside the proto or its nested protos

public static boolean has unknown fields ( generated message lite root proto ) { try { list < generated message lite > all protos = get inner protos ( root proto ) ; all protos add ( root proto ) ; for ( generated message lite proto : all protos ) { field field = generated message lite class get declared field ( " unknown fields " ) ; field set accessible ( true ) ; unknown field set lite unknown fields = ( unknown field set lite ) field get ( proto ) ; if ( unknown fields ! = null & & unknown fields get serialized size ( ) > 0 ) { return true ; } } } catch ( no such field exception | illegal access exception e ) { log w ( tag , " failed to read proto private fields ! assuming no unknown fields " ) ; } return false ; }


public sorted map < string , gauge > get gauges ( ) { return collections empty sorted map ( ) ; }


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


maps one or many filters to be executed before any matching routes

public static void before ( string path , string accept type , filter filters ) { for ( filter filter : filters ) { get instance ( ) before ( path , accept type , filter ) ; } }


returns the directory where object files are created

public static path fragment get obj directory ( label rule label , boolean sibling repository layout ) { return get obj directory ( rule label , false , sibling repository layout ) ; }


public string get response body ( ) { return response body ; }


returns delegated task for the s s l engine

protected runnable delegated task ( ) { return ssl engine get delegated task ( ) ; }


decides what needs to be done based on the request input and always returns a valid non - null fetch source context

private fetch source context normalize fetch source content ( @ nullable fetch source context context , @ nullable string [ ] g fields ) { if ( context ! = null ) { return context ; } if ( g fields = = null ) { return fetch source context fetch source ; } for ( string field : g fields ) { if ( source field mapper name equals ( field ) ) { return fetch source context fetch source ; } } return fetch source context do not fetch source ; }


dumps the { @ link debug data } this package - protected method is for debugging only


encodes the specified cookie into a cookie header value

public string encode ( string name , string value ) { return encode ( new default cookie ( name , value ) ) ; }


checks if the data should be classified as " string " in enum e g double in c # needs to be double - quoted ( e g " 2 8 " ) by treating it as a string in the future , we may rename this function to " is enum string "

public boolean is data type string ( string data type ) { return " string " equals ( data type ) ; }


returns true if the object has a field of the given name , otherwise false

public boolean hasattr ( object obj , string name , starlark thread thread ) throws eval exception { return starlark hasattr ( thread get semantics ( ) , obj , name ) ; } @ starlark method ( name = " getattr " , doc = " returns the struct ' s field of the given name if it exists if not , it either returns " + " < code > default < / code > ( if specified ) or raises an error " + " < code > getattr ( x , \ " foobar \ " ) < / code > is equivalent to < code > x foobar < / code > " + " < pre class = \ " language - python \ " > getattr ( ctx attr , \ " myattr \ " ) \ n " + " getattr ( ctx attr , \ " myattr \ " , \ " mydefault \ " ) < / pre > " , parameters = { @ param ( name = " x " , doc = " the struct whose attribute is accessed " ) , @ param ( name = " name " , doc = " the name of the struct attribute " ) , @ param ( name = " default " , default value = " unbound " , doc = " the default value to return in case the struct " + " doesn ' t have an attribute of the given name " ) }


returns label corresponding to the first word ( according to shell tokenization ) passed to - - run under


raise an overflow exception for the given number and target class

private static void raise overflow exception ( number number , class < ? > target class ) { throw new illegal argument exception ( " could not convert number [ " + number + " ] of type [ " + number get class ( ) get name ( ) + " ] to target class [ " + target class get name ( ) + " ] : overflow " ) ; }


public static void init session manager ( ) throws exception { session holder init ( null ) ; remoting server = new default coordinator test mock server message sender ( ) ; core = new default core ( remoting server ) ; }


tests that default conditions are only required when no main condition matches

public void no default condition ( ) throws exception { write hello rules ( / * include default condition = * / false ) ; write config rules ( ) ; / / an explicit configuration matches : all is well check rule ( " / / java / hello : hello " , " - - test arg = a " , / * expected : * / immutable list of ( adep input ) , / * not expected : * / immutable list of ( bdep input , defaultdep input ) ) ; / / nothing matches : expect an error reporter remove handler ( fail fast handler ) ; use configuration ( " " ) ; assert that ( get configured target ( " / / java / hello : hello " ) ) is null ( ) ; assert contains event ( " configurable attribute \ " deps \ " doesn ' t match this configuration " ) ; }


changes the key at the given { @ code index } in the order to { @ code after } , without changing the ordering of other entries or any values if { @ code after } is already present , this returns false ; it will also return false if { @ code index } is invalid for the size of this map otherwise , it returns true unlike { @ link # alter ( object , object ) } , this operates in constant time

public boolean alter index ( int index , k after ) { if ( index < 0 | | index > = size | | contains key ( after ) ) return false ; super put ( after , super remove ( keys get ( index ) ) ) ; keys set ( index , after ) ; return true ; }


private static string [ ] to resources ( final object [ ] args ) { val object = args [ 0 ] ; if ( object instanceof authentication transaction ) { val transaction = authentication transaction class cast ( object ) ; return new string [ ] { supplied credentials + transaction get credentials ( ) } ; } return new string [ ] { supplied credentials + collection utils wrap ( object ) } ; }


abstract template method for marshalling the given object graph to a { @ code output stream }

protected abstract void marshal output stream ( object graph , output stream output stream ) throws xml mapping exception , i o exception ;


obtain the annotation metadata ( as well as basic class metadata ) for this bean definition ' s bean class


check if the current candidate should be added in the queue

boolean add if competitive ( long inc ) { return add if competitive ( 0 , inc ) ; }


find the last ( maybe ) valid n snapshots this does some minor checks on the validity of the snapshots it just checks for at the end of the snapshot this does not mean that the snapshot is truly valid but is valid with a high probability also , the most recent will be first on the list

protected list < file > find n valid snapshots ( int n ) throws i o exception { list < file > files = util sort data dir ( snap dir list files ( ) , snapshot file prefix , false ) ; int count = 0 ; list < file > list = new array list < file > ( ) ; for ( file f : files ) { / / we should catch the exceptions / / from the valid snapshot and continue / / until we find a valid one try { if ( snap stream is valid snapshot ( f ) ) { list add ( f ) ; count + + ; if ( count = = n ) { break ; } } } catch ( i o exception e ) { log warn ( " invalid snapshot { } " , f , e ) ; } } return list ; }


test that a jelly is escaped when the escape - by - default = ' true ' directive is set in it

public void test jelly escaping default ( ) throws exception { test jelly ( null ) ; }


associate a textual description with this trigger

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


public matrix 3 set to scaling ( vector 2 scale ) { float [ ] val = this val ; val [ m00 ] = scale x ; val [ m10 ] = 0 ; val [ m20 ] = 0 ; val [ m01 ] = 0 ; val [ m11 ] = scale y ; val [ m21 ] = 0 ; val [ m02 ] = 0 ; val [ m12 ] = 0 ; val [ m22 ] = 1 ; return this ; }


requests the disposal of this view - it should be called again

public void shoul exit ( ) { should exit = true ; }


tests a simple { @ link checkpoint i d counter # set count ( long ) } operation

public void test set count ( ) throws exception { final checkpoint i d counter counter = create checkpoint id counter ( ) ; counter start ( ) ; / / test set count counter set count ( 1337 ) ; assert equals ( 1337 , counter get ( ) ) ; assert equals ( 1337 , counter get and increment ( ) ) ; assert equals ( 1338 , counter get ( ) ) ; assert equals ( 1338 , counter get and increment ( ) ) ; counter shutdown ( job status finished ) ; }


validate that the provided name is a valid application , or a wildcard pattern for an application and throws an exception otherwise

public static void validate application name or wildcard ( string application ) { validate application name ( application , true ) ; }


public final void remove reference ( reference reference ) { current program get reference manager ( ) delete ( reference ) ; }


returns the set of all types referenced in the method header , i e all types in the method return type and argument types

public immutable set < class name > get header type name set ( ) { return immutable set < class name > builder ( ) add ( get return type name ( ) ) add all ( get argument type names ( ) ) build ( ) ; }


when the normal exit , data recovery , all memory data have been flush

public void recover normally ( long max phy offset of consume queue ) { boolean check c r c on recover = this default message store get message store config ( ) is check c r c on recover ( ) ; final list < mapped file > mapped files = this mapped file queue get mapped files ( ) ; if ( ! mapped files is empty ( ) ) { / / began to recover from the last third file int index = mapped files size ( ) - 3 ; if ( index < 0 ) index = 0 ; mapped file mapped file = mapped files get ( index ) ; byte buffer byte buffer = mapped file slice byte buffer ( ) ; long process offset = mapped file get file from offset ( ) ; long mapped file offset = 0 ; while ( true ) { dispatch request dispatch request = this check message and return size ( byte buffer , check c r c on recover ) ; int size = dispatch request get msg size ( ) ; / / normal data if ( dispatch request is success ( ) & & size > 0 ) { mapped file offset + = size ; } / / come the end of the file , switch to the next file since the / / return 0 representatives met last hole , / / this can not be included in truncate offset else if ( dispatch request is success ( ) & & size = = 0 ) { index + + ; if ( index > = mapped files size ( ) ) { / / current branch can not happen log info ( " recover last 3 physics file over , last mapped file " + mapped file get file name ( ) ) ; break ; } else { mapped file = mapped files get ( index ) ; byte buffer = mapped file slice byte buffer ( ) ; process offset = mapped file get file from offset ( ) ; mapped file offset = 0 ; log info ( " recover next physics file , " + mapped file get file name ( ) ) ; } } / / intermediate file read error else if ( ! dispatch request is success ( ) ) { log info ( " recover physics file end , " + mapped file get file name ( ) ) ; break ; } } process offset + = mapped file offset ; this mapped file queue set flushed where ( process offset ) ; this mapped file queue set committed where ( process offset ) ; this mapped file queue truncate dirty files ( process offset ) ; / / clear consume queue redundant data if ( max phy offset of consume queue > = process offset ) { log warn ( " max phy offset of consume queue ( { } ) > = process offset ( { } ) , truncate dirty logic files " , max phy offset of consume queue , process offset ) ; this default message store truncate dirty logic files ( process offset ) ; } } else { / / commitlog case files are deleted log warn ( " the commitlog files are deleted , and delete the consume queue files " ) ; this mapped file queue set flushed where ( 0 ) ; this mapped file queue set committed where ( 0 ) ; this default message store destroy logics ( ) ; } }


stop an application @ api group app detail controller @ api name stop app @ api { post } app detailsstop { id } stop one instance of application @ api param { string } id application id to stop @ api success { string } text give deployment status @ api error bad request requested application does not stop

public response stop app ( @ path param ( " id " ) string id ) { app catalog solr client sc = new app catalog solr client ( ) ; app entry app = sc find app entry ( id ) ; service yarn app = app get yarnfile ( ) ; yarn app set state ( service state stopped ) ; try { yarn service client yc = new yarn service client ( ) ; yc stop app ( yarn app ) ; } catch ( json processing exception e ) { return response status ( status bad request ) build ( ) ; } return response ok ( ) build ( ) ; }


the business logic for this method resides in debug component time machine component tree only stores its own timeline

void append timeline ( component root , string root global key , state handler state handler , tree props props , @ layout state calculate layout source int source , @ nullable string attribution ) { assert holds lock ( this ) ; if ( m timeline = = null ) { m timeline = new debug component time machine tree revisions ( root , root global key , state handler , props , source , attribution ) ; } else { m timeline set latest ( root , state handler , props , source , attribution ) ; } }


public string index ( ) { return index ; }


asserts that the num ops and quantiles for a metric have been changed at some point to a non - zero value , for the specified value name of the metrics ( e g , " latency " , " count " )

public static void assert quantile gauges ( string prefix , metrics record builder rb , string value name ) { verify ( rb ) add gauge ( eq name ( info ( prefix + " num ops " , " " ) ) , geq ( 0l ) ) ; for ( quantile q : mutable quantiles quantiles ) { string name template = prefix + " % dth percentile " + value name ; int percentile = ( int ) ( 100 * q quantile ) ; verify ( rb ) add gauge ( eq name ( info ( string format ( name template , percentile ) , " " ) ) , geq ( 0l ) ) ; } }


it discards an existing checkpoint identified by its checkpoint i d

public boolean delete ( checkpoint i d id ) throws i o exception , interrupted exception ;


if set to true , all values are drawn above their bars , instead of below their top

public void set draw value above bar ( boolean enabled ) { m draw value above bar = enabled ; }


wraps this subject and serializes the calls to the on subscribe , on next , on error and on complete methods , making them thread - safe the method is thread - safe

public final subject < t > to serialized ( ) { if ( this instanceof serialized subject ) { return this ; } return new serialized subject < > ( this ) ; }


deletes the record in the database by id < br > the data in other tables which is referenced with the record will be removed too lite pal delete ( person class , 1 ) ; this means that the record 1 in person table will be removed

public static int delete ( class < ? > model class , long id ) { synchronized ( lite pal support class ) { int rows affected ; s q lite database db = connector get database ( ) ; db begin transaction ( ) ; try { delete handler delete handler = new delete handler ( db ) ; rows affected = delete handler on delete ( model class , id ) ; db set transaction successful ( ) ; return rows affected ; } finally { db end transaction ( ) ; } } }


checks that the given provider class either refers to an interface or to a value class

public static < t extends transitive info provider > void check provider ( class < t > clazz ) { / / write this check in terms of get name ( ) rather than get simple name ( ) ; the latter is expensive if ( ! clazz is interface ( ) & & clazz get name ( ) contains ( " auto value " ) ) { / / we must have a superclass due to the generic bound above throw new illegal argument exception ( clazz + " is generated by @ auto value ; use " + clazz get superclass ( ) + " instead " ) ; } }


return true if the jni - based native crc extensions are available

public static boolean is available ( ) { if ( is sparc ) { return false ; } else { return native code loader is native code loaded ( ) ; } }


{ @ link org apache flink kubernetes kubeclient flink kube client # check and update config map } is a transactional operation , we should definitely guarantee that the concurrent modification could work

public void test check and update config map concurrently ( ) throws exception { / / start multiple instances to update config map concurrently final list < completable future < void > > futures = new array list < > ( ) ; final int target = 10 ; final int update interval ms = 100 ; for ( string key : data key set ( ) ) { futures add ( completable future run async ( ( ) - > { for ( int index = 0 ; index < target ; index + + ) { final boolean updated = flink kube client check and update config map ( test config map name , config map - > { final int new value = integer value of ( config map get data ( ) get ( key ) ) + 1 ; config map get data ( ) put ( key , string value of ( new value ) ) ; return optional of ( config map ) ; } ) join ( ) ; assert that ( updated , is ( true ) ) ; try { / / simulate the update interval thread sleep ( ( long ) ( update interval ms * math random ( ) ) ) ; } catch ( interrupted exception e ) { / / noop } } } , executor service ) ) ; } future utils wait for all ( futures ) get ( timeout , time unit milliseconds ) ; / / all the value should be increased exactly to the target final optional < kubernetes config map > config map opt = flink kube client get config map ( test config map name ) ; assert that ( config map opt is present ( ) , is ( true ) ) ; assert that ( config map opt get ( ) get data ( ) values ( ) , every item ( is ( string value of ( target ) ) ) ) ; }


private static string unary rpc ( string request message , simple service grpc simple service blocking stub blocking stub ) { simple request request = simple request new builder ( ) set request message ( request message ) build ( ) ; simple response response = blocking stub unary rpc ( request ) ; return response get response message ( ) ; }


public project locator get project locator ( ) { return project locator ; }


translate { @ link vertex } i ds using the given { @ link translate function }

public static < old , new , vv > data set < vertex < new , vv > > translate vertex ids ( data set < vertex < old , vv > > vertices , translate function < old , new > translator , int parallelism ) { preconditions check not null ( vertices ) ; preconditions check not null ( translator ) ; class < vertex < new , vv > > vertex class = ( class < vertex < new , vv > > ) ( class < ? extends vertex > ) vertex class ; type information < old > old type = ( ( tuple type info < vertex < old , vv > > ) vertices get type ( ) ) get type at ( 0 ) ; type information < new > new type = type extractor get unary operator return type ( translator , translate function class , 0 , 1 , new int [ ] { 1 } , old type , null , false ) ; type information < vv > vertex value type = ( ( tuple type info < vertex < old , vv > > ) vertices get type ( ) ) get type at ( 1 ) ; tuple type info < vertex < new , vv > > return type = new tuple type info < > ( vertex class , new type , vertex value type ) ; return vertices map ( new translate vertex id < > ( translator ) ) returns ( return type ) set parallelism ( parallelism ) name ( " translate vertex i ds " ) ; }


returns a json adapter for { @ code type } , creating it if necessary

public < t > json adapter < t > adapter ( type type ) { return adapter ( type , util no annotations ) ; }


returns true if the import is ' by name '

public boolean has name ( ) { return name ! = null ; }


returns true if this filter has been saved ( i e has a name )

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


create a builder with a { @ linkplain http status # temporary redirect 307 temporary redirect } status and a location header set to the given uri

static body builder temporary redirect ( uri location ) { body builder builder = status ( http status temporary redirect ) ; return builder location ( location ) ; }


the value of { @ link org apache kafka streams streams config # application server config } configured for the streams instance , which is typically hostport

public host info host info ( ) { return host info ; }


get the role of this token ; subclasses should override this for better logging

protected string binding name ( ) { return " session " ; }