convert a byte array in some { @ link x content } format to a { @ link map } throws an { @ link elasticsearch parse exception } if there is any error note that unlike { @ link # convert to map ( bytes reference , boolean ) } , this doesn ' t automatically uncompress the input

public static map < string , object > convert to map ( x content x content , byte [ ] bytes , int offset , int length , boolean ordered ) throws elasticsearch parse exception { / / it is safe to use empty here because this never uses named object try ( x content parser parser = x content create parser ( named x content registry empty , deprecation handler throw unsupported operation , bytes , offset , length ) ) { return ordered ? parser map ordered ( ) : parser map ( ) ; } catch ( i o exception e ) { throw new elasticsearch parse exception ( " failed to parse content to map " , e ) ; } }


get the filters this will be an unmodifiable list

public list < keyed filter > filters ( ) { return collections unmodifiable list ( this filters ) ; }


public final cancellable delete async ( delete request delete request , request options options , action listener < delete response > listener ) { return perform request async and parse entity ( delete request , request converters : : delete , options , delete response : : from x content , listener , collections singleton ( 404 ) ) ; }


indicates whether or a stream created by this endpoint can be opened without violating { @ link # max active streams ( ) }


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


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

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


adds an artifact that is necessary for executing the spawn itself ( e g a compiler ) , in contrast to an artifact that is necessary for the spawn to do its work ( e g source code ) the artifact is implicitly added to the inputs of the action as well

public builder add tool ( artifact tool ) { tools builder add ( tool ) ; return this ; }


adds load image task to execution pool image will be returned with { @ link image loading listener # on loading complete ( string , android view view , android graphics bitmap ) } callback } < br > < b > note : < b > { @ link # init ( image loader configuration ) } method must be called before this method call

public void load image ( string uri , image size target image size , display image options options , image loading listener listener ) { load image ( uri , target image size , options , listener , null ) ; }


validate and set cluster id from { @ link properties }

protected void set cluster id ( properties props , int layout version , storage directory sd ) throws inconsistent f s state exception { / / set cluster id in version that supports federation if ( layout version supports ( get service layout feature map ( ) , feature federation , layout version ) ) { string cid = get property ( props , sd , " cluster i d " ) ; if ( ! ( cluster i d equals ( " " ) | | cid equals ( " " ) | | cluster i d equals ( cid ) ) ) { throw new inconsistent f s state exception ( sd get root ( ) , " cluster id is incompatible with others " ) ; } cluster i d = cid ; } }


this method returns a { @ code immutable sorted map } , consisting of the entries whose keys ranges from { @ code from key } , inclusive , to { @ code to key } , exclusive the { @ link sorted map # sub map } documentation states that a submap of a submap throws an { @ link illegal argument exception } if passed a { @ code from key } less than an earlier { @ code from key } however , this method doesn ' t throw an exception in that situation , but instead keeps the original { @ code from key } similarly , this method keeps the original { @ code to key } , instead of throwing an exception , if passed a { @ code to key } greater than an earlier { @ code to key }

public immutable sorted map < k , v > sub map ( k from key , k to key ) { return sub map ( from key , true , to key , false ) ; }


set the body of the response to the given { @ code object } and return it asynchronous response bodies are supported by providing a { @ link completion stage } or { @ link publisher } as body ( or any asynchronous producer of a single entity that can be adapted via the { @ link reactive adapter registry } )


selects the items at the given zero - relative indices in the receiver the current selection is not cleared before the new items are selected < p > if the item at a given index is not selected , it is selected if the item at a given index was already selected , it remains selected indices that are out of range and duplicate indices are ignored if the receiver is single - select and multiple indices are specified , then all indices are ignored < p > if cell selection is enabled , all cells within the given indices are selected

public void select ( int [ ] indices ) { check widget ( ) ; if ( indices = = null ) { swt error ( swt error null argument ) ; return ; } if ( selection type = = swt single & & indices length > 1 ) return ; for ( int j : indices ) { if ( j > = 0 & & j < get item count ( ) ) { select cells ( get cells ( j ) ) ; } } redraw ( ) ; }


check whether the matrix is symmetric matrix

public boolean is symmetric ( ) { if ( m ! = n ) { return false ; } for ( int i = 0 ; i < n ; i + + ) { for ( int j = i + 1 ; j < n ; j + + ) { if ( this get ( i , j ) ! = this get ( j , i ) ) { return false ; } } } return true ; }


public byte [ ] generate random bytes ( final int length ) { byte [ ] result = new byte [ length ] ; for ( int i = 0 ; i < length ; i + + ) { result [ i ] = seed [ random next int ( seed length ) ] ; } return result ; }


call { @ link # create ( string , fs permission , enum set , boolean , short , long , progressable , int , checksum opt ) } with < code > create parent < code > set to true

public d f s output stream create ( string src , fs permission permission , enum set < create flag > flag , short replication , long block size , progressable progress , int buffersize , checksum opt checksum opt ) throws i o exception { return create ( src , permission , flag , true , replication , block size , progress , buffersize , checksum opt , null ) ; }


returns whether binaries must be compiled with position independent code

public static boolean use pic for binaries ( cc toolchain provider toolchain , cpp configuration cpp configuration , feature configuration feature configuration ) { return cpp configuration force pic ( ) | | ( toolchain use pic for dynamic libraries ( cpp configuration , feature configuration ) & & cpp configuration get compilation mode ( ) ! = compilation mode opt ) ; }


resolves the given { @ code type } against the type context represented by this type for example : { @ code new type token < list < string > > ( ) { } resolve type ( list class get method ( " get " , int class ) get generic return type ( ) ) = > string class }

public final type token < ? > resolve type ( type type ) { check not null ( type ) ; / / being conservative here because the user could use resolve type ( ) to resolve a type in an / / invariant context return of ( get invariant type resolver ( ) resolve type ( type ) ) ; }


encode a couple of contexts where scandinavian , slavic or german names should get an alternate , native pronunciation of ' sv ' or ' xv '

boolean encode special sw ( ) { if ( m current = = 0 ) { / / if ( names beginning with sw that get alt sv ( ) ) { metaph add ( " s " , " sv " ) ; m current + = 2 ; return true ; } / / if ( names beginning with sw that get alt xv ( ) ) { metaph add ( " s " , " xv " ) ; m current + = 2 ; return true ; } } return false ; }


parses the a test result xml file into the corresponding protocol buffer

private test case parse xml to tree ( input stream xml stream ) throws test xml output parser exception { x m l stream reader parser = null ; try { parser = x m l input factory new instance ( ) create x m l stream reader ( xml stream ) ; while ( true ) { int event = parser next ( ) ; if ( event = = x m l stream constants end document ) { return null ; } / / first find the topmost node if ( event = = x m l stream constants start element ) { string element name = parser get local name ( ) ; if ( toplevel element names contains ( element name ) ) { test case result = parse test suite ( parser , element name ) ; return result ; } } } } catch ( x m l stream exception e ) { throw new test xml output parser exception ( e ) ; } catch ( number format exception e ) { / / the parser is definitely ! = null here throw new test xml output parser exception ( " number could not be parsed at " + parser get location ( ) get line number ( ) + " : " + parser get location ( ) get column number ( ) , e ) ; } catch ( uninitialized message exception e ) { / / this happens when the xml does not contain a field that is required / / in the protocol buffer throw new test xml output parser exception ( e ) ; } catch ( runtime exception e ) { / / seems like that an x n i exception can leak through , even though it is not / / specified anywhere / / / / it ' s a bad idea to refer to x n i exception directly because the xerces / / documentation says that it may not be available here soon ( and it / / results in a compile - time warning anyway ) , so we do it the roundabout / / way : check if the class name has something to do with xerces , and if / / so , wrap it in our own exception type , otherwise , let the stack / / unwinding continue string name = e get class ( ) get canonical name ( ) ; if ( name ! = null & & name contains ( " org apache xerces " ) ) { throw new test xml output parser exception ( e ) ; } else { throw e ; } } finally { if ( parser ! = null ) { try { parser close ( ) ; } catch ( x m l stream exception e ) { / / ignore errors during closure so that we do not interfere with an / / already propagating exception } } } }


public final void start ( client stream listener listener ) { master listener = listener ; status shutdown status = prestart ( ) ; if ( shutdown status ! = null ) { cancel ( shutdown status ) ; return ; } class start entry implements buffer entry { @ override public void run with ( substream substream ) { substream stream start ( new sublistener ( substream ) ) ; } } synchronized ( lock ) { state buffer add ( new start entry ( ) ) ; } substream substream = create substream ( 0 ) ; if ( is hedging ) { future canceller scheduled hedging ref = null ; synchronized ( lock ) { state = state add active hedge ( substream ) ; if ( has potential hedging ( state ) & & ( throttle = = null | | throttle is above threshold ( ) ) ) { scheduled hedging = scheduled hedging ref = new future canceller ( lock ) ; } } if ( scheduled hedging ref ! = null ) { scheduled hedging ref set future ( scheduled executor service schedule ( new hedging runnable ( scheduled hedging ref ) , hedging policy hedging delay nanos , time unit nanoseconds ) ) ; } } drain ( substream ) ; }


public list < integer > get prefix ns wrapped array ( ) { return prefix ns wrapped array ; }


private string [ ] get history file path ( ) { file path = new file ( config logging dir ) ; string [ ] path arr = path list ( new filename filter ( ) { @ override public boolean accept ( file dir , string name ) { return filename pattern matcher ( name ) matches ( ) ; } } ) ; return path arr ; }


the value of the name and type index item must be a valid index into the constant pool table the constant pool entry at that index must be a constant name and type info structure representing a field descriptor

public int get name and type index ( ) { return name and type index & 0xffff ; }


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 component at the given position in the binder

component tree get component at ( int position ) ;


gets the a register number , as a code unit this will throw if the value is out of the range of an unsigned code unit

public final short get a unit ( ) { int a = get a ( ) ; if ( ( a & ~ 0xffff ) ! = 0 ) { throw new dex exception ( " register a out of range : " + hex u 8 ( a ) ) ; } return ( short ) a ; }


get a random block id that is not used already

private long get free block id ( ) { long id = rand next long ( ) ; while ( true ) { id = rand next long ( ) ; if ( fs dataset test util fetch replica info ( fds , bpid , id ) = = null ) { break ; } } return id ; }


allow to specify an initial attribute of the newly created { @ link channel } if the { @ code value } is { @ code null } , the attribute of the specified { @ code key } is removed

public < t > b attr ( attribute key < t > key , t value ) { object util check not null ( key , " key " ) ; if ( value = = null ) { attrs remove ( key ) ; } else { attrs put ( key , value ) ; } return self ( ) ; }


set arguments for the method invocation if this property is not set , or the object array is of length 0 , a method with no arguments is assumed

public void set arguments ( object arguments ) { this arguments = arguments ; }


this test makes sure that only a hybridhash on the static path is transformed to the cached variant

public void test right side countercheck ( ) { try { plan plan = get test plan right static ( optimizer hint local strategy hash build first ) ; optimized plan o plan = compile no stats ( plan ) ; optimizer plan node resolver resolver = get optimizer plan node resolver ( o plan ) ; dual input plan node inner join = resolver get node ( " dummy joiner " ) ; / / verify correct join strategy assert equals ( driver strategy hybridhash build first , inner join get driver strategy ( ) ) ; assert equals ( temp mode none , inner join get input 1 ( ) get temp mode ( ) ) ; assert equals ( temp mode cached , inner join get input 2 ( ) get temp mode ( ) ) ; new job graph generator ( ) compile job graph ( o plan ) ; } catch ( exception e ) { system err println ( e get message ( ) ) ; e print stack trace ( ) ; fail ( " test errored : " + e get message ( ) ) ; } }


does some work and returns current state


convert a well - formed ( but not necessarily valid ) xml string into a j s o n object using the json m l transform each xml tag is represented as a j s o n object with a " tag name " property if the tag has attributes , then the attributes will be in the j s o n object as properties if the tag contains children , the object will have a " child nodes " property which will be an array of strings and json m l j s o n objects comments , prologs , d t ds , and < code > & lt ; [ [ ] ] > < code > are ignored

public static j s o n object to j s o n object ( x m l tokener x ) throws j s o n exception { return ( j s o n object ) parse ( x , false , null ) ; }


this returns a copy of { @ link aggregator factories } modified so that calls to { @ link # create sub aggregators } will ignore the provided parent aggregator and always use { @ code fixed parent } provided in to this method { @ link adapting aggregator } uses this to make sure that sub - aggregators get the { @ link adapting aggregator } aggregator itself as the parent

public aggregator factories fix parent ( aggregator fixed parent ) { aggregator factories previous = this ; return new aggregator factories ( context , factories ) { @ override public aggregator [ ] create sub aggregators ( aggregator parent , cardinality upper bound cardinality ) throws i o exception { / / note that we ' re throwing out the " parent " passed in to this method and using the parent passed to fix parent return previous create sub aggregators ( fixed parent , cardinality ) ; } } ; }


set whether to track all invocations that go through this interceptor , or just invocations with trace logging enabled default is " false " : only invocations with trace logging enabled will be monitored specify " true " to let j a mon track all invocations , gathering statistics even when trace logging is disabled

public void set track all invocations ( boolean track all invocations ) { this track all invocations = track all invocations ; }


this test tries to truncate some of larger files in the index to trigger leftovers on the recovery target this happens during recovery when the last chunk of the file is transferred to the replica we just throw an exception to make sure the recovery fails and we leave some half baked files on the target later we allow full recovery to ensure we can still recover and don ' t run into corruptions

public void test cancel recovery and resume ( ) throws exception { assert true ( client ( ) admin ( ) cluster ( ) prepare update settings ( ) set transient settings ( settings builder ( ) put ( chunk size setting get key ( ) , new byte size value ( random int between ( 50 , 300 ) , byte size unit bytes ) ) ) get ( ) is acknowledged ( ) ) ; nodes stats response node stats = client ( ) admin ( ) cluster ( ) prepare nodes stats ( ) get ( ) ; list < node stats > data node stats = new array list < > ( ) ; for ( node stats stat : node stats get nodes ( ) ) { if ( stat get node ( ) is data node ( ) ) { data node stats add ( stat ) ; } } assert that ( data node stats size ( ) , greater than or equal to ( 2 ) ) ; collections shuffle ( data node stats , random ( ) ) ; / / we use 2 nodes a lucky and unlucky one / / the lucky one holds the primary / / the unlucky one gets the replica and the truncated leftovers node stats primaries node = data node stats get ( 0 ) ; node stats unlucky node = data node stats get ( 1 ) ; / / create the index and prevent allocation on any other nodes than the lucky one / / we have no replicas so far and make sure that we allocate the primary on the lucky node assert acked ( prepare create ( " test " ) set mapping ( " field 1 " , " type = text " , " the id " , " type = text " ) set settings ( settings builder ( ) put ( index metadata setting number of replicas , 0 ) put ( index metadata setting number of shards , number of shards ( ) ) put ( " index routing allocation include name " , primaries node get node ( ) get name ( ) ) ) ) ; / / only allocate on the lucky node / / index some docs and check if they are coming back int num docs = random int between ( 100 , 200 ) ; list < index request builder > builder = new array list < > ( ) ; for ( int i = 0 ; i < num docs ; i + + ) { string id = integer to string ( i ) ; builder add ( client ( ) prepare index ( " test " ) set id ( id ) set source ( " field 1 " , english int to english ( i ) , " the id " , id ) ) ; } index random ( true , builder ) ; for ( int i = 0 ; i < num docs ; i + + ) { string id = integer to string ( i ) ; assert hit count ( client ( ) prepare search ( ) set query ( query builders term query ( " the id " , id ) ) get ( ) , 1 ) ; } ensure green ( ) ; / / ensure we have flushed segments and make them a big one via optimize client ( ) admin ( ) indices ( ) prepare flush ( ) set force ( true ) get ( ) ; client ( ) admin ( ) indices ( ) prepare flush ( ) set force ( true ) get ( ) ; / / double flush to create safe commit in case of async durability client ( ) admin ( ) indices ( ) prepare force merge ( ) set max num segments ( 1 ) set flush ( true ) get ( ) ; final count down latch latch = new count down latch ( 1 ) ; final atomic boolean truncate = new atomic boolean ( true ) ; for ( node stats data node : data node stats ) { 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 ) - > { if ( action equals ( peer recovery target service actions file chunk ) ) { recovery file chunk request req = ( recovery file chunk request ) request ; logger info ( " file chunk [ { } ] last chunk : { } " , req , req last chunk ( ) ) ; if ( ( req name ( ) ends with ( " cfs " ) | | req name ( ) ends with ( " fdt " ) ) & & req last chunk ( ) & & truncate get ( ) ) { latch count down ( ) ; throw new runtime exception ( " caused some truncated files for fun and profit " ) ; } } connection send request ( request id , action , request , options ) ; } ) ; } logger info ( " - - > bumping replicas to 1 " ) ; / / client ( ) admin ( ) indices ( ) prepare update settings ( " test " ) set settings ( settings builder ( ) put ( index metadata setting number of replicas , 1 ) put ( " index routing allocation include name " , / / now allow allocation on all nodes primaries node get node ( ) get name ( ) + " , " + unlucky node get node ( ) get name ( ) ) ) get ( ) ; latch await ( ) ; / / at this point we got some truncated left overs on the replica on the unlucky node / / now we are allowing the recovery to allocate again and finish to see if we wipe the truncated files truncate compare and set ( true , false ) ; ensure green ( " test " ) ; for ( int i = 0 ; i < num docs ; i + + ) { string id = integer to string ( i ) ; assert hit count ( client ( ) prepare search ( ) set query ( query builders term query ( " the id " , id ) ) get ( ) , 1 ) ; } }


public fake data append read action ( runnable action ) { segments add ( new segment ( action , get last segment ( ) ) ) ; return this ; }


public order get order ( ) { return order get order ( depth and order & 3 ) ; }


return a variant of this { @ code method parameter } which points to the same parameter but one nesting level deeper in case of a { @ link java util optional } declaration

public method parameter nested if optional ( ) { return ( get parameter type ( ) = = optional class ? nested ( ) : this ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void enter show tables ( sql base parser show tables context ctx ) { }


called when the model wants to end cell editing that is in progress this is due to an attempt to modify the composite data type in the editor while the model ' s field edit state indicates a field is being edited it is up to the application to determine whether to cancel or apply the field edits

public abstract void end field editing ( ) ;


set the offset variable string ( e g { @ code " # { offset } " } )

public t offset ( string variable ) { sql ( ) offset = variable ; sql ( ) limiting rows strategy = s q l statement limiting rows strategy offset limit ; return get self ( ) ; }


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


tests that the elasticsearch sink fails eagerly if the provided list of addresses is empty

public void run empty addresses test ( ) { try { create elasticsearch sink ( 1 , get cluster name ( ) , collections empty list ( ) , source sink data test kit get json sink function ( " test " ) ) ; } catch ( illegal argument exception expected exception ) { / / test passes return ; } fail ( ) ; }


public static date next year ( @ not null final date date ) { return date utils ceiling ( date , calendar year ) ; }


creates an empty { @ code priority queue } with the ordering given by its elements ' natural ordering

public static < e extends comparable > priority queue < e > new priority queue ( ) { return new priority queue < e > ( ) ; }


return an { @ link java util iterator } over all values in the set < b > note : < b > this is a fairly inefficient way to access the array contents , it requires generating a number of temporary objects and allocates additional state information associated with the container that will remain for the life of the container

public iterator < e > iterator ( ) { return get collection ( ) get key set ( ) iterator ( ) ; }


protected void parse managed classes ( element persistence unit , spring persistence unit info unit info ) { list < element > classes = dom utils get child elements by tag name ( persistence unit , managed class name ) ; for ( element element : classes ) { string value = dom utils get text value ( element ) trim ( ) ; if ( string utils has text ( value ) ) { unit info add managed class name ( value ) ; } } }


provided a pool , this will initialize it with view counts that make sense

static void initialize pool ( @ non null recycler view recycled view pool pool ) { pool set max recycled views ( message type incoming text , 15 ) ; pool set max recycled views ( message type incoming multimedia , 15 ) ; pool set max recycled views ( message type outgoing text , 15 ) ; pool set max recycled views ( message type outgoing multimedia , 15 ) ; pool set max recycled views ( message type placeholder , 15 ) ; pool set max recycled views ( message type header , 1 ) ; pool set max recycled views ( message type footer , 1 ) ; pool set max recycled views ( message type update , 5 ) ; }


test for the case when no a c ls are defined , so the default values are used expected result : the default a c ls for the root queue is " " ( all ) and for the other queues are " " ( none ) , so the user will have access to all the queues because they will have permissions from the root

public void test queue acl default values ( ) throws i o exception { update config with d and d 1 queues ( null , null , null ) ; check access ( true , true , true ) ; }


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

default response entity < client > test client model ( @ api param ( value = " client model " , required = true ) @ valid @ request body client body ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " client \ " : \ " client \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


" executes " the given action from the point of view of the cache ' s lifecycle with a custom client environment

private void run action ( action action , map < string , string > client env ) throws exception { run action ( action , client env , immutable map of ( ) ) ; }


creates a packaged program from the given command line options and the effective configuration

packaged program build program ( final program options run options , final configuration configuration ) throws file not found exception , program invocation exception , cli args exception { run options validate ( ) ; string [ ] program args = run options get program args ( ) ; string jar file path = run options get jar file path ( ) ; list < url > classpaths = run options get classpaths ( ) ; / / get assembler class string entry point class = run options get entry point class name ( ) ; file jar file = jar file path ! = null ? get jar file ( jar file path ) : null ; return packaged program new builder ( ) set jar file ( jar file ) set user class paths ( classpaths ) set entry point class name ( entry point class ) set configuration ( configuration ) set savepoint restore settings ( run options get savepoint restore settings ( ) ) set arguments ( program args ) build ( ) ; }


test serialization of outer string types

public single < string > rx fake outer string serialize ( string body , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate fake outer string serialize ( body , auth info , fut ) ) ) ; }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / id return id ; default : return null ; } }


model tests for additional properties array

public void test additional properties array ( ) { / / todo : test additional properties array }


private static string get localized values ( final string locale , final list < ? > items ) { val found locale = find locale ( string utils default string ( locale , " en " ) , items ) ; if ( found locale is present ( ) ) { return found locale get ( ) ; } if ( ! items is empty ( ) ) { val item = items get ( 0 ) ; var value = string utils empty ; if ( item instanceof localized name ) { value = ( ( localized name ) item ) get value ( ) ; } if ( item instanceof localized u r i ) { value = ( ( localized u r i ) item ) get u r i ( ) ; } if ( item instanceof x s string ) { value = ( ( x s string ) item ) get value ( ) ; } logger trace ( " loading first available locale [ { } ] " , value ) ; return value ; } return null ; }


determines whether this permission grants the specified privilege on the given resource an { @ link application permission } consists of a sequence of permission entries , where each entry contains a single { @ link application privilege } and one or more resource patterns this method returns { @ code true } if , one or more of those entries meet the following criteria the entry ' s application , when interpreted as an { @ link automaton } { @ link automatons # pattern ( string ) pattern } matches the application given in the argument ( interpreted as a raw string ) the { @ link application privilege # get automaton automaton that defines the entry ' s actions } entirely covers the automaton given in the argument ( that is , the argument is a subset of the entry ' s automaton ) the entry ' s resources , when interpreted as an { @ link automaton } { @ link automatons # patterns ( string ) } set of patterns } entirely covers the resource given in the argument ( also interpreted as an { @ link automaton } { @ link automatons # pattern ( string ) pattern }

public boolean grants ( application privilege other , string resource ) { automaton resource automaton = automatons patterns ( resource ) ; final boolean matched = permissions stream ( ) any match ( e - > e grants ( other , resource automaton ) ) ; logger trace ( " permission [ { } ] { } grant [ { } , { } ] " , this , matched ? " does " : " does not " , other , resource ) ; return matched ; }


short - circuit ? : no threadsemaphore : semaphore semaphore permit reached ? : no execution result : success

public void test execution hook semaphore success ( ) { assert hooks on success ( new func 0 < c > ( ) { @ override public c call ( ) { return get command ( execution isolation strategy semaphore , execution result success , fallback result success ) ; } } , new action 1 < c > ( ) { @ override public void call ( c command ) { testable execution hook hook = command get builder ( ) execution hook ; assert true ( hook command emissions match ( 1 , 0 , 1 ) ) ; assert true ( hook execution events match ( 1 , 0 , 1 ) ) ; assert true ( hook fallback events match ( 0 , 0 , 0 ) ) ; assert equals ( " on start - ! on run start - on execution start - on execution emit - ! on run success - ! on complete - on emit - on execution success - on success - " , hook execution sequence to string ( ) ) ; } } ) ; }


hash bytes in memory segment , length must be aligned to 4 bytes

public static int hash bytes by words ( memory segment segment , int offset , int length in bytes ) { return hash bytes by words ( segment , offset , length in bytes , default seed ) ; }


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


get the directory query parameter used by the list paths rest api and used as the path in the continuation token if the input path is null or the root path " " , empty string is returned if the input path begins with ' ' , the return value is the substring beginning at offset 1 otherwise , the input path is returned

public static string get directory query parameter ( final string path ) { string directory = path ; if ( strings is null or empty ( directory ) ) { directory = abfs http constants empty string ; } else if ( directory char at ( 0 ) = = ' / ' ) { directory = directory substring ( 1 ) ; } return directory ; }


get time for next login retry this will allow the thread to retry with exponential back - off , until tgt endtime last retry is { @ link # kerberos min seconds before relogin } before endtime

static long get next tgt renewal time ( final long tgt end time , final long now , final retry policy rp ) throws exception { final long last retry time = tgt end time - kerberos min seconds before relogin ; final retry policy retry action ra = rp should retry ( null , metrics renewal failures value ( ) , 0 , false ) ; return math min ( last retry time , now + ra delay millis ) ; }


determine the default locale for the given request , called if no locale session attribute has been found the default implementation returns the specified default locale , if any , else falls back to the request ' s accept - header locale

protected locale determine default locale ( http servlet request request ) { locale default locale = get default locale ( ) ; if ( default locale = = null ) { default locale = request get locale ( ) ; } return default locale ; }


determine the declared ( non - generic ) type of the wrapped parameterfield

public class < ? > get dependency type ( ) { if ( this field ! = null ) { if ( this nesting level > 1 ) { type type = this field get generic type ( ) ; for ( int i = 2 ; i < = this nesting level ; i + + ) { if ( type instanceof parameterized type ) { type [ ] args = ( ( parameterized type ) type ) get actual type arguments ( ) ; type = args [ args length - 1 ] ; } } if ( type instanceof class ) { return ( class < ? > ) type ; } else if ( type instanceof parameterized type ) { type arg = ( ( parameterized type ) type ) get raw type ( ) ; if ( arg instanceof class ) { return ( class < ? > ) arg ; } } return object class ; } else { return this field get type ( ) ; } } else { return obtain method parameter ( ) get nested parameter type ( ) ; } }


create a uri builder with default settings


adds several symlinks neither keys nor values may be null

public builder add symlinks ( map < path fragment , artifact > symlinks ) { for ( map entry < path fragment , artifact > symlink : symlinks entry set ( ) ) { symlinks builder add ( new symlink entry ( symlink get key ( ) , symlink get value ( ) ) ) ; } return this ; }


tests the serializationdeserialization of an abstract id

public void test serialization ( ) throws exception { final abstract i d orig i d = new abstract i d ( ) ; final abstract i d copy i d = common test utils create copy serializable ( orig i d ) ; assert equals ( orig i d hash code ( ) , copy i d hash code ( ) ) ; assert equals ( orig i d , copy i d ) ; }


adds an item to this history list < code > null < code > values are ignored calls to this method during selection notification will have no effect if you need to update the history during a notification , then you must do so at a later time , perhaps by using { @ link system utilities # run swing later ( runnable ) }

public void add ( t t ) { if ( is broadcasting ) { return ; } if ( ignore item ( t ) ) { return ; } drop null ( ) ; / / once we add a new item , any old history that was after this item needs to be / / removed , as that is old alternate timeline that no longer makes sense trim history to current index ( ) ; handle duplicate ( t ) ; history stack push ( t ) ; / / ' - 1 ' because we want to be at the new item history index = history stack size ( ) - 1 ; }


public void set time ( int parameter index , time x , calendar cal ) throws s q l exception { }


specify which properties must be present , to be verified by { @ link # validate required properties ( ) }

void set required properties ( string required properties ) ;


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


creates and returns a new " amnesiac " builder based on the amnesiac cache

protected builder with result amnesiac builder ( ) throws exception { return create builder ( amnesiac cache ) ; }


returns a fluent iterable that combines two iterables the returned iterable has an iterator that traverses the elements in { @ code a } , followed by the elements in { @ code b } the source iterators are not polled until necessary the returned iterable ' s iterator supports { @ code remove ( ) } when the corresponding input iterator supports it < b > { @ code stream } equivalent : < b > { @ link stream # concat }

public static < t > fluent iterable < t > concat ( iterable < ? extends t > a , iterable < ? extends t > b ) { return concat no defensive copy ( a , b ) ; }


get memory required to run a reduce task of the job , in mb if a value is specified in the configuration , it is returned else , it returns { @ link job context # default reduce memory mb } for backward compatibility , if the job configuration sets the key { @ link # mapred task maxvmem property } to a value different from { @ link # disabled memory limit } , that value will be used after converting it from bytes to mb

public long get memory for reduce task ( ) { long value = get deprecated memory value ( ) ; if ( value < 0 ) { return get memory required ( task type reduce ) ; } return value ; }


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


if expected values ever change double check that the change is not braking the contract of { @ link streaming runtime context # get operator unique i d ( ) } being stable between job submissions


find purchase order by id for valid response try integer i ds with value & lt ; & # x 3 d ; 5 or & gt ; 10 other values will generated exceptions

public order get order by id ( @ path param ( " order id " ) @ min ( 1l ) @ max ( 5l ) long order id ) ;


public static string build type source path ( final string source path , final string type ) { val new name = type replace ( " " , file separator ) ; return source path + " / src / main / java / " + new name + " java " ; }


public void outer enum test ( ) { / / todo : test outer enum }


public float max errors ( ) { return this max errors ; }


sets the settings selected tab of this m t config object

public void set settings selected tab ( final integer settings selected tab ) { this settings selected tab = settings selected tab ; }


invoked upon completion of the operation

void on completion ( throwable error , v result ) ;


public void test model return ( ) { / / todo : test model return }


returns { @ code default value } if the attribute didn ' t come back , { @ code true } or { @ code false } if it did come back as either of those , or throws an i o exception if the attribute came back in a strange way

private static boolean v 2 role attribute value ( map < string , list < string > > attributes , string name , boolean default value ) throws i o exception { list < string > value list = attributes remove ( name ) ; if ( value list = = null ) { return default value ; } if ( value list size ( ) ! = 1 ) { throw new i o exception ( " expected only a single attribute value for [ " + name + " ] but got " + value list ) ; } switch ( value list get ( 0 ) ) { case " true " : return true ; case " false " : return false ; default : throw new i o exception ( " expected [ " + name + " ] to be either [ true ] or [ false ] but was [ " + value list get ( 0 ) + " ] " ) ; } }


set the next node of the given node at the given level

private void help set next node ( long node , long next node , int level ) { skip list utils help set next node ( node , next node , level , level index header , space allocator ) ; }


clears the stack ( that is , this method pops everything off )

public void clear ( ) { throw if immutable ( ) ; for ( int i = 0 ; i < stack ptr ; i + + ) { stack [ i ] = null ; local [ i ] = false ; } stack ptr = 0 ; }


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


determines if every alternative subset in { @ code altsets } contains more than one alternative

public static boolean all subsets conflict ( collection < bit set > altsets ) { return ! has non conflicting alt set ( altsets ) ; }


reader has fields with upper case characters , writer has same names downcased

public void test reader lower cases field names from type ( ) throws i o exception { list < string > reader fields = new array list < > ( arrays as list ( " field a " , " field b " , " field c " ) ) ; list < string > writer fields = new array list < > ( arrays as list ( " field a " , " field b " , " field c " ) ) ; list < string > writer data = new array list < > ( arrays as list ( " field a value " , " field b value " , " field c value " ) ) ; type reader type = get type ( reader fields ) ; type writer type = get type ( writer fields ) ; write ( temp file , writer type , writer data ) ; row block read block = read ( temp file , reader type ) ; list actual = ( list ) reader type get object value ( session get sql function properties ( ) , read block , 0 ) ; assert equals ( actual size ( ) , reader fields size ( ) ) ; assert equals ( actual get ( 0 ) , " field a value " ) ; assert equals ( actual get ( 1 ) , " field b value " ) ; assert equals ( actual get ( 2 ) , " field c value " ) ; }


the classpath plugins this node was constructed with

public collection < class < ? extends plugin > > get classpath plugins ( ) { return classpath plugins ; }


looks up the label - like string in the location map and returns the resolved path string if the label - like string begins with a repository name , the repository name may be remapped using the { @ code repository mapping }

public string apply ( string arg , immutable map < repository name , repository name > repository mapping ) { label label ; try { label = root get relative with remapping ( arg , repository mapping ) ; } catch ( label syntax exception e ) { throw new illegal state exception ( string format ( " invalid label in % s expression : % s " , function name ( ) , e get message ( ) ) , e ) ; } collection < string > paths = resolve label ( label ) ; return join paths ( paths ) ; }


return whether to invoke the { @ code filter init } and { @ code filter destroy } lifecycle methods on the target bean

protected boolean is target filter lifecycle ( ) { return this target filter lifecycle ; }


initializes the staging directory and returns the path it also keeps track of all necessary ownership and permissions it is kept for unit testing

public static path get staging dir ( cluster cluster , configuration conf , user group information real user ) throws i o exception , interrupted exception { path staging area = cluster get staging area dir ( ) ; file system fs = staging area get file system ( conf ) ; user group information current user = real user get current user ( ) ; try { file status fs status = fs get file status ( staging area ) ; string file owner = fs status get owner ( ) ; if ( ! ( file owner equals ( current user get short user name ( ) ) | | file owner equals ignore case ( current user get user name ( ) ) | | file owner equals ( real user get short user name ( ) ) | | file owner equals ignore case ( real user get user name ( ) ) ) ) { string error message = " the ownership on the staging directory " + staging area + " is not as expected " + " it is owned by " + file owner + " the directory must " + " be owned by the submitter " + current user get short user name ( ) + " or " + current user get user name ( ) ; if ( ! real user get user name ( ) equals ( current user get user name ( ) ) ) { throw new i o exception ( error message + " or " + real user get short user name ( ) + " or " + real user get user name ( ) ) ; } else { throw new i o exception ( error message ) ; } } if ( ! fs status get permission ( ) equals ( job dir permission ) ) { log info ( " permissions on staging directory " + staging area + " are " + " incorrect : " + fs status get permission ( ) + " fixing permissions " + " to correct value " + job dir permission ) ; fs set permission ( staging area , job dir permission ) ; } } catch ( file not found exception e ) { fs mkdirs ( staging area , new fs permission ( job dir permission ) ) ; } return staging area ; }


return the integer value of this status series ranges from 1 to 5

public int value ( ) { return this value ; }


public body type get type ( ) { org jbox 2d dynamics body type type = body get type ( ) ; if ( type = = org jbox 2d dynamics body type dynamic ) return body type dynamic body ; if ( type = = org jbox 2d dynamics body type kinematic ) return body type kinematic body ; if ( type = = org jbox 2d dynamics body type static ) return body type static body ; return body type dynamic body ; }


this is called when recoverable exceptions happen at runtime they can be ignored and epoxy will recover , but you can override this to be aware of when they happen for example , you could choose to rethrow the exception in development builds , or log them in production

void on exception ( @ non null epoxy controller controller , @ non null runtime exception exception ) ;


exit a parse tree produced by the { @ code single grouping set } labeled alternative in { @ link sql base parser # grouping element }

void exit single grouping set ( sql base parser single grouping set context ctx ) ;


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

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


before each method , the thread is renamed to match the method name

public void name thread to method ( ) { thread current thread ( ) set name ( " j unit - " + get method name ( ) ) ; }


parse the provided { @ code data } assuming the provided default values index requests will be passed to the { @ code index request consumer } , update requests to the { @ code update request consumer } and delete requests to the { @ code delete request consumer }

public void parse ( bytes reference data , @ nullable string default index , @ nullable string default routing , @ nullable fetch source context default fetch source context , @ nullable string default pipeline , @ nullable boolean default require alias , boolean allow explicit index , x content type x content type , bi consumer < index request , string > index request consumer , consumer < update request > update request consumer , consumer < delete request > delete request consumer ) throws i o exception { x content x content = x content type x content ( ) ; int line = 0 ; int from = 0 ; byte marker = x content stream separator ( ) ; / / bulk requests can contain a lot of repeated strings for the index , pipeline and routing parameters this map is used to / / deduplicate duplicate strings parsed for these parameters while it does not prevent instantiating the duplicate strings , it / / reduces their lifetime to the lifetime of this parse call instead of the lifetime of the full bulk request final map < string , string > string deduplicator = new hash map < > ( ) ; while ( true ) { int next marker = find next marker ( marker , from , data ) ; if ( next marker = = - 1 ) { break ; } line + + ; / / now parse the action try ( x content parser parser = create parser ( data , x content , from , next marker ) ) { / / move pointers from = next marker + 1 ; / / move to start object x content parser token token = parser next token ( ) ; if ( token = = null ) { continue ; } if ( token ! = x content parser token start object ) { throw new illegal argument exception ( " malformed action / metadata line [ " + line + " ] , expected " + x content parser token start object + " but found [ " + token + " ] " ) ; } / / move to field name , that ' s the action token = parser next token ( ) ; if ( token ! = x content parser token field name ) { throw new illegal argument exception ( " malformed action / metadata line [ " + line + " ] , expected " + x content parser token field name + " but found [ " + token + " ] " ) ; } string action = parser current name ( ) ; string index = default index ; string type = null ; string id = null ; string routing = default routing ; fetch source context fetch source context = default fetch source context ; string op type = null ; long version = versions match any ; version type version type = version type internal ; long if seq no = sequence numbers unassigned seq no ; long if primary term = unassigned primary term ; int retry on conflict = 0 ; string pipeline = default pipeline ; boolean require alias = default require alias ! = null & & default require alias ; / / at this stage , next token can either be end object ( and use default index and type , with auto generated id ) / / or start object which will have another set of parameters token = parser next token ( ) ; if ( token = = x content parser token start object ) { string current field name = null ; while ( ( token = parser next token ( ) ) ! = x content parser token end object ) { if ( token = = x content parser token field name ) { current field name = parser current name ( ) ; } else if ( token is value ( ) ) { if ( index match ( current field name , parser get deprecation handler ( ) ) ) { if ( ! allow explicit index ) { throw new illegal argument exception ( " explicit index in bulk is not allowed " ) ; } index = string deduplicator compute if absent ( parser text ( ) , function identity ( ) ) ; } else if ( type match ( current field name , parser get deprecation handler ( ) ) ) { if ( error on type ) { throw new illegal argument exception ( " action / metadata line [ " + line + " ] contains an unknown parameter [ " + current field name + " ] " ) ; } type = string deduplicator compute if absent ( parser text ( ) , function identity ( ) ) ; } else if ( id match ( current field name , parser get deprecation handler ( ) ) ) { id = parser text ( ) ; } else if ( routing match ( current field name , parser get deprecation handler ( ) ) ) { routing = string deduplicator compute if absent ( parser text ( ) , function identity ( ) ) ; } else if ( op type match ( current field name , parser get deprecation handler ( ) ) ) { op type = parser text ( ) ; } else if ( version match ( current field name , parser get deprecation handler ( ) ) ) { version = parser long value ( ) ; } else if ( version type match ( current field name , parser get deprecation handler ( ) ) ) { version type = version type from string ( parser text ( ) ) ; } else if ( if seq no match ( current field name , parser get deprecation handler ( ) ) ) { if seq no = parser long value ( ) ; } else if ( if primary term match ( current field name , parser get deprecation handler ( ) ) ) { if primary term = parser long value ( ) ; } else if ( retry on conflict match ( current field name , parser get deprecation handler ( ) ) ) { retry on conflict = parser int value ( ) ; } else if ( pipeline match ( current field name , parser get deprecation handler ( ) ) ) { pipeline = string deduplicator compute if absent ( parser text ( ) , function identity ( ) ) ; } else if ( source match ( current field name , parser get deprecation handler ( ) ) ) { fetch source context = fetch source context from x content ( parser ) ; } else if ( require alias match ( current field name , parser get deprecation handler ( ) ) ) { require alias = parser boolean value ( ) ; } else { throw new illegal argument exception ( " action / metadata line [ " + line + " ] contains an unknown parameter [ " + current field name + " ] " ) ; } } else if ( token = = x content parser token start array ) { throw new illegal argument exception ( " malformed action / metadata line [ " + line + " ] , expected a simple value for field [ " + current field name + " ] but found [ " + token + " ] " ) ; } else if ( token = = x content parser token start object & & source match ( current field name , parser get deprecation handler ( ) ) ) { fetch source context = fetch source context from x content ( parser ) ; } else if ( token ! = x content parser token value null ) { throw new illegal argument exception ( " malformed action / metadata line [ " + line + " ] , expected a simple value for field [ " + current field name + " ] but found [ " + token + " ] " ) ; } } } else if ( token ! = x content parser token end object ) { throw new illegal argument exception ( " malformed action / metadata line [ " + line + " ] , expected " + x content parser token start object + " or " + x content parser token end object + " but found [ " + token + " ] " ) ; } if ( " delete " equals ( action ) ) { delete request consumer accept ( new delete request ( index ) id ( id ) routing ( routing ) version ( version ) version type ( version type ) set if seq no ( if seq no ) set if primary term ( if primary term ) ) ; } else { next marker = find next marker ( marker , from , data ) ; if ( next marker = = - 1 ) { break ; } line + + ; / / we use internal add so we don ' t fork here , this allows us not to copy over the big byte array to small chunks / / of index request if ( " index " equals ( action ) ) { if ( op type = = null ) { index request consumer accept ( new index request ( index ) id ( id ) routing ( routing ) version ( version ) version type ( version type ) set pipeline ( pipeline ) set if seq no ( if seq no ) set if primary term ( if primary term ) source ( slice trimming carriage return ( data , from , next marker , x content type ) , x content type ) set require alias ( require alias ) , type ) ; } else { index request consumer accept ( new index request ( index ) id ( id ) routing ( routing ) version ( version ) version type ( version type ) create ( " create " equals ( op type ) ) set pipeline ( pipeline ) set if seq no ( if seq no ) set if primary term ( if primary term ) source ( slice trimming carriage return ( data , from , next marker , x content type ) , x content type ) set require alias ( require alias ) , type ) ; } } else if ( " create " equals ( action ) ) { index request consumer accept ( new index request ( index ) id ( id ) routing ( routing ) version ( version ) version type ( version type ) create ( true ) set pipeline ( pipeline ) set if seq no ( if seq no ) set if primary term ( if primary term ) source ( slice trimming carriage return ( data , from , next marker , x content type ) , x content type ) set require alias ( require alias ) , type ) ; } else if ( " update " equals ( action ) ) { if ( version ! = versions match any | | version type ! = version type internal ) { throw new illegal argument exception ( " update requests do not support versioning " + " please use ` if seq no ` and ` if primary term ` instead " ) ; } update request update request = new update request ( ) index ( index ) id ( id ) routing ( routing ) retry on conflict ( retry on conflict ) set if seq no ( if seq no ) set if primary term ( if primary term ) set require alias ( require alias ) routing ( routing ) ; try ( x content parser slice parser = create parser ( slice trimming carriage return ( data , from , next marker , x content type ) , x content ) ) { update request from x content ( slice parser ) ; } if ( fetch source context ! = null ) { update request fetch source ( fetch source context ) ; } index request upsert request = update request upsert request ( ) ; if ( upsert request ! = null ) { upsert request set pipeline ( default pipeline ) ; } update request consumer accept ( update request ) ; } / / move pointers from = next marker + 1 ; } } } }


returns whether the builder contains a particular starlark option

boolean contains ( label key ) { return starlark options contains key ( key ) ; }


there is only intended to be a single instance of the null object , so the clone method returns itself

protected final object clone ( ) { return this ; }


display an warning string prefaced with the command name

public void display warning ( string message ) { err println ( get name ( ) + " : " + message ) ; }


checks that at least one bit is available for reading

boolean is readable ( ) { return bit count > 0 | | in is readable ( ) ; }


write out the non - default properties in this configuration to the given { @ link output stream } using utf - 8 encoding

public void write xml ( output stream out ) throws i o exception { write xml ( new output stream writer ( out , " utf - 8 " ) ) ; }


public void place order test ( ) throws api exception { order body = null ; order response = api place order ( body ) ; / / todo : test validations }


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


finds a permission that has the given name

public synchronized permission find ( string name ) { for ( permission p : permissions ) { if ( p name equals ( name ) ) return p ; } return null ; }


generates the default log message of the specified event whose argument is an arbitrary object

private static string format simple ( channel handler context ctx , string event name , object msg ) { string ch str = ctx channel ( ) to string ( ) ; string msg str = string value of ( msg ) ; string builder buf = new string builder ( ch str length ( ) + 1 + event name length ( ) + 2 + msg str length ( ) ) ; return buf append ( ch str ) append ( ' ' ) append ( event name ) append ( " : " ) append ( msg str ) to string ( ) ; }


public string get attribute string ( ) { return attribute string ; }


public int get number of vertices ( ) { return this task vertices size ( ) ; }


resumes the thread this call is non - blocking

public void on resume ( ) { synchronized ( this ) { paused = false ; this notify all ( ) ; } }


register a session factory with the given name

public void register session factory ( string name , session factory session factory ) { session factories put ( name , session factory ) ; }


returns the merged line execution found in the two given { @ code source file coverage } s

static tree map < integer , line coverage > merge lines ( source file coverage s 1 , source file coverage s 2 ) { return stream of ( s 1 lines , s 2 lines ) map ( map : : entry set ) flat map ( collection : : stream ) collect ( collectors to map ( map entry : : get key , map entry : : get value , line coverage : : merge , tree map : : new ) ) ; }


encodes all the information needed to identify a batch of rows to return to presto for a basic scan , includes schema name , table name , and output constraint for an index scan , includes schema name , table name , set of keys to lookup and output constraint

public presto thrift id get split id ( ) { return split id ; }


configure { @ code deferred result processing interceptor } ' s to register on async requests

public void set deferred result interceptors ( list < deferred result processing interceptor > interceptors ) { this deferred result interceptors = interceptors to array ( new deferred result processing interceptor [ 0 ] ) ; }


public void set ordinal position ( int ordinal position ) { this ordinal position = ordinal position ; }


get the unique set of declared methods on the leaf class and all superclasses leaf class methods are included first and while traversing the superclass hierarchy any methods found with signatures matching a method already included are filtered out

public static method [ ] get unique declared methods ( class < ? > leaf class ) { return get unique declared methods ( leaf class , null ) ; }


delegate method to perform the actual compilation subclasses can override this template method to perform their own compilation invoked after this base class ' s compilation is complete

protected void compile internal ( ) { data source data source = get jdbc template ( ) get data source ( ) ; assert state ( data source ! = null , " no data source set " ) ; this table meta data context process meta data ( data source , get column names ( ) , get generated key names ( ) ) ; this insert string = this table meta data context create insert string ( get generated key names ( ) ) ; this insert types = this table meta data context create insert types ( ) ; if ( logger is debug enabled ( ) ) { logger debug ( " compiled insert object : insert string is [ " + this insert string + " ] " ) ; } on compile internal ( ) ; }


public event type get event type ( ) { return event type task started ; }


processes a list of { @ link aggregation } s and writes a flat json document for each of its leaf aggregations supported sub - aggregations include : { @ link multi buckets aggregation } { @ link numeric metrics aggregation single value } { @ link percentiles }

private void process aggs ( long doc count , list < aggregation > aggregations ) throws i o exception { if ( aggregations is empty ( ) ) { / / this means we reached a bucket aggregation without sub - aggs thus , we can flush the path written so far queue doc to write ( key value pairs , doc count ) ; return ; } list < aggregation > leaf aggregations = new array list < > ( ) ; list < multi buckets aggregation > bucket aggregations = new array list < > ( ) ; list < single bucket aggregation > single bucket aggregations = new array list < > ( ) ; / / sort into leaf and bucket aggregations / / the leaf aggregations will be processed first for ( aggregation agg : aggregations ) { if ( agg instanceof multi buckets aggregation ) { bucket aggregations add ( ( multi buckets aggregation ) agg ) ; } else if ( agg instanceof single bucket aggregation ) { / / skip a level down for single bucket aggs , if they have a sub - agg that is not / / a bucketed agg we should treat it like a leaf in this bucket single bucket aggregation single bucket aggregation = ( single bucket aggregation ) agg ; for ( aggregation sub agg : single bucket aggregation get aggregations ( ) ) { if ( sub agg instanceof multi buckets aggregation | | sub agg instanceof single bucket aggregation ) { single bucket aggregations add ( single bucket aggregation ) ; } else { leaf aggregations add ( sub agg ) ; } } } else { leaf aggregations add ( agg ) ; } } / / if on the current level ( indicated via bucket aggregations ) or one of the next levels ( single bucket aggregations ) / / we have more than 1 ` multi buckets aggregation ` , we should error out / / we need to make the check in this way as each of the items in ` single bucket aggregations ` is treated as a separate branch / / in the recursive handling of this method int bucket agg level count = math max ( bucket aggregations size ( ) , ( int ) single bucket aggregations stream ( ) flat map ( s - > as list ( s get aggregations ( ) ) stream ( ) ) filter ( multi buckets aggregation class : : is instance ) count ( ) ) ; if ( bucket agg level count > 1 ) { throw new illegal argument exception ( " multiple bucket aggregations at the same level are not supported " ) ; } list < string > added leaf keys = new array list < > ( ) ; for ( aggregation leaf agg : leaf aggregations ) { if ( time field equals ( leaf agg get name ( ) ) ) { process time field ( leaf agg ) ; } else if ( fields contains ( leaf agg get name ( ) ) ) { boolean leaf added = process leaf ( leaf agg ) ; if ( leaf added ) { added leaf keys add ( leaf agg get name ( ) ) ; } } } boolean no more buckets to process = bucket aggregations is empty ( ) ; if ( no more buckets to process = = false ) { multi buckets aggregation bucket agg = bucket aggregations get ( 0 ) ; if ( bucket agg instanceof histogram ) { process date histogram ( ( histogram ) bucket agg ) ; } else { / / ignore bucket aggregations that don ' t contain a field we / / are interested in this avoids problems with pipeline bucket / / aggregations where we would create extra docs traversing a / / bucket agg that isn ' t used but is required for the pipeline agg if ( bucket agg contains required agg ( bucket agg ) ) { process bucket ( bucket agg , fields contains ( bucket agg get name ( ) ) ) ; } else { no more buckets to process = true ; } } } no more buckets to process = single bucket aggregations is empty ( ) & & no more buckets to process ; / / we support more than one ` single bucket aggregation ` at each level / / however , we only want to recurse with multi / single bucket aggs / / non - bucketed sub - aggregations were handle as leaf aggregations at this level for ( single bucket aggregation single bucket aggregation : single bucket aggregations ) { process aggs ( single bucket aggregation get doc count ( ) , as list ( single bucket aggregation get aggregations ( ) ) stream ( ) filter ( aggregation - > ( aggregation instanceof multi buckets aggregation | | aggregation instanceof single bucket aggregation ) ) collect ( collectors to list ( ) ) ) ; } / / if there are no more bucket aggregations to process we ' ve reached the end / / and it ' s time to write the doc if ( no more buckets to process ) { queue doc to write ( key value pairs , doc count ) ; } added leaf keys for each ( k - > key value pairs remove ( k ) ) ; }


public test endpoint parameters oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


sort by host , then by priority 1 the url with a specific host ip should have higher priority than 0 0 0 0 2 if two url has the same host , compare by priority value ；

default int compare to ( configurator o ) { if ( o = = null ) { return - 1 ; } int ip compare = get url ( ) get host ( ) compare to ( o get url ( ) get host ( ) ) ; / / host is the same , sort by priority if ( ip compare = = 0 ) { int i = get url ( ) get parameter ( priority key , 0 ) ; int j = o get url ( ) get parameter ( priority key , 0 ) ; return integer compare ( i , j ) ; } else { return ip compare ; } }


sets the quaternion to an identity quaternion

public quaternion idt ( ) { return this set ( 0 , 0 , 0 , 1 ) ; }


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


public void set max lifetime ( long max lifetime ms ) { this max lifetime = max lifetime ms ; }


returns an ordering which first uses the ordering { @ code this } , but which in the event of a " tie " , then delegates to { @ code secondary comparator } for example , to sort a bug list first by status and second by priority , you might use { @ code by status compound ( by priority ) } for a compound ordering with three or more components , simply chain multiple calls to this method an ordering produced by this method , or a chain of calls to this method , is equivalent to one created using { @ link ordering # compound ( iterable ) } on the same component comparators < b > java 8 users : < b > use { @ code this comparator then comparing ( secondary comparator ) } instead depending on what { @ code secondary comparator } is , one of the other overloads of { @ code then comparing } may be even more useful

public < u extends t > ordering < u > compound ( comparator < ? super u > secondary comparator ) { return new compound ordering < u > ( this , check not null ( secondary comparator ) ) ; }


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


filter the list of catalogs to those visible to the identity

default set < string > filter catalogs ( identity identity , access control context context , set < string > catalogs ) { return collections empty set ( ) ; }


set the content of the request body as a byte array if the supplied byte array represents text such as xml or json , the { @ link # set character encoding character encoding } should typically be set as well

public void set content ( @ nullable byte [ ] content ) { this content = content ; this input stream = null ; this reader = null ; }


reads a line of text a line is considered to be terminated by any one of a carriage return ( ' \ r ' ) , a line feed ( ' \ n ' ) , or a carriage return followed immediately by a line feed ( ' \ r \ n ' ) the utf - 8 charset is used this method discards leading utf - 8 byte order marks , if present

public string read line ( ) { if ( bytes left ( ) = = 0 ) { return null ; } int line limit = position ; while ( line limit < limit & & ! util is linebreak ( data [ line limit ] ) ) { line limit + + ; } if ( line limit - position > = 3 & & data [ position ] = = ( byte ) 0x e f & & data [ position + 1 ] = = ( byte ) 0x b b & & data [ position + 2 ] = = ( byte ) 0x b f ) { / / there ' s a utf - 8 byte order mark at the start of the line discard it position + = 3 ; } string line = util from utf 8 bytes ( data , position , line limit - position ) ; position = line limit ; if ( position = = limit ) { return line ; } if ( data [ position ] = = ' \ r ' ) { position + + ; if ( position = = limit ) { return line ; } } if ( data [ position ] = = ' \ n ' ) { position + + ; } return line ; }


retrieve a user by its id , and create a new one if requested

private static @ nullable user get or create by id ( @ non null string id , @ non null string full name , boolean create ) { user u = all users get ( id ) ; if ( u = = null & & ( create | | user id mapper get instance ( ) is mapped ( id ) ) ) { u = new user ( id , full name ) ; all users put ( id , u ) ; if ( ! id equals ( full name ) & & ! user id mapper get instance ( ) is mapped ( id ) ) { try { u save ( ) ; } catch ( i o exception x ) { logger log ( level warning , " failed to save user configuration for " + id , x ) ; } } } return u ; }


premultiplies this matrix with the given matrix , storing the result in this matrix for example : a mul left ( b ) results in a : = ba

public matrix 4 mul left ( matrix 4 matrix ) { tmp mat set ( matrix ) ; mul ( tmp mat val , val ) ; return set ( tmp mat ) ; }


all of the named writeables needed to deserialize the instances of { @ linkplain bucket extractor } s

public static list < named writeable registry entry > get named writeables ( ) { list < named writeable registry entry > entries = new array list < > ( bucket extractors get named writeables ( ) ) ; entries add ( new entry ( bucket extractor class , composite key extractor name , composite key extractor : : new ) ) ; entries add ( new entry ( bucket extractor class , metric agg extractor name , metric agg extractor : : new ) ) ; entries add ( new entry ( bucket extractor class , top hits agg extractor name , top hits agg extractor : : new ) ) ; entries add ( new entry ( bucket extractor class , pivot extractor name , pivot extractor : : new ) ) ; return entries ; }


public void test iteration with static input ( ) { try { execution environment env = execution environment get execution environment ( ) ; env set parallelism ( 100 ) ; data set < long > source = env generate sequence ( 1 , 1000000 ) ; data set < long > mapped = source map ( new identity mapper < long > ( ) ) ; data set < long > reduced = source group by ( new identity key extractor < long > ( ) ) reduce ( new select one reducer < long > ( ) ) ; iterative data set < long > iteration = mapped iterate ( 10 ) ; iteration close with ( iteration join ( reduced ) where ( new identity key extractor < long > ( ) ) equal to ( new identity key extractor < long > ( ) ) with ( new dummy flat join function < long > ( ) ) ) output ( new discarding output format < long > ( ) ) ; compile no stats ( env create program plan ( ) ) ; } catch ( exception e ) { e print stack trace ( ) ; fail ( e get message ( ) ) ; } }


convenience method to create a model with three orthonormal vectors shapes the resources the material might contain are not managed , use { @ link model # manage disposable ( disposable ) } to add those to the model

public model create x y z coordinates ( float axis length , float cap length , float stem thickness , int divisions , int primitive type , material material , long attributes ) { begin ( ) ; mesh part builder part builder ; node node = node ( ) ; part builder = part ( " xyz " , primitive type , attributes , material ) ; part builder set color ( color red ) ; part builder arrow ( 0 , 0 , 0 , axis length , 0 , 0 , cap length , stem thickness , divisions ) ; part builder set color ( color green ) ; part builder arrow ( 0 , 0 , 0 , 0 , axis length , 0 , cap length , stem thickness , divisions ) ; part builder set color ( color blue ) ; part builder arrow ( 0 , 0 , 0 , 0 , 0 , axis length , cap length , stem thickness , divisions ) ; return end ( ) ; }


public final string get path ( ) { return this path to string ( ) ; }


returns a set of { @ link with feature set } instances used to decide whether to use this tool given a set of enabled features

immutable set < with feature set > get with feature set sets ( ) { return with feature set sets ; }


sets the maximum message size allowed to be received on the server if not called , defaults to 4 mi b the default provides protection to services who haven ' t considered the possibility of receiving large messages while trying to be large enough to not be hit in normal usage

public netty server builder max message size ( int max message size ) { return max inbound message size ( max message size ) ; }


used by open search auto - completion returns json array of the form : [ " query string " , [ " comp 1 " , " comp 2 " , ] ] see http : developer mozilla orgendocs supporting search suggestions in search plugins

public void do suggest open search ( stapler request req , stapler response rsp , @ query parameter string q ) throws i o exception , servlet exception { rsp set content type ( flavor json content type ) ; data writer w = flavor json create data writer ( null , rsp ) ; w start array ( ) ; w value ( q ) ; w start array ( ) ; for ( suggested item item : get suggestions ( req , q ) ) w value ( item get path ( ) ) ; w end array ( ) ; w end array ( ) ; }


flush out all write operations scheduled via { @ link # write ( object , channel promise ) }


iterates over the provided records to deserialize , verifies the results and stats the number of full records

public static int deserialize records ( array deque < serialization test type > records , record deserializer < serialization test type > deserializer ) throws exception { int deserialized records = 0 ; while ( ! records is empty ( ) ) { serialization test type expected = records poll ( ) ; serialization test type actual = expected get class ( ) new instance ( ) ; if ( deserializer get next record ( actual ) is full record ( ) ) { assert assert equals ( expected , actual ) ; deserialized records + + ; } else { records add first ( expected ) ; break ; } } return deserialized records ; }


get or create a task handle for a given task id the task need not be created when this method is called if the handle is called before the task is created , the task will bind to the handle once it starts ( or restarts )

public task handle task handle ( string task id ) { return task handle ( task id , null ) ; }


a list of routes handled by this rest handler that have had their { @ code path } andor { @ code method } changed the pre - existing { @ code route } will be registered as deprecated alongside the updated { @ code route }

default list < replaced route > replaced routes ( ) { return collections empty list ( ) ; }


public void clear ( ) { / / todo : we should only clear policies loaded from nn metadata / / this is a placeholder for hdfs - 7337 }


removes the object with the given key from the cache

public synchronized void delete ( long key ) { process queue ( ) ; keyed soft reference ref = map get ( key ) ; if ( ref ! = null ) { t obj = ref get ( ) ; if ( obj ! = null ) { obj set deleted ( ) ; ref clear ( ) ; } map remove ( key ) ; } }


equivalent to < code > { @ link # reserve and write utf 8 ( byte buf , char sequence , int ) reserve and write utf 8 ( buf , seq sub sequence ( start , end ) , reserve bytes ) } < code > but avoids subsequence object allocation if possible

public static int reserve and write utf 8 ( byte buf buf , char sequence seq , int start , int end , int reserve bytes ) { return reserve and write utf 8 seq ( buf , check char sequence bounds ( seq , start , end ) , start , end , reserve bytes ) ; }


handle an account state warning produced by ldaptive account state machinery override this method to provide custom warning message handling

protected void handle warning ( final account state warning warning , final authentication response response , final password policy context configuration , final list < message descriptor > messages ) { logger debug ( " handling account state warning [ { } ] " , warning ) ; if ( warning = = null ) { logger debug ( " account state warning not defined " ) ; return ; } if ( warning get expiration ( ) ! = null ) { val exp date = date time utils zoned date time of ( warning get expiration ( ) ) ; val ttl = zoned date time now ( zone offset utc ) until ( exp date , chrono unit days ) ; logger debug ( " password expires in [ { } ] days expiration warning threshold is [ { } ] days " , ttl , configuration get password warning number of days ( ) ) ; if ( configuration is always display password expiration warning ( ) | | ttl < configuration get password warning number of days ( ) ) { messages add ( new password expiring warning message descriptor ( " password expires in { 0 } days " , ttl ) ) ; } } else { logger debug ( " no account expiration warning was provided as part of the account state " ) ; } if ( warning get logins remaining ( ) > 0 ) { messages add ( new default message descriptor ( " password expiration logins remaining " , " you have { 0 } logins remaining before you must change your password " , new serializable [ ] { warning get logins remaining ( ) } ) ) ; } }


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


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


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

public void create user test ( ) { user user = null ; / / api create user ( user ) ; / / todo : test validations }


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


delegates to { @ link test context manager # prepare test instance } as of spring framework 5 3 2 , this method also validates that test methods and test lifecycle methods are not annotated with { @ link autowired @ autowired }

public void post process test instance ( object test instance , extension context context ) throws exception { validate autowired config ( context ) ; get test context manager ( context ) prepare test instance ( test instance ) ; }


handle dedicated volume buttons as virtual keys if applicable

private boolean handle virtual keys ( int key code , key event event , boolean down ) { input device input device = event get device ( ) ; if ( m activity m settings m disable volume virtual keys ) { return false ; } else if ( input device ! = null & & input device get keyboard type ( ) = = input device keyboard type alphabetic ) { / / do not steal dedicated buttons from a full external keyboard return false ; } else if ( key code = = key event keycode volume down ) { m virtual control key down = down ; return true ; } else if ( key code = = key event keycode volume up ) { m virtual fn key down = down ; return true ; } return false ; }


returns additional mapper implementations added by this plugin the key of the returned { @ link map } is the unique name for the mapper which will be used as the mapping { @ code type } , and the value is a { @ link mapper type parser } to parse the mapper settings into a { @ link mapper }

default map < string , mapper type parser > get mappers ( ) { return collections empty map ( ) ; }


public void remove ( ) { check state ( key ! = long min value ) ; prev next = next ; next prev = prev ; prev = next = null ; }


deprecated : get method by inspecting the { @ link percentiles config } returned from { @ link percentiles aggregation builder # percentiles config ( ) } instead

public percentiles method method ( ) { return percentiles config = = null ? null : percentiles config get method ( ) ; }


read a remote invocation from the given http request delegates to { @ link # read remote invocation ( http exchange , input stream ) } with the { @ link http exchange # get request body ( ) } request ' s input stream }

protected remote invocation read remote invocation ( http exchange exchange ) throws i o exception , class not found exception { return read remote invocation ( exchange , exchange get request body ( ) ) ; }


creates a { @ code concurrent linked queue } containing the elements of the specified iterable , in the order they are returned by the iterable ' s iterator

public static < e > concurrent linked queue < e > new concurrent linked queue ( iterable < ? extends e > elements ) { if ( elements instanceof collection ) { return new concurrent linked queue < e > ( ( collection < ? extends e > ) elements ) ; } concurrent linked queue < e > queue = new concurrent linked queue < e > ( ) ; iterables add all ( queue , elements ) ; return queue ; } / / linked blocking deque


convert an item ' s ( parent , child ) key to a string value for logging there is no validation of the item

static string primary key to string ( primary key item ) { collection < key attribute > c = item get components ( ) ; string parent = " " ; string child = " " ; for ( key attribute attr : c ) { switch ( attr get name ( ) ) { case parent : parent = attr get value ( ) to string ( ) ; break ; case child : child = attr get value ( ) to string ( ) ; break ; default : } } return " s 3a : / / " + parent + " / " + child ; }


determines if the supplied class object represents an annotation type

static public boolean is annotation ( class c ) { return reflection cache get type ( c ) is annotation ( ) ; }


public acknowledged response put script ( put stored script request put stored script request , request options options ) throws i o exception { return perform request and parse entity ( put stored script request , request converters : : put script , options , acknowledged response : : from x content , empty set ( ) ) ; }


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

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


delete the record falls into [ begin key bytes , end key bytes ) of the db

private static void delete range ( rocks d b db , list < column family handle > column family handles , byte [ ] begin key bytes , byte [ ] end key bytes , @ nonnegative long write batch size ) throws rocks d b exception { for ( column family handle column family handle : column family handles ) { try ( read options read options = rocks d b operation utils create total order seek read options ( ) ; rocks iterator wrapper iterator wrapper = rocks d b operation utils get rocks iterator ( db , column family handle , read options ) ; rocks d b write batch wrapper write batch wrapper = new rocks d b write batch wrapper ( db , write batch size ) ) { iterator wrapper seek ( begin key bytes ) ; while ( iterator wrapper is valid ( ) ) { final byte [ ] current key = iterator wrapper key ( ) ; if ( before the prefix bytes ( current key , end key bytes ) ) { write batch wrapper remove ( column family handle , current key ) ; } else { break ; } iterator wrapper next ( ) ; } } } }


appends the string representation of each entry of { @ code map } , using the previously configured separator and key - value separator , to { @ code appendable }

public < a extends appendable > a append to ( a appendable , map < ? , ? > map ) throws i o exception { return append to ( appendable , map entry set ( ) ) ; }


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


sets the doc source of the update request to be used when the document does not exists

public update request builder set upsert ( byte [ ] source , int offset , int length , x content type x content type ) { request upsert ( source , offset , length , x content type ) ; return this ; }


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


public collection < r m container > get reserved containers ( ) { return reserved ; }


performs a watch for the serving status of the requested service the server will immediately send back a message indicating the current serving status it will then subsequently send a new message whenever the service ' s serving status changes if the requested service is unknown when the call is received , the server will send a message setting the serving status to service unknown but will not terminate the call if at some future point , the serving status of the service becomes known , the server will send a new message with the service ' s serving status if the call terminates with status unimplemented , then clients should assume this method is not supported and should not retry the call if the call terminates with any other status ( including ok ) , clients should retry the call with appropriate exponential backoff

public void watch ( io grpc health v 1 health check request request , io grpc stub stream observer < io grpc health v 1 health check response > response observer ) { io grpc stub server calls async unimplemented unary call ( get watch method ( ) , response observer ) ; }


specify the hessian serializer factory to use this will typically be passed in as an inner bean definition of type { @ code com caucho hessian io serializer factory } , with custom bean property values applied

public void set serializer factory ( serializer factory serializer factory ) { this proxy factory set serializer factory ( serializer factory ) ; }


clear all of this request ' s attributes

public void clear attributes ( ) { this attributes clear ( ) ; }


called when the specified controller has sent skip backward

int on skip backward ( media session session , controller info controller info ) ;


tests if this binary string data ends with the specified suffix

public boolean ends with ( final binary string data suffix ) { ensure materialized ( ) ; suffix ensure materialized ( ) ; return match at ( suffix , binary section size in bytes - suffix binary section size in bytes ) ; }


public string get name ( ) { return name ; }


returns true if a resource is set , even if the request is not yet complete or the primary request has failed


closes the connection to a particular node ( if there is one ) all requests on the connection will be cleared client request callbacks will not be invoked for the cleared requests , nor will they be returned from poll ( )

public void close ( string node id ) { selector close ( node id ) ; long now = time milliseconds ( ) ; cancel in flight requests ( node id , now , null ) ; connection states remove ( node id ) ; }


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


returns an iterator over addresses that have a property value within the property map @ exception type mismatch exception thrown if the property does not have values of type < code > object < code >

public address iterator get property iterator ( ) { return new address property iterator ( ) ; }


this test is intentionally brittle it should break if we add new methods on { @ link storage component } !

@ test public void declares all methods to forward ( ) { assert that ( forwarding storage component class get declared methods ( ) ) extracting ( method : : get name ) contains all ( stream concat ( stream of ( component class get declared methods ( ) ) map ( method : : get name ) , stream of ( storage component class get declared methods ( ) ) map ( method : : get name ) ) collect ( collectors to list ( ) ) ) ; }


start the re - encryption updater thread

void start updater thread ( ) { updater executor = executors new single thread executor ( new thread factory builder ( ) set daemon ( true ) set name format ( " reencryption updater thread # % d " ) build ( ) ) ; updater executor execute ( reencryption updater ) ; }


returns the middleman for the files produced by the transitive info collection

public nested set < artifact > get middleman artifact ( ) { return middleman artifact ; }


public void remove all ( ) { size = 0 ; root = null ; }


set the additional ( undeclared ) property with the specified name and value if the property does not already exist , create it otherwise replace it

public additional properties array put additional property ( string key , list value ) { if ( this additional properties = = null ) { this additional properties = new hash map < string , list > ( ) ; } this additional properties put ( key , value ) ; return this ; }


records an exception so that it can be rethrown later in the test harness thread , triggering a test case failure only the first failure is recorded ; subsequent calls to this method from within the same test have no effect

public void thread record failure ( throwable t ) { thread failure compare and set ( null , t ) ; }


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


avoid using read object , always try to pass the target class type for the data you want to read

public object read object ( ) { throw new unsupported operation exception ( " provide the protobuf message type you want to read " ) ; }


chooses a number in ( - 2 ^ num bits , 2 ^ num bits ) at random , with density concentrated in numbers of lower magnitude

static big integer random big integer ( int num bits ) { while ( true ) { if ( random source next boolean ( ) ) { return random non negative big integer ( num bits ) ; } big integer neg = random non negative big integer ( num bits ) negate ( ) ; if ( neg signum ( ) ! = 0 ) { return neg ; } } }


return the compressed data using quality

public static byte [ ] compress by quality ( final bitmap src , final long max byte size ) { return compress by quality ( src , max byte size , false ) ; }


run the scm trigger with additional build actions used by subversion repository status to trigger a build at a specific revision number

public void run ( action [ ] additional actions ) { if ( job = = null ) { return ; } descriptor impl d = get descriptor ( ) ; logger fine ( " scheduling a polling for " + job ) ; if ( d synchronous polling ) { logger fine ( " running the trigger directly without threading , " + " as it ' s already taken care of by trigger cron " ) ; new runner ( additional actions ) run ( ) ; } else { / / schedule the polling / / even if we end up submitting this too many times , that ' s ok / / the real exclusion control happens inside runner logger fine ( " scheduling the trigger to ( asynchronously ) run " ) ; d queue execute ( new runner ( additional actions ) ) ; d clog check ( ) ; } }


whitens the children of v it is only called after v has no more children left and we have backtracked to the calling parent of v this is to ensure that we don ' t miss out on any paths that contain a child of v which has other parents

public void whiten children ( vertex v ) { iterator < vertex > it = this get children ( v ) iterator ( ) ; while ( it has next ( ) ) { vertex next = it next ( ) ; if ( this get calling parent ( next ) equals ( v ) ) { this set color ( next , white ) ; } } }


writes < code > lines < code > using iso 8859 1 into the file , specified by the < code > sub path < code > relative to the working directory overrides the file if it exists , creates the file if it does not exist

public path write ( string sub path , list < string > lines ) throws i o exception { return path utils write file in dir ( work dir , sub path , lines ) ; }


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

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


adds a pattern to include to the glob builder for a description of the syntax of the patterns , see { @ link unix glob }

public builder add patterns ( collection < string > patterns ) { this patterns add all ( patterns ) ; return this ; }


void set time zone ( time zone tz ) { time zone = tz ; }


start a new tag with the supplied name leaves the tag open so that attributes , inner text or nested tags can be written into it

public void start tag ( string tag name ) throws jsp exception { if ( in tag ( ) ) { close tag and mark as block ( ) ; } push ( tag name ) ; this writer append ( " < " ) append ( tag name ) ; }


public static map < string , map < string , object > > parse request claims ( final j e e context context ) throws exception { val claims = context get request parameter ( o auth 2 0 constants claims ) map ( string : : value of ) or else ( string utils empty ) ; if ( string utils is blank ( claims ) ) { return new hash map < > ( 0 ) ; } return mapper read value ( json value read hjson ( claims ) to string ( ) , map class ) ; }


public void clear ( ) { target clear ( ) ; }


determine whether the given method is supposed to be included , that is , not configured as to be ignored

protected boolean is not ignored ( method method , string bean key ) { if ( this ignored method mappings ! = null ) { set < string > method names = this ignored method mappings get ( bean key ) ; if ( method names ! = null ) { return ! method names contains ( method get name ( ) ) ; } } if ( this ignored methods ! = null ) { return ! this ignored methods contains ( method get name ( ) ) ; } return true ; }


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