wrap the supplied { @ link statement } with a { @ code run before test execution callbacks } statement , thus preserving the default functionality while adding support for the spring test context framework

protected statement with before test execution callbacks ( framework method framework method , object test instance , statement statement ) { return new run before test execution callbacks ( statement , test instance , framework method get method ( ) , get test context manager ( ) ) ; }


protected logout response build saml logout response ( final saml registered service service provider metadata facade adaptor , final single logout service slo service , final request context request context , final saml registered service registered service , final logout request logout request ) { val request = web utils get http servlet request from external webflow context ( request context ) ; val response = web utils get http servlet response from external webflow context ( request context ) ; val id = ' ' + string value of ( random utils next long ( ) ) ; val builder = configuration context get logout response builder ( ) ; val status = builder new status ( status code success , " success " ) ; val issuer = builder new issuer ( configuration context get cas properties ( ) get authn ( ) get saml idp ( ) get entity id ( ) ) ; val location = string utils is blank ( slo service get response location ( ) ) ? slo service get location ( ) : slo service get response location ( ) ; logger trace ( " creating logout response for binding [ { } ] with issuer [ { } ] , location [ { } ] and service provider [ { } ] " , slo service get binding ( ) , issuer , location , adaptor get entity id ( ) ) ; val logout response = builder new logout response ( id , location , issuer , status , adaptor get entity id ( ) ) ; if ( configuration context get cas properties ( ) get authn ( ) get saml idp ( ) get logout ( ) is sign logout response ( ) ) { logger trace ( " signing logout request for service provider [ { } ] " , adaptor get entity id ( ) ) ; val logout response signed = configuration context get saml object signer ( ) encode ( logout response , registered service , adaptor , response , request , slo service get binding ( ) , logout request ) ; saml utils log saml object ( configuration context get open saml config bean ( ) , logout response signed ) ; return logout response signed ; } return logout response ; }


returns this tile ' s position as a packed point

public int pos ( ) { return point 2 pack ( x , y ) ; }


resolves a pattern to multiple , separate indices doesn ' t perform validation

public void resolve as separate mappings ( string index wildcard , string java regex , boolean include frozen , action listener < list < es index > > listener ) { field capabilities request field request = create field caps request ( index wildcard , include frozen ) ; client field caps ( field request , wrap ( response - > { client admin ( ) indices ( ) get aliases ( create get aliases request ( response , include frozen ) , wrap ( aliases - > listener on response ( separate mappings ( type registry , java regex , response get indices ( ) , response get ( ) , aliases get aliases ( ) ) ) , ex - > { if ( ex instanceof index not found exception | | ex instanceof elasticsearch security exception ) { listener on response ( separate mappings ( type registry , java regex , response get indices ( ) , response get ( ) , null ) ) ; } else { listener on failure ( ex ) ; } } ) ) ; } , listener : : on failure ) ) ; }


the non - virtual transitive proto source files different from { @ link # get transitive proto sources ( ) } if a transitive dependency has { @ code import prefix } or the like

public nested set < artifact > get original transitive proto sources ( ) { return original transitive proto sources ; }


this will be used by the uncaught exception handler and make the system exit

protected void handle exception ( string thread name , throwable e ) { log error ( " severe unrecoverable error , from thread : { } " , thread name , e ) ; listener notify stopping ( thread name , exit code unexpected error get value ( ) ) ; server metrics get metrics ( ) unrecoverable error count add ( 1 ) ; }


upgrade from l dir - based layout to 3 2x 3 2 block id - based layout ( - 57 ) - - change described in hdfs - 6482 and hdfs - 8791

public void test upgrade to id based layout ( ) throws i o exception { test d f s upgrade from image upgrade = new test d f s upgrade from image ( ) ; upgrade unpack storage ( hadoop24 datanode , hadoop datanode dir txt ) ; configuration conf = new configuration ( test d f s upgrade from image upgrade conf ) ; conf set ( d f s config keys dfs datanode data dir key , generic test utils get test dir ( " dfs " + file separator + " data " ) to u r i ( ) to string ( ) ) ; conf set ( d f s config keys dfs namenode name dir key , generic test utils get test dir ( " dfs " + file separator + " name " ) to u r i ( ) to string ( ) ) ; upgrade upgrade and verify ( new mini d f s cluster builder ( conf ) num data nodes ( 1 ) manage data dfs dirs ( false ) manage name dfs dirs ( false ) , null ) ; }


create a new method definition with a different call handler

public server method definition < req t , resp t > with server call handler ( server call handler < req t , resp t > handler ) { return new server method definition < > ( method , handler ) ; }


public void put ( @ non null final string key , final object value ) { put ( key , value , - 1 ) ; }


this test validates the correctness of { @ link r m web service protocol # get cluster node labels ( ) } inside router

public void test get cluster node labels x m l ( ) throws exception { list < node labels info > responses = perform get calls ( rm web service path + get node labels , node labels info class , null , null ) ; node labels info router response = responses get ( 0 ) ; node labels info rm response = responses get ( 1 ) ; assert not null ( router response ) ; assert not null ( rm response ) ; assert equals ( rm response get node labels ( ) size ( ) , router response get node labels ( ) size ( ) ) ; }


gets request security token response from result

public requested security token get request security token from result ( final string wresult ) { logger debug ( " result token received from adfs is [ { } ] " , wresult ) ; try ( input stream in = new byte array input stream ( wresult get bytes ( standard charsets utf 8 ) ) ) { logger debug ( " parsing token into a document " ) ; val document = config bean get parser pool ( ) parse ( in ) ; val metadata root = document get document element ( ) ; val unmarshaller factory = config bean get unmarshaller factory ( ) ; val unmarshaller = unmarshaller factory get unmarshaller ( metadata root ) ; if ( unmarshaller = = null ) { throw new illegal argument exception ( " unmarshaller for the metadata root element cannot be determined " ) ; } logger debug ( " unmarshalling the document into a security token response " ) ; val rs token = ( request security token response ) unmarshaller unmarshall ( metadata root ) ; if ( rs token get requested security token ( ) = = null ) { throw new illegal argument exception ( " request security token response is null " ) ; } logger debug ( " locating list of requested security tokens " ) ; val rst = rs token get requested security token ( ) ; if ( rst is empty ( ) ) { throw new illegal argument exception ( " no requested security token response is provided in the response " ) ; } logger debug ( " locating the first occurrence of a requested security token in the list " ) ; val req token = rst get ( 0 ) ; if ( req token get security tokens ( ) = = null | | req token get security tokens ( ) is empty ( ) ) { throw new illegal argument exception ( " requested security token response is not carrying any security tokens " ) ; } return req token ; } catch ( final exception ex ) { logging utils error ( logger , ex ) ; } return null ; }


returns a view of this immutable list in reverse order for example , { @ code immutable list of ( 1 , 2 , 3 ) reverse ( ) } is equivalent to { @ code immutable list of ( 3 , 2 , 1 ) }

public immutable list < e > reverse ( ) { return ( size ( ) < = 1 ) ? this : new reverse immutable list < e > ( this ) ; }


removes the block of defined code units from the listing all necessary checks will be made by listing before this method is called , so just do the work

private void delete address range ( address start , address end , boolean keep comments , task monitor monitor ) throws cancelled exception { lock acquire ( ) ; boolean success = false ; try { composite mgr remove range ( start , end ) ; monitor check canceled ( ) ; inst adapter delete records ( start , end ) ; monitor check canceled ( ) ; data adapter delete records ( start , end ) ; monitor check canceled ( ) ; length mgr remove range ( start , end ) ; monitor check canceled ( ) ; if ( ! keep comments ) { comment adapter delete records ( start , end ) ; monitor check canceled ( ) ; history adapter delete records ( start , end ) ; monitor check canceled ( ) ; } cache delete ( addr map get key ranges ( start , end , false ) ) ; success = true ; } catch ( i o exception e ) { program db error ( e ) ; } finally { if ( ! success ) { cache invalidate ( ) ; } lock release ( ) ; } }


returns whether all of a collection of { @ link cor ref } s are satisfied by at least one of a collection of { @ link cor def } s

private boolean has all ( collection < cor ref > cor refs , collection < cor def > cor defs ) { for ( cor ref cor ref : cor refs ) { if ( ! has ( cor defs , cor ref ) ) { return false ; } } return true ; }


notification that the capture function data types command completed

public void capture function data types completed ( capture function data types cmd cmd ) ;


return a sorted enumeration of the keys in this { @ link properties } object

public synchronized enumeration < object > keys ( ) { return collections enumeration ( key set ( ) ) ; }


re - initialize the < code > resource scheduler < code >

void reinitialize ( configuration conf , r m context rm context ) throws i o exception ;


test the property ' enum form string array '

public void enum form string array test ( ) { / / todo : test enum form string array }


private static linked hash map < aspect descriptor , aspect > deduplicate aspects ( iterable < aspect > aspect path ) throws aspect cycle on path exception { linked hash map < aspect descriptor , aspect > aspect map = new linked hash map < > ( ) ; array list < aspect > seen aspects = new array list < > ( ) ; for ( aspect aspect : aspect path ) { if ( ! aspect map contains key ( aspect get descriptor ( ) ) ) { aspect map put ( aspect get descriptor ( ) , aspect ) ; seen aspects add ( aspect ) ; } else { validate duplicate aspect ( aspect , seen aspects ) ; } } return aspect map ; }


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

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


registers { @ code type } identified by { @ code label } labels are case sensitive

public runtime type adapter factory < t > register subtype ( class < ? extends t > type , string label ) { if ( type = = null | | label = = null ) { throw new null pointer exception ( ) ; } if ( subtype to label contains key ( type ) | | label to subtype contains key ( label ) ) { throw new illegal argument exception ( " types and labels must be unique " ) ; } label to subtype put ( label , type ) ; subtype to label put ( type , label ) ; return this ; }


void write ( t data , object context , writable out ) ;


get the resource utilization of the node

public resource utilization get utilization ( ) ;


reads a code of given length and at given index in an array of bits

private static int read code ( boolean [ ] rawbits , int start index , int length ) { int res = 0 ; for ( int i = start index ; i < start index + length ; i + + ) { res < < = 1 ; if ( rawbits [ i ] ) { res | = 0x 0 1 ; } } return res ; }


public float get end value float ( ) { if ( end value float = = unset float ) { end value float = ( float ) ( float ) end value ; } return end value float ; }


sets a job to run after all currently running and queued jobs if a final job was already set , then that job will be replaced with the given job

public synchronized void set final job ( graph job job ) { trace ( " set final job ( ) - " + job ) ; if ( job is finished ( ) ) { throw new illegal argument exception ( " cannot schedule a finished job ! " ) ; } / / simply overwrite any pending final job , as we can only have one final job = objects require non null ( job , " graph job cannot be null " ) ; swing ( this : : maybe run next job ) ; }


creates a new { @ link recovery state } per shard this method is called once per shard on shard creation

recovery state new recovery state ( shard routing shard routing , discovery node target node , @ nullable discovery node source node ) ;


internal query to resolve the " to many desc list " to - many relationship of to many entity

public list < to many target entity > query to many entity to many desc list ( long to many id desc ) { synchronized ( this ) { if ( to many entity to many desc list query = = null ) { query builder < to many target entity > query builder = query builder ( ) ; query builder where ( properties to many id desc eq ( null ) ) ; query builder order raw ( " t ' id ' desc " ) ; to many entity to many desc list query = query builder build ( ) ; } } query < to many target entity > query = to many entity to many desc list query for current thread ( ) ; query set parameter ( 0 , to many id desc ) ; return query list ( ) ; }


test producer - consumer pattern through the mailbox in a concurrent setting ( n - writer 1 - reader )

private void test put take ( function with exception < task mailbox , mail , interrupted exception > take method ) throws exception { final int num threads = 10 ; final int num mails per thread = 1000 ; final int [ ] results = new int [ num threads ] ; thread [ ] writer threads = new thread [ num threads ] ; for ( int i = 0 ; i < writer threads length ; + + i ) { final int thread id = i ; writer threads [ i ] = new thread ( throwing runnable unchecked ( ( ) - > { for ( int k = 0 ; k < num mails per thread ; + + k ) { task mailbox put ( new mail ( ( ) - > + + results [ thread id ] , default priority , " result " + k ) ) ; } } ) ) ; } for ( thread writer thread : writer threads ) { writer thread start ( ) ; } for ( thread writer thread : writer threads ) { writer thread join ( ) ; } atomic boolean is running = new atomic boolean ( true ) ; task mailbox put ( new mail ( ( ) - > is running set ( false ) , default priority , " poison mail , default priority " ) ) ; while ( is running get ( ) ) { take method apply ( task mailbox ) run ( ) ; } for ( int per thread result : results ) { assert equals ( num mails per thread , per thread result ) ; } }


gets the paths of matching artifacts that are used as input to resource processing

private list < string > resource input paths ( string dir , validated android resources resource ) { return paths to artifacts ( dir , resource generating action ( resource ) get inputs ( ) to list ( ) ) ; }


enabledisable checking return for constant references

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


get an array of filter configuration specified in the conf

private static filter initializer [ ] get filter initializers ( configuration conf ) { if ( conf = = null ) { return null ; } class < ? > [ ] classes = conf get classes ( filter initializer property ) ; if ( classes = = null ) { return null ; } list < class < ? > > class list = new array list < > ( arrays as list ( classes ) ) ; if ( class list contains ( authentication filter initializer class ) & & class list contains ( proxy user authentication filter initializer class ) ) { class list remove ( authentication filter initializer class ) ; } filter initializer [ ] initializers = new filter initializer [ class list size ( ) ] ; for ( int i = 0 ; i < class list size ( ) ; i + + ) { initializers [ i ] = ( filter initializer ) reflection utils new instance ( class list get ( i ) , conf ) ; } return initializers ; }


public void debug print ( print writer out , boolean verbose ) { / / todo : maybe put something better here ? out println ( to string ( ) ) ; }


nodes on which the containers for this { @ link r m app } ran


public group plug un plug ( int group ) { return plugs remove ( group ) ; }


test a getters of task attempt finished event and task attempt finished

public void test task attempt finished event ( ) throws exception { job i d jid = new job i d ( " 001 " , 1 ) ; task i d tid = new task i d ( jid , task type reduce , 2 ) ; task attempt i d task attempt id = new task attempt i d ( tid , 3 ) ; counters counters = new counters ( ) ; task attempt finished event test = new task attempt finished event ( task attempt id , task type reduce , " test " , 123l , " rakname " , " hostname " , " status " , counters , 234 ) ; assert that ( test get attempt id ( ) to string ( ) ) is equal to ( task attempt id to string ( ) ) ; assert that ( test get counters ( ) ) is equal to ( counters ) ; assert that ( test get finish time ( ) ) is equal to ( 123l ) ; assert that ( test get hostname ( ) ) is equal to ( " hostname " ) ; assert that ( test get rack name ( ) ) is equal to ( " rakname " ) ; assert that ( test get state ( ) ) is equal to ( " status " ) ; assert that ( test get task id ( ) ) is equal to ( tid ) ; assert that ( test get task status ( ) ) is equal to ( " test " ) ; assert that ( test get task type ( ) ) is equal to ( task type reduce ) ; assert equals ( 234 , test get start time ( ) ) ; }


name of pattern that processing will be skipped to

public optional < string > get pattern name ( ) { return optional empty ( ) ; }


expands the query to another entity type by using a join the given source join ' s property is used to match the given destination property of the given destination entity note that destination entity of the given join is used as the source for the new join to add in this way , it is possible to compose complex " join of joins " across several entities if required

public < j > join < t , j > join ( join < ? , t > source join , property source property , class < j > destination entity class , property destination property ) { abstract dao < j , ? > destination dao = ( abstract dao < j , ? > ) dao get session ( ) get dao ( destination entity class ) ; return add join ( source join table prefix , source property , destination dao , destination property ) ; }


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


redirects any http request of type delete on ' from path ' to ' to path ' with the provided redirect ' status ' code

public void delete ( string from path , string to path , status status ) { http delete ( from path , redirect route ( to path , status ) ) ; }


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

public boolean is set error time secs ( ) { return isset bit vector get ( error time secs isset id ) ; }


returns endpoints for all listeners including the advertised host and port to which the listener is bound


resolve $ { } placeholders in the given text , replacing them with corresponding property values as resolved by { @ link # get property } unresolvable placeholders with no default value will cause an illegal argument exception to be thrown

string resolve required placeholders ( string text ) throws illegal argument exception ;


read - only settings the mock object was created with see { @ link org mockito mockito # mock ( class , mock settings ) }

mock creation settings < t > get mock settings ( ) ;


public void test gzip ( ) throws i o exception , interrupted exception { configuration conf = new configuration ( default conf ) ; compression codec gzip = new gzip codec ( ) ; reflection utils set conf ( gzip , conf ) ; local fs delete ( work dir , true ) ; write file ( local fs , new path ( work dir , " part 1 txt gz " ) , gzip , " line - 1 \ tthe quick \ nline - 2 \ tbrown \ nline - 3 \ t " + " fox jumped \ nline - 4 \ tover \ nline - 5 \ t the lazy \ nline - 6 \ t dog \ n " ) ; write file ( local fs , new path ( work dir , " part 2 txt gz " ) , gzip , " line - 1 \ tthis is a test \ nline - 1 \ tof gzip \ n " ) ; job job = job get instance ( conf ) ; file input format set input paths ( job , work dir ) ; key value text input format format = new key value text input format ( ) ; list < input split > splits = format get splits ( job ) ; assert equals ( " compressed splits = = 2 " , 2 , splits size ( ) ) ; file split tmp = ( file split ) splits get ( 0 ) ; if ( tmp get path ( ) get name ( ) equals ( " part 2 txt gz " ) ) { splits set ( 0 , splits get ( 1 ) ) ; splits set ( 1 , tmp ) ; } list < text > results = read split ( format , splits get ( 0 ) , job ) ; assert equals ( " splits [ 0 ] length " , 6 , results size ( ) ) ; assert equals ( " splits [ 0 ] [ 0 ] " , " the quick " , results get ( 0 ) to string ( ) ) ; assert equals ( " splits [ 0 ] [ 1 ] " , " brown " , results get ( 1 ) to string ( ) ) ; assert equals ( " splits [ 0 ] [ 2 ] " , " fox jumped " , results get ( 2 ) to string ( ) ) ; assert equals ( " splits [ 0 ] [ 3 ] " , " over " , results get ( 3 ) to string ( ) ) ; assert equals ( " splits [ 0 ] [ 4 ] " , " the lazy " , results get ( 4 ) to string ( ) ) ; assert equals ( " splits [ 0 ] [ 5 ] " , " dog " , results get ( 5 ) to string ( ) ) ; results = read split ( format , splits get ( 1 ) , job ) ; assert equals ( " splits [ 1 ] length " , 2 , results size ( ) ) ; assert equals ( " splits [ 1 ] [ 0 ] " , " this is a test " , results get ( 0 ) to string ( ) ) ; assert equals ( " splits [ 1 ] [ 1 ] " , " of gzip " , results get ( 1 ) to string ( ) ) ; }


create distributed cache emulator object and do the initialization by calling init ( ) on it with dummy trace also configure the pseudo local fs

private distributed cache emulator create distributed cache emulator ( configuration conf , path io path , boolean generate ) throws i o exception { distributed cache emulator dce = new distributed cache emulator ( conf , io path ) ; job creator job creator = job creator get policy ( conf , job creator loadjob ) ; job creator set dist cache emulator ( dce ) ; dce init ( " dummytrace " , job creator , generate ) ; return dce ; }


get the defaultassumed stack depth change for this language

private int get default stack depth change ( program prog , int depth ) { prototype model default model = prog get compiler spec ( ) get default calling convention ( ) ; int call stack mod = default model get extrapop ( ) ; int call stack shift = default model get stackshift ( ) ; if ( call stack mod ! = prototype model unknown extrapop ) { return call stack shift ; } if ( depth = = function unknown stack depth change | | depth = = function invalid stack depth change ) { return function unknown stack depth change ; } return call stack shift + depth ; }


public void set binary stream ( int parameter index , input stream x , int length ) throws s q l exception { }


get a connection form the connection pool

public connection get connection ( database configuration database configuration ) throws database service exception { try { if ( connection ! = null ) { connection close ( ) ; } class for name ( type get class path ( ) ) ; string db u r l = get database url ( database configuration ) ; connection = driver manager get connection ( db u r l ) ; logger debug ( " * * * acquired new connection for : : { } * * * * " , db u r l ) ; return connection ; } catch ( class not found exception e ) { logger error ( " jdbc driver not found " , e ) ; throw new database service exception ( e get message ( ) ) ; } catch ( s q l exception e ) { logger error ( " s q l exception : : couldn ' t get a connection ! " , e ) ; throw new database service exception ( true , e get s q l state ( ) , e get error code ( ) , e get message ( ) ) ; } }


default response entity < void > add pet ( @ api param ( value = " pet object that needs to be added to the store " , required = true ) @ valid @ request body pet body ) { return new response entity < > ( http status not implemented ) ; }


defines the size of a char ( char ) data type

public void set char size ( int char size ) { this char size = char size ; }


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


reports whether a starlark value is assumed to be deeply immutable

public static boolean is immutable ( object x ) { / / nb : this is used as the basis for accepting objects in depsets , / / as well as for accepting objects as keys for starlark dicts if ( x instanceof string | | x instanceof boolean ) { return true ; } else if ( x instanceof starlark value ) { return ( ( starlark value ) x ) is immutable ( ) ; } else { throw new illegal argument exception ( " invalid starlark value : " + x get class ( ) ) ; } }


get the value object which corresponds to an array in memory this will either be a string for the array stringable case or null

default object get array value ( mem buffer buf , settings settings , int length ) { if ( ! buf get memory ( ) get all initialized address set ( ) contains ( buf get address ( ) ) ) { return null ; } array stringable as = array stringable get array stringable ( get data type ( ) ) ; object value = ( as ! = null ) ? as get array string ( buf , settings , length ) : null ; return value ; / / todo / / for large array it is not scalable to create a java array object perhaps / / we could create a ghidra array that can dish out objects / / data type dt = array dt get data type ( ) ; / / class < ? > value class = dt get value class ( settings ) ; / / if ( value class ! = null ) { / / int count = array dt get num elements ( ) ; / / int element length = array dt get element length ( ) ; / / wrapped mem buffer wrapped buffer = new wrapped mem buffer ( buf , 0 ) ; / / object [ ] array = ( object [ ] ) java lang reflect array new instance ( value class , count ) ; / / for ( int i = 0 ; i < count ; i + + ) { / / wrapped buffer set base offset ( i * element length ) ; / / array [ i ] = dt get value ( wrapped buffer , settings , element length ) ; / / } / / return array ; / / } }


public int length ( ) { return value ! = null ? redis constants type length : 0 ; }


convenience method to create a model with a single node containing a sphere shape the resources the material might contain are not managed , use { @ link model # manage disposable ( disposable ) } to add those to the model

public model create sphere ( float width , float height , float depth , int divisions u , int divisions v , final material material , final long attributes ) { return create sphere ( width , height , depth , divisions u , divisions v , gl20 gl triangles , material , attributes ) ; }


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


we use a special form of unboxing that treats null as zero

private static int unbox ( @ nullable integer i ) { return ( i = = null ) ? 0 : i ; }


< t > flux < t > body to flux ( class < ? extends t > element class ) ;


create an f s data output stream at the indicated path

public f s data output stream create ( path f , boolean overwrite , int buffer size , short replication , long block size ) throws i o exception { return create ( f , overwrite , buffer size , replication , block size , null ) ; }


to test special tags to test special tags and operation id starting with number

public void call 1 2 3test special tags test ( ) throws api exception { client body = null ; client response = api call 1 2 3test special tags ( body ) ; / / todo : test validations }


creates new { @ link completion result }

static completion result wrap ( completion result completion result , lookup element lookup ) { return completion result wrap ( lookup , completion result get prefix matcher ( ) , completion result get sorter ( ) ) ; }


stores an empty blob that ' s linking to the temporary file where ' re we ' re uploading the initial data

public void store empty link file ( string key , string temp blob key , permission status permission status ) throws azure exception { if ( null = = storage interaction layer ) { final string err msg = string format ( " storage session expected for uri ' % s ' but does not exist " , session uri ) ; throw new assertion error ( err msg ) ; } / / check if there is an authenticated account associated with the file / / this instance of the wasb file system if not the file system has not / / been authenticated and all access is anonymous if ( ! is authenticated access ( ) ) { / / preemptively raise an exception indicating no uploads are / / allowed to anonymous accounts throw new azure exception ( " uploads to to public accounts using anonymous access is prohibited " ) ; } try { check container ( container access type pure write ) ; cloud blob wrapper blob = get blob reference ( key ) ; store permission status ( blob , permission status ) ; store link attribute ( blob , temp blob key ) ; open output stream ( blob ) close ( ) ; } catch ( exception e ) { / / caught exception while attempting upload re - throw as an azure / / storage exception throw new azure exception ( e ) ; } }


more complex validations with how { @ link transform config # get destination ( ) } and { @ link transform config # get source ( ) } relate are done in the transport handler

public action request validation exception validate ( ) { action request validation exception validation exception = null ; validation exception = config validate ( validation exception ) ; validation exception = source dest validator validate request ( validation exception , config get destination ( ) get index ( ) ) ; if ( transform strings is valid id ( config get id ( ) ) = = false ) { validation exception = add validation error ( transform messages get message ( transform messages invalid id , transform field id get preferred name ( ) , config get id ( ) ) , validation exception ) ; } if ( transform strings has valid length for id ( config get id ( ) ) = = false ) { validation exception = add validation error ( transform messages get message ( transform messages id too long , transform strings id length limit ) , validation exception ) ; } time value frequency = config get frequency ( ) ; if ( frequency ! = null ) { if ( frequency compare to ( min frequency ) < 0 ) { validation exception = add validation error ( " minimum permitted [ " + transform field frequency + " ] is [ " + min frequency get string rep ( ) + " ] " , validation exception ) ; } else if ( frequency compare to ( max frequency ) > 0 ) { validation exception = add validation error ( " highest permitted [ " + transform field frequency + " ] is [ " + max frequency get string rep ( ) + " ] " , validation exception ) ; } } return validation exception ; }


returns the difference of the given particular double value and this double value

public double value subtract from ( particular double value other ) { return subtract from ( ( specific double value ) other ) ; }


public boolean has messages ( ) { return count > 0 ; }


update the count of each directory with quota in the namespace a directory ' s count is defined as the total number inodes in the tree rooted at the directory this is an update of existing state of the filesystem and does not throw quota exceeded exception

void update count for quota ( int init threads ) { write lock ( ) ; try { int threads = ( init threads < 1 ) ? 1 : init threads ; log info ( " initializing quota with " + threads + " thread ( s ) " ) ; long start = time monotonic now ( ) ; quota counts counts = new quota counts builder ( ) build ( ) ; fork join pool p = new fork join pool ( threads ) ; recursive action task = new init quota task ( get block storage policy suite ( ) , root dir get storage policy i d ( ) , root dir , counts ) ; p execute ( task ) ; task join ( ) ; p shutdown ( ) ; log info ( " quota initialization completed in " + ( time monotonic now ( ) - start ) + " milliseconds \ n " + counts ) ; } finally { write unlock ( ) ; } }


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


clean up any known side - effects that the running spawn may have had on the output tree this is supposed to leave the output tree as it was right after { @ link com google devtools build lib skyframe skyframe action executor } created the output directories for the spawn , which means that any outputs have to be deleted but any top - level directory for tree artifacts has to be kept behind ( and empty )

private void maybe cleanup on interrupt ( ) { if ( ! local execution options local lockfree output ) { / / if we don ' t allow lockfree executions of local subprocesses , there is no need to clean up / / anything : we would have already locked the output tree upfront , so we " own " it return ; } if ( ! need cleanup ) { / / if the subprocess has not yet started , there is no need to worry about checking on - disk / / state return ; } for ( action input output : spawn get output files ( ) ) { path path = context get path resolver ( ) to path ( output ) ; try { if ( path exists ( ) ) { step log ( info , " clearing output % s after interrupt " , path ) ; if ( output instanceof artifact & & ( ( artifact ) output ) is tree artifact ( ) ) { path delete trees below ( ) ; } else { path delete tree ( ) ; } } } catch ( i o exception e ) { step log ( severe , e , " cannot delete local output % s after interrupt " , path ) ; } } }


returns if the label starts with a repository ( @ whatever ) or a package ( whatever )

public static boolean is absolute ( string label ) { return label starts with ( " / / " ) | | label starts with ( " @ " ) ; }


explicitly detaches current root { @ link litho view }

public litho view rule detach from window ( ) { get litho view ( ) on detached from window for test ( ) ; return this ; }


extract private key from resource private key

public static private key extract private key from resource ( final string signing secret key ) { logger debug ( " attempting to extract private key " ) ; val resource = resource utils get resource from ( signing secret key ) ; val factory = new private key factory bean ( ) ; factory set algorithm ( rsa key util rsa ) ; factory set location ( resource ) ; factory set singleton ( false ) ; return factory get object ( ) ; }


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

public void test group parameters ( integer required string group , boolean required boolean group , long required int 6 4 group , integer string group , boolean boolean group , long int 6 4 group , handler < async result < void > > result handler ) { delegate test group parameters ( required string group , required boolean group , required int 6 4 group , string group , boolean group , int 6 4 group , result handler ) ; }


check if this collection has the same attributes as the other collection if compare values is true , it also compares the values of each attribute

public final boolean same ( final attributes other , boolean compare values ) { if ( other = = this ) return true ; if ( ( other = = null ) | | ( mask ! = other mask ) ) return false ; if ( ! compare values ) return true ; sort ( ) ; other sort ( ) ; for ( int i = 0 ; i < attributes size ; i + + ) if ( ! attributes get ( i ) equals ( other attributes get ( i ) ) ) return false ; return true ; }


not supported use { @ link immutable sorted set # to immutable sorted set } instead this method exists only to hide { @ link immutable set # to immutable set } from consumers of { @ code immutable sorted set }

public static < e > collector < e , ? , immutable set < e > > to immutable set ( ) { throw new unsupported operation exception ( ) ; }


advances the ticker value by { @ code time } in { @ code time unit }

public synchronized fake test clock advance ( duration duration ) { monotonic = monotonic plus ( duration ) ; return this ; }


returns whether the legend will draw inside the chart or outside

public boolean is draw inside enabled ( ) { return m draw inside ; }


public literal value value ( double value ) { this value = value ; return this ; }


sets the coordinator for the two listings within this code comparison panel it coordinates their scrolling and location synchronization

public void set field panel coordinator ( listing comparison field panel coordinator listing field panel coordinator ) { listing comparison field panel coordinator field panel coordinator = get field panel coordinator ( ) ; if ( field panel coordinator = = listing field panel coordinator ) { return ; } super set field panel coordinator ( listing field panel coordinator ) ; if ( listing field panel coordinator ! = null ) { listing panel focused listing panel = get focused listing panel ( ) ; program location program location = focused listing panel get program location ( ) ; if ( program location ! = null ) { focused listing panel go to ( program location ) ; } } }


< code > replace function parameters < code > replaces the parameters of the function in program 1 with the parameters of the function in program 2 at the specified entry point address it also replaces the return typestorage as well as custom storage use

public void replace function parameters ( address origin entry point , task monitor monitor ) { address result entry point = origin to result translator get address ( origin entry point ) ; function result function = result program get function manager ( ) get function at ( result entry point ) ; function origin function = origin program get function manager ( ) get function at ( origin entry point ) ; replace function parameters ( result function , origin function ) ; }


all the active primary shards for the provided indices grouped ( each group is a single element , consisting of the primary shard ) this is handy for components that expect to get group iterators , but still want in some cases to iterate over all primary shards ( and not just one shard in replication group )

public group shards iterator < shard iterator > active primary shards grouped ( string [ ] indices , boolean include empty ) { / / use list here since we need to maintain identity across shards array list < shard iterator > set = new array list < > ( ) ; for ( string index : indices ) { index routing table index routing table = index ( index ) ; if ( index routing table = = null ) { throw new index not found exception ( index ) ; } for ( index shard routing table index shard routing table : index routing table ) { shard routing primary = index shard routing table primary shard ( ) ; if ( primary active ( ) ) { set add ( primary shards it ( ) ) ; } else if ( include empty ) { / / we need this for counting properly , just make it an empty one set add ( new plain shard iterator ( primary shard id ( ) , collections empty list ( ) ) ) ; } } } return group shards iterator sort and create ( set ) ; }


variant of { @ link # intercept ( class , callable ) } to simplify void invocations

public static < e extends throwable > e intercept ( class < e > clazz , string contained , string message , void callable eval ) throws exception { return intercept ( clazz , contained , message , ( ) - > { eval call ( ) ; return " void " ; } ) ; }


protected void paint text ( final graphics g , final j component c , final rectangle text rect , final string text ) { if ( u i util is help button ( c ) ) { return ; } final abstract button button = ( abstract button ) c ; final button model model = button get model ( ) ; color fg = is default button ( c ) ? primary button fg ( ) : button fg ( ) ; if ( fg instanceof u i resource & & button is selected ( ) ) { fg = selected button fg ( ) ; } else if ( model is rollover ( ) ) { fg = selected button fg ( ) ; } g set color ( fg ) ; final font metrics metrics = swing utilities 2 get font metrics ( c , g ) ; final string text to print = m t config get instance ( ) is upper case buttons ( ) ? text to upper case ( locale english ) : text ; final int text width = metrics string width ( text to print ) ; final int x = ( c get width ( ) - get text shift offset ( ) - text width ) / 2 ; final int y = text rect y + metrics get ascent ( ) ; final int mnemonic index = darcula laf is alt pressed ( ) ? button get displayed mnemonic index ( ) : - 1 ; if ( model is enabled ( ) ) { swing utilities 2 draw string underline char at ( c , g , text to print , mnemonic index , x , y ) ; } else { paint disabled text ( g , text , c , text rect , metrics ) ; } }


applies the given exception visitor to all exceptions that are applicable to the instruction at the specified offset

public void exceptions accept ( clazz clazz , method method , int offset , exception info visitor exception info visitor ) { for ( int index = 0 ; index < u 2exception table length ; index + + ) { exception info exception info = exception table [ index ] ; if ( exception info is applicable ( offset ) ) { exception info visitor visit exception info ( clazz , method , this , exception info ) ; } } }


returns a list of artifacts from ' provider ' that were registered by an aspect from ' aspect classes ' all artifacts in ' provider ' are considered - both direct and transitive

private static immutable list < artifact > filter transitive extra actions ( extra action artifacts provider provider , set < aspect class > aspect classes ) { immutable list builder < artifact > artifacts = immutable list builder ( ) ; / / add to ' artifacts ' all extra - actions which were registered by aspects which ' top level ' / / might have injected for ( artifact derived artifact artifact : provider get transitive extra action artifacts ( ) to list ( ) ) { action lookup key owner = artifact get artifact owner ( ) ; if ( owner instanceof aspect key ) { if ( aspect classes contains ( ( ( aspect key ) owner ) get aspect class ( ) ) ) { artifacts add ( artifact ) ; } } } return artifacts build ( ) ; }


public int get stream port ( ) { return base port + stream port ; }


collect all metrics from a { @ link metrics provider } a metrics provider provides a { @ link metrics provider # dump ( java util function bi consumer ) } method , that method will in general be more efficient and it does not impose to the metrics provider to waste resources

public static map < string , object > collect ( metrics provider metrics provider ) { map < string , object > res = new hash map < > ( ) ; metrics provider dump ( res : : put ) ; return res ; }


public boolean is active ( ) { return jni is active ( addr ) ; }


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

public base model view model on visibility state changed ( on model visibility state changed listener < base model view model , base model view > listener ) { on mutation ( ) ; this on model visibility state changed listener epoxy generated model = listener ; return this ; }


public string get application id ( ) { string application id = null ; if ( proto has application id ( ) ) { application id = proto get application id ( ) ; } return application id ; }


public api response < model api response > upload file with required file with http info ( long pet id , file required file , string additional metadata ) throws api exception { http request builder local var request builder = upload file with required file request builder ( pet id , required file , additional metadata ) ; try { http response < input stream > local var response = member var http client send ( local var request builder build ( ) , http response body handlers of input stream ( ) ) ; if ( member var response interceptor ! = null ) { member var response interceptor accept ( local var response ) ; } if ( local var response status code ( ) / 100 ! = 2 ) { throw new api exception ( local var response status code ( ) , " upload file with required file call received non - success response " , local var response headers ( ) , local var response body ( ) = = null ? null : new string ( local var response body ( ) read all bytes ( ) ) ) ; } return new api response < model api response > ( local var response status code ( ) , local var response headers ( ) map ( ) , member var object mapper read value ( local var response body ( ) , new type reference < model api response > ( ) { } ) ) ; } catch ( i o exception e ) { throw new api exception ( e ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new api exception ( e ) ; } }


public class < ? > get serialization view ( ) { return this serialization view ; }


test the metric snapshottable directories , allow snapshot ops , disallow snapshot ops , and list snapshottable dir ops

public void test snapshottable dirs ( ) throws exception { cluster get namesystem ( ) get snapshot manager ( ) set allow nested snapshots ( true ) ; assert gauge ( " snapshottable directories " , 0 , get metrics ( ns metrics ) ) ; assert counter ( " allow snapshot ops " , 0l , get metrics ( nn metrics ) ) ; assert counter ( " disallow snapshot ops " , 0l , get metrics ( nn metrics ) ) ; / / allow snapshots for directories , and check the metrics hdfs allow snapshot ( sub 1 ) ; assert gauge ( " snapshottable directories " , 1 , get metrics ( ns metrics ) ) ; assert counter ( " allow snapshot ops " , 1l , get metrics ( nn metrics ) ) ; path sub 2 = new path ( dir , " sub 2 " ) ; path file = new path ( sub 2 , " file " ) ; d f s test util create file ( hdfs , file , 1024 , replication , seed ) ; hdfs allow snapshot ( sub 2 ) ; assert gauge ( " snapshottable directories " , 2 , get metrics ( ns metrics ) ) ; assert counter ( " allow snapshot ops " , 2l , get metrics ( nn metrics ) ) ; path subsub 1 = new path ( sub 1 , " sub 1sub 1 " ) ; path subfile = new path ( subsub 1 , " file " ) ; d f s test util create file ( hdfs , subfile , 1024 , replication , seed ) ; hdfs allow snapshot ( subsub 1 ) ; assert gauge ( " snapshottable directories " , 3 , get metrics ( ns metrics ) ) ; assert counter ( " allow snapshot ops " , 3l , get metrics ( nn metrics ) ) ; / / set an already snapshottable directory to snapshottable , should not / / change the metrics hdfs allow snapshot ( sub 1 ) ; assert gauge ( " snapshottable directories " , 3 , get metrics ( ns metrics ) ) ; / / but the number of allow snapshot operations still increases assert counter ( " allow snapshot ops " , 4l , get metrics ( nn metrics ) ) ; / / disallow the snapshot for snapshottable directories , then check the / / metrics again hdfs disallow snapshot ( sub 1 ) ; assert gauge ( " snapshottable directories " , 2 , get metrics ( ns metrics ) ) ; assert counter ( " disallow snapshot ops " , 1l , get metrics ( nn metrics ) ) ; / / delete subsub 1 , snapshottable directories should be 1 hdfs delete ( subsub 1 , true ) ; assert gauge ( " snapshottable directories " , 1 , get metrics ( ns metrics ) ) ; / / list all the snapshottable directories snapshottable directory status [ ] status = hdfs get snapshottable dir listing ( ) ; assert equals ( 1 , status length ) ; assert counter ( " list snapshottable dir ops " , 1l , get metrics ( nn metrics ) ) ; }


public final byte [ ] get byte array ( ) { return this byte array ; }


take a varargs list and and return as an array

private string [ ] l ( string s ) { return s ; }


slices the given buffer to the given index ( exclusive )

public static data buffer slice to ( data buffer buf , int idx ) { int pos = buf read position ( ) ; int len = idx - pos + 1 ; return buf retained slice ( pos , len ) ; }


a { @ link collector } implementation that joins { @ link code block } instances together into one separated by { @ code separator } for example , joining { @ code string s } , { @ code object o } and { @ code int i } using { @ code " , " } would produce { @ code string s , object o , int i }

public static collector < code block , ? , code block > joining ( string separator ) { return collector of ( ( ) - > new code block joiner ( separator , builder ( ) ) , code block joiner : : add , code block joiner : : merge , code block joiner : : join ) ; }


returns true if there is at least one of the provided domain files can be or is version controlled

public boolean is add to popup ( domain file context context ) { if ( ! context is in active project ( ) ) { return false ; } check repository ( ) ; list < domain file > domain files = context get selected files ( ) ; for ( domain file domain file : domain files ) { if ( domain file get version ( ) > 0 ) { return true ; / / has at least one domain file that can be or is version controlled } } return false ; }


writes a new line to the file , if it doesn ' t exist it will automatically create it

public static synchronized void write new line ( string filename , byte [ ] file contents , boolean debug ) { print writer writer = null ; string original = filename ; int counter = 0 ; boolean saved = false ; while ( ! saved ) { try { writer = new print writer ( new buffered writer ( new file writer ( filename , true ) ) ) ; writer println ( file contents ) ; if ( debug ) system out println ( " saved " + filename + " to disk " ) ; saved = true ; } catch ( exception e ) { if ( debug ) system out println ( " failed saving , trying to save as " + filename ) ; if ( original contains ( " " ) ) { filename = insert file name ( original , " " + counter ) ; } else filename = original + counter ; counter + + ; } } writer close ( ) ; }


intercepts { @ link channel handler context # read ( ) }

void read ( channel handler context ctx ) throws exception ;


stops a specific node in the cluster returns true if the node was found to stop , false otherwise

public synchronized boolean stop node ( string node name ) throws i o exception { ensure open ( ) ; optional < node and client > node to stop = nodes values ( ) stream ( ) filter ( n - > n get name ( ) equals ( node name ) ) find first ( ) ; if ( node to stop is present ( ) ) { logger info ( " closing node [ { } ] " , node to stop get ( ) name ) ; stop nodes and client ( node to stop get ( ) ) ; return true ; } return false ; }


configure custom return value handlers for handler methods

public void add custom handler ( handler method return value handler handlers ) { assert not null ( handlers , " ' handlers ' must not be null " ) ; this custom handlers add all ( arrays as list ( handlers ) ) ; }


public boolean is magic commit enabled ( ) { return committer integration is magic commit enabled ( ) ; }


return a { @ link socket input wrapper } for the socket and set the given timeout if the socket does not have an associated channel , then its socket timeout will be set to the specified value otherwise , a { @ link socket input stream } will be created which reads with the configured timeout any socket created using socket factories returned by { @ link # net utils } , must use this interface instead of { @ link socket # get input stream ( ) } in general , this should be called only once on each socket : see the note in { @ link socket input wrapper # set timeout ( long ) } for more information

public static socket input wrapper get input stream ( socket socket , long timeout ) throws i o exception { input stream stm = ( socket get channel ( ) = = null ) ? socket get input stream ( ) : new socket input stream ( socket ) ; socket input wrapper w = new socket input wrapper ( socket , stm ) ; w set timeout ( timeout ) ; return w ; }


utility to create a { @ link container status } during exceptional circumstances

public static container status create abnormal container status ( container id container id , string diagnostics ) { return create abnormal container status ( container id , container exit status aborted , diagnostics ) ; }


checks the two iterables for equality by first converting both to a list

public static < t > void check equals ( iterable < t > it 1 , iterable < t > it 2 ) { assert equals ( to list ( it 1 ) , to list ( it 2 ) ) ; }


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


utility to check the supplied key or value for references to the old schema , and if so to return an updated key or value object that references the new schema note that this method assumes that the new schema may have a different name andor version , but has fields that exactly match those of the old schema currently only { @ link struct } objects have references to the { @ link schema }

protected static object update schema in ( object key or value , schema updated schema ) { if ( key or value instanceof struct ) { struct orig struct = ( struct ) key or value ; struct new struct = new struct ( updated schema ) ; for ( field field : updated schema fields ( ) ) { / / assume both schemas have exact same fields with same names and schemas new struct put ( field , orig struct get ( field ) ) ; } return new struct ; } return key or value ; }


return true if this action implies that action

public boolean implies ( fs action that ) { if ( that ! = null ) { return ( ordinal ( ) & that ordinal ( ) ) = = that ordinal ( ) ; } return false ; }


initiate a graceful failover by talking to the target node ' s zkfc this sends an rpc to the zkfc , which coordinates the failover

protected int graceful failover through z k f cs ( h a service target to node ) throws i o exception { int timeout = failover controller get rpc timeout to new active ( get conf ( ) ) ; z k f c protocol proxy = to node get z k f c proxy ( get conf ( ) , timeout ) ; try { proxy graceful failover ( ) ; out println ( " failover to " + to node + " successful " ) ; } catch ( service failed exception sfe ) { err out println ( " failover failed : " + sfe get localized message ( ) ) ; return - 1 ; } return 0 ; }


use the http cookie value as the cache key so multiple executions in the same hystrix request context will respond from cache

protected string get cache key ( ) { return http cookie get value ( ) ; }


returns a custom { @ link patch transition } with the given value added to { @ link test configuration test options # test filter }

private static patch transition new patch transition ( final string value ) { return new patch transition ( ) { @ override public immutable set < class < ? extends fragment options > > requires option fragments ( ) { return immutable set of ( test configuration test options class ) ; } @ override public build options patch ( build options view options , event handler event handler ) { build options view to options = options clone ( ) ; test configuration test options base options = to options get ( test configuration test options class ) ; base options test filter = null to empty ( base options test filter ) + value ; return to options underlying ( ) ; } } ; }


set the suffix that gets appended to view names when building a url

public url based view resolver registration suffix ( string suffix ) { this view resolver set suffix ( suffix ) ; return this ; }


add a sequence of validation errors to the accumulating validation errors

public final void add validation errors ( iterable < string > errors ) { for ( string error : errors ) { validation errors add ( error ) ; } }


match the specified candidate against the configured patterns

protected boolean matches pattern ( string signature string ) { for ( int i = 0 ; i < this patterns length ; i + + ) { boolean matched = matches ( signature string , i ) ; if ( matched ) { for ( int j = 0 ; j < this excluded patterns length ; j + + ) { boolean excluded = matches exclusion ( signature string , j ) ; if ( excluded ) { return false ; } } return true ; } } return false ; }


determine if current name is a default name this is more important for parameters so always returning false for locals is ok

protected boolean has default name ( ) { return false ; }


public void visit newarray ( int offset , int length , cst type type , array list < constant > init values ) { / / this space intentionally left blank }


return a map with all handler methods and their mappings

public map < t , handler method > get handler methods ( ) { return collections unmodifiable map ( this handler methods ) ; }


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


public final cancellable exists source async ( get source request get source request , request options options , action listener < boolean > listener ) { return perform request async ( get source request , request converters : : source exists , options , rest high level client : : convert exists response , listener , empty set ( ) ) ; }


specifies whether the graph will allow self - loops ( edges that connect a node to itself ) attempting to add a self - loop to a graph that does not allow them will throw an { @ link unsupported operation exception } the default value is { @ code false }

public graph builder < n > allows self loops ( boolean allows self loops ) { this allows self loops = allows self loops ; return this ; }


manually implemented with json so not as slow as normal java

public span serialize kryo ( ) { return kryo read object ( new input ( client span serialized ) , span class ) ; }


public void set margin height ( int mh ) { margin height = mh ; repaint ( ) ; }


rm service contexts which runs through out jvm life span these are created once during start of rm

public r m service context get service context ( ) { return service context ; }


sets the < code > declawed < code > property

public void set declawed ( boolean declawed ) { this declawed = declawed ; }


protected static assembly resolution solve or backfill ( pattern expression exp , masked long goal , map < string , long > vals , map < integer , object > res , assembly resolved constructor cur , string description ) { try { return solver solve ( exp , goal , vals , res , cur , description ) ; } catch ( needs backfill exception bf ) { int field length = solver get instruction length ( exp , res ) ; return assembly resolution backfill ( exp , goal , res , field length , description ) ; } }


resets relative position state when the base field is moved

private void reset ( ) { x = get start ( ) ; y = base row * row height ; width left field = - 1 ; width right field = - 1 ; if ( base col > 0 ) { width left field = model get factorys ( base row ) [ base col - 1 ] get width ( ) ; } if ( base col < model get factorys ( base row ) length - 1 ) { width right field = model get factorys ( base row ) [ base col + 1 ] get width ( ) ; } }


public void update pet ( pet body , handler < async result < void > > result handler ) { update pet ( body , null , result handler ) ; }


performs intersect on the edge sets of the input graphs edges are considered equal , if they have the same source identifier , target identifier and edge value the method computes pairs of equal edges from the input graphs if the same edge occurs multiple times in the input graphs , there will be multiple edge pairs to be considered each edge instance can only be part of one pair if the given parameter { @ code distinct edges } is set to { @ code true } , there will be exactly one edge in the output graph representing all pairs of equal edges if the parameter is set to { @ code false } , both edges of each pair will be in the output vertices in the output graph will have no vertex values

public graph < k , null value , ev > intersect ( graph < k , vv , ev > graph , boolean distinct edges ) { data set < edge < k , ev > > intersect edges ; if ( distinct edges ) { intersect edges = get distinct edge intersection ( graph get edges ( ) ) ; } else { intersect edges = get pairwise edge intersection ( graph get edges ( ) ) ; } return graph from data set ( intersect edges , get context ( ) ) ; }


determine whether a { @ link reader } is required as opposed to an { @ link input stream } , i e whether an { @ linkplain # get encoding ( ) encoding } or a { @ link # get charset ( ) charset } has been specified

public boolean requires reader ( ) { return ( this encoding ! = null | | this charset ! = null ) ; }


checks whether this node has branching output a node ' s output is branched , if it has more than one output connection

public boolean is branching ( ) { return get outgoing connections ( ) ! = null & & get outgoing connections ( ) size ( ) > 1 ; }


returns type mappings using type parameters and type arguments found in the generic superclass and the super interfaces of { @ code context class }

static immutable map < type variable key , type > get type mappings ( type context type ) { check not null ( context type ) ; type mapping introspector introspector = new type mapping introspector ( ) ; introspector visit ( context type ) ; return immutable map copy of ( introspector mappings ) ; }


public static string read file 2 string ( final file file ) { return read file 2 string ( file , null ) ; }


create a builder with a { @ linkplain http status # see other 303 see other } status and a location header set to the given uri

static body builder see other ( uri location ) { body builder builder = status ( http status see other ) ; return builder location ( location ) ; }


tells the heartbeat and handler threads to stop and waits for them to terminate

protected void service stop ( ) throws exception { keep running = false ; heartbeat thread interrupt ( ) ; try { heartbeat thread join ( ) ; } catch ( interrupted exception ex ) { log error ( " error joining with heartbeat thread " , ex ) ; } client stop ( ) ; handler thread interrupt ( ) ; super service stop ( ) ; }


public long get network bytes read ( ) { refresh if needed ( ) ; return net bytes read ; }


decorates the given { @ link readable buffer } to ignore calls to { @ link readable buffer # close }

public static readable buffer ignore close ( readable buffer buffer ) { return new forwarding readable buffer ( buffer ) { @ override public void close ( ) { / / ignore } } ; }


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


returns the next available http chunk the caller is responsible to test if this chunk is the last one ( is last ( ) ) , in order to stop calling this get method

public http content read chunk ( byte buf allocator allocator ) throws exception { if ( is last chunk sent ) { return null ; } else { http content next chunk = next chunk ( ) ; global progress + = next chunk content ( ) readable bytes ( ) ; return next chunk ; } }


private void wipe cluster settings ( ) throws i o exception { map < ? , ? > get response = entity as map ( admin client ( ) perform request ( new request ( " get " , " / cluster / settings " ) ) ) ; boolean must clear = false ; x content builder clear command = json x content content builder ( ) ; clear command start object ( ) ; for ( map entry < ? , ? > entry : get response entry set ( ) ) { string type = entry get key ( ) to string ( ) ; map < ? , ? > settings = ( map < ? , ? > ) entry get value ( ) ; if ( settings is empty ( ) ) { continue ; } must clear = true ; clear command start object ( type ) ; for ( object key : settings key set ( ) ) { clear command field ( key + " * " ) null value ( ) ; } clear command end object ( ) ; } clear command end object ( ) ; if ( must clear ) { request request = new request ( " put " , " / cluster / settings " ) ; request set json entity ( strings to string ( clear command ) ) ; admin client ( ) perform request ( request ) ; } }


converts a unix timestamp into a 32 - bit dos timestamp

static int unix to dos time ( long time millis ) { calendar time = calendar get instance ( ) ; time set time in millis ( time millis ) ; if ( ! is valid in dos ( time millis ) ) { date format df = new simple date format ( " yyyy - mm - dd hh : mm : ss " ) ; throw new illegal argument exception ( string format ( " % s is not representable in the dos time " + " format it must be in the range % s to % s " , df format ( time get time ( ) ) , df format ( new date ( dos epoch ) ) , df format ( new date ( max dos date ) ) ) ) ; } int dos = time get ( calendar second ) / 2 ; dos | = time get ( calendar minute ) < < dos minute offset ; dos | = time get ( calendar hour of day ) < < dos hour offset ; dos | = time get ( calendar day of month ) < < dos day offset ; dos | = ( time get ( calendar month ) + 1 ) < < dos month offset ; dos | = ( time get ( calendar year ) - 1980 ) < < dos year offset ; return dos ; }


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


return the first readable storage file of the given name across any of the ' current ' directories in s ds of the given type , or null if no such file exists

private file find file ( name node dir type dir type , string name ) { for ( storage directory sd : dir iterable ( dir type ) ) { file candidate = new file ( sd get current dir ( ) , name ) ; if ( file util can read ( sd get current dir ( ) ) & & candidate exists ( ) ) { return candidate ; } } return null ; }


sets the cue box anchor positioned by { @ link # set position ( float ) position }

public builder set position anchor ( @ anchor type int position anchor ) { this position anchor = position anchor ; return this ; }


returns { @ code true } if key names present at @ left , appearing in prefix order at @ right

public boolean is ordered subset ( ) { return is ordered subset ; }


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


normalize the geo { @ code point } for the given coordinates to lie within their respective normalized ranges you can control which coordinate gets normalized with the two flags note : a shift of 180 & deg ; is applied in the longitude if necessary , in order to normalize properly the latitude if normalizing latitude but not longitude , it is assumed that the longitude is in the form x + k 3 6 0 , with x in ] - 180 ; 180 ] , and k is meaningful to the application therefore x will be adjusted while keeping k preserved

public static void normalize point ( geo point point , boolean norm lat , boolean norm lon ) { double [ ] pt = { point lon ( ) , point lat ( ) } ; normalize point ( pt , norm lon , norm lat ) ; point reset ( pt [ 1 ] , pt [ 0 ] ) ; }


public builder add sdk dylibs ( nested set < string > sdk dylibs ) { this sdk dylibs add transitive ( sdk dylibs ) ; return this ; }


public headers headers ( ) { return headers ; }


determine if this schema can use fixed key node ' s within a table

boolean use fixed key nodes ( ) { return ! use variable key nodes ( ) & & ! use long key nodes ( ) ; }


clears the observer list so that this object no longer has any observers

public void delete observers ( ) { obs clear ( ) ; }


storages are marked as " content stale " after nn restart or fails over and before nn receives the first heartbeat followed by the first blockreport

public int get num stale storages ( ) { return get block manager ( ) get datanode manager ( ) get num stale storages ( ) ; }


returns the default value of the ith parameter ( { @ code 0 < = i < get parameter names ( ) size ( ) } ) , or null if the parameter is required residual parameters , if any , are always last , and have no default value

public object get default value ( int i ) { if ( i < 0 | | i > = rfn get parameters ( ) size ( ) ) { throw new index out of bounds exception ( ) ; } int nparams = rfn get parameters ( ) size ( ) - ( rfn has kwargs ( ) ? 1 : 0 ) - ( rfn has varargs ( ) ? 1 : 0 ) ; int prefix = nparams - default values size ( ) ; if ( i < prefix ) { return null ; / / implicit prefix of mandatory parameters } if ( i < nparams ) { object v = default values get ( i - prefix ) ; return v = = mandatory ? null : v ; } return null ; / / * args or * kwargs }


see { @ link # friendly encode h t m l ( string ) }

private static string friendly encode h t m l ( string text , boolean skip leading whitespace ) { string builder buffer = new string builder ( ) ; int i = 0 ; int col = 0 ; if ( skip leading whitespace ) { for ( i = 0 ; i < text length ( ) ; i + + ) { / / skip leading spaces if ( ! character is whitespace ( text char at ( i ) ) ) { break ; } } } for ( ; i < text length ( ) ; i + + ) { char c = text char at ( i ) ; if ( c = = ' \ r ' ) { / / strip cr and reset column col = 0 ; continue ; } else if ( c = = ' \ n ' ) { buffer append ( c ) ; col = 0 ; continue ; } else if ( c = = ' \ t ' ) { int cnt = tab size - ( col % tab size ) ; for ( int k = 0 ; k < cnt ; k + + ) { buffer append ( html space ) ; } col = 0 ; continue ; } else if ( c = = ' ' ) { buffer append ( html space ) ; } else if ( c < ' ' ) { / / strip other non - printing chars continue ; } else if ( c > 0x 7 f ) { buffer append ( " & # x " ) ; buffer append ( integer to string ( c , 16 ) to upper case ( ) ) ; buffer append ( " ; " ) ; } else { switch ( c ) { case ' & ' : buffer append ( " & amp ; " ) ; break ; case ' < ' : buffer append ( " & lt ; " ) ; break ; case ' > ' : buffer append ( " & gt ; " ) ; break ; case 0x 7 f : break ; default : buffer append ( c ) ; break ; } } + + col ; } return buffer to string ( ) ; }


public object remove ( int index ) { object o = opt ( index ) ; this my array list remove ( index ) ; return o ; }


returns the index of the last window in the playback order depending on whether shuffling is enabled

public int get last window index ( boolean shuffle mode enabled ) { return is empty ( ) ? c index unset : get window count ( ) - 1 ; }


returns the java call methods declared for a python object some python " methods " in the new - style python objects are actually classes in and of themselves , re - implementing call methods to tell us how to call them this returns an array of those methods ( for code completion help )

public static object [ ] get call methods ( py object obj ) { list < method > call method list = new array list < > ( ) ; method [ ] declared methods = obj get class ( ) get declared methods ( ) ; for ( method declared method : declared methods ) { if ( declared method get name ( ) equals ( " call " ) ) { call method list add ( declared method ) ; } } return call method list to array ( ) ; }


public void get gauge ( io grpc testing integration metrics gauge request request , io grpc stub stream observer < io grpc testing integration metrics gauge response > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get get gauge method ( ) , get call options ( ) ) , request , response observer ) ; }


show the given tooltip on the component with the given handle instance

public static void show tooltip on handle ( component context c , final popup window popup window , handle handle , int x offset , int y offset ) { show tooltip on handle ( c , new litho tooltip ( ) { @ override public void show litho tooltip ( view container , rect anchor bounds , int x offset , int y offset ) { popup window show as drop down ( container , anchor bounds left + x offset , anchor bounds bottom + y offset ) ; } } , handle , x offset , y offset ) ; }


add a single include directory to be added with " - i " it can be either relative to the exec root ( see { @ link com google devtools build lib analysis blaze directories # get exec root ( string ) } ) or absolute before it is stored , the include directory is normalized

public builder add include dir ( path fragment include dir ) { include dirs add ( include dir ) ; return this ; }


checks to see if the given project is a ghidra project

public static boolean is ghidra project ( i project project ) { return is java project ( project ) & & project get folder ( ghidra folder name ) exists ( ) ; }


public void set program ( program program ) { model set program ( program ) ; }


returns the name of the directory where the solib symlinks for the dynamic runtime libraries live the directory itself will be under the root of the host configuration in the ' bin ' directory

public path fragment get dynamic runtime solib dir ( ) { return dynamic runtime solib dir ; }


public void rebase ( final object result ) { rebased = true ; this result = result ; }


public void add contents ( dex file file ) { mixed item section word data = file get word data ( ) ; if ( class annotations ! = null ) { class annotations = word data intern ( class annotations ) ; } if ( field annotations ! = null ) { for ( field annotation struct item : field annotations ) { item add contents ( file ) ; } } if ( method annotations ! = null ) { for ( method annotation struct item : method annotations ) { item add contents ( file ) ; } } if ( parameter annotations ! = null ) { for ( parameter annotation struct item : parameter annotations ) { item add contents ( file ) ; } } }


configures { @ link # bind ( ) } to attach vertices in { @ code buffer } ( each of size { @ code size } elements ) to this { @ link attribute }

public void set buffer ( float [ ] buffer , int size ) { this buffer = create buffer ( buffer ) ; this size = size ; }


post fakecreate xml item : creates an xml item this route creates an xml item

default response entity < void > create xml item ( xml item xml item ) { return new response entity < > ( http status not implemented ) ; }


{ @ code annotation config context loader } should be used as a { @ link org springframework test context smart context loader smart context loader } , not as a legacy { @ link org springframework test context context loader context loader } consequently , this method is not supported

protected string [ ] modify locations ( class < ? > clazz , string locations ) { throw new unsupported operation exception ( " annotation config context loader does not support the modify locations ( class , string ) method " ) ; }


instant get expiration time ( ) { return expiration time ; }


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


in this short living thread , any local states should be collected before the thread dies away

private void collect thread local states ( ) { if ( datanode get peer metrics ( ) ! = null ) { datanode get peer metrics ( ) collect thread local states ( ) ; } }


public string get sc a e t h flow points ( ) { return sc a e t h flow points ; }


public integer get int 3 2 ( ) { return int 3 2 ; }


private input stream get test jpeg input stream ( ) { return get test image input stream ( " redsquare jpg " ) ; }


whether to copy the http session id to the handshake attributes

public boolean is copy http session id ( ) { return this copy http session id ; }


initialize this shader , causing all registered uniformsattributes to be fetched

public void init ( final shader program program , final renderable renderable ) { if ( locations ! = null ) throw new gdx runtime exception ( " already initialized " ) ; if ( ! program is compiled ( ) ) throw new gdx runtime exception ( program get log ( ) ) ; this program = program ; final int n = uniforms size ; locations = new int [ n ] ; for ( int i = 0 ; i < n ; i + + ) { final string input = uniforms get ( i ) ; final validator validator = validators get ( i ) ; final setter setter = setters get ( i ) ; if ( validator ! = null & & ! validator validate ( this , i , renderable ) ) locations [ i ] = - 1 ; else { locations [ i ] = program fetch uniform location ( input , false ) ; if ( locations [ i ] > = 0 & & setter ! = null ) { if ( setter is global ( this , i ) ) global uniforms add ( i ) ; else local uniforms add ( i ) ; } } if ( locations [ i ] < 0 ) { validators set ( i , null ) ; setters set ( i , null ) ; } } if ( renderable ! = null ) { final vertex attributes attrs = renderable mesh part mesh get vertex attributes ( ) ; final int c = attrs size ( ) ; for ( int i = 0 ; i < c ; i + + ) { final vertex attribute attr = attrs get ( i ) ; final int location = program get attribute location ( attr alias ) ; if ( location > = 0 ) attributes put ( attr get key ( ) , location ) ; } } }


return the number of days since the last usage relevant only if the last use date is not null

public long get num days use ( ) { return last use date = = null ? 0 : util days elapsed since ( last use date ) ; }


public string get additional metadata ( ) { return additional metadata ; }


visit a parse tree produced by the { @ code value expression default } labeled alternative in { @ link eql base parser # value expression }

t visit value expression default ( eql base parser value expression default context ctx ) ;


runs cleanup operations on the given repository

private void cleanup repo ( string repository name , action listener < repository cleanup result > listener ) { final repository repository = repositories service repository ( repository name ) ; if ( repository instanceof blob store repository = = false ) { listener on failure ( new illegal argument exception ( " repository [ " + repository name + " ] does not support repository cleanup " ) ) ; return ; } final blob store repository blob store repository = ( blob store repository ) repository ; final step listener < repository data > repository data listener = new step listener < > ( ) ; repository get repository data ( repository data listener ) ; repository data listener when complete ( repository data - > { final long repository state id = repository data get gen id ( ) ; logger info ( " running cleanup operations on repository [ { } ] [ { } ] " , repository name , repository state id ) ; cluster service submit state update task ( " cleanup repository [ " + repository name + " ] [ " + repository state id + ' ] ' , new cluster state update task ( ) { private boolean started cleanup = false ; @ override public cluster state execute ( cluster state current state ) { final repository cleanup in progress repository cleanup in progress = current state custom ( repository cleanup in progress type , repository cleanup in progress empty ) ; if ( repository cleanup in progress has cleanup in progress ( ) ) { throw new illegal state exception ( " cannot cleanup [ " + repository name + " ] - a repository cleanup is already in - progress in [ " + repository cleanup in progress + " ] " ) ; } final snapshot deletions in progress deletions in progress = current state custom ( snapshot deletions in progress type , snapshot deletions in progress empty ) ; if ( deletions in progress has deletions in progress ( ) ) { throw new illegal state exception ( " cannot cleanup [ " + repository name + " ] - a snapshot is currently being deleted in [ " + deletions in progress + " ] " ) ; } snapshots in progress snapshots = current state custom ( snapshots in progress type , snapshots in progress empty ) ; if ( snapshots entries ( ) is empty ( ) = = false ) { throw new illegal state exception ( " cannot cleanup [ " + repository name + " ] - a snapshot is currently running in [ " + snapshots + " ] " ) ; } return cluster state builder ( current state ) put custom ( repository cleanup in progress type , new repository cleanup in progress ( list of ( repository cleanup in progress started entry ( repository name , repository state id ) ) ) ) build ( ) ; } @ override public void on failure ( string source , exception e ) { after ( e , null ) ; } @ override public void cluster state processed ( string source , cluster state old state , cluster state new state ) { started cleanup = true ; logger debug ( " initialized repository cleanup in cluster state for [ { } ] [ { } ] " , repository name , repository state id ) ; thread pool executor ( thread pool names snapshot ) execute ( action runnable wrap ( listener , l - > blob store repository cleanup ( repository state id , snapshots service min compatible version ( new state nodes ( ) get min node version ( ) , repository data , null ) , action listener wrap ( result - > after ( null , result ) , e - > after ( e , null ) ) ) ) ) ; } private void after ( @ nullable exception failure , @ nullable repository cleanup result result ) { if ( failure = = null ) { logger debug ( " finished repository cleanup operations on [ { } ] [ { } ] " , repository name , repository state id ) ; } else { logger debug ( ( ) - > new parameterized message ( " failed to finish repository cleanup operations on [ { } ] [ { } ] " , repository name , repository state id ) , failure ) ; } assert failure ! = null | | result ! = null ; if ( started cleanup = = false ) { logger debug ( " no cleanup task to remove from cluster state because we failed to start one " , failure ) ; listener on failure ( failure ) ; return ; } cluster service submit state update task ( " remove repository cleanup task [ " + repository name + " ] [ " + repository state id + ' ] ' , new cluster state update task ( ) { @ override public cluster state execute ( cluster state current state ) { return remove in progress cleanup ( current state ) ; } @ override public void on failure ( string source , exception e ) { if ( failure ! = null ) { e add suppressed ( failure ) ; } logger warn ( ( ) - > new parameterized message ( " [ { } ] failed to remove repository cleanup task " , repository name ) , e ) ; listener on failure ( e ) ; } @ override public void cluster state processed ( string source , cluster state old state , cluster state new state ) { if ( failure = = null ) { logger info ( " done with repository cleanup on [ { } ] [ { } ] with result [ { } ] " , repository name , repository state id , result ) ; listener on response ( result ) ; } else { logger warn ( ( ) - > new parameterized message ( " failed to run repository cleanup operations on [ { } ] [ { } ] " , repository name , repository state id ) , failure ) ; listener on failure ( failure ) ; } } } ) ; } } ) ; } , listener : : on failure ) ; }


if the recovery source is on an old node ( before { @ link org elasticsearch version # v 7 2 0 } ) then the recovery target won ' t have the safe commit after phase 1 because the recovery source does not send the global checkpoint in the clean files step and if the recovery fails and retries , then the recovery stage might not transition properly this test simulates this behavior by changing the global checkpoint in phase 1 to unassigned

public void test simulate recovery source on old node ( ) throws exception { internal cluster ( ) start master only node ( ) ; string source = internal cluster ( ) start data only node ( ) ; string index name = " test " ; assert acked ( client ( ) admin ( ) indices ( ) prepare create ( index name ) set settings ( settings builder ( ) put ( index metadata setting number of shards , 1 ) put ( index metadata setting number of replicas , 0 ) ) ) ; ensure green ( index name ) ; if ( random boolean ( ) ) { index random ( random boolean ( ) , random boolean ( ) , random boolean ( ) , int stream range ( 0 , between ( 200 , 500 ) ) map to obj ( n - > client ( ) prepare index ( index name ) set source ( " f " , " v " ) ) collect ( collectors to list ( ) ) ) ; } if ( random boolean ( ) ) { client ( ) admin ( ) indices ( ) prepare flush ( index name ) get ( ) ; } if ( random boolean ( ) ) { sync flush ( index name ) ; } internal cluster ( ) start data only node ( ) ; mock transport service transport service = ( mock transport service ) internal cluster ( ) get instance ( transport service class , source ) ; semaphore fail recovery = new semaphore ( 1 ) ; transport service add send behavior ( ( connection , request id , action , request , options ) - > { if ( action equals ( peer recovery target service actions clean files ) ) { recovery clean files request clean files request = ( recovery clean files request ) request ; request = new recovery clean files request ( clean files request recovery id ( ) , clean files request request seq no ( ) , clean files request shard id ( ) , clean files request source meta snapshot ( ) , clean files request total translog ops ( ) , sequence numbers unassigned seq no ) ; } if ( action equals ( peer recovery target service actions finalize ) ) { if ( fail recovery try acquire ( ) ) { throw new illegal state exception ( " simulated " ) ; } } connection send request ( request id , action , request , options ) ; } ) ; assert acked ( client ( ) admin ( ) indices ( ) prepare update settings ( ) set indices ( index name ) set settings ( settings builder ( ) put ( index metadata setting number of replicas , 1 ) build ( ) ) ) ; ensure green ( index name ) ; transport service clear all rules ( ) ; }


copies all bytes from the input stream to the output stream does not close or flush either stream

public static long copy ( input stream from , output stream to ) throws i o exception { check not null ( from ) ; check not null ( to ) ; byte [ ] buf = new byte [ buf size ] ; long total = 0 ; while ( true ) { int r = from read ( buf ) ; if ( r = = - 1 ) { break ; } to write ( buf , 0 , r ) ; total + = r ; } return total ; }


configure the { @ link clock } to use to set last access time on every created session and to calculate if it is expired this may be useful to align to different timezone or to set the clock back in a test , e g { @ code clock offset ( clock , duration of minutes ( - 31 ) ) } in order to simulate session expiration by default this is { @ code clock system ( zone id of ( " gmt " ) ) }

public void set clock ( clock clock ) { assert not null ( clock , " clock is required " ) ; this clock = clock ; remove expired sessions ( ) ; }


gets the number of bytes currently occupied in this hash table

public long get occupancy ( ) { return num all memory segments * segment size - free memory segments size ( ) * segment size ; }


obtain a { @ link jackson 2 object mapper builder } instance in order to build a regular json { @ link object mapper } instance

public static jackson 2 object mapper builder json ( ) { return new jackson 2 object mapper builder ( ) ; }


public boolean get bool item ( ) { return bool item ; }


adds a new section using the specified memory block the memory block is used to setting the address and size as well as , setting the data

public elf section header add section ( memory block block , int sh name ) throws memory access exception { elf section header new section = new elf section header ( this , block , sh name , get image base ( ) ) ; add section ( new section ) ; return new section ; }


set the date format for json ( de ) serialization with date properties

public void set date format ( date format date format ) { mapper set date format ( date format ) ; }


uninstall the app silently without root permission must hold { @ code android : shared user id = " android uid shell " } and { @ code < uses - permission android : name = " android permission delete packages " > }

public static boolean uninstall app silent ( final string package name ) { return uninstall app silent ( package name , false ) ; }


public list < string > get children ( final string path ) throws exception { return curator get children ( ) for path ( path ) ; }


returns the ciphers preferred to use during tests they may be chosen because they are widely available or because they are fast there is no requirement that they provide confidentiality or integrity

public static list < string > preferred test ciphers ( ) { string [ ] ciphers ; try { ciphers = s s l context get default ( ) get default s s l parameters ( ) get cipher suites ( ) ; } catch ( no such algorithm exception ex ) { throw new runtime exception ( ex ) ; } list < string > ciphers minus gcm = new array list < > ( ) ; for ( string cipher : ciphers ) { / / the gcm implementation in java is very slow ( ~ 1 mb / s ) if ( cipher contains ( " gcm " ) ) { continue ; } ciphers minus gcm add ( cipher ) ; } return collections unmodifiable list ( ciphers minus gcm ) ; }


return a string representing the rule summary for the given rule with the given name for example : ' my rule ( foo , bar ) ' the summary will contain hyperlinks for each attribute

public string rule summary ( string rule name , rule info rule info ) { list < string > attribute names = rule info get attribute list ( ) stream ( ) map ( attr - > attr get name ( ) ) collect ( collectors to list ( ) ) ; return summary ( rule name , attribute names ) ; }


public string to string ( ) { int value = get int bits ( ) ; return " short { 0x " + hex u 2 ( value ) + " / " + value + ' } ' ; }


set the jvm property to enable kerberos debugging

public static void enable kerberos debugging ( ) { system set property ( abstract secure registry test sun security krb5 debug , " true " ) ; }


gets the relative name to this item from the specified group

default string get relative name from ( @ check for null item group g ) { return functions get relative name from ( this , g ) ; }


reports bytes consumed by calls to { @ link # inflate bytes } since the last invocation of this method , then resets the count to zero

int get and reset bytes consumed ( ) { int saved bytes consumed = bytes consumed ; bytes consumed = 0 ; return saved bytes consumed ; }


public static void main ( string [ ] args ) { var service = service locator get service ( jndi service a ) ; service execute ( ) ; service = service locator get service ( jndi service b ) ; service execute ( ) ; service = service locator get service ( jndi service a ) ; service execute ( ) ; service = service locator get service ( jndi service a ) ; service execute ( ) ; }


add the shortest paths from the source to the given destination into the given collection this is used internally to recover the shortest paths

protected void add paths to ( collection < deque < e > > paths , v dst ) { add paths to ( paths , dst , new linked list < > ( ) ) ; }


returns the escaped form of a given literal string , starting at the given index this method is called by the { @ link # escape ( string ) } method when it discovers that escaping is required it is protected to allow subclasses to override the fastpath escaping function to inline their escaping test see { @ link char escaper builder } for an example usage this method is not reentrant and may only be invoked by the top level { @ link # escape ( string ) } method

protected final string escape slow ( string s , int index ) { int end = s length ( ) ; / / get a destination buffer and setup some loop variables char [ ] dest = platform char buffer from thread local ( ) ; int dest index = 0 ; int unescaped chunk start = 0 ; while ( index < end ) { int cp = code point at ( s , index , end ) ; if ( cp < 0 ) { throw new illegal argument exception ( " trailing high surrogate at end of input " ) ; } / / it is possible for this to return null because next escape index ( ) may / / ( for performance reasons ) yield some false positives but it must never / / give false negatives char [ ] escaped = escape ( cp ) ; int next index = index + ( character is supplementary code point ( cp ) ? 2 : 1 ) ; if ( escaped ! = null ) { int chars skipped = index - unescaped chunk start ; / / this is the size needed to add the replacement , not the full / / size needed by the string we only regrow when we absolutely must int size needed = dest index + chars skipped + escaped length ; if ( dest length < size needed ) { int dest length = size needed + ( end - index ) + dest pad ; dest = grow buffer ( dest , dest index , dest length ) ; } / / if we have skipped any characters , we need to copy them now if ( chars skipped > 0 ) { s get chars ( unescaped chunk start , index , dest , dest index ) ; dest index + = chars skipped ; } if ( escaped length > 0 ) { system arraycopy ( escaped , 0 , dest , dest index , escaped length ) ; dest index + = escaped length ; } / / if we dealt with an escaped character , reset the unescaped range unescaped chunk start = next index ; } index = next escape index ( s , next index , end ) ; } / / process trailing unescaped characters - no need to account for escaped / / length or padding the allocation int chars skipped = end - unescaped chunk start ; if ( chars skipped > 0 ) { int end index = dest index + chars skipped ; if ( dest length < end index ) { dest = grow buffer ( dest , dest index , end index ) ; } s get chars ( unescaped chunk start , end , dest , dest index ) ; dest index = end index ; } return new string ( dest , 0 , dest index ) ; }


public synchronized boolean wait for finish ( ) throws throwable { while ( ! done & & exception = = null ) { wait ( ) ; } if ( exception ! = null ) { throw exception ; } return done ; }


public final long compute file size ( ) { return compute file size ( current state id ) ; }


this is the main interface for writing values to the memory state if there is no registered memory bank for the desired address space , or if there is some other error , an exception is thrown

public final void set value ( address space spc , long off , int size , long cval ) { set chunk ( utils long to bytes ( cval , size , language is big endian ( ) ) , spc , off , size ) ; }


get the view ' s name should never be { @ code null } if the view was correctly configured

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


determines if we should apply - f p i c for this rule ' s c + + compilations this determination is generally made by the global c + + configuration settings " needs pic " and " use pic for binaries " however , an individual rule may override these settings by applying - f p i c " to its " nocopts " attribute this allows incompatible rules to " opt out " of global pic settings ( see bug : " provide a way to turn off - f p i c for targets that can ' t be built that way " )

public boolean use pic for dynamic libraries ( cpp configuration cpp configuration , feature configuration feature configuration ) { return cpp configuration force pic ( ) | | feature configuration is enabled ( cpp rule classes supports pic ) ; }


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

public model with final field on visibility changed ( on model visibility changed listener < model with final field , object > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


tells this service to find all places where the given datatype is defined < b > and < b > will display the results of the search

public void find and display applied data type addresses ( composite data type , string field name ) ;


sets the < code > map array anytype < code > property

public additional properties class map array anytype ( map < string , list < object > > map array anytype ) { this map array anytype = map array anytype ; return this ; }


creates a new key unless present that is newer than the current active key and returns the corresponding metadata note : this method doesn ' t modify the metadata used in this token service see { @ link # refresh metadata ( token metadata ) }

synchronized token metadata generate spare key ( ) { key and cache max key = key cache cache values ( ) stream ( ) max ( comparator comparing long ( v - > v key and timestamp get timestamp ( ) ) ) get ( ) ; key and cache current key = key cache active key cache ; if ( current key = = max key ) { long timestamp = created time stamps increment and get ( ) ; while ( true ) { byte [ ] salt arr = new byte [ salt bytes ] ; secure random next bytes ( salt arr ) ; secure string token key = generate token key ( ) ; key and cache key and cache = new key and cache ( new key and timestamp ( token key , timestamp ) , new bytes key ( salt arr ) ) ; if ( key cache cache contains key ( key and cache get key hash ( ) ) ) { continue ; / / collision - - generate a new key } return new token metadata ( key cache current token key hash , iterables concat ( key cache cache values ( ) , collections singleton list ( key and cache ) ) ) ; } } return new token metadata ( key cache current token key hash , key cache cache values ( ) ) ; }


the read side of { @ link flink kafka shuffle # persistent key by } each consumer task should read kafka partitions equal to the key group indices it is assigned the number of kafka partitions is the maximum parallelism of the consumer this version only supports number of partitions = consumer parallelism in the case of using { @ link time characteristic # event time } , a consumer task is responsible to emit watermarks watermarks are read from the corresponding kafka partitions notice that a consumer task only starts to emit a watermark after receiving at least one watermark from each producer task to make sure watermarks are monotonically increasing hence a consumer task needs to know ` producer parallelism ` as well attention : make sure kafka properties include { @ link flink kafka shuffle # producer parallelism } and { @ link flink kafka shuffle # partition number } explicitly { @ link flink kafka shuffle # producer parallelism } is the parallelism of the producer { @ link flink kafka shuffle # partition number } is the number of partitions they are not necessarily the same and allowed to be set independently

public static < t , k > keyed stream < t , k > read key by ( string topic , stream execution environment env , type information < t > type information , properties kafka properties , key selector < t , k > key selector ) { type serializer < t > type serializer = type information create serializer ( env get config ( ) ) ; type information serialization schema < t > schema = new type information serialization schema < > ( type information , type serializer ) ; source function < t > kafka consumer = new flink kafka shuffle consumer < > ( topic , schema , type serializer , kafka properties ) ; / / todo : consider situations where number of partitions ! = consumer parallelism preconditions check argument ( kafka properties get property ( partition number ) ! = null , " missing partition number for kafka shuffle " ) ; int number of partitions = properties util get int ( kafka properties , partition number , integer min value ) ; data stream < t > output data stream = env add source ( kafka consumer ) set parallelism ( number of partitions ) ; return data stream utils reinterpret as keyed stream ( output data stream , key selector ) ; }


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


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


clears the current selection calling this method is equivalent to calling { @ link # set current selection ( address set view ) } with a null or empty address set

public void remove selection ( ) { set current selection ( null ) ; }


gets a copy of the buffer that has the right length for the data serialized so far the returned buffer is an exclusive copy and can be safely used without being overwritten by future write calls to this serializer this method is equivalent to { @ code arrays copy of ( get shared buffer ( ) , length ( ) ) ; }

public byte [ ] get copy of buffer ( ) { return arrays copy of ( buffer , position ) ; }


public abstract string get node name ( ) ;


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