same as { @ link nested object mapper tests # test multiple levels include root 1 ( ) } but tests that the redundant includes are removed even if each individual mapping doesn ' t contain the redundancy , only the merged mapping does

public void test multiple levels include root with merge ( ) throws exception { mapper service mapper service = create mapper service ( mapping ( b - > { } ) ) ; string first mapping = strings to string ( x content factory json builder ( ) start object ( ) start object ( mapper service single mapping name ) start object ( " properties " ) start object ( " nested 1 " ) field ( " type " , " nested " ) field ( " include in root " , true ) start object ( " properties " ) start object ( " nested 2 " ) field ( " type " , " nested " ) field ( " include in root " , true ) field ( " include in parent " , true ) end object ( ) end object ( ) end object ( ) end object ( ) end object ( ) end object ( ) ) ; mapper service merge ( mapper service single mapping name , new compressed x content ( first mapping ) , merge reason index template ) ; string second mapping = strings to string ( x content factory json builder ( ) start object ( ) start object ( mapper service single mapping name ) start object ( " properties " ) start object ( " nested 1 " ) field ( " type " , " nested " ) field ( " include in root " , true ) field ( " include in parent " , true ) start object ( " properties " ) start object ( " nested 2 " ) field ( " type " , " nested " ) field ( " include in root " , true ) end object ( ) end object ( ) end object ( ) end object ( ) end object ( ) end object ( ) ) ; mapper service merge ( mapper service single mapping name , new compressed x content ( second mapping ) , merge reason index template ) ; document mapper doc mapper = mapper service document mapper ( ) ; parsed document doc = doc mapper parse ( new source to parse ( " test " , " 1 " , bytes reference bytes ( x content factory json builder ( ) start object ( ) start array ( " nested 1 " ) start object ( ) start array ( " nested 2 " ) start object ( ) field ( " foo " , " bar " ) end object ( ) end array ( ) end object ( ) end array ( ) end object ( ) ) , x content type json ) ) ; final collection < indexable field > fields = doc root doc ( ) get fields ( ) ; assert that ( fields size ( ) , equal to ( new hash set < > ( fields ) size ( ) ) ) ; }


display a string representation of the schema

public string to string ( ) { string builder b = new string builder ( ) ; b append ( ' { ' ) ; for ( int i = 0 ; i < this fields length ; i + + ) { b append ( this fields [ i ] to string ( ) ) ; if ( i < this fields length - 1 ) b append ( ' , ' ) ; } b append ( " } " ) ; return b to string ( ) ; }


assert that an optional value matches an expected one ; checks include null and empty on the actual value

public static < t > void assert optional unset ( string message , optional < t > actual ) { assert assert not null ( message , actual ) ; actual if present ( t - > assert fail ( " expected empty option , got " + t to string ( ) ) ) ; }


returns the fragments required by starlark definitions ( e g < code > fragments = [ " cpp " ] < code > with the naming form seen in the starlark api { @ link com google devtools build lib analysis config build configuration # get starlark fragment by name } can be used to convert this to java fragment instances

public collection < string > get required starlark fragments ( ) { return starlark required configuration fragments values ( ) ; }


if { @ code key } is not already associated with a value or if { @ code key } is associated with zero , associate it with { @ code new value } returns the previous value associated with { @ code key } , or zero if there was no mapping for { @ code key }

long put if absent ( k key , long new value ) { atomic boolean no value = new atomic boolean ( false ) ; long result = map compute ( key , ( k , old value ) - > { if ( old value = = null | | old value = = 0 ) { no value set ( true ) ; return new value ; } else { return old value ; } } ) ; return no value get ( ) ? 0l : result long value ( ) ; }


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit subquery ( sql base parser subquery context ctx ) { return visit children ( ctx ) ; }


log a put into the operations log at debug level

private static void log put ( @ nullable ancestor state state , item [ ] items ) { if ( operations log is debug enabled ( ) ) { / / log the operations string state str = ancestor state state as string ( state ) ; for ( item item : items ) { boolean tombstone = ! item exists ( item ) ; boolean is dir = get bool attribute ( item , is dir , false ) ; boolean auth = get bool attribute ( item , is authoritative , false ) ; operations log debug ( " { } { } { } { } { } " , state str , tombstone ? " tombstone " : " put " , item primary key to string ( item ) , auth ? " [ auth ] " : " " , is dir ? " directory " : " " ) ; } } }


{ @ inherit doc } this implementation is guaranteed to throw an { @ link unsupported operation exception }

public final entry < e > poll first entry ( ) { throw new unsupported operation exception ( ) ; }


setter for the final directory for dist cp ( where files copied will be moved , atomically )

public static void set commit directory ( job job , path commit directory ) { job get configuration ( ) set ( dist cp constants conf label target final path , commit directory to string ( ) ) ; }


join an collection of objects with a separator that appears after every instance in the list - optionally at the end

public static string join ( collection collection , string separator , boolean trailing ) { string builder b = new string builder ( ) ; / / fast return on empty collection if ( collection is empty ( ) ) { return trailing ? separator : " " ; } for ( object o : collection ) { b append ( o ) append ( separator ) ; } int length = separator length ( ) ; string s = b to string ( ) ; return ( trailing | | s is empty ( ) ) ? s : ( b substring ( 0 , b length ( ) - length ) ) ; }


returns the x - position in pixels where this highlight object was last drawn

public float get draw x ( ) { return m draw x ; }


returns true if this subscription has been cancelled

public final boolean is cancelled ( ) { return get ( ) = = cancelled ; }


tests that if local recovery is enabled we won ' t spread out tasks when recovering for regional failover

public void test local recovery region ( ) throws exception { test local recovery internal ( " region " ) ; }


public synchronized boolean set a m r m token ( token < a m r m token identifier > amrm token ) { token < a m r m token identifier > old value = this amrm token ; this amrm token = amrm token ; return ! this amrm token equals ( old value ) ; }


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


public static string get app version name ( ) { return get app version name ( utils get app ( ) get package name ( ) ) ; }


public void visit switch insn ( switch insn insn ) { visit ( insn ) ; }


test changing source on existing symbol only in latest

public void test change symbol source only in latest ( ) throws exception { / / 01002721 : primary global " xxx " mtf initialize ( " notepad merge listing test " , new program modifier listener ( ) { / * ( non - javadoc ) * @ see ghidra framework data program modifier listener # modify latest ( ghidra program database program d b ) * / @ override public void modify latest ( program d b program ) { int tx id = program start transaction ( " modify my program " ) ; boolean commit = false ; try { symbol symbol = get unique symbol ( program , " xxx " ) ; assert equals ( source type user defined , symbol get source ( ) ) ; symbol set source ( source type analysis ) ; commit = true ; } catch ( exception e ) { assert fail ( e get message ( ) ) ; } finally { program end transaction ( tx id , commit ) ; } } / * ( non - javadoc ) * @ see ghidra framework data program modifier listener # modify private ( ghidra program database program d b ) * / @ override public void modify private ( program d b program ) { / / no changes for my program } } ) ; execute merge ( ask user ) ; wait for merge completion ( ) ; symbol s ; s = get unique symbol ( result program , " xxx " ) ; check symbol ( s , " xxx " , true ) ; assert equals ( source type analysis , s get source ( ) ) ; }


begin to define how to enhance class after invoke this method , only means definition is finished

protected dynamic type builder < ? > enhance ( type description type description , dynamic type builder < ? > new class builder , class loader class loader , enhance context context ) throws plugin exception { new class builder = this enhance class ( type description , new class builder , class loader ) ; new class builder = this enhance instance ( type description , new class builder , class loader , context ) ; return new class builder ; }


creates an { @ link variable resolver } that aggregates all the parameters if you are a { @ link build step } , most likely you should call { @ link abstract build # get build variable resolver ( ) }

public variable resolver < string > create variable resolver ( abstract build < ? , ? > build ) { variable resolver [ ] resolvers = new variable resolver [ get parameters ( ) size ( ) + 1 ] ; int i = 0 ; for ( parameter value p : get parameters ( ) ) { if ( p = = null ) continue ; resolvers [ i + + ] = p create variable resolver ( build ) ; } resolvers [ i ] = build get build variable resolver ( ) ; return new variable resolver union < string > ( resolvers ) ; }


returns a hash function implementing the message authentication code ( mac ) algorithm , using the md5 ( 128 hash bits ) hash function and a { @ link secret key spec } created from the given byte array and the md5 algorithm

public static hash function hmac md 5 ( byte [ ] key ) { return hmac md 5 ( new secret key spec ( check not null ( key ) , " hmac m d 5 " ) ) ; }


creates a new object type of the given type

public static object type create object type ( int class index ) { return new object type ( class index ) ; }


runs through the process of creating a demangler , demangling a symbol string , testing the output , and performing other ancillary outputs and tests

public void demangle and test ( string mangled arg , string mdtruth , string mstruth , string ghtruth , string ms 2 0 1 3truth ) throws exception { mangled = mangled arg ; set truth ( mdtruth , mstruth , ghtruth , ms 2 0 1 3truth ) ; output info = new string builder ( ) ; if ( verbose output ) { output info append ( get number header ( mangled arg length ( ) ) ) ; output info append ( get test header ( ) ) ; } / / meant to be overridden , as needed by extended classes do demangle symbol ( ) ; do basic tests and output ( ) ; / / meant to be overridden , as needed by extended classes do extra proc check ( ) ; / / msg info ( this , output info ) ; logger ( output info ) ; / / is the string mangled and is the truth unknown ( truth matches input ) ? / / historically , with the microsoft demangler ( undname or dumpbin ) , if the output equals / / the input ( it could also produce garbage ) , then it did not know how to demangle the / / input here , " truth " represents either microsoft ' s or one of my desired results , and / / we hold to this pattern that if we do not know how to demangle the input , we represent / / this as truth equals ( mangled arg ) however , if a symbol is not actually mangled , msft / / also outputs the original ( we hope that a c - language symbol going in will look / / exactly the same coming out ) / / so this logic of this if - else is as follows : / / if the symbol is recognized as mangled and the truth is equal to this mangled string / / ( meaning that we as testers or msft do not know what the demangled output should look / / like ) , then we expect m d mang to also not know how to demangle it it just so / / happens that we coded m d mang to return an empty string in this case the " else " of / / this is that if the symbol does not appear to be mangled ( like c - language ) or we / / expect to be able to demangle the input ( truth not equal to mangle arg ) , then we / / expect the output to be that which we desire ( " truth " equals ( demangled ) ) if ( ( truth equals ( mangled arg ) ) & & is mangled ( mangled arg ) ) { assert true ( demangled is empty ( ) ) ; } else { assert equals ( truth , demangled ) ; } if ( mangled arg starts with ( " ? a " ) ) { assert true ( ( demang item ! = null ) & & ( demang item instanceof m d data type ) ) ; / / test for data type } }


returns the response headers associated with the load must only be called after the load completed , failed , or was canceled

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


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


map of string keys and values that can be used to organize and categorize resources within a collection < code > map & lt ; string , string & gt ; labels = 4 ; < code >

public java util map < java lang string , java lang string > get labels map ( ) { return internal get labels ( ) get map ( ) ; }


format the given { @ code offset date time } object into string

public string format offset date time ( offset date time offset date time ) { return offset date time formatter format ( offset date time ) ; }


test exports adds dependencies to java compilation args provider

public void build helper create java info export provider exports deps added ( ) throws exception { rule builder ( ) build ( ) ; scratch file ( " foo / build " , " load ( ' : extension bzl ' , ' my rule ' ) " , " java library ( name = ' my java lib exports ' , srcs = [ ' java / a java ' ] ) " , " my rule ( name = ' my starlark rule ' , " , " output jar = ' my starlark rule lib jar ' , " , " dep exports = [ ' : my java lib exports ' ] " , " ) " ) ; assert no events ( ) ; java info java info = fetch java info ( ) ; java exports provider exports provider = java info get provider ( java exports provider class ) ; assert that ( exports provider get transitive exports ( ) to list ( ) ) is empty ( ) ; java source jars provider java source jars provider = java info get provider ( java source jars provider class ) ; assert that ( java source jars provider get source jars ( ) ) is empty ( ) ; java compilation args provider java compilation args provider = java info get provider ( java compilation args provider class ) ; assert that ( pretty artifact names ( java compilation args provider get direct compile time jars ( ) ) ) contains exactly ( " foo / my starlark rule lib jar " , " foo / libmy java lib exports - hjar jar " ) ; assert that ( pretty artifact names ( java compilation args provider get direct full compile time jars ( ) ) ) contains exactly ( " foo / my starlark rule lib jar " , " foo / libmy java lib exports jar " ) ; assert that ( pretty artifact names ( java compilation args provider get runtime jars ( ) ) ) contains exactly ( " foo / my starlark rule lib jar " , " foo / libmy java lib exports jar " ) ; assert that ( pretty artifact names ( java compilation args provider get transitive compile time jars ( ) ) ) contains exactly ( " foo / my starlark rule lib jar " , " foo / libmy java lib exports - hjar jar " ) ; }


public void write to ( filer filer ) throws i o exception { string file name = package name is empty ( ) ? type spec name : package name + " " + type spec name ; list < element > originating elements = type spec originating elements ; java file object filer source file = filer create source file ( file name , originating elements to array ( new element [ originating elements size ( ) ] ) ) ; try ( writer writer = filer source file open writer ( ) ) { write to ( writer ) ; } catch ( exception e ) { try { filer source file delete ( ) ; } catch ( exception ignored ) { } throw e ; } }


executes the given task in a cpu thread pool after the given delay

public static < t > void execute by cpu with delay ( final task < t > task , final long delay , final time unit unit ) { execute with delay ( get pool by type and priority ( type cpu ) , task , delay , unit ) ; }


gets the default edge weight of this graph specified at creation time

public double get default edge weight ( ) { return default value ; }


public < t > t in transaction ( callable < t > call ) { return dao test in transaction ( call ) ; }


when using fuzzy or prefix type query , the number of term expansions to use

public match bool prefix query builder max expansions ( int max expansions ) { if ( max expansions < = 0 ) { throw new illegal argument exception ( " [ " + name + " ] requires max expansions to be positive " ) ; } this max expansions = max expansions ; return this ; }


test embedding a character that doesn ' t satisfy character # is java identifier part do so in a value resource this is a case that aapt doesn ' t validate , so it may pass through to the java compiler

public void illegal value res field names characters ( ) throws exception { path target = fs get path ( " target " ) ; path source = fs get path ( " source " ) ; assert that ( character is java identifier start ( ' c ' ) ) is true ( ) ; assert that ( character is java identifier part ( ' + ' ) ) is false ( ) ; android resource class writer resource class writer = android resource class writer of ( mock android framework ids , target , " com boop " ) ; parsed android data direct = android data builder of ( source ) add resource ( " values / integers xml " , android data builder resource type value , " < integer name = \ " c + + \ " > 0xd < / integer > " ) create manifest ( " android manifest xml " , " com boop " , " " ) build parsed ( ) ; unwritten merged android data unwritten merged android data = unwritten merged android data of ( source resolve ( " android manifest xml " ) , direct , parsed android data builder empty ( ) ) ; assert throws ( invalid java identifier class , ( ) - > unwritten merged android data write resource class ( resource class writer ) ) ; }


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


escape paths before handing to glob status ; this is needed as parameterized runs produce paths with [ ] in them

private string escape ( string pathstr ) { string builder r = new string builder ( ) ; for ( char c : pathstr to char array ( ) ) { string ch = character to string ( c ) ; if ( " ? * [ { " contains ( ch ) ) { r append ( " \ \ " ) ; } r append ( ch ) ; } return r to string ( ) ; } }


default configuration format resolution , only n a cos - server ip or ip : port or hostname : port information

public static collection < member > read server conf ( collection < string > members ) { set < member > nodes = new hash set < > ( ) ; for ( string member : members ) { member target = single parse ( member ) ; nodes add ( target ) ; } return nodes ; }


private void delete block ( array list < memory block > blocks ) { mem manager delete blocks ( blocks ) ; }


check that count refers to factory class , not bean class ( we don ' t know what type factories may return , and it may even change over time )

public void get count for factory class ( ) { assert that ( get listable bean factory ( ) get bean names for type ( factory bean class ) length = = 2 ) as ( " should have 2 factories , not " + get listable bean factory ( ) get bean names for type ( factory bean class ) length ) is true ( ) ; assert that ( get listable bean factory ( ) get bean names for type ( factory bean class ) length = = 2 ) as ( " should have 2 factories , not " + get listable bean factory ( ) get bean names for type ( factory bean class ) length ) is true ( ) ; }


append an value into the hash map ' s record area

public void append ( lookup info < k , iterator < row data > > lookup info , binary row data value ) throws i o exception { try { if ( lookup info found ) { / / append value only if there exits key - value pair int new pointer = ( ( record area ) record area ) append value ( value ) ; if ( pointer to second value = = - 1 ) { / / this is the second value ( ( record area ) record area ) update value pointer in key area ( new pointer , end ptr ) ; } else { ( ( record area ) record area ) update value pointer in value area ( new pointer , end ptr ) ; } / / update pointer of the tail value under a key end ptr = new pointer ; ( ( record area ) record area ) update value pointer in key area ( new pointer , end ptr offset ) ; } else { if ( num keys > = growth threshold ) { grow and rehash ( ) ; / / update info ' s bucket segment index and bucket offset lookup ( lookup info key ) ; } / / append key and value if it does not exists int pointer to appended = record area append record ( lookup info , value ) ; bucket segments get ( lookup info bucket segment index ) put int ( lookup info bucket offset , pointer to appended ) ; bucket segments get ( lookup info bucket segment index ) put int ( lookup info bucket offset + element point length , lookup info key hash code ) ; num keys + + ; } num elements + + ; } catch ( e o f exception e ) { num spill files + + ; spill in bytes + = record area get segments size ( ) ; throw e ; } }


public void cancel delegation token ( token < delegation token identifier > token ) throws i o exception { log info ( " cancelling " + delegation token identifier stringify token ( token ) ) ; try { token cancel ( conf ) ; } catch ( interrupted exception ie ) { throw new runtime exception ( " caught interrupted " , ie ) ; } catch ( remote exception re ) { throw re unwrap remote exception ( invalid token class , access control exception class ) ; } }


determine whether the given bean class qualifies as an m bean as - is the default implementation delegates to { @ link jmx utils # is m bean } , which checks for { @ link javax management dynamic m bean } classes as well as classes with corresponding " m bean " interface ( standard m beans ) or corresponding " m x bean " interface ( java 6 m x beans )

protected boolean is m bean ( @ nullable class < ? > bean class ) { return jmx utils is m bean ( bean class ) ; }


one request followed by one response the server returns the client payload as - is

public com google common util concurrent listenable future < io grpc benchmarks proto messages simple response > unary call ( io grpc benchmarks proto messages simple request request ) { return io grpc stub client calls future unary call ( get channel ( ) new call ( get unary call method ( ) , get call options ( ) ) , request ) ; }


expose an isolation level for the current transaction called by the transaction manager on transaction begin and on cleanup

public static void set current transaction isolation level ( @ nullable integer isolation level ) { current transaction isolation level set ( isolation level ) ; }


connects the java side of an ml process to the named pipes that connect it to the c + + side , and starts tailing the c + + logs stores references to all the streams except the state persistence stream

public void start ( executor service executor service ) throws i o exception { process pipes connect log stream ( ) ; cpp log handler set ( process pipes get log stream handler ( ) ) ; log tail future = executor service submit ( ( ) - > { try ( cpp log message handler h = cpp log handler get ( ) ) { h tail stream ( ) ; } catch ( i o exception e ) { if ( process killed = = false ) { logger error ( new parameterized message ( " [ { } ] error tailing { } process logs " , job id , get name ( ) ) , e ) ; } } finally { detect crash ( ) ; } } ) ; process pipes connect other streams ( ) ; if ( process pipes get process in stream ( ) is present ( ) ) { process in stream set ( new buffered output stream ( process pipes get process in stream ( ) get ( ) ) ) ; this record writer set ( new length encoded writer ( process in stream get ( ) ) ) ; } process out stream set ( process pipes get process out stream ( ) or else ( null ) ) ; process restore stream set ( process pipes get restore stream ( ) or else ( null ) ) ; }


returns a fully - populated { @ link recipient } based off of a { @ link signal service address } , creating one in the database if necessary convenience overload of { @ link # external push ( context , uuid , string , boolean ) }

public static @ non null recipient external push ( @ non null context context , @ non null signal service address signal service address ) { return external push ( context , signal service address get uuid ( ) or null ( ) , signal service address get number ( ) or null ( ) , false ) ; }


tests retry mechanism when indexing if an exception occurs when indexing then the indexing request is tried again before finally failing if auto generated ids are used this must not lead to duplicate ids see https : github comelasticelasticsearchissues 8 7 8 8

public void test retry due to exception on network layer ( ) throws execution exception , interrupted exception , i o exception { final atomic boolean exception thrown = new atomic boolean ( false ) ; int num docs = scaled random int between ( 100 , 1000 ) ; client client = internal cluster ( ) coord only node client ( ) ; nodes stats response node stats = client ( ) admin ( ) cluster ( ) prepare nodes stats ( ) get ( ) ; node stats unlucky node = random from ( node stats get nodes ( ) stream ( ) filter ( ( s ) - > s get node ( ) is data node ( ) ) collect ( collectors to list ( ) ) ) ; assert acked ( client ( ) admin ( ) indices ( ) prepare create ( " index " ) set settings ( settings builder ( ) put ( " index number of replicas " , 1 ) put ( " index number of shards " , 5 ) ) ) ; ensure green ( " index " ) ; logger info ( " unlucky node : { } " , unlucky node get node ( ) ) ; / / create a transport service that throws a connect transport exception for one bulk request and therefore triggers a retry for ( node stats data node : node stats get nodes ( ) ) { mock transport service mock transport service = ( ( mock transport service ) internal cluster ( ) get instance ( transport service class , data node get node ( ) get name ( ) ) ) ; mock transport service add send behavior ( internal cluster ( ) get instance ( transport service class , unlucky node get node ( ) get name ( ) ) , ( connection , request id , action , request , options ) - > { connection send request ( request id , action , request , options ) ; if ( action equals ( transport shard bulk action action name ) & & exception thrown compare and set ( false , true ) ) { logger debug ( " throw connect transport exception " ) ; throw new connect transport exception ( connection get node ( ) , action ) ; } } ) ; } bulk request builder bulk builder = client prepare bulk ( ) ; for ( int i = 0 ; i < num docs ; i + + ) { x content builder doc = null ; doc = json builder ( ) start object ( ) field ( " foo " , " bar " ) end object ( ) ; bulk builder add ( client prepare index ( " index " ) set source ( doc ) ) ; } bulk response response = bulk builder get ( ) ; if ( response has failures ( ) ) { for ( bulk item response single index respons : response get items ( ) ) { if ( single index respons is failed ( ) ) { fail ( " none of the bulk items should fail but got " + single index respons get failure message ( ) ) ; } } } refresh ( ) ; search response search response = client ( ) prepare search ( " index " ) set size ( num docs * 2 ) add stored field ( " id " ) get ( ) ; set < string > unique ids = new hash set < > ( ) ; long dup counter = 0 ; boolean found duplicate already = false ; for ( int i = 0 ; i < search response get hits ( ) get hits ( ) length ; i + + ) { if ( ! unique ids add ( search response get hits ( ) get hits ( ) [ i ] get id ( ) ) ) { if ( ! found duplicate already ) { search response dup id response = client ( ) prepare search ( " index " ) set query ( term query ( " id " , search response get hits ( ) get hits ( ) [ i ] get id ( ) ) ) set explain ( true ) get ( ) ; assert that ( dup id response get hits ( ) get total hits ( ) value , greater than ( 1l ) ) ; logger info ( " found a duplicate id : " ) ; for ( search hit hit : dup id response get hits ( ) ) { logger info ( " doc { } was found on shard { } " , hit get id ( ) , hit get shard ( ) get shard id ( ) ) ; } logger info ( " will not print anymore in case more duplicates are found " ) ; found duplicate already = true ; } dup counter + + ; } } assert search response ( search response ) ; assert that ( dup counter , equal to ( 0l ) ) ; assert hit count ( search response , num docs ) ; indices stats response index = client ( ) admin ( ) indices ( ) prepare stats ( " index " ) clear ( ) set segments ( true ) get ( ) ; index stats index stats = index get index ( " index " ) ; long max unsafe auto id timestamp = long min value ; for ( index shard stats index shard stats : index stats ) { for ( shard stats shard stats : index shard stats ) { segments stats segments = shard stats get stats ( ) get segments ( ) ; max unsafe auto id timestamp = math max ( max unsafe auto id timestamp , segments get max unsafe auto id timestamp ( ) ) ; } } assert true ( " exception must have been thrown otherwise setup is broken " , exception thrown get ( ) ) ; assert true ( " max unsafe auto id timestamp must be > than 0 we have at least one retry " , max unsafe auto id timestamp > - 1 ) ; }


returns a newly - created immutable multimap

public immutable multimap < k , v > build ( ) { collection < map entry < k , collection < v > > > map entries = builder map entry set ( ) ; if ( key comparator ! = null ) { map entries = ordering from ( key comparator ) < k > on keys ( ) immutable sorted copy ( map entries ) ; } return immutable list multimap from map entries ( map entries , value comparator ) ; }


helper method that transforms provided string into it ' s byte representation using ascii encoding

public static byte [ ] ascii bytes ( string value ) { preconditions check not null ( value ) ; try { return value get bytes ( " ascii " ) ; } catch ( unsupported encoding exception uee ) { / / won ' t happen throw new runtime exception ( " ascii not found ! " , uee ) ; } }


gets a handle to the system ' s keyvalue folding state this state is similar to the state accessed via { @ link # get state ( value state descriptor ) } , but is optimized for state that aggregates values with different types this state is only accessible if the function is executed on a keyed stream { @ code data stream < my type > stream = ; keyed stream < my type > keyed stream = stream key by ( " id " ) ; aggregate function < > aggregate function = keyed stream map ( new rich map function < my type , list < my type > > ( ) { private aggregating state < my type , long > state ; public void open ( configuration cfg ) { state = get runtime context ( ) get aggregating state ( new aggregating state descriptor < > ( " sum " , aggregate function , long class ) ) ; } public tuple 2 < my type , long > map ( my type value ) { state add ( value ) ; return new tuple 2 < > ( value , state get ( ) ) ; } } ) ; }

< in , acc , out > aggregating state < in , out > get aggregating state ( aggregating state descriptor < in , acc , out > state properties ) ;


default void rename table ( connector session session , connector table handle table handle , schema table name new table name ) { throw new presto exception ( not supported , " this connector does not support renaming tables " ) ; }


adds a listener to be notified for various changes that occur in this filter model

public void add listener ( table filter dialog model listener listener ) { this listeners add ( listener ) ; }


log the dns address associated with s 3 endpoint if endpoint is not set in the configuration , the { @ code constants # default endpoint } will be used

public static void log dns lookup ( configuration conf ) { string end point = conf get trimmed ( endpoint , default endpoint ) ; string host name = end point ; if ( ! end point is empty ( ) & & log is debug enabled ( ) ) { / / updating the hostname if there is a scheme present if ( end point contains ( " : / / " ) ) { try { uri uri = new uri ( end point ) ; host name = uri get host ( ) ; } catch ( u r i syntax exception e ) { log debug ( " got u r i syntax exception , ignoring " ) ; } } log debug ( " bucket endpoint : { } , hostname : { } , d n s address : { } " , end point , host name , net utils normalize host name ( host name ) ) ; } }


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


this method iterates through all the leases and counts the number of blocks which are not complete the f s namesystem read lock must be held before calling this method

synchronized long get num under construction blocks ( ) { assert this fsnamesystem has read lock ( ) : " the f s namesystem read lock wasn ' t " + " acquired before counting under construction blocks " ; long num u c blocks = 0 ; for ( long id : get i node id with leases ( ) ) { i node inode = fsnamesystem get f s directory ( ) get inode ( id ) ; if ( inode = = null ) { / / the inode could have been deleted after get i node id with leases ( ) is / / called , check here , and ignore it if so log warn ( " failed to find inode { } in get num under construction blocks ( ) " , id ) ; continue ; } final i node file cons = inode as file ( ) ; if ( ! cons is under construction ( ) ) { log warn ( " the file { } is not under construction but has lease " , cons get full path name ( ) ) ; continue ; } block info [ ] blocks = cons get blocks ( ) ; if ( blocks = = null ) { continue ; } for ( block info b : blocks ) { if ( ! b is complete ( ) ) { num u c blocks + + ; } } } log info ( " number of blocks under construction : { } " , num u c blocks ) ; return num u c blocks ; }


writes the specified row which is serialized into arrow format

public void write ( in row ) { for ( int i = 0 ; i < field writers length ; i + + ) { field writers [ i ] write ( row , i ) ; } }


returns the location of the application patch directory the patch directory can be used to modify existing code within a distribution

public final resource file get patch dir ( ) { return patch dir ; }


public builder set state visibility ( @ nonnull state visibility state visibility ) { this state visibility = state visibility ; return this ; }


size the columns such that the interesting ones are wider than the uninteresting columns

private void adjust table columns ( ) { bookmark table size columns to fit ( - 1 ) ; table column column = bookmark table get column ( bookmark table get column name ( bookmark table model comment col ) ) ; column set preferred width ( 200 ) ; column = bookmark table get column ( bookmark table get column name ( bookmark table model preview col ) ) ; column set preferred width ( 150 ) ; column = bookmark table get column ( bookmark table get column name ( bookmark table model category col ) ) ; column set preferred width ( 90 ) ; column = bookmark table get column ( bookmark table get column name ( bookmark table model location col ) ) ; column set preferred width ( 90 ) ; }


gets the most recent { @ linkplain # is building ( ) completed } build excluding ' this ' run itself

public final @ check for null run t get previous completed build ( ) { run t r = get previous build ( ) ; while ( r ! = null & & r is building ( ) ) r = r get previous build ( ) ; return r ; }


public void test network host private dns ( ) throws i o exception { resolve gce ( " gce : hostname " , inet address get by name ( " localhost " ) ) ; }


take an array of strings and split each element based on the given delimiter a { @ code properties } instance is then generated , with the left of the delimiter providing the key , and the right of the delimiter providing the value will trim both the key and value before adding them to the { @ code properties } instance

public static properties split array elements into properties ( string [ ] array , string delimiter , @ nullable string chars to delete ) { if ( object utils is empty ( array ) ) { return null ; } properties result = new properties ( ) ; for ( string element : array ) { if ( chars to delete ! = null ) { element = delete any ( element , chars to delete ) ; } string [ ] splitted element = split ( element , delimiter ) ; if ( splitted element = = null ) { continue ; } result set property ( splitted element [ 0 ] trim ( ) , splitted element [ 1 ] trim ( ) ) ; } return result ; }


updates the cluster metadata if topic expiry is enabled , expiry time is set for topics if required and expired topics are removed from the metadata

public synchronized void update ( int request version , metadata response response , boolean is partial update , long now ms ) { objects require non null ( response , " metadata response cannot be null " ) ; if ( is closed ( ) ) throw new illegal state exception ( " update requested after metadata close " ) ; this need partial update = request version < this request version ; this last refresh ms = now ms ; this update version + = 1 ; if ( ! is partial update ) { this need full update = false ; this last successful refresh ms = now ms ; } string previous cluster id = cache cluster resource ( ) cluster id ( ) ; this cache = handle metadata response ( response , is partial update , now ms ) ; cluster cluster = cache cluster ( ) ; maybe set metadata error ( cluster ) ; this last seen leader epochs key set ( ) remove if ( tp - > ! retain topic ( tp topic ( ) , false , now ms ) ) ; string new cluster id = cache cluster resource ( ) cluster id ( ) ; if ( ! objects equals ( previous cluster id , new cluster id ) ) { log info ( " cluster id : { } " , new cluster id ) ; } cluster resource listeners on update ( cache cluster resource ( ) ) ; log debug ( " updated cluster metadata update version { } to { } " , this update version , this cache ) ; }


returns true if the key was not already in the set if this set already contains the key , the call leaves the set unchanged and returns false

public boolean add ( t key ) { int i = locate key ( key ) ; if ( i > = 0 ) return false ; / / existing key was found i = - ( i + 1 ) ; / / empty space was found key table [ i ] = key ; if ( + + size > = threshold ) resize ( key table length < < 1 ) ; return true ; }


validate the given token ' s scope against the required scope every required scope element ( if any ) must exist in the provided token ' s scope for the validation to succeed

public static o auth bearer validation result validate scope ( o auth bearer token token , list < string > required scope ) { final set < string > token scope = token scope ( ) ; if ( required scope = = null | | required scope is empty ( ) ) return o auth bearer validation result new success ( ) ; for ( string required scope element : required scope ) { if ( ! token scope contains ( required scope element ) ) return o auth bearer validation result new failure ( string format ( " the provided scope ( % s ) was mising a required scope ( % s ) all required scope elements : % s " , string value of ( token scope ) , required scope element , required scope to string ( ) ) , required scope to string ( ) , null ) ; } return o auth bearer validation result new success ( ) ; }


matches { @ code is compatible with reconfigured serializer } { @ link type serializer schema compatibility }

public static < t > matcher < type serializer schema compatibility < t > > is compatible with reconfigured serializer ( matcher < ? extends type serializer < t > > reconfigured serializer matcher ) { return new compatible after reconfiguration < > ( reconfigured serializer matcher ) ; }


closes streams opened to the chunk - file

public void close ( ) { i o utils cleanup with logger ( log , reader , writer ) ; }


returns final set of targets and sets error flag if required

public collection < target > build ( walkable graph walkable graph ) throws interrupted exception { precompute packages ( walkable graph ) ; return transform labels into targets ( resolved labels builder ) ; }


verifies that the specified expected result is always produced by collecting the specified inputs , regardless of how the elements are divided

public final collector tester < t , a , r > expect collects ( @ nullable r expected result , t inputs ) { list < t > list = arrays as list ( inputs ) ; do expect collects ( expected result , list ) ; if ( collector characteristics ( ) contains ( collector characteristics unordered ) ) { collections reverse ( list ) ; do expect collects ( expected result , list ) ; } return this ; }


hadoop - 16457 in certain cases prune doesn ' t create an fs

public void test maybe init filesystem ( ) throws exception { path test path = path ( " maybe init filesystem " ) ; try ( s 3 guard tool prune cmd = new s 3 guard tool prune ( get file system ( ) get conf ( ) ) ) { cmd maybe init filesystem ( collections singleton list ( test path to string ( ) ) ) ; assert not null ( " command did not create a filesystem " , cmd get filesystem ( ) ) ; } }


public void create input file ( configuration conf ) throws i o exception { file system local fs = file system get local ( conf ) ; path file = new path ( input dir , " test txt " ) ; writer writer = new output stream writer ( local fs create ( file ) ) ; writer write ( " abc \ ndef \ t \ nghi \ njkl " ) ; writer close ( ) ; }


helper method to configure the usernamepassword for basic auth or password o auth

public void set credentials ( string username , string password ) { for ( request interceptor api authorization : api authorizations values ( ) ) { if ( api authorization instanceof http basic auth ) { http basic auth basic auth = ( http basic auth ) api authorization ; basic auth set credentials ( username , password ) ; return ; } if ( api authorization instanceof o auth ) { o auth oauth = ( o auth ) api authorization ; oauth get token request builder ( ) set username ( username ) set password ( password ) ; return ; } } throw new runtime exception ( " no basic authentication or o auth configured ! " ) ; }


build call for upload file with required file

public okhttp 3 call upload file with required file call ( long pet id , file required file , string additional metadata , final api callback callback ) throws api exception { object local var post body = null ; / / create path and map variables api operation api operation = local var api client get operation lookup map ( ) get ( " upload file with required file " ) ; if ( api operation = = null ) { throw new api exception ( " operation not found in oas " ) ; } operation operation = api operation get operation ( ) ; string local var path = api operation get path ( ) ; map < string , object > param map = new hash map < > ( ) ; param map put ( " pet id " , pet id ) ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; if ( additional metadata ! = null ) { local var form params put ( " additional metadata " , additional metadata ) ; } if ( required file ! = null ) { local var form params put ( " required file " , required file ) ; } local var path = local var api client fill parameters from operation ( operation , param map , local var path , local var query params , local var collection query params , local var header params , local var cookie params ) ; final string [ ] local var accepts = { " application / json " } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { " multipart / form - data " } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { " petstore auth " } ; return local var api client build call ( local var path , api operation get method ( ) , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


returns the remainder of ' reader ' as a string , closing it when done

public static string read fully ( reader reader ) throws i o exception { try { string writer writer = new string writer ( ) ; char [ ] buffer = new char [ 1024 ] ; int count ; while ( ( count = reader read ( buffer ) ) ! = - 1 ) { writer write ( buffer , 0 , count ) ; } return writer to string ( ) ; } finally { reader close ( ) ; } }


public boolean get prefix ns boolean ( ) { return prefix ns boolean ; }


protected string get policy message bundle code ( final request context request context ) { val registered service = web utils get registered service ( request context ) ; if ( registered service ! = null & & registered service get acceptable usage policy ( ) ! = null & & string utils is not blank ( registered service get acceptable usage policy ( ) get message code ( ) ) ) { return registered service get acceptable usage policy ( ) get message code ( ) ; } if ( string utils is blank ( aup properties get aup policy terms attribute name ( ) ) ) { return null ; } val principal = web utils get authentication ( request context ) get principal ( ) ; val attributes = principal get attributes ( ) ; if ( ! attributes contains key ( aup properties get aup policy terms attribute name ( ) ) ) { logger trace ( " no attribute for policy terms is defined " ) ; return null ; } val value = collection utils first element ( attributes get ( aup properties get aup policy terms attribute name ( ) ) ) ; return value map ( v - > string format ( " % s % s " , acceptable usage policy terms code , value get ( ) ) ) or else ( null ) ; }


return the priority assigned for the given bean instance by the { @ code javax annotation priority } annotation the default implementation delegates to the specified { @ link # set dependency comparator dependency comparator } , checking its { @ link order comparator # get priority method } if it is an extension of spring ' s common { @ link order comparator } - typically , an { @ link org springframework core annotation annotation aware order comparator } if no such comparator is present , this implementation returns { @ code null }

protected integer get priority ( object bean instance ) { comparator < object > comparator = get dependency comparator ( ) ; if ( comparator instanceof order comparator ) { return ( ( order comparator ) comparator ) get priority ( bean instance ) ; } return null ; }


public big decimal get big decimal ( string column label ) throws s q l exception { return null ; }


called for each request with the corresponding { @ link abstract checkpoint stats } instance

protected abstract r handle checkpoint request ( handler request < empty request body , m > request , abstract checkpoint stats checkpoint stats ) throws rest handler exception ;


returns whether a string contains any xml special characters if this function returns true , the string will need to be encoded either using the string encode x m l function above or using a cdata section note that msxml has a nasty bug whereby whitespace characters outside of a cdata section are lost when parsing to avoid hitting this bug , this method treats many whitespace characters as " special "

private static boolean string has x m l specials ( string input ) { for ( int i = 0 ; i < input length ( ) ; i + + ) { char c = input char at ( i ) ; switch ( c ) { case ' < ' : case ' > ' : case ' " ' : case ' \ ' ' : case ' & ' : case ' \ t ' : case ' \ n ' : case ' \ r ' : return true ; } } return false ; }


send a { @ link android util log # info } log message and log the exception

void i ( string tag , string msg , throwable tr ) ;


create a new role defined by given role and the limited role

public static limited role create limited role ( role from role , role limited by role ) { objects require non null ( limited by role , " limited by role is required to create limited role " ) ; return new limited role ( from role cluster ( ) , from role indices ( ) , from role application ( ) , from role run as ( ) , limited by role ) ; }


public void print context ( print stream out ) { out println ( get message ( ) ) ; out print ( context ) ; }


public executor get executor ( ) { return null ; }


create a stream graph as below source 1 - - ( rebalance & pipelined ) - - > map 1 source 2 - - ( rebalance & blocking ) - - > map 2

private stream graph create stream graph for slot sharing test ( ) { final stream execution environment env = stream execution environment get execution environment ( ) ; final data stream < integer > source 1 = env from elements ( 1 , 2 , 3 ) name ( " source 1 " ) ; source 1 rebalance ( ) map ( v - > v ) name ( " map 1 " ) ; final data stream < integer > source 2 = env from elements ( 4 , 5 , 6 ) name ( " source 2 " ) ; final data stream < integer > partitioned = new data stream < > ( env , new partition transformation < > ( source 2 get transformation ( ) , new rebalance partitioner < > ( ) , shuffle mode batch ) ) ; partitioned map ( v - > v ) name ( " map 2 " ) ; return env get stream graph ( ) ; }


public final void read fields ( final data input data input ) throws i o exception { worker id read fields ( data input ) ; task id read fields ( data input ) ; set run state ( writable utils read enum ( data input , state class ) ) ; set start time ( writable utils read v long ( data input ) ) ; set end time ( writable utils read v long ( data input ) ) ; set task c m d ( writable utils read string ( data input ) ) ; set task type ( writable utils read string ( data input ) ) ; set exit code ( writable utils read v int ( data input ) ) ; }


creates the renderers needed for this combined - renderer in the required order also takes the draw order into consideration

public void create renderers ( ) { m renderers clear ( ) ; combined chart chart = ( combined chart ) m chart get ( ) ; if ( chart = = null ) return ; draw order [ ] orders = chart get draw order ( ) ; for ( draw order order : orders ) { switch ( order ) { case bar : if ( chart get bar data ( ) ! = null ) m renderers add ( new bar chart renderer ( chart , m animator , m view port handler ) ) ; break ; case bubble : if ( chart get bubble data ( ) ! = null ) m renderers add ( new bubble chart renderer ( chart , m animator , m view port handler ) ) ; break ; case line : if ( chart get line data ( ) ! = null ) m renderers add ( new line chart renderer ( chart , m animator , m view port handler ) ) ; break ; case candle : if ( chart get candle data ( ) ! = null ) m renderers add ( new candle stick chart renderer ( chart , m animator , m view port handler ) ) ; break ; case scatter : if ( chart get scatter data ( ) ! = null ) m renderers add ( new scatter chart renderer ( chart , m animator , m view port handler ) ) ; break ; } } }


provides a custom { @ link name resolver factory } for the channel if this method is not called , the builder will try the providers registered in the default { @ link name resolver registry } for the given target this method should rarely be used , as name resolvers should provide a { @ code name resolver provider } and users rely on service loading to find implementations in the class path that allows application ' s configuration to easily choose the name resolver via the ' target ' string passed to { @ link managed channel builder # for target ( string ) }

public abstract t name resolver factory ( name resolver factory resolver factory ) ;


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


public boolean is position dependent ( ) { return false ; }


get the string representation of the local name

default string get local name ( ) { return d f s util client bytes 2 string ( get local name in bytes ( ) ) ; }


return { @ link config def } from { @ code cls } , which is expected to be a non - null { @ code class < t > } , by instantiating it and invoking { @ link # config ( t ) }

config def get config def from config providing class ( string key , class < ? > cls ) { if ( cls = = null | | ! base class is assignable from ( cls ) ) { throw new config exception ( key , string value of ( cls ) , " not a " + base class get simple name ( ) ) ; } if ( modifier is abstract ( cls get modifiers ( ) ) ) { string child class names = stream of ( cls get classes ( ) ) filter ( cls : : is assignable from ) filter ( c - > ! modifier is abstract ( c get modifiers ( ) ) ) filter ( c - > modifier is public ( c get modifiers ( ) ) ) map ( class : : get name ) collect ( collectors joining ( " , " ) ) ; string message = child class names trim ( ) is empty ( ) ? alias kind + " is abstract and cannot be created " : alias kind + " is abstract and cannot be created did you mean " + child class names + " ? " ; throw new config exception ( key , string value of ( cls ) , message ) ; } t transformation ; try { transformation = utils new instance ( cls , base class ) ; } catch ( exception e ) { throw new config exception ( key , string value of ( cls ) , " error getting config definition from " + base class get simple name ( ) + " : " + e get message ( ) ) ; } config def config def = config ( transformation ) ; if ( null = = config def ) { throw new connect exception ( string format ( " % s config ( ) must return a config def that is not null " , cls get name ( ) ) ) ; } return config def ; }


the objects inserted into the cache using this method are all unique

file system get unique ( uri uri , configuration conf ) throws i o exception { key key = new key ( uri , conf , unique get and increment ( ) ) ; return get internal ( uri , conf , key ) ; }


only called after all addresses attempted and failed ( transient failure )

private void schedule backoff ( final status status ) { sync context throw if not in this synchronization context ( ) ; class end of current backoff implements runnable { @ override public void run ( ) { reconnect task = null ; channel logger log ( channel log level info , " connecting after backoff " ) ; goto non error state ( connecting ) ; start new transport ( ) ; } } goto state ( connectivity state info for transient failure ( status ) ) ; if ( reconnect policy = = null ) { reconnect policy = backoff policy provider get ( ) ; } long delay nanos = reconnect policy next backoff nanos ( ) - connecting timer elapsed ( time unit nanoseconds ) ; channel logger log ( channel log level info , " transient failure ( { 0 } ) will reconnect after { 1 } ns " , print short status ( status ) , delay nanos ) ; preconditions check state ( reconnect task = = null , " previous reconnect task is not done " ) ; reconnect task = sync context schedule ( new end of current backoff ( ) , delay nanos , time unit nanoseconds , scheduled executor ) ; }


gets a list of all broadcast inputs attached to this node

public list < named channel > get broadcast inputs ( ) { return this broadcast inputs ; }


public discovery node get node ( ) { return node ; }


returns a set ( hash set ) of all vertices descended from a vertex in the given array

public set < vertex > get descendants ( vertex [ ] seed vertices ) { edge edge ; vertex parent , child ; set < vertex > descendants = new hash set < vertex > ( 2 * seed vertices length ) ; set < vertex > pending = new hash set < vertex > ( seed vertices length ) ; set < vertex > newly pending = new hash set < vertex > ( seed vertices length ) ; for ( vertex seed vertice : seed vertices ) { pending add ( seed vertice ) ; } while ( ! pending is empty ( ) ) { iterator < vertex > iter = pending iterator ( ) ; while ( iter has next ( ) ) { parent = iter next ( ) ; edge = vertices get first outgoing edge ( parent ) ; descendants add ( parent ) ; iter remove ( ) ; while ( edge ! = null ) { child = edge to ( ) ; if ( ! descendants contains ( child ) ) { newly pending add ( child ) ; } edge = edges get next edge with same from ( edge ) ; } } pending add all ( newly pending ) ; newly pending clear ( ) ; } return descendants ; }


free the mmap associated with this replica must be called with the cache lock held

void munmap ( ) { mapped byte buffer mmap = ( mapped byte buffer ) mmap data ; native i o posix munmap ( mmap ) ; mmap data = null ; }


creates a fluent iterable with the first { @ code size } elements of this fluent iterable if this fluent iterable does not contain that many elements , the returned fluent iterable will have the same behavior as this fluent iterable the returned fluent iterable ' s iterator supports { @ code remove ( ) } if this fluent iterable ' s iterator does < b > { @ code stream } equivalent : < b > { @ link stream # limit } ( same )

public final fluent iterable < e > limit ( int max size ) { return from ( iterables limit ( get delegate ( ) , max size ) ) ; }


returns a new { @ link aggregated spawn metrics } that incorporates the provided metrics by summing them with the existing ones ( if any )

public aggregated spawn metrics sum all metrics ( spawn metrics other ) { spawn metrics existing = get metrics ( other exec kind ( ) ) ; spawn metrics builder builder = spawn metrics builder for exec ( other exec kind ( ) ) add durations ( existing ) add durations ( other ) add non durations ( existing ) add non durations ( other ) ; enum map < spawn metrics exec kind , spawn metrics > map = new enum map < > ( spawn metrics exec kind class ) ; map put all ( metrics map ) ; map put ( other exec kind ( ) , builder build ( ) ) ; return new aggregated spawn metrics ( maps immutable enum map ( map ) ) ; }


obtains the given ticket by its id and returns the cas - representative object implementations need to check for the validity of the ticket by making sure it exists and has not expired yet , etc this method is specifically designed to remove the need to access the ticket registry

ticket get ticket ( string ticket id ) throws invalid ticket exception ;


creates storage block reports , consisting of a single report with the requested number of blocks the block data is fake , because the tests just need to validate that the messages can pass correctly this intentionally uses the old - style decoding method as a helper the test needs to cover the new - style encoding technique passing through that code path here would trigger an exception before the test is ready to deal with it

private storage block report [ ] create reports ( int num blocks ) { int longs per block = 3 ; int block list size = 2 + num blocks * longs per block ; list < long > longs = new array list < long > ( block list size ) ; longs add ( long value of ( num blocks ) ) ; longs add ( 0l ) ; for ( int i = 0 ; i < block list size ; + + i ) { longs add ( long value of ( i ) ) ; } block list as longs block list = block list as longs decode longs ( longs ) ; storage block report [ ] reports = new storage block report [ ] { new storage block report ( dn storage , block list ) } ; return reports ; }


public static hls media chunk create instance ( hls extractor factory extractor factory , data source data source , format format , long start of playlist in period us , hls media playlist media playlist , int segment index in playlist , uri playlist url , @ nullable list < format > muxed caption formats , int track selection reason , @ nullable object track selection data , boolean is master timestamp source , timestamp adjuster provider timestamp adjuster provider , @ nullable hls media chunk previous chunk , @ nullable byte [ ] media segment key , @ nullable byte [ ] init segment key ) { / / media segment hls media playlist segment media segment = media playlist segments get ( segment index in playlist ) ; data spec data spec = new data spec ( uri util resolve to uri ( media playlist base uri , media segment url ) , media segment byte range offset , media segment byte range length ) ; boolean media segment encrypted = media segment key ! = null ; @ nullable byte [ ] media segment iv = media segment encrypted ? get encryption iv array ( assertions check not null ( media segment encryption i v ) ) : null ; data source media data source = build data source ( data source , media segment key , media segment iv ) ; / / init segment hls media playlist segment init segment = media segment initialization segment ; data spec init data spec = null ; boolean init segment encrypted = false ; @ nullable data source init data source = null ; if ( init segment ! = null ) { init segment encrypted = init segment key ! = null ; @ nullable byte [ ] init segment iv = init segment encrypted ? get encryption iv array ( assertions check not null ( init segment encryption i v ) ) : null ; uri init segment uri = uri util resolve to uri ( media playlist base uri , init segment url ) ; init data spec = new data spec ( init segment uri , init segment byte range offset , init segment byte range length ) ; init data source = build data source ( data source , init segment key , init segment iv ) ; } long segment start time in period us = start of playlist in period us + media segment relative start time us ; long segment end time in period us = segment start time in period us + media segment duration us ; int discontinuity sequence number = media playlist discontinuity sequence + media segment relative discontinuity sequence ; @ nullable hls media chunk extractor previous extractor = null ; id 3 decoder id 3 decoder ; parsable byte array scratch id 3 data ; boolean should splice in ; if ( previous chunk ! = null ) { boolean is following chunk = playlist url equals ( previous chunk playlist url ) & & previous chunk load completed ; id 3 decoder = previous chunk id 3 decoder ; scratch id 3 data = previous chunk scratch id 3 data ; boolean can continue without splice = is following chunk | | ( media playlist has independent segments & & segment start time in period us > = previous chunk end time us ) ; should splice in = ! can continue without splice ; previous extractor = is following chunk & & ! previous chunk extractor invalidated & & previous chunk discontinuity sequence number = = discontinuity sequence number ? previous chunk extractor : null ; } else { id 3 decoder = new id 3 decoder ( ) ; scratch id 3 data = new parsable byte array ( id 3 decoder id3 header length ) ; should splice in = false ; } return new hls media chunk ( extractor factory , media data source , data spec , format , media segment encrypted , init data source , init data spec , init segment encrypted , playlist url , muxed caption formats , track selection reason , track selection data , segment start time in period us , segment end time in period us , / * chunk media sequence = * / media playlist media sequence + segment index in playlist , discontinuity sequence number , media segment has gap tag , is master timestamp source , / * timestamp adjuster = * / timestamp adjuster provider get adjuster ( discontinuity sequence number ) , media segment drm init data , previous extractor , id 3 decoder , scratch id 3 data , should splice in ) ; }


set ( ) - s this tile , except it ' s synced across the network

public void set floor net ( block floor , block overlay ) { call set floor ( this , floor , overlay ) ; }


what isolation strategy { @ link hystrix command # run ( ) } will be executed with if { @ link execution isolation strategy # thread } then it will be executed on a separate thread and concurrent requests limited by the number of threads in the thread - pool if { @ link execution isolation strategy # semaphore } then it will be executed on the calling thread and concurrent requests limited by the semaphore count

public hystrix property < execution isolation strategy > execution isolation strategy ( ) { return execution isolation strategy ; }


fill the buffer from the file fp keeps track of the file pointer fileoffset is the offset into the file to where the buffer came from

private int fill ( ) throws i o exception { fileoffset = fp ; int read = file read ( buffer , 0 , buffer length ) ; if ( log is debug enabled ( ) ) { string buf = new string ( buffer , 0 , 40 , " utf - 8 " ) ; log debug ( " fill ( buffer = " + buf + " ) " ) ; } if ( read = = - 1 ) { / / eof reached buffersize = 0 ; } else { buffersize = read ; } fp + = buffersize ; bufferoffset = 0 ; return buffersize ; }


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


attempt to use evil reflection tricks to determine the pid of a launched process this is helpful to ops if debugging a fencing process that might have gone wrong if running on a system or jvm where this doesn ' t work , it will simply return null

private static string try get pid ( process p ) { try { class < ? extends process > clazz = p get class ( ) ; if ( clazz get name ( ) equals ( " java lang u n i x process " ) ) { field f = clazz get declared field ( " pid " ) ; f set accessible ( true ) ; return string value of ( f get int ( p ) ) ; } else { log trace ( " unable to determine pid for " + p + " since it is not a u n i x process " ) ; return null ; } } catch ( throwable t ) { log trace ( " unable to determine pid for " + p , t ) ; return null ; } }


ensures that at least < code > n < code > data nodes are present in the cluster if more nodes than < code > n < code > are present this method will not stop any of the running nodes

public synchronized void ensure at least num data nodes ( int n ) { int size = num data nodes ( ) ; if ( size < n ) { logger info ( " increasing cluster size from { } to { } " , size , n ) ; if ( num shared dedicated master nodes > 0 ) { start data only nodes ( n - size ) ; } else { start nodes ( n - size ) ; } validate cluster formed ( ) ; } }


tests the registration of the checkpoint metrics

public void test metrics registration ( ) throws exception { final collection < string > registered gauge names = new array list < > ( ) ; metric group metric group = new unregistered metrics group ( ) { @ override public < t , g extends gauge < t > > g gauge ( string name , g gauge ) { if ( gauge ! = null ) { registered gauge names add ( name ) ; } return gauge ; } } ; execution job vertex job vertex = mock ( execution job vertex class ) ; when ( job vertex get job vertex id ( ) ) then return ( new job vertex i d ( ) ) ; when ( job vertex get parallelism ( ) ) then return ( 1 ) ; new checkpoint stats tracker ( 0 , collections singleton list ( job vertex ) , mock ( checkpoint coordinator configuration class ) , metric group ) ; / / make sure this test is adjusted when further metrics are added assert true ( registered gauge names contains all ( arrays as list ( checkpoint stats tracker number of checkpoints metric , checkpoint stats tracker number of in progress checkpoints metric , checkpoint stats tracker number of completed checkpoints metric , checkpoint stats tracker number of failed checkpoints metric , checkpoint stats tracker latest restored checkpoint timestamp metric , checkpoint stats tracker latest completed checkpoint size metric , checkpoint stats tracker latest completed checkpoint duration metric , checkpoint stats tracker latest completed checkpoint processed data metric , checkpoint stats tracker latest completed checkpoint persisted data metric , checkpoint stats tracker latest completed checkpoint external path metric ) ) ) ; assert equals ( 10 , registered gauge names size ( ) ) ; }


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


returns true if the given code completion actually would insert something

public static boolean is valid ( code completion completion ) { return ( ( completion ! = null ) & & ( completion get insertion ( ) ! = null ) ) ; }


set whether the returned connection ' s " auto commit " setting should be overridden

public void set auto commit ( boolean auto commit ) { this auto commit = ( auto commit ) ; }


return all interfaces ( and subinterfaces ) on the system

static list < network interface > get interfaces ( ) throws socket exception { list < network interface > all = new array list < > ( ) ; add all interfaces ( all , collections list ( network interface get network interfaces ( ) ) ) ; collections sort ( all , new comparator < network interface > ( ) { @ override public int compare ( network interface left , network interface right ) { return integer compare ( left get index ( ) , right get index ( ) ) ; } } ) ; return all ; }


sets the command timeout for synchronous command execution

public void set timeout ( long timeout ) { assert util not null ( timeout , " timeout must not be null " ) ; assert util is true ( timeout > = 0 , " timeout must be greater or equal 0 " ) ; this timeout = timeout ; }


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


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

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


tests that { @ link event sample stream # skip data ( long ) } will only skip to the point right after it last event a following { @ link event sample stream # update event stream ( event stream , boolean ) } will update the underlying event stream and keep the timestamp the stream has skipped to , so the next { @ link event sample stream # read data ( format holder , decoder input buffer , boolean ) } call will return sample data from the skipped position

public void skip data then update stream continue to read do not skipped more than available ( ) { long presentation time us 1 = 1000000 ; long presentation time us 2 = 2000000 ; long presentation time us 3 = 3000000 ; event message event message 1 = new event message with id ( 1 ) ; event message event message 2 = new event message with id ( 2 ) ; event message event message 3 = new event message with id ( 3 ) ; event stream event stream 1 = new event stream ( scheme id , value , time scale , new long [ ] { presentation time us 1 } , new event message [ ] { event message 1 } ) ; event stream event stream 2 = new event stream ( scheme id , value , time scale , new long [ ] { presentation time us 1 , presentation time us 2 , presentation time us 3 } , new event message [ ] { event message 1 , event message 2 , event message 3 } ) ; event sample stream sample stream = new event sample stream ( event stream 1 , format , true ) ; / / first read - read format read data ( sample stream ) ; / / even though the skip call is to 2000001 , since event stream 1 only contains sample until / / 1000000 , it will only skip to 1000001 sample stream skip data ( presentation time us 2 + 1 ) ; sample stream update event stream ( event stream 2 , true ) ; int result = read data ( sample stream ) ; assert that ( result ) is equal to ( c result buffer read ) ; assert that ( input buffer data array ( ) ) is equal to ( get encoded message ( event message 2 ) ) ; }


add a array of coordinates to the collection

public e coordinates ( coordinate coordinates ) { return this coordinates ( arrays as list ( coordinates ) ) ; }


initialize any state necessary to run benchmark this is run once at start up

protected void set up ( ) { / / default : no - op }


cleans any resources held by this command the main goal is to delete id file created in { @ link org apache hadoop hdfs server balancer name node connector # check and mark running } , otherwise , it ' s not allowed to run multiple commands in a row

public void close ( ) throws i o exception { if ( fs ! = null ) { fs close ( ) ; } }


public just symbol enum get just symbol ( ) { return just symbol ; }


invalidate cached objects held by this manager

public void invalidate cache ( boolean all ) { lock acquire ( ) ; try { cache invalidate ( ) ; bookmark adapter reload tables ( ) ; refresh bookmark types ( ) ; } finally { lock release ( ) ; } }


close output stream and prevent further writing

private void close ( ) throws i o exception { fw close ( ) ; ok to write = false ; }


test rename where src has snapshottable descendant directories and dst is a descent of a snapshottable directory such case will cause nested snapshot which hdfs currently not fully supported

public void test rename with nested snapshottable dirs ( ) throws exception { final path sdir 1 = new path ( " / dir 1 " ) ; final path sdir 2 = new path ( " / dir 2 " ) ; final path foo = new path ( sdir 1 , " foo " ) ; final path bar = new path ( sdir 2 , " bar " ) ; hdfs mkdirs ( foo ) ; hdfs mkdirs ( bar ) ; hdfs allow snapshot ( foo ) ; hdfs allow snapshot ( sdir 2 ) ; try { hdfs rename ( foo , bar , rename overwrite ) ; fail ( " except exception since " + " unable to rename because " + foo to string ( ) + " has snapshottable descendant directories and " + sdir 2 to string ( ) + " is a descent of a snapshottable directory , " + " and hdfs does not support nested snapshottable directory " ) ; } catch ( i o exception e ) { generic test utils assert exception contains ( " unable to rename because " + foo to string ( ) + " has snapshottable descendant directories and " + sdir 2 to string ( ) + " is a descent of a snapshottable directory , " + " and hdfs does not support nested snapshottable directory " , e ) ; } hdfs disallow snapshot ( foo ) ; hdfs rename ( foo , bar , rename overwrite ) ; snapshottable directory status [ ] dirs = fsn get snapshottable dir listing ( ) ; assert equals ( 1 , dirs length ) ; assert equals ( sdir 2 , dirs [ 0 ] get full path ( ) ) ; }


set the timeout to use for receive calls , in < b > milliseconds < b > the default is 1000 ms , that is , 1 second < b > note : < b > this value needs to be smaller than the transaction timeout used by the transaction manager ( in the appropriate unit , of course ) 0 indicates no timeout at all ; however , this is only feasible if not running within a transaction manager and generally discouraged since such a listener container cannot cleanly shut down a negative value such as - 1 indicates a no - wait receive operation

public void set receive timeout ( long receive timeout ) { this receive timeout = receive timeout ; }


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


public int get port ( ) { return address get port ( ) ; }


public static int dp 2px ( final float dp value ) { final float scale = resources get system ( ) get display metrics ( ) density ; return ( int ) ( dp value * scale + 0 5f ) ; }


private void on mouse up ( mouse event e ) { if ( focus column ! = null & & focus item > = 0 ) { if ( e button = = 1 & & cell renderer is over link ( focus column , focus item , e x , e y ) ) { / / navigate link event event = new event ( ) ; event x = e x ; event y = e y ; event state mask = e state mask ; event data = new grid cell ( focus column get element ( ) , row elements [ focus item ] ) ; notify listeners ( event navigate link , event ) ; return ; } } cell selected on last mouse down = false ; if ( hovering on column sorter ) { handle hover on column header ( e x , e y ) ; if ( hovering on column sorter ) { if ( e button = = 1 ) { event event = new event ( ) ; event x = e x ; event y = e y ; event data = column being sorted = = null ? null : column being sorted get element ( ) ; event state mask = e state mask ; notify listeners ( event change sort , event ) ; return ; } } } if ( hovering on column filter ) { handle hover on column header ( e x , e y ) ; if ( hovering on column filter ) { if ( e button = = 1 ) { event event = new event ( ) ; event x = e x ; event y = e y ; event data = column being filtered = = null ? null : column being filtered get element ( ) ; event state mask = e state mask ; notify listeners ( event filter column , event ) ; return ; } } } if ( resizing column ) { resizing column = false ; handle hover on column header ( e x , e y ) ; / / resets cursor if / / necessary return ; } if ( cell drag selection occurring | | cell row drag selection occurring | | cell column drag selection occurring ) { cell drag selection occurring = false ; cell row drag selection occurring = false ; cell column drag selection occurring = false ; set cursor ( null ) ; if ( followup cell selection event owed ) { event se = new event ( ) ; se button = e button ; point point = new point ( e x , e y ) ; grid column column = get column ( point ) ; int row index = get row ( point ) ; if ( column ! = null & & row index > = 0 ) { se data = new grid cell ( column get element ( ) , row elements [ row index ] ) ; } se state mask = e state mask ; se x = e x ; se y = e y ; se detail = swt drop down ; notify listeners ( swt selection , se ) ; followup cell selection event owed = false ; } } }


tests that removing a job completes the job leader id future exceptionally

public void test removing job ( ) throws exception { final job i d job id = new job i d ( ) ; testing high availability services high availability services = new testing high availability services ( ) ; settable leader retrieval service leader retrieval service = new settable leader retrieval service ( null , null ) ; high availability services set job master leader retriever ( job id , leader retrieval service ) ; scheduled executor scheduled executor = mock ( scheduled executor class ) ; time timeout = time milliseconds ( 5000l ) ; job leader id actions job leader id actions = mock ( job leader id actions class ) ; job leader id service job leader id service = new job leader id service ( high availability services , scheduled executor , timeout ) ; job leader id service start ( job leader id actions ) ; job leader id service add job ( job id ) ; completable future < job master id > leader id future = job leader id service get leader id ( job id ) ; / / remove the job before we could find a leader job leader id service remove job ( job id ) ; assert false ( job leader id service contains job ( job id ) ) ; try { leader id future get ( ) ; fail ( " the leader id future should be completed exceptionally " ) ; } catch ( execution exception ignored ) { / / expected exception } }


returns the given list if not null , otherwise returns an empty list this is useful for clients avoid null checks

public static < t > list < t > as list ( list < t > list ) { if ( list = = null ) { return new array list < > ( ) ; } return list ; }


returns the null count of the given column

public double get column null count ( rel node rel , int index ) { for ( ; ; ) { try { return column null count handler get column null count ( rel , this , index ) ; } catch ( janino rel metadata provider no handler e ) { column null count handler = revise ( e rel class , flink metadata column null count def ) ; } } }


the set of enumsflags defined in this attribute only makes sense if the format includes either format flags : : enum or format flags : : flags having both is an error < code > repeated aapt pb attribute symbol symbol = 4 ; < code >


returns the number of bytes that this primitive takes in instantiation

public int get type size ( ) { return type size ; }


public float get float item ( ) { return float item ; }


returns the canonical string representation of this entry , defined as follows if the count for this entry is one , this is simply the string representation of the corresponding element otherwise , it is the string representation of the element , followed by the three characters { @ code " x " } ( space , letter x , space ) , followed by the count


public long get pet id ( ) { return pet id ; }


gets the current number of received buffers which have not been processed yet

public int get number of queued buffers ( ) { synchronized ( received buffers ) { return received buffers size ( ) ; } }


public void cancel ( ) { codepane remove all ( ) ; / / codepane repaint ( ) ; field layout manager layout container ( codepane ) ; codepane request focus in window ( ) ; }


public boolean can undo ( ) { return current action ! = null | | actions index > 0 ; }


private int header size ( ) { / * * because of how this instance was set up , this is the same * as the alignment * / return get alignment ( ) ; }


public int get fetch direction ( ) throws s q l exception { check closed ( ) ; return 0 ; }


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


public void int 3 2 test ( ) { / / todo : test int 3 2 }


public void write ( final data output out ) throws i o exception { new long writable ( serial version u i d ) write ( out ) ; text write string ( out , encryption algorithm ) ; text write string ( out , encryption key ) ; }


underlying drawable ' s aspect ratio is smaller than view ' s , so it has to be slided vertically after scaling focus point is at 40 % and it can be completely centered

public void test configure bounds focus crop vc ( ) { rect bounds = new rect ( 10 , 10 , 410 , 310 ) ; int width = 200 ; int height = 300 ; point f focus point = new point f ( 0 5f , 0 4f ) ; matrix expected matrix = new matrix ( ) ; expected matrix set scale ( 2 0f , 2 0f ) ; expected matrix post translate ( 10 , - 79 ) ; test configure bounds ( bounds , width , height , scale type focus crop , focus point , expected matrix ) ; / / expected bounds of the actual image after the scaling has been performed ( without cropping ) test actual image bounds ( new rect f ( 1 0f , - 7 9f , 4 1 0f , 5 2 1f ) ) ; }


mark a block as " suspect " this means that we should try to rescan it soon note that the volume scanner keeps a list of recently suspicious blocks , which it uses to avoid rescanning the same block over and over in a short time frame

synchronized void mark suspect block ( string storage id , extended block block ) { if ( ! is enabled ( ) ) { log debug ( " not scanning suspicious block { } on { } , because the block " + " scanner is disabled " , block , storage id ) ; return ; } volume scanner scanner = scanners get ( storage id ) ; if ( scanner = = null ) { / / this could happen if the volume is in the process of being removed / / the removal process shuts down the volume scanner , but the volume / / object stays around as long as there are references to it ( which / / should not be that long ) log info ( " not scanning suspicious block { } on { } , because there is no " + " volume scanner for that storage id " , block , storage id ) ; return ; } scanner mark suspect block ( block ) ; }


test for hadoop - 16109 : parquet reading s 3 a file system causes eof this sets up a read which will span the active readahead and , in random io mode , a subsequent get

public void test read across readahead ( ) throws throwable { describe ( " sets up a read which will span the active readahead " + " and the rest of the file " ) ; path path = path ( " test read across readahead " ) ; write test dataset ( path ) ; file system fs = get file system ( ) ; / / forward seek reading across readahead boundary try ( f s data input stream in = fs open ( path ) ) { final byte [ ] temp = new byte [ 5 ] ; in read byte ( ) ; int offset = readahead - 1 ; in read fully ( offset , temp ) ; / / < - - works assert dataset equals ( offset , " read spanning boundary " , temp , temp length ) ; } / / read exactly on the the boundary try ( f s data input stream in = fs open ( path ) ) { final byte [ ] temp = new byte [ 5 ] ; read at end and return ( in ) ; assert equals ( " current position " , 1 , ( int ) ( in get pos ( ) ) ) ; in read fully ( readahead , temp ) ; assert dataset equals ( readahead , " read exactly on boundary " , temp , temp length ) ; } }


return a short name for this exporter used for tracing of remote invocations default is the unqualified class name ( without package ) can be overridden in subclasses

protected string get exporter name ( ) { return class utils get short name ( get class ( ) ) ; }


copies the contents of src to dst , starting from src [ src offset ] , copying num elements elements the { @ link buffer } instance ' s { @ link buffer # position ( ) } is used to define the offset into the buffer itself the position will stay the same , the limit will be set to position + num elements < b > the buffer must be a direct buffer with native byte order no error checking is performed < b >

public static void copy ( float [ ] src , int src offset , buffer dst , int num elements ) { dst limit ( dst position ( ) + bytes to elements ( dst , num elements < < 2 ) ) ; copy jni ( src , src offset , dst , position in bytes ( dst ) , num elements < < 2 ) ; }


provide the implementation of the platform bitmap factory for the current platform using the provided pool factory

public static platform bitmap factory build platform bitmap factory ( pool factory pool factory , platform decoder platform decoder , closeable reference factory closeable reference factory ) { if ( build version sdk int > = build version codes lollipop ) { return new art bitmap factory ( pool factory get bitmap pool ( ) , closeable reference factory ) ; } else if ( build version sdk int > = build version codes honeycomb ) { return new honeycomb bitmap factory ( new empty jpeg generator ( pool factory get pooled byte buffer factory ( ) ) , platform decoder , closeable reference factory ) ; } else { return new gingerbread bitmap factory ( ) ; } }


public static base http method source of ( string name ) { for ( base http method method : base http method values ( ) ) { if ( string utils equals ignore case ( name , method name ) ) { return method ; } } throw new illegal argument exception ( " unsupported http method : " + name ) ; }


parses a sql string as an identifier into a { @ link sql identifier }

public sql identifier parse identifier ( string identifier ) { try { return create flink parser ( identifier ) table api identifier ( ) ; } catch ( exception e ) { throw new sql parser exception ( string format ( " invalid sql identifier % s " , identifier ) ) ; } }


helper method to return a literal bits argument string

protected static string literal bits string ( cst literal bits value ) { string buffer sb = new string buffer ( 100 ) ; sb append ( ' # ' ) ; if ( value instanceof cst known null ) { sb append ( " null " ) ; } else { sb append ( value type name ( ) ) ; sb append ( ' ' ) ; sb append ( value to human ( ) ) ; } return sb to string ( ) ; }


removes all parts from the metric identifier preceding the latency - related parts

private static string sanitize name ( final string registration name ) { return registration name substring ( registration name last index of ( parent group name ) + parent group name length ( ) + 1 ) ; }


merges the given providers into one { @ link java info } all the providers with the same type in the given list are merged into one provider that is added to the resulting { @ link java info }

public static java info merge ( list < java info > providers ) { list < java compilation args provider > java compilation args providers = java info fetch providers from list ( providers , java compilation args provider class ) ; list < java strict compilation args provider > java strict compilation args providers = java info fetch providers from list ( providers , java strict compilation args provider class ) ; list < java source jars provider > java source jars providers = java info fetch providers from list ( providers , java source jars provider class ) ; list < java runfiles provider > java runfiles providers = java info fetch providers from list ( providers , java runfiles provider class ) ; list < java plugin info provider > java plugin info providers = java info fetch providers from list ( providers , java plugin info provider class ) ; list < java exports provider > java exports providers = java info fetch providers from list ( providers , java exports provider class ) ; list < java rule output jars provider > java rule output jars providers = java info fetch providers from list ( providers , java rule output jars provider class ) ; list < java source info provider > source infos = java info fetch providers from list ( providers , java source info provider class ) ; runfiles merged runfiles = runfiles empty ; for ( java runfiles provider java runfiles provider : java runfiles providers ) { runfiles runfiles = java runfiles provider get runfiles ( ) ; merged runfiles = merged runfiles = = runfiles empty ? runfiles : merged runfiles merge ( runfiles ) ; } immutable list builder < artifact > runtime jars = immutable list builder ( ) ; immutable list builder < string > java constraints = immutable list builder ( ) ; for ( java info java info : providers ) { runtime jars add all ( java info get direct runtime jars ( ) ) ; java constraints add all ( java info get java constraints ( ) ) ; } return java info builder create ( ) add provider ( java compilation args provider class , java compilation args provider merge ( java compilation args providers ) ) add provider ( java strict compilation args provider class , java strict compilation args provider merge ( java strict compilation args providers ) ) add provider ( java source jars provider class , java source jars provider merge ( java source jars providers ) ) add provider ( java rule output jars provider class , java rule output jars provider merge ( java rule output jars providers ) ) add provider ( java runfiles provider class , new java runfiles provider ( merged runfiles ) ) add provider ( java plugin info provider class , java plugin info provider merge ( java plugin info providers ) ) add provider ( java exports provider class , java exports provider merge ( java exports providers ) ) add provider ( java source info provider class , java source info provider merge ( source infos ) ) / / todo ( b / 65618333 ) : add merge function to java gen jars provider see # 3769 / / todo ( iirina ) : merge or remove java compilation info provider set runtime jars ( runtime jars build ( ) ) set java constraints ( java constraints build ( ) ) build ( ) ; }


gets the current catalog that will be used when resolving table path

public string get current catalog ( ) { return current catalog name ; }


returns the summary section from the latest fsimage stored on the cluster this is effectively the image index which contains the offset of each section and subsection

public static fs image proto file summary get latest image summary ( mini d f s cluster cluster ) throws i o exception { random access file ra file = null ; try { file image = f s image test util find latest image file ( f s image test util get f s image ( cluster get name node ( ) ) get storage ( ) get storage dir ( 0 ) ) ; ra file = new random access file ( image , " r " ) ; return f s image util load summary ( ra file ) ; } finally { if ( ra file ! = null ) { ra file close ( ) ; } } }


public @ non null string get log ( ) throws i o exception { return util load file ( get log file ( ) , get charset ( ) ) ; }