returns the ( unmodifiable , ordered ) list of artifacts which are the outputs of this target each element in this list is associated with a single output , either declared implicitly ( via set implicit outputs function ( ) ) or explicitly ( listed in the ' outs ' attribute of our rule )

public final immutable list < artifact > get output artifacts ( ) { immutable list builder < artifact > artifacts = immutable list builder ( ) ; for ( output file out : get rule ( ) get output files ( ) ) { artifacts add ( create output artifact ( out ) ) ; } return artifacts build ( ) ; }


creates a new default data organization this has a mapping which defines the alignment of a data type based on its size the map defines pairs for data types that are 1 , 2 , 4 , and 8 bytes in length

public static data organization impl get default organization ( language language ) { data organization impl data organization = new data organization impl ( ) ; data organization set size alignment ( 1 , 1 ) ; data organization set size alignment ( 2 , 2 ) ; data organization set size alignment ( 4 , 4 ) ; data organization set size alignment ( 8 , 4 ) ; if ( language ! = null ) { data organization set pointer size ( language get default space ( ) get pointer size ( ) ) ; data organization set big endian ( language is big endian ( ) ) ; } return data organization ; }


sets a color with a specific alpha value

public void set color ( int color , int alpha ) { set color ( color argb ( alpha , color red ( color ) , color green ( color ) , color blue ( color ) ) ) ; }


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


prints the hierarchy of nodes represented by this node

string print tree ( ) { string builder buffy = new string builder ( ) ; print nodes ( buffy , get top level node ( ) , 0 ) ; return buffy to string ( ) ; }


return a zip entry for { @ code filename } if the provider is a { @ link zip input file provider } , the method returns the existing zip entry in order to keep its metadata , otherwise a new one is created

zip entry get zip entry ( string filename ) ;


verify self - generated uuid logic a committer used for job setup can also use it for task setup , but a committer which generated a job id but was only used for task setup - that is rejected task abort will still work

public void test self generated u u i d ( ) throws throwable { describe ( " run two jobs to the same destination , assert they both complete " ) ; configuration conf = get configuration ( ) ; unset u u i d options ( conf ) ; / / job is set to generate u u i ds conf set boolean ( fs s3a committer generate uuid , true ) ; / / create the job don ' t write anything job data job data = start job ( false ) ; abstract s 3 a committer committer = job data committer ; string uuid = committer get u u i d ( ) ; assertions assert that ( committer get u u i d source ( ) ) described as ( " uuid source of % s " , committer ) is equal to ( abstract s 3 a committer job u u i d source generated locally ) ; / / examine the job configuration and verify that it has been updated configuration job conf = job data conf ; assertions assert that ( job conf get ( fs s3a committer uuid , null ) ) described as ( " config option " + fs s3a committer uuid ) is equal to ( uuid ) ; assertions assert that ( job conf get ( fs s3a committer uuid source , null ) ) described as ( " config option " + fs s3a committer uuid source ) is equal to ( abstract s 3 a committer job u u i d source generated locally get text ( ) ) ; / / because the task was set up in the job , it can have task / / setup called , even though it had a random id committer setup task ( job data t context ) ; / / but a new committer will not be set up task attempt context t context 2 = new task attempt context impl ( conf , task attempt 1 ) ; abstract s 3 a committer committer 2 = create committer ( out dir , t context 2 ) ; assertions assert that ( committer 2 get u u i d source ( ) ) described as ( " uuid source of % s " , committer 2 ) is equal to ( abstract s 3 a committer job u u i d source generated locally ) ; assert not equals ( " job u u i ds " , committer get u u i d ( ) , committer 2 get u u i d ( ) ) ; / / task setup must fail intercept ( path commit exception class , e self generated job uuid , ( ) - > { committer 2 setup task ( t context 2 ) ; return committer 2 ; } ) ; / / task abort with the self - generated option is fine committer 2 abort task ( t context 2 ) ; }


use this in case no { @ code gl viewport } is in use otherwise please supply the used { @ link viewport } to { @ link # begin ( viewport ) }

public void begin ( camera camera ) { this camera = camera ; shape renderer set projection matrix ( camera combined ) ; shape renderer begin ( shape type line ) ; }


public snapshot stats get stats ( ) { return stats ; }


public static void unregister ( ) { class filter set default ( class filter standard ) ; }


adds a field to be highlighted with a provided fragment size ( in characters ) , and a provided ( maximum ) number of fragments

public highlight builder field ( string name , int fragment size , int number of fragments ) { return field ( new field ( name ) fragment size ( fragment size ) num of fragments ( number of fragments ) ) ; }


adds replaces removes a function at the specified address in the result listing based on the function in the orig listing < br > note : this method will replace the function , but does not create the parent namespace or put the function in the parent namespace this must be done separately

private function replace function ( address origin entry point , task monitor monitor ) throws cancelled exception , unsupported operation exception { if ( ! origin to result translator is one for one translator ( ) ) { string message = origin to result translator get class ( ) get name ( ) + " is not a one for one translator and can ' t replace a function " ; throw new unsupported operation exception ( message ) ; } address result entry point = origin to result translator get address ( origin entry point ) ; function origin function = origin listing get function at ( origin entry point ) ; function result function = result listing get function at ( result entry point ) ; / / check for removing function or no function if ( origin function = = null ) { if ( result function ! = null ) { result listing remove function ( result entry point ) ; / / remove the original function } return null ; } if ( program diff equivalent functions ( origin function , result function , false ) ) { return result function ; } if ( origin function is thunk ( ) ) { function thunked function = origin function get thunked function ( false ) ; address thunked entry point = thunked function get entry point ( ) ; address result thunked entry point = origin to result translator get address ( thunked entry point ) ; if ( result thunked entry point = = null ) { error msg append ( " can ' t replace thunk function @ " + origin entry point + " " + " can ' t determine equivalent thunked function entry point address " + " for thunked function @ " + thunked entry point + " \ n " ) ; return null ; } function result thunked function = result listing get function at ( result thunked entry point ) ; if ( result thunked function = = null ) { error msg append ( " can ' t replace thunk function @ " + origin entry point + " no function at pointed to address " + thunked entry point + " \ n " ) ; return null ; } } function new result function = result function ; / / initially assume the body hasn ' t changed address set view origin body = origin function get body ( ) ; address set new result body = origin to result translator get address set ( origin body ) ; / / check for function body overlap conflict if ( program merge overlaps other functions ( origin to result translator , origin function ) ) { error msg append ( " can ' t replace function @ " + origin entry point + " it would overlap another function \ n " ) ; return null ; } / / variable reference [ ] restore refs = new variable reference [ 0 ] ; string origin name = origin function get name ( ) ; namespace desired to namespace = result program get global namespace ( ) ; try { desired to namespace = symbol merge resolve namespace ( origin function get parent namespace ( ) , conflict symbol i d map ) ; } catch ( duplicate name exception e 1 ) { msg error ( this , " unexpected exception : " + e 1 get message ( ) , e 1 ) ; } catch ( invalid input exception e 1 ) { msg error ( this , " unexpected exception : " + e 1 get message ( ) , e 1 ) ; } address set view old result body = ( result function = = null ) ? null : result function get body ( ) ; boolean same body = new result body equals ( old result body ) ; if ( ! same body ) { try { / / changing function ? if ( result function ! = null ) { result function set body ( new result body ) ; } else { try { new result function = result listing create function ( origin name , desired to namespace , origin entry point , new result body , origin function get symbol ( ) get source ( ) ) ; } catch ( invalid input exception e ) { string error message = " error creating function \ " " + origin name + " \ " at " + origin entry point to string ( true ) + " \ n " ; error msg append ( error message + e get message ( ) ) ; return null ; } / * create function appears to throw an illegal argument exception * if data exists where you are trying to create the function * this should really happen via the invalid input exception above * / catch ( illegal argument exception e ) { string error message = " error creating function \ " " + origin name + " \ " at " + origin entry point to string ( true ) + " \ n " ; error msg append ( error message + e get message ( ) ) ; return null ; } } } catch ( overlapping function exception e ) { error msg append ( " address = " + result entry point + " : " + e get message ( ) + " \ n " ) ; return null ; } } if ( new result function = = null ) { return null ; } / / handle thunk if ( origin function is thunk ( ) ) { function origin thunked function = origin function get thunked function ( false ) ; function origin thunked function in result = diff utility get function ( origin thunked function , result program ) ; if ( origin thunked function in result = = null ) { / / no matching function to thunk to error msg append ( " thunked function not found at " + origin thunked function get entry point ( ) + " for function at " + origin function get entry point ( ) + " \ n " ) ; return null ; } function current thunked function = new result function get thunked function ( false ) ; if ( current thunked function ! = origin thunked function in result ) { new result function set thunked function ( origin thunked function in result ) ; } } else if ( new result function is thunk ( ) ) { new result function set thunked function ( null ) ; } if ( new result function is thunk ( ) ) { / / a thunk function has its own name and body but refers to another function , / / so we don ' t want to affect the return type , calling convention , variables , etc / / body was handled above and the name will get handled later return new result function ; } / / do not replace the function name here , since the symbols need to get sorted out first / / after the symbols are merged you will need to replace the function symbol in case the / / merge of symbols was not chosen try { new result function update function ( origin function get calling convention name ( ) , origin function get return ( ) , origin function has custom variable storage ( ) ? function update type custom storage : function update type dynamic storage all params , true , origin function get signature source ( ) , origin function get parameters ( ) ) ; } catch ( duplicate name exception e ) { / / should not occur error msg append ( " address = " + result entry point + " : " + e get message ( ) + " \ n " ) ; } catch ( invalid input exception e ) { error msg append ( " address = " + result entry point + " : " + e get message ( ) + " \ n " ) ; } stack frame origin frame = origin function get stack frame ( ) ; stack frame new to frame = new result function get stack frame ( ) ; new to frame set local size ( origin frame get local size ( ) ) ; new to frame set return address offset ( origin frame get return address offset ( ) ) ; new result function set stack purge size ( origin function get stack purge size ( ) ) ; new result function set var args ( origin function has var args ( ) ) ; new result function set inline ( origin function is inline ( ) ) ; new result function set no return ( origin function has no return ( ) ) ; replace locals ( new result function , origin function , monitor ) ; / / restore variable refs ( new result function , restore refs ) ; new result function set signature source ( origin function get signature source ( ) ) ; return new result function ; }


guaranteed to throw an exception and leave the map unmodified

public void put all ( map < ? extends type token < ? extends b > , ? extends b > map ) { throw new unsupported operation exception ( ) ; }


generates a limited translator xml tag for the specified address factory and optional register set

public string build translator tag ( address factory factory , long unique offset , symbol table optional sym tab ) { address space [ ] spclist = factory get all address spaces ( ) ; string builder res buf = new string builder ( ) ; res buf append ( " < sleigh " ) ; spec xml utils encode boolean attribute ( res buf , " bigendian " , is big endian ( ) ) ; spec xml utils encode unsigned integer attribute ( res buf , " uniqbase " , unique offset ) ; res buf append ( " > \ n " ) ; res buf append ( " < spaces " ) ; spec xml utils encode string attribute ( res buf , " defaultspace " , factory get default address space ( ) get name ( ) ) ; res buf append ( " > \ n " ) ; string tag ; int delay ; boolean physical ; boolean global ; for ( address space element : spclist ) { if ( ( element instanceof overlay address space ) ) { overlay address space ospace = ( overlay address space ) element ; res buf append ( " < space overlay " ) ; spec xml utils encode string attribute ( res buf , " name " , ospace get name ( ) ) ; spec xml utils encode signed integer attribute ( res buf , " index " , ospace get unique ( ) ) ; spec xml utils encode string attribute ( res buf , " base " , ospace get overlayed space ( ) get name ( ) ) ; res buf append ( " / > \ n " ) ; continue ; } switch ( element get type ( ) ) { case address space type ram : tag = " space " ; delay = 1 ; physical = true ; global = true ; break ; case address space type register : tag = " space " ; delay = 0 ; physical = true ; global = false ; break ; case address space type unique : tag = " space unique " ; delay = 0 ; physical = true ; global = false ; break ; case address space type other : tag = " space other " ; delay = 0 ; physical = true ; global = true ; break ; default : continue ; } res buf append ( " < " ) append ( tag ) ; spec xml utils encode string attribute ( res buf , " name " , element get name ( ) ) ; spec xml utils encode signed integer attribute ( res buf , " index " , element get unique ( ) ) ; int size = element get size ( ) ; / / size in bits if ( element instanceof segmented address space ) { / / todo : segmented address space shouldn ' t really return 21 size = 32 ; } if ( size > 64 ) { size = 64 ; } int bytesize = ( size + 7 ) / 8 ; / / convert bits to bytes spec xml utils encode signed integer attribute ( res buf , " size " , bytesize ) ; if ( element get addressable unit size ( ) > 1 ) { spec xml utils encode signed integer attribute ( res buf , " wordsize " , element get addressable unit size ( ) ) ; } spec xml utils encode boolean attribute ( res buf , " bigendian " , is big endian ( ) ) ; spec xml utils encode signed integer attribute ( res buf , " delay " , delay ) ; spec xml utils encode boolean attribute ( res buf , " physical " , physical ) ; spec xml utils encode boolean attribute ( res buf , " global " , global ) ; res buf append ( " / > \ n " ) ; } res buf append ( " < / spaces > \ n " ) ; sleigh language description sleigh description = ( sleigh language description ) get language description ( ) ; set < string > truncated space names = sleigh description get truncated space names ( ) ; if ( ! truncated space names is empty ( ) ) { for ( string space name : truncated space names ) { int sz = sleigh description get truncated space size ( space name ) ; res buf append ( " < truncate space " ) ; spec xml utils encode string attribute ( res buf , " space " , space name ) ; spec xml utils encode signed integer attribute ( res buf , " size " , sz ) ; res buf append ( " / > \ n " ) ; } } if ( optional sym tab ! = null ) { res buf append ( build symbols xml ( optional sym tab ) ) ; } res buf append ( " < / sleigh > \ n " ) ; return res buf to string ( ) ; }


determine whether the given method is a " finalize " method

public static boolean is finalize method ( @ nullable method method ) { return ( method ! = null & & method get name ( ) equals ( " finalize " ) & & method get parameter count ( ) = = 0 ) ; }


callback for { @ link bt dbvt # collide o c l } , which will trigger a call to this method if a leaf node is not occluded if the node contains an object which can occlude others , it will be added to the depth buffer so that it may be considered in future occlusion checks only box shaped occluder objects are supported

public void process ( bt dbvt node leaf , float depth ) { bt collision object object = leaf get data as proxy client object ( ) ; on object visible ( object ) ; bt collision shape shape = object get collision shape ( ) ; if ( shape instanceof bt box shape & & is occluder ( object ) ) { ocl buffer draw b b ( object get world transform ( ) , ( ( bt box shape ) shape ) get half extents with margin ( ) ) ; } }


set the name of the database defaults to { @ value # default database name } will be overridden if the { @ code generate unique database name } flag has been set to { @ code true }

public void set database name ( string database name ) { assert has text ( database name , " database name is required " ) ; this database name = database name ; }


obtains the display name of the given initialization task

protected string get display name of ( method e , t i ) { class < ? > c = e get declaring class ( ) ; string key = display name of ( i ) ; if ( key length ( ) = = 0 ) return c get simple name ( ) + " " + e get name ( ) ; try { resource bundle holder rb = resource bundle holder get ( c get class loader ( ) load class ( c get package ( ) get name ( ) + " messages " ) ) ; return rb format ( key ) ; } catch ( class not found exception x ) { logger log ( warning , " failed to load " + x get message ( ) + " for " + e to string ( ) , x ) ; return key ; } catch ( missing resource exception x ) { logger log ( warning , " could not find key ' " + key + " ' in " + c get package ( ) get name ( ) + " messages " , x ) ; return key ; } }


helper method to set api key prefix for the first api key authentication

public api client set api key prefix ( string api key prefix ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof api key auth ) { ( ( api key auth ) auth ) set api key prefix ( api key prefix ) ; return this ; } } throw new runtime exception ( " no api key authentication configured ! " ) ; }


creates a { @ link data set } that represents the strings produced by reading the given file line wise the file will be read with the utf - 8 character set

public data source < string > read text file ( string file path ) { preconditions check not null ( file path , " the file path may not be null " ) ; return new data source < > ( this , new text input format ( new path ( file path ) ) , basic type info string type info , utils get call location name ( ) ) ; }


resolve the target type in the given typed string value

protected class < ? > resolve target type ( typed string value value ) throws class not found exception { if ( value has target type ( ) ) { return value get target type ( ) ; } return value resolve target type ( this bean factory get bean class loader ( ) ) ; }


draws the value of the given entry by using the provided i value formatter

public void draw value ( canvas c , i value formatter formatter , float value , entry entry , int data set index , float x , float y , int color ) { m value paint set color ( color ) ; c draw text ( formatter get formatted value ( value , entry , data set index , m view port handler ) , x , y , m value paint ) ; }


checks if { @ code advertised provider set } satisfies these { @ code required providers }

public abstract boolean satisfies ( advertised provider set advertised provider set , required providers required providers , builder missing ) ;


{ @ link io prometheus client counter } may not decrease , so report { @ link counter } as { @ link io prometheus client gauge }

public void counter is reported as prometheus gauge ( ) throws unirest exception { counter test counter = new simple counter ( ) ; test counter inc ( 7 ) ; assert that gauge is exported ( test counter , " test counter " , " 7 0 " ) ; }


writes shorts from the given short array to the current position and increases the position by the number of shorts written calling this method has the same effect as { @ code put ( src , 0 , src length ) }

public final short buffer put ( short [ ] src ) { return put ( src , 0 , src length ) ; }


we have a document that requires 12 operations to read we read it step - by - step with one real reader before each of the real reader ’ s operations we create a peeking reader and let it read the rest of the document

public void peek json reader ( ) throws i o exception { json reader reader = new reader ( " [ 12 , 34 , { \ " a \ " : 56 , \ " b \ " : 78 } , 90 ] " ) ; for ( int i = 0 ; i < 12 ; i + + ) { read peek 1 2 steps ( reader peek json ( ) , i , 12 ) ; read peek 1 2 steps ( reader , i , i + 1 ) ; } }


returns the zero - relative index of the item which is currently selected in the receiver , or - 1 if no item is selected if cell selection is enabled , returns the index of first item that contains at least one selected cell

public int get selection index ( ) { if ( selected cells is empty ( ) ) return - 1 ; return selected cells iterator ( ) next ( ) row ; }


public boolean is reg a source ( int reg ) { / * * avoid creating a sources list in case it has not already been * created * / for ( operand o : operands ) { if ( o reg spec get reg ( ) = = reg ) { return true ; } } return false ; }


called when the specified controller has sent skip forward

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


retrieves a domain name given a buffer containing a dns packet if the name contains a pointer , the position of the buffer will be set to directly after the pointer ' s index after the name has been read

public static string decode name ( byte buf in ) { return dns codec util decode domain name ( in ) ; }


finds the child with the specified index and returns it as an int

public int get int ( int index ) { json value child = get ( index ) ; if ( child = = null ) throw new illegal argument exception ( " indexed value not found : " + name ) ; return child as int ( ) ; }


helper method to determine if an unsigned int value fits in a byte

protected static boolean unsigned fits in byte ( int value ) { return value = = ( value & 0xff ) ; }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case arg : return is set arg ( ) ; } throw new illegal state exception ( ) ; }


add a provider to be invoked to get additional index settings prior to an index being created

public void add additional index setting provider ( index setting provider provider ) { if ( provider = = null ) { throw new illegal argument exception ( " provider must not be null " ) ; } if ( index setting providers contains ( provider ) ) { throw new illegal argument exception ( " provider already added " ) ; } this index setting providers add ( provider ) ; }


public string get base path ( ) { return base path ; }


sets this matrix to a rotation matrix that will rotate any vector in counter - clockwise direction around the z - axis

public affine 2 set to rotation ( float cos , float sin ) { m 0 0 = cos ; m 0 1 = - sin ; m 0 2 = 0 ; m 1 0 = sin ; m 1 1 = cos ; m 1 2 = 0 ; return this ; }


grab current pending change records for each op in a multi - op this is used inside multi op error code path to rollback in the event of a failed multi - op

private map < string , change record > get pending changes ( multi operation record multi request ) { map < string , change record > pending change records = new hash map < string , change record > ( ) ; for ( op op : multi request ) { string path = op get path ( ) ; change record cr = get outstanding change ( path ) ; / / only previously existing records need to be rolled back if ( cr ! = null ) { pending change records put ( path , cr ) ; } / * * zookeeper - 1624 - we need to store for parent ' s change record * of the parent node of a request so that if this is a * sequential node creation request , rollback pending changes ( ) * can restore previous parent ' s change record correctly * * otherwise , sequential node name generation will be incorrect * for a subsequent request * / int last slash = path last index of ( ' / ' ) ; if ( last slash = = - 1 | | path index of ( ' \ 0 ' ) ! = - 1 ) { continue ; } string parent path = path substring ( 0 , last slash ) ; change record parent cr = get outstanding change ( parent path ) ; if ( parent cr ! = null ) { pending change records put ( parent path , parent cr ) ; } } return pending change records ; }


returns the number of thunks in the thunk table

public int get num thunks ( ) { return num thunks ; }


public void publish message ( message message ) { message priority message queue add ( message ) ; }


consumes the current token if it is not of the specified ( expected ) kind , throws { @ link query syntax exception } returns the value associated with the consumed token , if any

private string consume ( token kind kind ) throws query syntax exception { if ( token kind ! = kind ) { throw syntax error ( token ) ; } string word = token word ; next token ( ) ; return word ; }


public action get action ( ) { return action ; }


void set viewer highlight ( byte block selection highlight ) { for ( int i = 0 ; i < view list size ( ) ; i + + ) { byte viewer component c = view list get ( i ) ; c set viewer highlight ( highlight ) ; } }


gets device fingerprint component extractors

list < device fingerprint component extractor > get device fingerprint component extractors ( ) ;


there ' s no read timeout when reading the first byte of a new frame but as soon as we start reading a frame we enable the read timeout in this test we have the server returning the first byte of a frame but no more frames

@ test public void read timeout applies within frames ( ) { web server set dispatcher ( new dispatcher ( ) { @ override public mock response dispatch ( recorded request request ) { return upgrade response ( request ) set body ( new buffer ( ) write ( byte string decode hex ( " 81 " ) ) ) / / truncated frame remove header ( " content - length " ) set socket policy ( socket policy keep open ) ; } } ) ; web socket web socket = new web socket ( ) ; client listener assert open ( ) ; client listener assert failure ( socket timeout exception class , " timeout " , " read timed out " ) ; assert that ( web socket close ( 1000 , null ) ) is false ( ) ; }


public outer enum get outer enum ( ) { return outer enum ; }


public static boolean is date ( @ nullable char sequence input ) { return is match ( pattern regex date , input ) ; }


json string deserialize to jackson { @ link json node }

public static json node to obj ( string json ) { try { return mapper read tree ( json ) ; } catch ( i o exception e ) { throw new nacos deserialization exception ( e ) ; } }


get an int parameter , with a fallback value never throws an exception can pass a distinguished value as default to enable checks of whether it was supplied

public static int get int parameter ( servlet request request , string name , int default val ) { if ( request get parameter ( name ) = = null ) { return default val ; } try { return get required int parameter ( request , name ) ; } catch ( servlet request binding exception ex ) { return default val ; } }


sets the last change time to the current time

protected synchronized void mark change time ( ) { preconditions check state ( clock ! = null ) ; last change time = clock current time millis ( ) ; }


creates an xml item this route creates an xml item

public void create xml item ( xml item xml item ) throws api exception { object local var post body = xml item ; / / verify the required parameter ' xml item ' is set if ( xml item = = null ) { throw new api exception ( 400 , " missing the required parameter ' xml item ' when calling create xml item " ) ; } / / create path and map variables string local var path = " / fake / create xml item " ; / / query params list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { " application / xml " , " application / xml ; charset = utf - 8 " , " application / xml ; charset = utf - 16 " , " text / xml " , " text / xml ; charset = utf - 8 " , " text / xml ; charset = utf - 16 " } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; api client invoke a p i ( local var path , " post " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , null ) ; }


add the sink operators to the stream graph

private void internal translate ( sink transformation < input t , comm t , writer state t , global comm t > sink transformation , int writer parallelism , @ suppress warnings ( " same parameter value " ) @ nullable string previous sink state name , one input stream operator factory < comm t , comm t > committer factory , int committer parallelism , int committer max parallelism , one input stream operator factory < comm t , global comm t > global committer factory , context context ) throws i o exception { stream graph utils validate transformation uid ( context get stream graph ( ) , sink transformation ) ; final int writer id = add writer ( sink transformation , writer parallelism , previous sink state name , context ) ; final int committer id = add committer ( writer id , sink transformation , committer factory , committer parallelism , committer max parallelism , context ) ; add global committer ( committer id > 0 ? committer id : writer id , sink transformation , global committer factory , context ) ; }


creates an { @ link extrema } that can aggregate { @ code n } elements into the { @ code min ( k , n ) } smallest , per the given { @ code comparator }

public static < t > extrema < t > min ( int k , comparator < t > comparator ) { return create ( k , comparator ) ; }


write the byte array { @ link # data } to the given output stream

private void write data ( f s data output stream s ) throws i o exception { s write ( data ) ; s close ( ) ; }


public file get file ( ) { return file ; }


adds a method annotations item to this instance

public void add method annotations ( cst method ref method , annotations annotations , dex file dex file ) { if ( method annotations = = null ) { method annotations = new array list < method annotation struct > ( ) ; } method annotations add ( new method annotation struct ( method , new annotation set item ( annotations , dex file ) ) ) ; }


from bug report http : code google compgoogle - gsonissuesdetail ? id = 204

public void test serialize maps ( ) { map < string , object > map = new linked hash map < string , object > ( ) ; map put ( " a " , 12 ) ; map put ( " b " , null ) ; linked hash map < string , object > inner map = new linked hash map < string , object > ( ) ; inner map put ( " test " , 1 ) ; inner map put ( " test string array " , new string [ ] { " one " , " two " } ) ; map put ( " c " , inner map ) ; assert equals ( " { \ " a \ " : 12 , \ " b \ " : null , \ " c \ " : { \ " test \ " : 1 , \ " test string array \ " : [ \ " one \ " , \ " two \ " ] } } " , new gson builder ( ) serialize nulls ( ) create ( ) to json ( map ) ) ; assert equals ( " { \ n \ " a \ " : 12 , \ n \ " b \ " : null , \ n \ " c \ " : " + " { \ n \ " test \ " : 1 , \ n \ " test string array \ " : " + " [ \ n \ " one \ " , \ n \ " two \ " \ n ] \ n } \ n } " , new gson builder ( ) set pretty printing ( ) serialize nulls ( ) create ( ) to json ( map ) ) ; assert equals ( " { \ " a \ " : 12 , \ " c \ " : { \ " test \ " : 1 , \ " test string array \ " : [ \ " one \ " , \ " two \ " ] } } " , new gson builder ( ) create ( ) to json ( map ) ) ; assert equals ( " { \ n \ " a \ " : 12 , \ n \ " c \ " : " + " { \ n \ " test \ " : 1 , \ n \ " test string array \ " : " + " [ \ n \ " one \ " , \ n \ " two \ " \ n ] \ n } \ n } " , new gson builder ( ) set pretty printing ( ) create ( ) to json ( map ) ) ; inner map put ( " d " , " e " ) ; assert equals ( " { \ " a \ " : 12 , \ " c \ " : { \ " test \ " : 1 , \ " test string array \ " : [ \ " one \ " , \ " two \ " ] , \ " d \ " : \ " e \ " } } " , new gson ( ) to json ( map ) ) ; }


return true if this user was not the originally authenticated user , false otherwise

public boolean is run as ( ) { return authenticated user ! = null ; }


repair a non - returning function which includes all calling points and the functions containing those calling points

private address set repair locations for non returning function ( program program , function func , address entry , task monitor monitor ) { address set fixed call locations = new address set ( ) ; try { string name = func get name ( ) ; monitor set message ( " clearing fallthrough for : " + name ) ; fixed call locations = set no fall thru ( program , entry ) ; if ( fixed call locations is empty ( ) ) { return fixed call locations ; } monitor set message ( " fixup function bodies for : " + name ) ; fix calling function body ( program , fixed call locations , monitor ) ; } catch ( cancelled exception e ) { / / a cancel here implies that the entire script has been cancelled } return fixed call locations ; }


public void set value ( @ nullable string value ) { this value = value ; }


implements any authentication mechanism use transport layer to read or write tokens for security protocols plaintext and ssl , this is a no - op since no further authentication needs to be done for sasl plaintext and sasl ssl , this performs the sasl authentication

void authenticate ( ) throws authentication exception , i o exception ;


adds each element of { @ code elements } to the { @ code immutable sorted multiset }

public builder < e > add all ( iterable < ? extends e > elements ) { super add all ( elements ) ; return this ; }


uses a { @ link tree set } ordered by the specified comparator to store value collections multimaps generated by the resulting builder will not be serializable if { @ code comparator } is not serializable

public < v0 > sorted set multimap builder < k0 , v0 > tree set values ( final comparator < v0 > comparator ) { check not null ( comparator , " comparator " ) ; return new sorted set multimap builder < k0 , v0 > ( ) { @ override public < k extends k0 , v extends v0 > sorted set multimap < k , v > build ( ) { return multimaps new sorted set multimap ( multimap builder with keys this < k , v > create map ( ) , new tree set supplier < v > ( comparator ) ) ; } } ; }


serialize state descriptors , edge descriptors , and decision & rarr ; state map into list of ints : grammar - type , ( a n t l r parser lexer , ) max token type , num states , state - 0 - type rule index , state - 1 - type rule index , state - i - type rule index optional - arg num rules , rule - 1 - start - state rule - 1 - args , rule - 2 - start - state rule - 2 - args , ( args are token type , action index in lexer else 0 , 0 ) num modes , mode - 0 - start - state , mode - 1 - start - state , ( parser has 0 modes ) num unicode - bmp - sets bmp - set - 0 - interval - count intervals , bmp - set - 1 - interval - count intervals , num unicode - smp - sets smp - set - 0 - interval - count intervals , smp - set - 1 - interval - count intervals , num total edges , src , trg , edge - type , edge arg 1 , optional edge arg 2 ( present always ) , num decisions , decision - 0 - start - state , decision - 1 - start - state , convenient to pack into unsigned shorts to make as java string

public integer list serialize ( ) { integer list data = new integer list ( ) ; data add ( a t n deserializer serialized version ) ; serialize u u i d ( data , a t n deserializer serialized uuid ) ; / / convert grammar type to atn const to avoid dependence on a n t l r parser data add ( atn grammar type ordinal ( ) ) ; data add ( atn max token type ) ; int nedges = 0 ; / / note that we use a linked hash map as a set to / / maintain insertion order while deduplicating / / entries with the same key map < interval set , boolean > sets = new linked hash map < > ( ) ; / / dump states , count edges and collect sets while doing so integer list non greedy states = new integer list ( ) ; integer list precedence states = new integer list ( ) ; data add ( atn states size ( ) ) ; for ( a t n state s : atn states ) { if ( s = = null ) { / / might be optimized away data add ( a t n state invalid type ) ; continue ; } int state type = s get state type ( ) ; if ( s instanceof decision state & & ( ( decision state ) s ) non greedy ) { non greedy states add ( s state number ) ; } if ( s instanceof rule start state & & ( ( rule start state ) s ) is left recursive rule ) { precedence states add ( s state number ) ; } data add ( state type ) ; if ( s rule index = = - 1 ) { data add ( character max value ) ; } else { data add ( s rule index ) ; } if ( s get state type ( ) = = a t n state loop end ) { data add ( ( ( loop end state ) s ) loop back state state number ) ; } else if ( s instanceof block start state ) { data add ( ( ( block start state ) s ) end state state number ) ; } if ( s get state type ( ) ! = a t n state rule stop ) { / / the deserializer can trivially derive these edges , so there ' s no need to serialize them nedges + = s get number of transitions ( ) ; } for ( int i = 0 ; i < s get number of transitions ( ) ; i + + ) { transition t = s transition ( i ) ; int edge type = transition serialization types get ( t get class ( ) ) ; if ( edge type = = transition set | | edge type = = transition not set ) { set transition st = ( set transition ) t ; sets put ( st set , true ) ; } } } / / non - greedy states data add ( non greedy states size ( ) ) ; for ( int i = 0 ; i < non greedy states size ( ) ; i + + ) { data add ( non greedy states get ( i ) ) ; } / / precedence states data add ( precedence states size ( ) ) ; for ( int i = 0 ; i < precedence states size ( ) ; i + + ) { data add ( precedence states get ( i ) ) ; } int nrules = atn rule to start state length ; data add ( nrules ) ; for ( int r = 0 ; r < nrules ; r + + ) { a t n state rule start state = atn rule to start state [ r ] ; data add ( rule start state state number ) ; if ( atn grammar type = = a t n type lexer ) { if ( atn rule to token type [ r ] = = token eof ) { data add ( character max value ) ; } else { data add ( atn rule to token type [ r ] ) ; } } } int nmodes = atn mode to start state size ( ) ; data add ( nmodes ) ; if ( nmodes > 0 ) { for ( a t n state mode start state : atn mode to start state ) { data add ( mode start state state number ) ; } } list < interval set > bmp sets = new array list < > ( ) ; list < interval set > smp sets = new array list < > ( ) ; for ( interval set set : sets key set ( ) ) { if ( set get max element ( ) < = character max value ) { bmp sets add ( set ) ; } else { smp sets add ( set ) ; } } serialize sets ( data , bmp sets , new code point serializer ( ) { @ override public void serialize code point ( integer list data , int cp ) { data add ( cp ) ; } } ) ; serialize sets ( data , smp sets , new code point serializer ( ) { @ override public void serialize code point ( integer list data , int cp ) { serialize int ( data , cp ) ; } } ) ; map < interval set , integer > set indices = new hash map < > ( ) ; int set index = 0 ; for ( interval set bmp set : bmp sets ) { set indices put ( bmp set , set index + + ) ; } for ( interval set smp set : smp sets ) { set indices put ( smp set , set index + + ) ; } data add ( nedges ) ; for ( a t n state s : atn states ) { if ( s = = null ) { / / might be optimized away continue ; } if ( s get state type ( ) = = a t n state rule stop ) { continue ; } for ( int i = 0 ; i < s get number of transitions ( ) ; i + + ) { transition t = s transition ( i ) ; if ( atn states get ( t target state number ) = = null ) { throw new illegal state exception ( " cannot serialize a transition to a removed state " ) ; } int src = s state number ; int trg = t target state number ; int edge type = transition serialization types get ( t get class ( ) ) ; int arg 1 = 0 ; int arg 2 = 0 ; int arg 3 = 0 ; switch ( edge type ) { case transition rule : trg = ( ( rule transition ) t ) follow state state number ; arg 1 = ( ( rule transition ) t ) target state number ; arg 2 = ( ( rule transition ) t ) rule index ; arg 3 = ( ( rule transition ) t ) precedence ; break ; case transition precedence : precedence predicate transition ppt = ( precedence predicate transition ) t ; arg 1 = ppt precedence ; break ; case transition predicate : predicate transition pt = ( predicate transition ) t ; arg 1 = pt rule index ; arg 2 = pt pred index ; arg 3 = pt is ctx dependent ? 1 : 0 ; break ; case transition range : arg 1 = ( ( range transition ) t ) from ; arg 2 = ( ( range transition ) t ) to ; if ( arg 1 = = token eof ) { arg 1 = 0 ; arg 3 = 1 ; } break ; case transition atom : arg 1 = ( ( atom transition ) t ) label ; if ( arg 1 = = token eof ) { arg 1 = 0 ; arg 3 = 1 ; } break ; case transition action : action transition at = ( action transition ) t ; arg 1 = at rule index ; arg 2 = at action index ; if ( arg 2 = = - 1 ) { arg 2 = 0x f f f f ; } arg 3 = at is ctx dependent ? 1 : 0 ; break ; case transition set : arg 1 = set indices get ( ( ( set transition ) t ) set ) ; break ; case transition not set : arg 1 = set indices get ( ( ( set transition ) t ) set ) ; break ; case transition wildcard : break ; } data add ( src ) ; data add ( trg ) ; data add ( edge type ) ; data add ( arg 1 ) ; data add ( arg 2 ) ; data add ( arg 3 ) ; } } int ndecisions = atn decision to state size ( ) ; data add ( ndecisions ) ; for ( decision state dec start state : atn decision to state ) { data add ( dec start state state number ) ; } / / / / lexer actions / / if ( atn grammar type = = a t n type lexer ) { data add ( atn lexer actions length ) ; for ( lexer action action : atn lexer actions ) { data add ( action get action type ( ) ordinal ( ) ) ; switch ( action get action type ( ) ) { case channel : int channel = ( ( lexer channel action ) action ) get channel ( ) ; data add ( channel ! = - 1 ? channel : 0x f f f f ) ; data add ( 0 ) ; break ; case custom : int rule index = ( ( lexer custom action ) action ) get rule index ( ) ; int action index = ( ( lexer custom action ) action ) get action index ( ) ; data add ( rule index ! = - 1 ? rule index : 0x f f f f ) ; data add ( action index ! = - 1 ? action index : 0x f f f f ) ; break ; case mode : int mode = ( ( lexer mode action ) action ) get mode ( ) ; data add ( mode ! = - 1 ? mode : 0x f f f f ) ; data add ( 0 ) ; break ; case more : data add ( 0 ) ; data add ( 0 ) ; break ; case pop mode : data add ( 0 ) ; data add ( 0 ) ; break ; case push mode : mode = ( ( lexer push mode action ) action ) get mode ( ) ; data add ( mode ! = - 1 ? mode : 0x f f f f ) ; data add ( 0 ) ; break ; case skip : data add ( 0 ) ; data add ( 0 ) ; break ; case type : int type = ( ( lexer type action ) action ) get type ( ) ; data add ( type ! = - 1 ? type : 0x f f f f ) ; data add ( 0 ) ; break ; default : string message = string format ( locale get default ( ) , " the specified lexer action type % s is not valid " , action get action type ( ) ) ; throw new illegal argument exception ( message ) ; } } } / / note : this value shifting loop is documented in a t n deserializer / / don ' t adjust the first value since that ' s the version number for ( int i = 1 ; i < data size ( ) ; i + + ) { if ( data get ( i ) < character min value | | data get ( i ) > character max value ) { throw new unsupported operation exception ( " serialized atn data element " + data get ( i ) + " element " + i + " out of range " + ( int ) character min value + " " + ( int ) character max value ) ; } int value = ( data get ( i ) + 2 ) & 0x f f f f ; data set ( i , value ) ; } return data ; }


public void test json form data test ( ) throws api exception { string param = null ; string param 2 = null ; api test json form data ( param , param 2 ) ; / / todo : test validations }


adds stack trace and other useful information to exceptions thrown from a painless script

default script exception convert to script exception ( throwable t , map < string , list < string > > extra metadata ) { / / create a script stack : this is just the script portion list < string > script stack = new array list < > ( ) ; script exception position pos = null ; for ( stack trace element element : t get stack trace ( ) ) { if ( writer constants class name equals ( element get class name ( ) ) ) { / / found the script portion int original offset = element get line number ( ) ; if ( original offset = = - 1 ) { script stack add ( " < < < unknown portion of script > > > " ) ; } else { int offset = - - original offset ; / / offset is 1 based , line numbers must be ! int start offset = get previous statement ( offset ) ; if ( start offset = = - 1 ) { assert false ; / / should never happen unless we hit exc in ctor prologue start offset = 0 ; } int end offset = get next statement ( start offset ) ; if ( end offset = = - 1 ) { end offset = get source ( ) length ( ) ; } / / todo : if this is still too long , truncate and use ellipses string snippet = get source ( ) substring ( start offset , end offset ) ; script stack add ( snippet ) ; string builder pointer = new string builder ( ) ; for ( int i = start offset ; i < offset ; i + + ) { pointer append ( ' ' ) ; } pointer append ( " ^ - - - - here " ) ; script stack add ( pointer to string ( ) ) ; pos = new script exception position ( original offset , start offset , end offset ) ; } break ; / / but filter our own internal stacks ( e g indy bootstrap ) } else if ( ! should filter ( element ) ) { script stack add ( element to string ( ) ) ; } } script exception script exception = new script exception ( " runtime error " , t , script stack , get name ( ) , painless script engine name , pos ) ; for ( map entry < string , list < string > > entry : extra metadata entry set ( ) ) { script exception add metadata ( entry get key ( ) , entry get value ( ) ) ; } return script exception ; }


returns whether this is a two - byte codepoint with the form ' 10xxxxxx '

private static boolean is two bytes ( byte b ) { return b < ( byte ) 0x e 0 ; }


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


returns a new { @ link page } using the given vm template file path the template file path must be the resource path for the vm file in the jar since the velocity engine is configured to load vm files from jar resources

public static page new page ( string template ) { velocity engine engine = new velocity engine ( ) ; engine set property ( " resource loader " , " classpath , jar " ) ; engine set property ( " classpath resource loader class " , classpath resource loader class get name ( ) ) ; engine set property ( " jar resource loader class " , jar resource loader class get name ( ) ) ; engine set property ( " input encoding " , " utf - 8 " ) ; engine set property ( " output encoding " , " utf - 8 " ) ; engine set property ( " directive set null allowed " , true ) ; engine set property ( " parser pool size " , 3 ) ; engine set property ( " runtime references strict " , true ) ; return new page ( engine , template ) ; }


public static void setup cluster ( ) throws exception { job conf conf = new job conf ( ) ; assume session tests enabled ( conf ) ; disable filesystem caching ( conf ) ; cluster = deploy service ( conf , new mini kerberized hadoop cluster ( ) ) ; }


get the version id of the status object ; may be null

public string get version id ( ) { return status get version id ( ) ; }


provides an x stream replacement for an object unless a call to { @ link # write } is currently in progress as per jenkins - 45892 this may be used by any class which expects to be written at top level to an xml file but which cannot safely be serialized as a nested object ( for example , because it expects some { @ code on load } hook ) : implement a { @ code write replace } method delegating to this method the replacement need not be { @ link serializable } since it is only necessary for use from x stream

public static object replace if not at top level ( object o , supplier < object > replacement ) { file currently writing = writing get ( ) ; if ( being written contains key ( o ) | | currently writing = = null ) { return o ; } else { logger log ( level warning , " jenkins - 45892 : reference to " + o + " being saved from unexpected " + currently writing , new illegal state exception ( ) ) ; return replacement get ( ) ; } }


get the number of matches which are false positives since they occur within a defined instruction

public int get num f p misaligned ( ) { return fp misaligned ; }


{ @ inherit doc } this method returns a { @ link sorted map } , instead of the { @ code map } specified in the { @ link table } interface

sorted map < r , map < c , v > > row map ( ) ;


get an array of filter configuration specified in the conf

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


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

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


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


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


protected map < string , list < object > > get cas principal attributes ( final map < string , object > model , final registered service registered service ) { return get principal attributes as multi valued attributes ( model ) ; }


public optional < provider config > get default provider ( ) { list < provider config > provider configs = get default configs ( get configs map ( get tag name ( provider config class ) ) ) ; if ( collection utils is not empty ( provider configs ) ) { return optional of ( provider configs get ( 0 ) ) ; } return optional empty ( ) ; }


public void select tracks with disabled no sample renderer ( ) throws exo playback exception { track selector set parameters ( default parameters build upon ( ) set renderer disabled ( 1 , true ) ) ; track selector result result = track selector select tracks ( renderer capabilities with no sample renderer , track groups , period id , timeline ) ; assert selections ( result , track selections with no sample renderer ) ; assert that ( new renderer configuration [ ] { default , null } ) is equal to ( result renderer configurations ) ; }


if the dns query failed this will provide the rational


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


end all domain object transactions and keep track as to which ones resulted in a low - level transaction

boolean end all ( boolean commit ) { boolean has change = false ; for ( int i = 0 ; i < managers length ; i + + ) { transaction transaction = managers [ i ] end transaction ( managers [ i ] get domain object ( ) , hold transaction ids [ i ] , commit , false ) ; if ( commit & & transaction has committed d b transaction ( ) ) { has changes [ i ] = true ; has change = true ; } else { descriptions [ i ] = null ; } } return has change ; }


public void merge ( int set other ) { if ( other instanceof bit int set ) { bit int set o = ( bit int set ) other ; ensure capacity ( bits get max ( o bits ) + 1 ) ; bits or ( bits , o bits ) ; } else if ( other instanceof list int set ) { list int set o = ( list int set ) other ; int sz = o ints size ( ) ; if ( sz > 0 ) { ensure capacity ( o ints get ( sz - 1 ) ) ; } for ( int i = 0 ; i < o ints size ( ) ; i + + ) { bits set ( bits , o ints get ( i ) , true ) ; } } else { int iterator iter = other iterator ( ) ; while ( iter has next ( ) ) { add ( iter next ( ) ) ; } } }


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


rename this filedirectory to the target filepath this file path and the target must be on the some host

public void rename to ( final file path target ) throws i o exception , interrupted exception { if ( this channel ! = target channel ) { throw new i o exception ( " rename to target must be on the same host " ) ; } act ( new rename to ( target ) ) ; }


this test validates that an index which is out of bounds throws an index out of bounds exception

public void test out of tuple bounds grouping 3 ( ) { final execution environment env = execution environment get execution environment ( ) ; unsorted grouping < tuple 5 < integer , long , string , long , integer > > group ds = env from collection ( empty tuple data , tuple type info ) group by ( 0 ) ; / / should not work , key out of tuple bounds group ds min by ( 1 , 2 , 3 , 4 , - 1 ) ; }


like { @ link # stat } , but may return null if the file is not found ( corresponding to { @ code enoent } and { @ code enotdir } in unix ' s stat ( 2 ) function ) instead of throwing follows symbolic links

public file status stat if found ( ) throws i o exception { return file system stat if found ( this , true ) ; }


provide a { @ code web session manager } instance to use with the exchange this is mutually exclusive with { @ link # session ( web session ) }

public builder session manager ( web session manager session manager ) { this session manager = session manager ; return this ; }


this test validates if the client request interceptor chain for the user can build and init correctly when a multi - client process begins to request router client r m service for the same user simultaneously

public void test client pipeline concurrent ( ) throws interrupted exception { final string user = " test 1 " ; / * * client test thread is a thread to simulate a client request to get a * client request interceptor for the user * / class client test thread extends thread { private client request interceptor interceptor ; @ override public void run ( ) { try { interceptor = pipeline ( ) ; } catch ( i o exception | interrupted exception e ) { e print stack trace ( ) ; } } private client request interceptor pipeline ( ) throws i o exception , interrupted exception { return user group information create remote user ( user ) do as ( new privileged exception action < client request interceptor > ( ) { @ override public client request interceptor run ( ) throws exception { request interceptor chain wrapper wrapper = get router client r m service ( ) get interceptor chain ( ) ; client request interceptor interceptor = wrapper get root interceptor ( ) ; assert assert not null ( interceptor ) ; log info ( " init client interceptor success for user " + user ) ; return interceptor ; } } ) ; } } / * * we start the first thread it should not finish initing a chain wrapper * before the other thread starts in this way , the second thread can * init at the same time of the first one in the end , we validate that * the 2 threads get the same chain wrapper without going into error * / client test thread client 1 = new client test thread ( ) ; client test thread client 2 = new client test thread ( ) ; client 1 start ( ) ; client 2 start ( ) ; client 1 join ( ) ; client 2 join ( ) ; assert assert not null ( client 1 interceptor ) ; assert assert not null ( client 2 interceptor ) ; assert assert true ( client 1 interceptor = = client 2 interceptor ) ; }


public synchronized text get kind ( ) { return kind ; }


updates or creates sessions based on a position discontinuity at { @ link event time } should be called instead of { @ link # update sessions ( event time ) } if a position discontinuity occurred

void update sessions with discontinuity ( event time event time , @ discontinuity reason int reason ) ;


get the refresh check delay for the given { @ link script factory } { @ link bean definition } if the { @ link bean definition } has a { @ link org springframework core attribute accessor metadata attribute } under the key { @ link # refresh check delay attribute } which is a valid { @ link number } type , then this value is used otherwise , the { @ link # default refresh check delay } value is used

protected long resolve refresh check delay ( bean definition bean definition ) { long refresh check delay = this default refresh check delay ; object attribute value = bean definition get attribute ( refresh check delay attribute ) ; if ( attribute value instanceof number ) { refresh check delay = ( ( number ) attribute value ) long value ( ) ; } else if ( attribute value instanceof string ) { refresh check delay = long parse long ( ( string ) attribute value ) ; } else if ( attribute value ! = null ) { throw new bean definition store exception ( " invalid refresh check delay attribute [ " + refresh check delay attribute + " ] with value ' " + attribute value + " ' : needs to be of type number or string " ) ; } return refresh check delay ; }


builds downstream tls context from file - names

private static downstream tls context build downstream tls context from filenames ( string private key , string cert chain , string trust ca ) throws i o exception { return build downstream tls context ( build common tls context from filenames ( private key , cert chain , trust ca ) ) ; }


public boolean is descend ( ) { return this descend ; }


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


creates an { @ link instruction sequence } instance from a xml node

public static instruction sequence from xml ( element element ) { if ( element = = null ) { return null ; } list < string > instructions list = new array list < > ( ) ; element instructions list ele = element get child ( " instructions " ) ; if ( instructions list ele ! = null ) { for ( element inst ele : xml utilities get children ( instructions list ele , " instruction " ) ) { string val = inst ele get attribute value ( " value " ) ; instructions list add ( val ) ; } } list < integer > sizes list = new array list < > ( ) ; element sizes list ele = element get child ( " sizes " ) ; if ( sizes list ele ! = null ) { for ( element size ele : xml utilities get children ( sizes list ele , " size " ) ) { string val = size ele get attribute value ( " value " ) ; sizes list add ( val ! = null ? xml utilities parse int ( val ) : null ) ; } } list < string > cso list = new array list < > ( ) ; element cso list ele = element get child ( " comma separated operands " ) ; if ( cso list ele ! = null ) { for ( element cso ele : xml utilities get children ( cso list ele , " operands " ) ) { string val = cso ele get attribute value ( " value " ) ; cso list add ( val ) ; } } instruction sequence result = new instruction sequence ( ) ; result set instructions ( instructions list to array ( new string [ instructions list size ( ) ] ) ) ; result set comma separated operands ( cso list to array ( new string [ cso list size ( ) ] ) ) ; result set sizes ( sizes list to array ( new integer [ sizes list size ( ) ] ) ) ; return result ; }


public static void setup h d f s ( ) throws i o exception { if ( hdfs = = null ) { job conf c = new job conf ( ) ; hdfs = new mini d f s cluster service ( ) ; hdfs init ( c ) ; hdfs start ( ) ; conf = c ; } }


run a test where one result must match a given instruction pattern , and all others must disassemble exactly to the input

protected void assert one compat rest exact ( string assembly , string instr ) { run test ( assembly , instr , collections singleton ( assembly ) , default addr , null , true , true , false , false ) ; }


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


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


public abstract json writer value ( long value ) throws i o exception ;


any < code > byte < code > or non - null < code > byte < code > since mockito 2 1 0 , only allow valued < code > byte < code > , thus < code > null < code > is not anymore a valid value as primitive wrappers are nullable , the suggested api to match < code > null < code > wrapper would be { @ link # is null ( ) } we felt this change would make tests harness much safer that it was with mockito 1 x see examples in javadoc for { @ link argument matchers } class

public static byte any byte ( ) { report matcher ( new instance of ( byte class , " < any byte > " ) ) ; return 0 ; }


public builder clear tags ( ) { if ( tags = = null ) return this ; tags clear ( ) ; return this ; }


specify a limited set of in parameters to be used

public void set limited in parameter names ( set < string > limited in parameter names ) { this limited in parameter names = limited in parameter names ; }


enables the " apply percentage filter " and " clear percentage filter " buttons

public void enable percentage filter buttons ( boolean enable ) { if ( apply percentage filter button ! = null ) { apply percentage filter button set enabled ( enable ) ; } if ( clear percentage filter button ! = null ) { clear percentage filter button set enabled ( enable ) ; } return ; }


for patterns of type { @ link type # single target } and { @ link type # targets in package } , returns the { @ link package identifier } corresponding to the package that would contain the target ( s ) matched by this { @ link target pattern }

public package identifier get directory for target or targets in package ( ) { throw new illegal state exception ( ) ; }


set the indirect storage flag associated with a record

private void enable indirect storage ( int index , boolean state ) { buffer put byte ( ind option base offset + ( index * entry size ) , state ? ( byte ) 1 : ( byte ) 0 ) ; }


a single preview frame will be returned to the handler supplied the data will arrive as byte [ ] in the message obj field , with width and height encoded as message arg 1 and message arg 2 , respectively

public synchronized void request preview frame ( handler handler , int message ) { open camera the camera = camera ; if ( the camera ! = null & & previewing ) { preview callback set handler ( handler , message ) ; the camera get camera ( ) set one shot preview callback ( preview callback ) ; } }


deserializes the kafka record can output multiple records through the { @ link collector } note that number and size of the produced records should be relatively small depending on the source implementation records can be buffered in memory or collecting records might delay emitting checkpoint barrier

default void deserialize ( consumer record < byte [ ] , byte [ ] > message , collector < t > out ) throws exception { t deserialized = deserialize ( message ) ; if ( deserialized ! = null ) { out collect ( deserialized ) ; } }


public void register ( long raw , long offset start , long offset end ) ;


testing that we cannot close while running exclusively

public void test run exclusively ( ) throws interrupted exception { count down latch exclusive code started = new count down latch ( 1 ) ; final int num mails = 10 ; / / send 10 mails in an atomic operation new thread ( ( ) - > task mailbox run exclusively ( ( ) - > { exclusive code started count down ( ) ; for ( int index = 0 ; index < num mails ; index + + ) { try { task mailbox put ( new mail ( ( ) - > { } , 1 , " mail d " ) ) ; thread sleep ( 1 ) ; } catch ( exception e ) { } } } ) ) start ( ) ; exclusive code started await ( ) ; / / make sure that all 10 messages have been actually enqueued assert equals ( num mails , task mailbox close ( ) size ( ) ) ; }


lookup monitor data 1 support lookup by day : count : hostinterface ? application = foo & method = foo & side = provider & view = chart & date = 2012 - 07 - 03 1 1 host , application , interface , group , version , method : query criteria for looking up by host , application , interface , method when one criterion is not present , it means all will be accepted , but 0 0 0 0 is all for host 1 2 side = consumer , provider : decide the data from which side , both provider and consumer are returned by default 1 3 default value is view = summary , to return the summarized data for the whole day view = chart will return the url address showing the whole day trend which is convenient for embedding in other web page 1 4 date = 2012 - 07 - 03 : specify the date to collect the data , today is the default value


called by { @ link spatial join operator } { @ link spatial join operator } must call { @ link # probe operator finished ( ) } on completion to signal that spatial index is no longer needed

public synchronized listenable future < pages spatial index > create pages spatial index ( ) { active probe operators retain ( ) ; if ( pages spatial index ! = null ) { return immediate future ( pages spatial index get ( ) ) ; } settable future < pages spatial index > future = settable future create ( ) ; pages spatial index futures add ( future ) ; return future ; }


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


acquire the light lock and ensure that the consumer hasn ' t been closed

private void acquire and ensure open ( ) { acquire ( ) ; if ( this closed ) { release ( ) ; throw new illegal state exception ( " this consumer has already been closed " ) ; } }


returns true if the children of this die are within a new namespace ie namespaces , subprogram , class , interface , struct , union , enum

public boolean is name space container ( ) { switch ( get tag ( ) ) { case d w a r f tag dw tag namespace : case d w a r f tag dw tag subprogram : case d w a r f tag dw tag lexical block : case d w a r f tag dw tag class type : case d w a r f tag dw tag interface type : case d w a r f tag dw tag structure type : case d w a r f tag dw tag union type : case d w a r f tag dw tag enumeration type : return true ; } return false ; }


exit a parse tree produced by the { @ code arithmetic binary } labeled alternative in { @ link sql base parser # value expression }

void exit arithmetic binary ( sql base parser arithmetic binary context ctx ) ;


enqueues new transactions at the transaction manager and returns a { @ link transactional request result } that allows waiting on them if there are no new transactions we return a { @ link transactional request result } that is already done

private transactional request result enqueue new partitions ( ) { object transaction manager = get field ( kafka producer , " transaction manager " ) ; synchronized ( transaction manager ) { object new partitions in transaction = get field ( transaction manager , " new partitions in transaction " ) ; object new partitions in transaction is empty = invoke ( new partitions in transaction , " is empty " ) ; transactional request result result ; if ( new partitions in transaction is empty instanceof boolean & & ! ( ( boolean ) new partitions in transaction is empty ) ) { object txn request handler = invoke ( transaction manager , " add partitions to transaction handler " ) ; invoke ( transaction manager , " enqueue request " , new class [ ] { txn request handler get class ( ) get superclass ( ) } , new object [ ] { txn request handler } ) ; result = ( transactional request result ) get field ( txn request handler , txn request handler get class ( ) get superclass ( ) , " result " ) ; } else { / / we don ' t have an operation but this operation string is also used in / / add partitions to transaction handler result = new transactional request result ( " add partitions to txn " ) ; result done ( ) ; } return result ; } }


after a short delay , if the main data hasn ' t shown yet , then a loading message is displayed

private @ non null live data < spannable > loading ( @ non null live data < spannable > string ) { return live data util until ( string , live data util delay ( 250 , new spannable string ( get context ( ) get string ( r string conversation update item loading ) ) ) ) ; }


adds a field to load and return as part of the search request

public inner hit builder add fetch field ( string name , @ nullable string format ) { return add fetch field ( name , format , null ) ; }


given an output filename , write a bunch of random records to it

public void map ( writable comparable key , writable value , context context ) throws i o exception , interrupted exception { int item count = 0 ; while ( num bytes to write > 0 ) { int key length = min key size + ( key size range ! = 0 ? random next int ( key size range ) : 0 ) ; random key set size ( key length ) ; randomize bytes ( random key get bytes ( ) , 0 , random key get length ( ) ) ; int value length = min value size + ( value size range ! = 0 ? random next int ( value size range ) : 0 ) ; random value set size ( value length ) ; randomize bytes ( random value get bytes ( ) , 0 , random value get length ( ) ) ; context write ( random key , random value ) ; num bytes to write - = key length + value length ; context get counter ( counters bytes written ) increment ( key length + value length ) ; context get counter ( counters records written ) increment ( 1 ) ; if ( + + item count % 200 = = 0 ) { context set status ( " wrote record " + item count + " " + num bytes to write + " bytes left " ) ; } } context set status ( " done with " + item count + " records " ) ; }


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


available space in the { @ link # side } buffer

private int space ( ) { return side buffer size - side size ( ) ; }


invokes a client protocol method against the specified namespace re - throws exceptions generated by the remote rpc call as either remote exception or i o exception

public object invoke single ( final string ns id , remote method method ) throws i o exception { user group information ugi = router rpc server get remote user ( ) ; acquire permit ( ns id , ugi , method ) ; try { list < ? extends federation namenode context > nns = get namenodes for nameservice ( ns id ) ; remote location context loc = new remote location ( ns id , " / " , " / " ) ; class < ? > proto = method get protocol ( ) ; method m = method get method ( ) ; object [ ] params = method get params ( loc ) ; return invoke method ( ugi , nns , proto , m , params ) ; } finally { release permit ( ns id , ugi , method ) ; } }


return the name of this parameter in the operation signature

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


returns the { @ link path } relative to the base { @ link path } for example , < code > path create ( " foobarwiz " ) relative to ( path create ( " foo " ) ) < code > returns < code > path create ( " barwiz " ) < code > if the { @ link path } is not a child of the passed { @ link path } an { @ link illegal argument exception } is thrown in particular , this will happen whenever the two { @ link path } instances aren ' t both absolute or both relative

public path fragment relative to ( path base ) { preconditions check not null ( base ) ; check same file system ( base ) ; string base path = base path ; if ( ! os starts with ( path , base path ) ) { throw new illegal argument exception ( string format ( " path ' % s ' is not under ' % s ' , cannot relativize " , this , base ) ) ; } int bn = base path length ( ) ; if ( bn = = 0 ) { return path fragment create already normalized ( path , drive str length ) ; } if ( path length ( ) = = bn ) { return path fragment empty fragment ; } final int last slash index ; if ( base path char at ( bn - 1 ) = = ' / ' ) { last slash index = bn - 1 ; } else { last slash index = bn ; } if ( path char at ( last slash index ) ! = ' / ' ) { throw new illegal argument exception ( string format ( " path ' % s ' is not under ' % s ' , cannot relativize " , this , base ) ) ; } string new path = path substring ( last slash index + 1 ) ; return path fragment create already normalized ( new path , 0 ) ; }


creates a copy of the { @ link table source } that projects its output to the given field indexes the field indexes relate to the physical produced data type ( { @ link table source # get produced data type ( ) } ) and not to the table schema ( { @ link table source # get table schema ( ) } of the { @ link table source } the table schema ( { @ link table source # get table schema ( ) } of the { @ link table source } copy must not be modified by this method , but only the produced data type ( { @ link table source # get produced data type ( ) } ) and the produced { @ code data set } ( { @ code batch table source get data set ( } ) or { @ code data stream } ( { @ code stream table source get data stream ( ) } ) the produced data type may only be changed by removing or reordering first level fields the type of the first level fields must not be changed if the { @ link table source } implements the { @ link defined field mapping } interface , it might be necessary to adjust the mapping as well the { @ code nested fields } parameter contains all nested fields that are accessed by the query this information can be used to only read and set the accessed fields non - accessed fields may be left empty , set to null , or to a default value this method is called with parameters as shown in the example below : { @ code schema table schema = { id , student < \ school < \ city , tuition > , age , name > , teacher < \ age , name > } query select ( id , student school city , student age , teacher ) parameters fields = field = [ 0 , 1 , 2 ] nested fields \ [ \ [ " " ] , [ " school city " , " age " ] , [ " " \ ] \ ] } important : this method must return a true copy and must not modify the original table source object

table source < t > project nested fields ( int [ ] fields , string [ ] [ ] nested fields ) ;


check this filter data has been used to calculate bit map when msg was stored in server

public boolean is msg in live ( long msg store time ) { return msg store time > get born time ( ) ; }


test balancer with observer nodes when one has failed

public void test balancer with observer with failed node ( ) throws exception { test balancer with observer ( true ) ; }


shrinks this instance to fit , by removing any unset ( { @ code null } ) elements , leaving the remaining elements in their original order

public void shrink to fit ( ) { int sz = arr length ; int new sz = 0 ; for ( int i = 0 ; i < sz ; i + + ) { if ( arr [ i ] ! = null ) { new sz + + ; } } if ( sz = = new sz ) { return ; } throw if immutable ( ) ; object [ ] newa = new object [ new sz ] ; int at = 0 ; for ( int i = 0 ; i < sz ; i + + ) { object one = arr [ i ] ; if ( one ! = null ) { newa [ at ] = one ; at + + ; } } arr = newa ; if ( new sz = = 0 ) { set immutable ( ) ; } }


returns true if the specified oas model has at least one operation with the http basic security scheme

public static boolean has http basic methods ( list < codegen security > auth methods ) { if ( auth methods ! = null & & ! auth methods is empty ( ) ) { for ( codegen security cs : auth methods ) { if ( boolean true equals ( cs is basic basic ) ) { return true ; } } } return false ; }


load the properties from the specified reader

protected void load ( reader reader ) throws i o exception { properties = new object map < string , string > ( ) ; properties utils load ( properties , reader ) ; }


adds a setting , it ' s consumer and validator for this index

public < t > void add settings update consumer ( setting < t > setting , consumer < t > consumer , consumer < t > validator ) { ensure not frozen ( ) ; if ( setting = = null ) { throw new illegal argument exception ( " setting must not be null " ) ; } index settings get scoped settings ( ) add settings update consumer ( setting , consumer , validator ) ; }


returns the signed short at < code > index < code >

public short read short ( long index ) throws i o exception { byte [ ] bytes = provider read bytes ( index , sizeof short ) ; return converter get short ( bytes ) ; }


applies basic assertions on the search response this method checks if all shards were successful , if any of the shards threw an exception and if the response is serializable

public static search response assert search response ( search response response ) { assert no failures ( response ) ; return response ; }


extract returned result sets from the completed stored procedure

protected map < string , object > extract returned results ( callable statement cs , @ nullable list < sql parameter > update count parameters , @ nullable list < sql parameter > result set parameters , int update count ) throws s q l exception { map < string , object > results = new linked hash map < > ( 4 ) ; int rs index = 0 ; int update index = 0 ; boolean more results ; if ( ! this skip results processing ) { do { if ( update count = = - 1 ) { if ( result set parameters ! = null & & result set parameters size ( ) > rs index ) { sql return result set declared rs param = ( sql return result set ) result set parameters get ( rs index ) ; results put all ( process result set ( cs get result set ( ) , declared rs param ) ) ; rs index + + ; } else { if ( ! this skip undeclared results ) { string rs name = return result set prefix + ( rs index + 1 ) ; sql return result set undeclared rs param = new sql return result set ( rs name , get column map row mapper ( ) ) ; if ( logger is trace enabled ( ) ) { logger trace ( " added default sql return result set parameter named ' " + rs name + " ' " ) ; } results put all ( process result set ( cs get result set ( ) , undeclared rs param ) ) ; rs index + + ; } } } else { if ( update count parameters ! = null & & update count parameters size ( ) > update index ) { sql return update count uc param = ( sql return update count ) update count parameters get ( update index ) ; string declared uc name = uc param get name ( ) ; results put ( declared uc name , update count ) ; update index + + ; } else { if ( ! this skip undeclared results ) { string undeclared name = return update count prefix + ( update index + 1 ) ; if ( logger is trace enabled ( ) ) { logger trace ( " added default sql return update count parameter named ' " + undeclared name + " ' " ) ; } results put ( undeclared name , update count ) ; update index + + ; } } } more results = cs get more results ( ) ; update count = cs get update count ( ) ; if ( logger is trace enabled ( ) ) { logger trace ( " callable statement get update count ( ) returned " + update count ) ; } } while ( more results | | update count ! = - 1 ) ; } return results ; }


lifted from e s test case : s don ' t reuse this anywhere ! create a copy of an original { @ link search source builder } object by running it through a { @ link bytes stream output } and reading it in again using a { @ link writeable reader } the stream that is wrapped around the { @ link stream input } potentially need to use a { @ link named writeable registry } , so this needs to be provided too

private static search source builder copy writeable ( search source builder original , named writeable registry named writeable registry , writeable reader < search source builder > reader ) throws i o exception { writeable writer < search source builder > writer = ( out , value ) - > value write to ( out ) ; try ( bytes stream output output = new bytes stream output ( ) ) { output set version ( version current ) ; writer write ( output , original ) ; try ( stream input in = new named writeable aware stream input ( output bytes ( ) stream input ( ) , named writeable registry ) ) { in set version ( version current ) ; return reader read ( in ) ; } } }


returns { @ link bug reporter } to use when reporting bugs , instead of { @ link com google devtools build lib bugreport bug report # send bug report }

public bug reporter get bug reporter ( ) { return executor get bug reporter ( ) ; }


determine the canonical name for the given property path removes surrounding quotes from map keys : < br > { @ code map [ ' key ' ] } - > { @ code map [ key ] } < br > { @ code map [ " key " ] } - > { @ code map [ key ] }

public static string canonical property name ( @ nullable string property name ) { if ( property name = = null ) { return " " ; } string builder sb = new string builder ( property name ) ; int search index = 0 ; while ( search index ! = - 1 ) { int key start = sb index of ( property accessor property key prefix , search index ) ; search index = - 1 ; if ( key start ! = - 1 ) { int key end = sb index of ( property accessor property key suffix , key start + property accessor property key prefix length ( ) ) ; if ( key end ! = - 1 ) { string key = sb substring ( key start + property accessor property key prefix length ( ) , key end ) ; if ( ( key starts with ( " ' " ) & & key ends with ( " ' " ) ) | | ( key starts with ( " \ " " ) & & key ends with ( " \ " " ) ) ) { sb delete ( key start + 1 , key start + 2 ) ; sb delete ( key end - 2 , key end - 1 ) ; key end = key end - 2 ; } search index = key end + property accessor property key suffix length ( ) ; } } } return sb to string ( ) ; }


tells the function manager that its tags are out of date this will cause functions to go to the database to retrieve tags next time they are requested , rather than using their internal cache

private void invalidate functions ( ) { function manager d b function manager = ( function manager d b ) program get function manager ( ) ; function manager function tags changed ( ) ; }


this is a bit of a hack to mirror the old { @ link value type } behavior , which would allow a rough compatibility between types this behavior is being phased out in the aggregations framework , in favor of explicitly listing supported types , but we haven ' t gotten to fixing composite yet

public boolean is a ( value type value type ) { if ( numeric value types contains ( this ) ) { return numeric value types contains ( value type ) ; } if ( string value types contains ( this ) ) { return string value types contains ( value type ) ; } return this equals ( value type ) ; }


public static < t > list < t > top n ( iterable < t > coll , int n , comparator < ? super t > comp ) { return ordering from ( comp ) greatest of ( coll , n ) ; }


show a animation , and depending on gone on end , will stay on the screen or be gone

public void show and animate control ( final int drawable id , final boolean gone on end ) { if ( debug ) { log d ( tag , " show and animate control ( ) called with : " + " drawable id = [ " + drawable id + " ] , gone on end = [ " + gone on end + " ] " ) ; } if ( control view animator ! = null & & control view animator is running ( ) ) { if ( debug ) { log d ( tag , " show and animate control : control view animator is running " ) ; } control view animator end ( ) ; } if ( drawable id = = - 1 ) { if ( binding control animation view get visibility ( ) = = view visible ) { control view animator = object animator of property values holder ( binding control animation view , property values holder of float ( view alpha , 1 0f , 0 0f ) , property values holder of float ( view scale x , 1 4f , 1 0f ) , property values holder of float ( view scale y , 1 4f , 1 0f ) ) set duration ( default controls duration ) ; control view animator add listener ( new animator listener adapter ( ) { @ override public void on animation end ( final animator animation ) { binding control animation view set visibility ( view gone ) ; } } ) ; control view animator start ( ) ; } return ; } final float scale from = gone on end ? 1f : 1f ; final float scale to = gone on end ? 1 8f : 1 4f ; final float alpha from = gone on end ? 1f : 0f ; final float alpha to = gone on end ? 0f : 1f ; control view animator = object animator of property values holder ( binding control animation view , property values holder of float ( view alpha , alpha from , alpha to ) , property values holder of float ( view scale x , scale from , scale to ) , property values holder of float ( view scale y , scale from , scale to ) ) ; control view animator set duration ( gone on end ? 1000 : 500 ) ; control view animator add listener ( new animator listener adapter ( ) { @ override public void on animation end ( final animator animation ) { binding control animation view set visibility ( gone on end ? view gone : view visible ) ; } } ) ; binding control animation view set visibility ( view visible ) ; binding control animation view set image drawable ( app compat resources get drawable ( context , drawable id ) ) ; control view animator start ( ) ; }


creates a { @ link monitoring doc node } from a { @ link discovery node } and a timestamp , copying over the required information

public static monitoring doc node convert node ( final long timestamp , final @ nullable discovery node node ) { if ( node = = null ) { return null ; } return new monitoring doc node ( node get id ( ) , node get host name ( ) , node get address ( ) to string ( ) , node get host address ( ) , node get name ( ) , timestamp ) ; }


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

default response entity < void > delete user ( @ api param ( value = " the name that needs to be deleted " , required = true ) @ path variable ( " username " ) string username ) { return new response entity < > ( http status not implemented ) ; }


this method is executed once per superstep after the scatter function has been invoked for each vertex

public void post superstep ( ) throws exception { }


method to determine the actual ttl of a { @ link ticket } , based on the policy

default long get time to live ( final ticket state ticket state ) { return get time to live ( ) ; }


fallback if none of the other { @ code decorrelate rel } methods match

public frame decorrelate rel ( rel node rel ) { rel node new rel = rel copy ( rel get trait set ( ) , rel get inputs ( ) ) ; if ( rel get inputs ( ) size ( ) > 0 ) { list < rel node > old inputs = rel get inputs ( ) ; list < rel node > new inputs = new array list < > ( ) ; for ( int i = 0 ; i < old inputs size ( ) ; + + i ) { final frame frame = get invoke ( old inputs get ( i ) , rel ) ; if ( frame = = null | | ! frame cor def outputs is empty ( ) ) { / / if input is not rewritten , or if it produces correlated / / variables , terminate rewrite return null ; } new inputs add ( frame r ) ; new rel replace input ( i , frame r ) ; } if ( ! util equal shallow ( old inputs , new inputs ) ) { new rel = rel copy ( rel get trait set ( ) , new inputs ) ; } } / / the output position should not change since there are no cor vars / / coming from below return register ( rel , new rel , identity map ( rel get row type ( ) get field count ( ) ) , immutable sorted map of ( ) ) ; }


sets the < code > prefix number < code > property

public xml item prefix number ( big decimal prefix number ) { this prefix number = prefix number ; return this ; }


return the number of milliseconds to wait , based on the connection state and the throttle time , before attempting to send data if the connection has been established but being throttled , return throttle delay otherwise , return connection delay

long poll delay ms ( node node , long now ) ;