public string to string ( string string ) { string buffer buf = new string buffer ( string ) ; p p token token = defs get ( string ) ; vector < p p token > arg vector = get args ( string ) ; if ( arg vector ! = null ) { buf append ( " ( " ) ; for ( int i = 0 ; i < arg vector size ( ) ; i + + ) { p p token arg = arg vector get ( i ) ; buf append ( arg ) ; if ( i + 1 < arg vector size ( ) ) { buf append ( " , " ) ; } } buf append ( " ) " ) ; } buf append ( " = " + token to string ( ) ) ; return buf to string ( ) ; }


gets the zoomable controller zoomable controller can be used to zoom to point , or to map point from view to image coordinates for instance

public zoomable controller get zoomable controller ( ) { return m zoomable controller ; }


aggregates the thread ' s local samples into the global metrics the caller should ensure its thread safety

private void aggregate local states to global metrics ( final concurrent map < string , thread safe sample stat > local stats ) { for ( map entry < string , thread safe sample stat > entry : local stats entry set ( ) ) { string name = entry get key ( ) ; mutable rate global metric = add metric if not exists ( name ) ; entry get value ( ) snapshot into ( global metric ) ; } }


this method is called when an attempt to connect a channel throws an exception

protected void connect exception ( socket channel context context , exception exception ) { context handle exception ( exception ) ; }


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

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


< code > optional string foo = 1 ; < code >

public com google protobuf byte string get foo bytes ( ) { object ref = foo ; if ( ref instanceof string ) { com google protobuf byte string b = com google protobuf byte string copy from utf 8 ( ( string ) ref ) ; foo = b ; return b ; } else { return ( com google protobuf byte string ) ref ; } }


creates a state handle , stores it in zoo keeper and locks it a locked node cannot be removed by another { @ link zoo keeper state handle store } instance as long as this instance remains connected to zoo keeper important : this will not store the actual state in zoo keeper , but create a state handle and store it in zoo keeper this level of indirection makes sure that data in zoo keeper is small the operation will fail if there is already an node under the given path

public retrievable state handle < t > add and lock ( string path in zoo keeper , t state ) throws exception { check not null ( path in zoo keeper , " path in zoo keeper " ) ; check not null ( state , " state " ) ; final string path = normalize path ( path in zoo keeper ) ; retrievable state handle < t > store handle = storage store ( state ) ; boolean success = false ; try { / / serialize the state handle this writes the state to the backend byte [ ] serialized store handle = instantiation util serialize object ( store handle ) ; / / write state handle ( not the actual state ) to zoo keeper this is expected to be / / smaller than the state itself this level of indirection makes sure that data in / / zoo keeper is small , because zoo keeper is designed for data in the kb range , but / / the state can be larger / / create the lock node in a transaction with the actual state node that way we can / / prevent / / race conditions with a concurrent delete operation client in transaction ( ) create ( ) with mode ( create mode persistent ) for path ( path , serialized store handle ) and ( ) create ( ) with mode ( create mode ephemeral ) for path ( get lock path ( path ) ) and ( ) commit ( ) ; success = true ; return store handle ; } catch ( keeper exception node exists exception e ) { / / we wrap the exception here so that it could be caught in default job graph store throw new already exist exception ( " zoo keeper node " + path + " already exists " , e ) ; } finally { if ( ! success ) { / / cleanup the state handle if it was not written to zoo keeper if ( store handle ! = null ) { store handle discard state ( ) ; } } } }


initialize the plugin this might involve - initializing the variables - calibrating the plugin

void initialize ( configuration conf , resource usage metrics metrics , resource calculator plugin monitor , progressive progress ) ;


tries to enrich the passed exception or its causes with additional information this method improves error messages for direct and metaspace { @ link out of memory error } it adds descriptions about possible causes and ways of resolution

public static void try enrich cluster entry point error ( @ nullable throwable root ) { try enrich out of memory error ( root , jm metaspace oom error message , jm direct oom error message , jm heap space oom error message ) ; }


returns an iterator containing the elements of { @ code array } in order the returned iterator is a view of the array ; subsequent changes to the array will be reflected in the iterator < b > note : < b > it is often preferable to represent your data using a collection type , for example using { @ link arrays # as list ( object [ ] ) } , making this method unnecessary the { @ code iterable } equivalent of this method is either { @ link arrays # as list ( object [ ] ) } , { @ link immutable list # copy of ( object [ ] ) } } , or { @ link immutable list # of }

public static < t > unmodifiable iterator < t > for array ( final t array ) { return for array ( array , 0 , array length , 0 ) ; }


increment the initial window size for this stream

void increment initial stream window ( int delta ) ;


choose nodes for the calls in the pending calls list

private long maybe drain pending calls ( long now ) { long poll timeout = long max value ; log trace ( " trying to choose nodes for { } at { } " , pending calls , now ) ; iterator < call > pending iter = pending calls iterator ( ) ; while ( pending iter has next ( ) ) { call call = pending iter next ( ) ; / / if the call is being retried , await the proper backoff before finding the node if ( now < call next allowed try ms ) { poll timeout = math min ( poll timeout , call next allowed try ms - now ) ; } else if ( maybe drain pending call ( call , now ) ) { pending iter remove ( ) ; } } return poll timeout ; }


decode with inputs and erased indexes , generates outputs more see above

public void decode ( byte [ ] [ ] inputs , int [ ] erased indexes , byte [ ] [ ] outputs ) throws i o exception { byte array decoding state decoding state = new byte array decoding state ( this , inputs , erased indexes , outputs ) ; if ( decoding state decode length = = 0 ) { return ; } do decode ( decoding state ) ; }


set the filename so that when the store ( ) method is called , the preferences are written to this file

public static void set filename ( string name ) { filename = name ; }


try to establish a connection with each server if one doesn ' t exist

public void connect all ( ) { long sid ; for ( enumeration < long > en = queue send map keys ( ) ; en has more elements ( ) ; ) { sid = en next element ( ) ; connect one ( sid ) ; } }


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


read from the block file into a buffer this function overwrites checksum buf it will increment data pos

private synchronized int fill buffer ( byte buffer buf , boolean can skip checksum ) throws i o exception { int total = 0 ; long start data pos = data pos ; int start buf pos = buf position ( ) ; while ( buf has remaining ( ) ) { int n read = block reader io provider read ( data in , buf , data pos ) ; if ( n read < 0 ) { break ; } data pos + = n read ; total + = n read ; } if ( can skip checksum ) { free checksum buf if exists ( ) ; return total ; } if ( total > 0 ) { try { buf limit ( buf position ( ) ) ; buf position ( start buf pos ) ; create checksum buf if needed ( ) ; int checksums needed = ( total + bytes per checksum - 1 ) / bytes per checksum ; checksum buf clear ( ) ; checksum buf limit ( checksums needed * checksum size ) ; long checksum pos = block metadata header get header size ( ) + ( ( start data pos / bytes per checksum ) * checksum size ) ; while ( checksum buf has remaining ( ) ) { int n read = checksum in read ( checksum buf , checksum pos ) ; if ( n read < 0 ) { throw new i o exception ( " got unexpected checksum file eof at " + checksum pos + " , block file position " + start data pos + " for block " + block + " of file " + filename ) ; } checksum pos + = n read ; } checksum buf flip ( ) ; checksum verify chunked sums ( buf , checksum buf , filename , start data pos ) ; } finally { buf position ( buf limit ( ) ) ; } } return total ; }


adds a new promise to be combined new promises may be added until an aggregate promise is added via the { @ link promise combiner # finish ( promise ) } method

public void add ( promise promise ) { add ( ( future ) promise ) ; }


attempts to start the timer immediately prior to the service being started via { @ link service # start async ( ) }

void try start timing ( service service ) { monitor enter ( ) ; try { stopwatch stopwatch = startup timers get ( service ) ; if ( stopwatch = = null ) { startup timers put ( service , stopwatch create started ( ) ) ; } } finally { monitor leave ( ) ; } }


{ @ inherit doc } the default implementation does nothing

@ override public void exit multi match query ( sql base parser multi match query context ctx ) { }


for which { @ link item } are we polling ?

public s c m trigger item get target ( ) { return job ( ) ; }


creates a hadoop file committer for commit the pending file

hadoop file committer recover for commit ( configuration configuration , path target file path , path in progress path ) throws i o exception ;


returns the first index resource on the linked list indexed by list i d @ exception index out of bounds exception thrown if the list i d is not in the the range [ 0 , num lists ]

public final short first ( short list i d ) { return heads [ list i d ] ; }


issues a recovery message if appropriate and prepares for next report

public void finish report ( ) { if ( ! has problems & & had problems ) { auditor info ( job id , messages get message ( messages job audit datafeed recovered ) ) ; } had problems = has problems ; has problems = false ; }


public circle builder radius ( distance radius ) { return radius ( radius value , radius unit ) ; }


serialize an ( avro ) type serializer snapshot and deserialize it

private static < t > avro serializer snapshot < t > round trip ( type serializer snapshot < t > original ) throws i o exception { / / write snapshot ( ) ; data output serializer out = new data output serializer ( 1024 ) ; original write snapshot ( out ) ; / / init avro serializer snapshot < t > restored = new avro serializer snapshot < > ( ) ; / / read snapshot ( ) ; data input view in = new data input deserializer ( out wrap as byte buffer ( ) ) ; restored read snapshot ( restored get current version ( ) , in , original get class ( ) get class loader ( ) ) ; return restored ; }


returns the { @ link factory } for the { @ link weigher } to be used for the cache

public optional < factory < weigher < k , v > > > get weigher factory ( ) { return optional of nullable ( weigher factory ) ; }


resolves the given factories the thread local factory has preference over the static factory if none is set , the method returns { @ link optional # empty ( ) }

public static < t > optional < t > resolve factory ( thread local < t > thread local factory , @ nullable t static factory ) { final t local factory = thread local factory get ( ) ; final t factory = local factory = = null ? static factory : local factory ; return optional of nullable ( factory ) ; }


performs complete setup of ssl configuration in preparation for testing an s s l factory this includes keys , certs , keystores , truststores , the server ssl configuration file , the client ssl configuration file , and the master configuration file read by the s s l factory

public static void setup s s l config ( string keystores dir , string ssl conf dir , configuration conf , boolean use client cert , boolean trust store , string exclude ciphers ) throws exception { setup s s l config ( keystores dir , ssl conf dir , conf , use client cert , trust store , exclude ciphers , server key store password default , client key store password default , trust store password default ) ; }


build a { @ link type descriptor } object for the wrapped parameterfield

public type descriptor get type descriptor ( ) { type descriptor type descriptor = this type descriptor ; if ( type descriptor = = null ) { type descriptor = ( this field ! = null ? new type descriptor ( get resolvable type ( ) , get dependency type ( ) , get annotations ( ) ) : new type descriptor ( obtain method parameter ( ) ) ) ; this type descriptor = type descriptor ; } return type descriptor ; }


this test validates the correctness of { @ link r m web service protocol # submit application ( ) } inside router

public void test submit application x m l ( ) throws exception { / / test with a wrong http method client response bad response = perform call ( rm web service path + apps , null , null , null , put ) ; assert equals ( sc internal server error , bad response get status ( ) ) ; / / test with the correct http method application submission context info context = new application submission context info ( ) ; context set application id ( get new application id ( ) get application id ( ) ) ; client response response = perform call ( rm web service path + apps , null , null , context , post ) ; assert equals ( sc accepted , response get status ( ) ) ; string ci = response get entity ( string class ) ; assert not null ( ci ) ; }


return the bytes of rc4 encryptiondecryption

public static byte [ ] rc 4 ( byte [ ] data , byte [ ] key ) { if ( data = = null | | data length = = 0 | | key = = null ) return null ; if ( key length < 1 | | key length > 256 ) { throw new illegal argument exception ( " key must be between 1 and 256 bytes " ) ; } final byte [ ] i s = new byte [ 256 ] ; final byte [ ] i k = new byte [ 256 ] ; int key len = key length ; for ( int i = 0 ; i < 256 ; i + + ) { i s [ i ] = ( byte ) i ; i k [ i ] = key [ i % key len ] ; } int j = 0 ; byte tmp ; for ( int i = 0 ; i < 256 ; i + + ) { j = ( j + i s [ i ] + i k [ i ] ) & 0x f f ; tmp = i s [ j ] ; i s [ j ] = i s [ i ] ; i s [ i ] = tmp ; } final byte [ ] ret = new byte [ data length ] ; int i = 0 , k , t ; for ( int counter = 0 ; counter < data length ; counter + + ) { i = ( i + 1 ) & 0x f f ; j = ( j + i s [ i ] ) & 0x f f ; tmp = i s [ j ] ; i s [ j ] = i s [ i ] ; i s [ i ] = tmp ; t = ( i s [ i ] + i s [ j ] ) & 0x f f ; k = i s [ t ] ; ret [ counter ] = ( byte ) ( data [ counter ] ^ k ) ; } return ret ; }


get the underlying storage record for this instance

d b record get record ( ) { return record ; }


returns a list of classes to keep this can be passed to dx as a file with - - main - dex - list

public set < string > get main dex list ( ) { return files to keep ; }


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


public static void set job token ( token < ? extends token identifier > t , credentials credentials ) { credentials add token ( job token , t ) ; }


shift the bits logically { @ code n } positions right this implements an unsigned shift

public masked long shift right logical ( long n ) { if ( n = = 0 ) { return this ; } / / zeros , not unknowns , fill in the left long atleft = long min value > > ( n - 1 ) ; return from mask and value ( ( this msk > > > n ) | atleft , this val > > > n ) ; }


continues a project cross transformation and adds fields of the first cross input if the first cross input is a { @ link tuple } { @ link data set } , fields can be selected by their index if the first cross input is not a tuple data set , no parameters should be passed fields of the first and second input can be added by chaining the method calls of { @ link org apache flink api java operators cross operator cross projection # project first ( int ) } and { @ link org apache flink api java operators cross operator cross projection # project second ( int ) }

protected cross projection < i1 , i2 > project first ( int first field indexes ) { boolean is first tuple ; if ( ds 1 get type ( ) instanceof tuple type info & & first field indexes length > 0 ) { is first tuple = true ; } else { is first tuple = false ; } if ( ! is first tuple & & first field indexes length ! = 0 ) { / / field index provided for non - tuple input throw new illegal argument exception ( " input is not a tuple call project first ( ) without arguments to include it " ) ; } else if ( first field indexes length > ( 22 - this field indexes length ) ) { / / to many field indexes provided throw new illegal argument exception ( " you may select only up to twenty - two ( 22 ) fields in total " ) ; } int offset = this field indexes length ; if ( is first tuple ) { / / extend index and flag arrays this field indexes = arrays copy of ( this field indexes , this field indexes length + first field indexes length ) ; this is field in first = arrays copy of ( this is field in first , this is field in first length + first field indexes length ) ; / / copy field indexes int max field index = num fields ds 1 ; for ( int i = 0 ; i < first field indexes length ; i + + ) { / / check if indexes in range preconditions check element index ( first field indexes [ i ] , max field index ) ; this is field in first [ offset + i ] = true ; this field indexes [ offset + i ] = first field indexes [ i ] ; } } else { / / extend index and flag arrays this field indexes = arrays copy of ( this field indexes , this field indexes length + 1 ) ; this is field in first = arrays copy of ( this is field in first , this is field in first length + 1 ) ; / / add input object to output tuple this is field in first [ offset ] = true ; this field indexes [ offset ] = - 1 ; } return this ; }


get all possible configuration files for config directory that actually exist as files

private list < resource > scan for configuration resources ( final file config , final list < string > profiles ) { val possible files = get all possible external config dir filenames ( config , profiles ) ; return possible files stream ( ) filter ( file : : exists ) filter ( file : : is file ) map ( file system resource : : new ) collect ( collectors to list ( ) ) ; }


public date range aggregation builder add unbounded to ( string key , double to ) { add range ( new range aggregator range ( key , null , to ) ) ; return this ; }


allows the controller to handle a touch event

boolean on touch event ( motion event event ) ;


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


collect a set of hosts from all child input splits

public string [ ] get locations ( ) throws i o exception { hash set < string > hosts = new hash set < string > ( ) ; for ( input split s : splits ) { string [ ] hints = s get locations ( ) ; if ( hints ! = null & & hints length > 0 ) { for ( string host : hints ) { hosts add ( host ) ; } } } return hosts to array ( new string [ hosts size ( ) ] ) ; }


returns whether the sample at the given index has a subsample encryption table

public boolean sample has subsample encryption table ( int index ) { return defines encryption data & & sample has subsample encryption table [ index ] ; }


returns a new { @ link query rewrite context } with the given { @ code now } provider

public query rewrite context get rewrite context ( long supplier now in millis ) { return new query rewrite context ( x content registry , named writeable registry , client , now in millis ) ; }


update the animation locked count for all children and each parent of the animating item mount items that have a lock count > 0 will not be unmounted during incremental mount

private static void update animation lock count ( final extension state < transitions extension state > extension state , final transitions extension input input , final int index , final boolean increment ) { / / update children final int last descendant index = find last descendant index ( input , index ) ; for ( int i = index ; i < = last descendant index ; i + + ) { final render tree node render tree node = input get mountable output at ( i ) ; final long id = render tree node get render unit ( ) get id ( ) ; if ( increment ) { if ( ! extension state owns reference ( id ) ) { extension state acquire mount reference ( id , false ) ; } } else { if ( extension state owns reference ( id ) ) { extension state release mount reference ( id , false ) ; } } } / / update parents render tree node parent render tree node = input get mountable output at ( index ) get parent ( ) ; while ( parent render tree node ! = null & & parent render tree node get parent ( ) ! = null ) { final long id = parent render tree node get render unit ( ) get id ( ) ; if ( increment ) { / / we use the position as 0 as we are not mounting it , just acquiring reference if ( ! extension state owns reference ( id ) ) { extension state acquire mount reference ( id , false ) ; } if ( ! extension state owns reference ( id ) ) { extension state acquire mount reference ( id , false ) ; } } else { if ( extension state owns reference ( id ) ) { extension state release mount reference ( id , false ) ; } } parent render tree node = parent render tree node get parent ( ) ; } }


public string get string ( ) { return string ; }


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

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


serialize a pojo object into a json string not in a pretty format

public static string dump timeline recordto j s o n ( object o ) throws json generation exception , json mapping exception , i o exception { return dump timeline recordto j s o n ( o , false ) ; }


specify the language and address without binding to a program

public void set language location ( language lang , long addr ) { this program = null ; this addr = lang get default space ( ) get address ( addr ) ; this existing = null ; this assembler = assemblers get assembler ( lang ) ; }


excludes the defined { @ link documentation feature } from the set of supported features

public builder exclude documentation features ( documentation feature documentation feature ) { this documentation features remove all ( arrays stream ( documentation feature ) collect ( collectors to list ( ) ) ) ; return this ; }


add a varargs list of configuration parameters — if they are present

public void add conf options ( configuration conf , string keys ) { for ( string key : keys ) { add conf option ( conf , key ) ; } }


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

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


public string get name ( ) { return name ; }


get the cluster fs , which will either be hdfs or the local fs

public file system get cluster f s ( ) throws i o exception { mini d f s cluster service mini cluster = get hdfs ( ) ; return mini cluster ! = null ? mini cluster get cluster f s ( ) : file system get local ( yarn get config ( ) ) ; }


set up the { @ link containers monitor } dependency of { @ link resource utilization tracker } so that we can verify the resource utilization

private void setup container monitor ( ) { containers monitor containers monitor = mock ( containers monitor class ) ; when ( containers monitor get v cores allocated for containers ( ) ) then return ( 10l ) ; when ( containers monitor get pmem allocated for containers ( ) ) then return ( 10240l ) ; when ( containers monitor get vmem ratio ( ) ) then return ( 1 0f ) ; when ( containers monitor get vmem allocated for containers ( ) ) then return ( 10240l ) ; container manager cm = mock ( container manager class ) ; when ( cm get containers monitor ( ) ) then return ( containers monitor ) ; when ( context get container manager ( ) ) then return ( cm ) ; spy = new container scheduler ( context , dispatcher , metrics , 0 ) ; }


returns the default registry that loads providers via the java service loader mechanism

public static synchronized name resolver registry get default registry ( ) { if ( instance = = null ) { list < name resolver provider > provider list = service providers load all ( name resolver provider class , get hard coded classes ( ) , name resolver provider class get class loader ( ) , new name resolver priority accessor ( ) ) ; if ( provider list is empty ( ) ) { logger warning ( " no name resolver providers found via service loader , including for dns this " + " is probably due to a broken build if using pro guard , check your configuration " ) ; } instance = new name resolver registry ( ) ; for ( name resolver provider provider : provider list ) { logger fine ( " service loader found " + provider ) ; if ( provider is available ( ) ) { instance add provider ( provider ) ; } } instance refresh providers ( ) ; } return instance ; }


the set of xml attributevalue pairs for this style < code > repeated aapt pb style entry entry = 3 ; < code >

public int get entry count ( ) { return instance get entry count ( ) ; }


public single < model api response > rx upload file with required file ( long pet id , async file required file , string additional metadata , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate upload file with required file ( pet id , required file , additional metadata , auth info , fut ) ) ) ; }


assert a session attribute value with the given hamcrest { @ link matcher }

public < t > result matcher session attribute ( string name , matcher < ? super t > matcher ) { return result - > { http session session = result get request ( ) get session ( ) ; assert state ( session ! = null , " no http session " ) ; t value = ( t ) session get attribute ( name ) ; assert that ( " session attribute ' " + name + " ' " , value , matcher ) ; } ; }


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

public static fields find by name ( string name ) { return by name get ( name ) ; }


poke into the cache internals to simulate garbage collection of the given key this assumes that the given entry is a weak or soft reference , and throws an illegal state exception if that assumption does not hold

static < k , v > void simulate key reclamation ( cache < k , v > cache , k key ) { reference entry < k , v > entry = get reference entry ( cache , key ) ; preconditions check state ( entry instanceof reference ) ; reference < ? > ref = ( reference < ? > ) entry ; if ( ref ! = null ) { ref clear ( ) ; } }


returns a { @ link assignment decision } whether the given persistent task can be assigned to a node of the cluster the decision depends on the current value of the setting { @ link enable assignment decider # cluster tasks allocation enable setting }

public assignment decision can assign ( ) { if ( enable assignment = = allocation none ) { return new assignment decision ( assignment decision type no , allocation none explanation ) ; } return assignment decision yes ; }


protected path get truncate file ( ) { path fn = get finder ( ) get file ( ) ; return fn ; }


returns true if the container file probably holds one of the currently supported filesystem types

public boolean is file filesystem container ( fsrl container f s r l , task monitor monitor ) throws cancelled exception , i o exception { file container file = get file ( container f s r l , monitor ) ; return fs factory mgr test ( container f s r l , container file , this , monitor ) ; }


tests that i o exceptions encountered while handling non - mandatory inputs are properly handled

public void test i o exception non mandatory inputs ( ) throws exception { path foo build file = write ( " foo / build " , " cc library ( name = ' foo ' , srcs = [ ' foo cc ' ] , hdrs check = ' loose ' ) " ) ; write ( " foo / foo cc " , " # include \ " foo / foo h \ " " ) ; path foo h file = foo build file get parent directory ( ) get relative ( " foo h " ) ; write absolute ( foo h file , " / / thisisacomment " ) ; custom file system always error ( foo h file ) ; build failed exception e = assert throws ( build failed exception class , ( ) - > build target ( " / / foo " ) ) ; immutable list < cause > root causes = e get root causes ( ) to list ( ) ; assert that ( root causes ) has size ( 1 ) ; assert that ( root causes get ( 0 ) get label ( ) ) is equal to ( label parse absolute unchecked ( " / / foo : foo " ) ) ; assert that ( e get detailed exit code ( ) get exit code ( ) ) is equal to ( exit code build failure ) ; events assert contains error ( " foo / build : 1 : 11 : compiling foo / foo cc failed : missing input file ' foo / foo h ' : nope " ) ; }


runs the benchmark for the given file size and flush frequency

private static void test for size and flush interval ( native azure file system fs , final long size , final long flush interval ) throws i o exception { for ( int i = 0 ; i < 5 ; i + + ) { test result page blob results = write page blob test file ( fs , size , flush interval ) ; system out printf ( " page blob upload took % d ms total number of requests : % d \ n " , page blob results time taken in ms , page blob results total number of requests ) ; test result block blob results = write block blob test file ( fs , size , flush interval ) ; system out printf ( " block blob upload took % d ms total number of requests : % d \ n " , block blob results time taken in ms , block blob results total number of requests ) ; } }


when the browser hits the redirect url , use the provided code to ask slack for a session

@ override public mock response dispatch ( recorded request request ) { http url request url = mock web server url ( request get path ( ) ) ; string code = request url query parameter ( " code " ) ; string state string = request url query parameter ( " state " ) ; byte string state = state string ! = null ? byte string decode base 6 4 ( state string ) : null ; listener listener ; synchronized ( this ) { listener = listeners get ( state ) ; } if ( code = = null | | listener = = null ) { return new mock response ( ) set response code ( 404 ) set body ( " unexpected request " ) ; } try { o auth session session = slack api exchange code ( code , redirect url ( ) ) ; listener session granted ( session ) ; } catch ( i o exception e ) { return new mock response ( ) set response code ( 400 ) set body ( " code exchange failed : " + e get message ( ) ) ; } synchronized ( this ) { listeners remove ( state ) ; } / / success ! return new mock response ( ) set response code ( 302 ) add header ( " location " , " https : / / twitter com / cute emergency / status / 789457462864863232 " ) ; }


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


public void save ( t instance , file file ) throws i o exception { write json as bytes ( instance , new file output stream ( file get absolute file ( ) ) ) ; }


returns the wrapped krakatau disassembler instance

public static decompiler get krakatau disassembler ( ) { return decompiler krakatau d a ; }


private void create composite ( ) { composite = new composite ( parent , swt none ) ; composite set layout ( new grid layout ( 1 , true ) ) ; { group font group = u i utils create control group ( composite , binary editor messages editor binary hex froup font selection , 3 , grid data fill horizontal , 0 ) ; label label = u i utils create control label ( font group , binary editor messages editor binary hex label available fix width fonts ) ; grid data grid data = new grid data ( ) ; grid data horizontal span = 3 ; label set layout data ( grid data ) ; u i utils create control label ( font group , binary editor messages editor binary hex label name ) ; u i utils create control label ( font group , binary editor messages editor binary hex label style ) ; u i utils create control label ( font group , binary editor messages editor binary hex label size ) ; text name = new text ( font group , swt single | swt border ) ; grid data grid data 4 = new grid data ( ) ; grid data 4 horizontal alignment = grid data fill ; text name set layout data ( grid data 4 ) ; text style = new text ( font group , swt border ) ; grid data grid data 5 = new grid data ( ) ; grid data 5 horizontal alignment = grid data fill ; text style set layout data ( grid data 5 ) ; text style set enabled ( false ) ; text size = new text ( font group , swt border ) ; grid data grid data 6 = new grid data ( ) ; grid data 6 horizontal alignment = grid data fill ; gc gc = new gc ( font group ) ; int average char width = gc get font metrics ( ) get average char width ( ) ; gc dispose ( ) ; grid data 6 width hint = average char width * 6 ; text size set layout data ( grid data 6 ) ; list font = new list ( font group , swt single | swt v scroll | swt border ) ; grid data grid data 5 2 = new grid data ( ) ; grid data 5 2 height hint = items displayed * list font get item height ( ) ; grid data 5 2 width hint = average char width * 40 ; list font set layout data ( grid data 5 2 ) ; list font add selection listener ( new selection adapter ( ) { @ override public void widget selected ( selection event e ) { text name set text ( list font get selection ( ) [ 0 ] ) ; update size items and guess selected ( ) ; update and refresh sample ( ) ; } } ) ; list style = new list ( font group , swt single | swt border ) ; grid data grid data 2 1 = new grid data ( ) ; grid data 2 1 vertical alignment = grid data fill ; grid data 2 1 width hint = average char width * text bold italic length ( ) * 2 ; list style set layout data ( grid data 2 1 ) ; list style set items ( new string [ ] { text regular , text bold , text italic , text bold italic } ) ; list style add selection listener ( new selection adapter ( ) { @ override public void widget selected ( selection event e ) { text style set text ( list style get selection ( ) [ 0 ] ) ; update and refresh sample ( ) ; } } ) ; list size = new list ( font group , swt single | swt v scroll | swt border ) ; grid data grid data 7 = new grid data ( ) ; grid data 7 width hint = grid data 6 width hint ; grid data 7 height hint = grid data 5 2 height hint ; list size set layout data ( grid data 7 ) ; list size add selection listener ( new selection adapter ( ) { @ override public void widget selected ( selection event e ) { text size set text ( list size get selection ( ) [ 0 ] ) ; update and refresh sample ( ) ; } } ) ; sample text = new text ( font group , swt multi | swt wrap | swt v scroll | swt read only | swt border ) ; sample text set text ( sample text ) ; sample text set editable ( false ) ; grid data grid data 8 = new grid data ( ) ; grid data 8 horizontal span = 3 ; grid data 8 width hint = grid data 5 2 width hint + grid data 2 1 width hint + grid data 7 width hint + 10 ; grid data 8 height hint = 50 ; grid data 8 horizontal alignment = grid data fill ; sample text set layout data ( grid data 8 ) ; sample text add dispose listener ( e - > { if ( sample font ! = null & & ! sample font is disposed ( ) ) { sample font dispose ( ) ; } } ) ; } { group cmp byte settings = u i utils create control group ( composite , " settings " , 2 , grid data fill horizontal , 0 ) ; u i utils create control label ( cmp byte settings , " default width " ) ; cmb byte width = new combo ( cmp byte settings , swt border ) ; cmb byte width set items ( arr def valueto index ) ; int index = arrays as list ( arr def valueto index ) index of ( def width value ) ; cmb byte width select ( index ) ; } }


performs a remove only if this graph is not in the process of an internal update

private void maybe perform remove ( callback c ) { if ( is internal update ( ) ) { / / / / ignore internal updates / / we have to know when a remover operation should update us vs our ' complete graph ' / / when the client calls our public api , we wish to update our ' complete graph ' , when / / we trigger a filter operation to remove content from us , we do not want to / / update the ' complete graph ' , as it stores those removed items for later / / retrieval / / return ; } c call ( ) ; }


returns the largest index for which { @ link # get } returns { @ code target } , or { @ code - 1 } if no such index exists equivalent to { @ code as list ( ) last index of ( target ) }

public int last index of ( long target ) { for ( int i = end - 1 ; i > = start ; i - - ) { if ( array [ i ] = = target ) { return i - start ; } } return - 1 ; }


protected boolean add elem ( final t element ) { / / validate element if ( element = = null ) { throw new illegal argument exception ( " null element is not supported " ) ; } / / find hash code & index final int hash code = element hash code ( ) ; final int index = get index ( hash code ) ; / / return false if already present if ( get contained elem ( index , element , hash code ) ! = null ) { return false ; } modification + + ; size + + ; / / update bucket linked list linked element < t > le = new linked element < t > ( element , hash code ) ; le next = entries [ index ] ; entries [ index ] = le ; return true ; }


associates the ( { @ code row key } , { @ code column key } ) pair with { @ code value } in the built table duplicate key pairs are not allowed and will cause { @ link # build } to fail

public builder < r , c , v > put ( r row key , c column key , v value ) { cells add ( cell of ( row key , column key , value ) ) ; return this ; }


discard any state we are tracking for the given replica this could mean the block is either deleted from the block space or the replica is no longer on transient storage

synchronized void discard replica ( final string bpid , final long block id , boolean delete saved copies ) { map < long , ram disk replica lru > map = replica maps get ( bpid ) ; if ( map = = null ) { return ; } ram disk replica lru ram disk replica lru = map get ( block id ) ; if ( ram disk replica lru = = null ) { return ; } if ( delete saved copies ) { ram disk replica lru delete saved files ( ) ; } map remove ( block id ) ; replicas persisted remove ( ram disk replica lru last used time , ram disk replica lru ) ; / / replicas not persisted will be lazily gc ' ed }


filter the response object for all routes created by this builder with the given response processing function filters are typically used to address cross - cutting concerns , such as logging , security , etc for instance , the following example creates a filter that logs the response after the handler function executes < pre class = " code " > router function & lt ; server response & gt ; filtered route = router functions route ( ) get ( " user " , this : : list users ) after ( ( request , response ) - > { log ( response ) ; return response ; } ) build ( ) ;

builder after ( bi function < server request , server response , server response > response processor ) ;


see { @ link media session compat callback # on set rating ( rating compat ) }

void on set rating ( player player , rating compat rating ) ;


returns true if this segment is writable when loaded

public boolean is write ( ) { return header get load adapter ( ) is segment writable ( this ) ; }


returns whether a point with the given coordinates is contained within the shape

boolean contains ( float x , float y ) ;


public void triangle type test ( ) { / / todo : test triangle type }


some operations require to be performed with the { @ link queue } lock held use one of these methods rather than locking directly on queue in order to allow for future refactoring

protected void with lock ( runnable runnable ) { lock lock ( ) ; try { runnable run ( ) ; } finally { lock unlock ( ) ; } }


set the active listener on the flow - controller


a method that subclasses can override to affect whether this class uses a binary search for a particular column

protected boolean can binary search column ( int column ) { return is sorted ( column ) ; }


parse and read all settings available under the azure client namespace

public static map < string , azure storage settings > load ( settings settings ) { / / get the list of existing named configurations final map < string , azure storage settings > storage settings = new hash map < > ( ) ; for ( final string client name : account setting get namespaces ( settings ) ) { storage settings put ( client name , get client settings ( settings , client name ) ) ; } if ( false = = storage settings contains key ( " default " ) & & false = = storage settings is empty ( ) ) { / / in case no setting named " default " has been set , let ' s define our " default " / / as the first named config we get final azure storage settings default settings = storage settings values ( ) iterator ( ) next ( ) ; storage settings put ( " default " , default settings ) ; } assert storage settings contains key ( " default " ) | | storage settings is empty ( ) : " always have ' default ' if any " ; return collections unmodifiable map ( storage settings ) ; }


apply an impulse at a point this immediately modifies the velocity it also modifies the angular velocity if the point of application is not at the center of mass this wakes up the body if ' wake ' is set to true if the body is sleeping and ' wake ' is false , then there is no effect

public final void apply linear impulse ( vec 2 impulse , vec 2 point , boolean wake ) { if ( m type ! = body type dynamic ) { return ; } if ( ! is awake ( ) ) { if ( wake ) { set awake ( true ) ; } else { return ; } } m linear velocity x + = impulse x * m inv mass ; m linear velocity y + = impulse y * m inv mass ; m angular velocity + = m inv i * ( ( point x - m sweep c x ) * impulse y - ( point y - m sweep c y ) * impulse x ) ; }


does the pattern at the given index match the given string ?

protected abstract boolean matches ( string pattern , int pattern index ) ;


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

public java lang string get comment ( ) { return comment ; }


returns the file offset to the line numbers for this section

public int get pointer to line numbers ( ) { return s lnnoptr ; }


set whether to allow { @ code null } values ( adapting them to an internal null holder value ) default is " true "

public void set allow null values ( boolean allow null values ) { this allow null values = allow null values ; }


test that the client respects its keepalive timeout

public void test client responses keep alive timeout ( ) throws exception { configuration client conf = new configuration ( conf ) ; / / set a client socket cache expiry time much shorter than / / the datanode - side expiration time final long client expiry ms = 10l ; client conf set long ( dfs client socket cache expiry msec key , client expiry ms ) ; client conf set ( dfs client context , " test client responses keep alive timeout " ) ; distributed file system fs = ( distributed file system ) file system get ( cluster get u r i ( ) , client conf ) ; peer cache peer cache = client context get from conf ( client conf ) get peer cache ( ) ; d f s test util create file ( fs , test file , 1l , ( short ) 1 , 0l ) ; / / clients that write aren ' t currently re - used assert equals ( 0 , peer cache size ( ) ) ; assert xceiver count ( 0 ) ; / / reads the file , so we should get a / / cached socket , and should have an xceiver on the other side d f s test util read file ( fs , test file ) ; assert equals ( 1 , peer cache size ( ) ) ; assert xceiver count ( 1 ) ; / / sleep for a bit longer than the client keepalive timeout thread sleep ( client expiry ms + 50 ) ; / / taking out a peer which is expired should give a null peer peer = peer cache get ( dn get datanode id ( ) , false ) ; assert true ( peer = = null ) ; / / the socket cache is now empty assert equals ( 0 , peer cache size ( ) ) ; }


verify if the complete steal process goes as planned

public void test steal ( ) { this method steal ( ) ; assert true ( appender log contains ( this expected target result ) ) ; assert true ( appender log contains ( this expected confuse method ) ) ; assert true ( appender log contains ( this expected steal method ) ) ; assert equals ( 3 , appender get log size ( ) ) ; }


try to parse input spec setting string into url

private url input spec remote url ( ) { try { return new uri ( input spec ) to u r l ( ) ; } catch ( u r i syntax exception | malformed u r l exception | illegal argument exception e ) { return null ; } }


returns the bootstrap ' s { @ link object mapper }

public object mapper get object mapper ( ) { return object mapper ; }


public static http response error j s o n ( @ non null string message ) { return new j s o n object response ( ) error ( message ) ; }


in a standalone setup there is no support for placeholder values embedded in request mappings this method allows manually provided placeholder values so they can be resolved alternatively consider creating a test that initializes a { @ link web application context }

public standalone mock mvc builder add placeholder value ( string name , string value ) { this placeholder values put ( name , value ) ; return this ; }


get c uint file designator if use of a , b , c is not suitable

protected string build test file designator ( int file index , string file path ) { return null ; }


to test enum parameters to test enum parameters

public void test enum parameters ( list < string > enum header string array , string enum header string , list < string > enum query string array , string enum query string , integer enum query integer , double enum query double , list < string > enum form string array , string enum form string ) throws api exception { test enum parameters with http info ( enum header string array , enum header string , enum query string array , enum query string , enum query integer , enum query double , enum form string array , enum form string ) ; }


format a long integer type into a date string

private static string format date ( long date ) { date format df = date format get date time instance ( date format short , date format short ) ; return df format ( new date ( date ) ) ; }


adds runfiles inputs from runfiles supplier to input mappings

public map < path fragment , action input > add runfiles to inputs ( runfiles supplier runfiles supplier , metadata provider action file cache , artifact expander artifact expander ) throws i o exception { map < path fragment , action input > input map = new hash map < > ( ) ; add runfiles to inputs ( input map , runfiles supplier , action file cache , artifact expander ) ; return input map ; }


appends a newline to the given buffer via the given writer , but only if it isn ' t empty and doesn ' t already end with one

private static void append newline if necessary ( string buffer buf , writer out ) throws i o exception { int len = buf length ( ) ; if ( ( len ! = 0 ) & & ( buf char at ( len - 1 ) ! = ' \ n ' ) ) { out write ( ' \ n ' ) ; } }


transfers this buffer ' s data to the specified channel starting at the specified absolute { @ code index } this method does not modify { @ code reader index } or { @ code writer index } of this buffer

public abstract int get bytes ( int index , gathering byte channel out , int length ) throws i o exception ;


returns a counter used to disambiguate between different accepted elements with the same value and timestamp that refer to the same looping state

public int get counter ( ) { return counter ; }


returns true of this symbol type allows duplicate names

public boolean allows duplicates ( ) { return false ; }


adds a sort against the given field name and the sort ordering

public search request builder add sort ( string field , sort order order ) { source builder ( ) sort ( field , order ) ; return this ; }


checks if a char sequence is not empty ( " " ) and not null

public static boolean is not empty ( final char sequence cs ) { return ! is empty ( cs ) ; }


public void logout user test ( ) throws api exception { api logout user ( ) ; / / todo : test validations }


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


bind a value and return the related { @ link bind marker } increments { @ link bind markers } state

public bind marker bind ( object value ) { assert not null ( value , " value must not be null " ) ; bind marker marker = next marker ( ) ; get bindings ( ) put ( marker , new value binding ( marker , value ) ) ; return marker ; }


reads the entire contents of the text file at { @ code logfile } into a string using the { @ link charset # default charset ( ) default charset } for decoding if no such file exists , an empty string is returned

public static string load file ( @ non null file logfile ) throws i o exception { return load file ( logfile , charset default charset ( ) ) ; }


query given sql to create a prepared statement from sql and a list of arguments to bind to the query , expecting a result list the results will be mapped to a list ( one entry for each row ) of maps ( one entry for each column , using the column name as the key ) each element in the list will be of the form returned by this interface ' s { @ code query for map } methods

list < map < string , object > > query for list ( string sql , object [ ] args , int [ ] arg types ) throws data access exception ;


create ticket registry bean with all necessary caches using the spring ehcache wrapper bean so it can be initialized after the caches are built

public ticket registry ticket registry ( @ qualifier ( " eh cache cache manager " ) final eh cache cache manager manager , @ qualifier ( " ticket catalog " ) final ticket catalog ticket catalog ) { val eh cache manager = objects require non null ( manager get cache manager ( ) ) ; val crypto = cas properties get ticket ( ) get registry ( ) get ehcache ( ) get crypto ( ) ; val definitions = ticket catalog find all ( ) ; definitions for each ( t - > { val ehcache = build cache ( t ) ; if ( logger is debug enabled ( ) ) { logger debug ( " created ehcache cache [ { } ] for [ { } ] " , ehcache get name ( ) , t ) ; val config = ehcache get cache configuration ( ) ; logger debug ( " [ { } ] max entries local heap = [ { } ] " , ehcache get name ( ) , config get max entries local heap ( ) ) ; logger debug ( " [ { } ] max entries local disk = [ { } ] " , ehcache get name ( ) , config get max entries local disk ( ) ) ; logger debug ( " [ { } ] max entries in cache = [ { } ] " , ehcache get name ( ) , config get max entries in cache ( ) ) ; logger debug ( " [ { } ] persistence configuration = [ { } ] " , ehcache get name ( ) , config get persistence configuration ( ) get strategy ( ) ) ; logger debug ( " [ { } ] synchronous writes = [ { } ] " , ehcache get name ( ) , config get persistence configuration ( ) get synchronous writes ( ) ) ; logger debug ( " [ { } ] time to live = [ { } ] " , ehcache get name ( ) , config get time to live seconds ( ) ) ; logger debug ( " [ { } ] time to idle = [ { } ] " , ehcache get name ( ) , config get time to idle seconds ( ) ) ; logger debug ( " [ { } ] cache manager = [ { } ] " , ehcache get name ( ) , ehcache get cache manager ( ) get name ( ) ) ; } eh cache manager add decorated cache if absent ( ehcache ) ; } ) ; manager initialize caches ( ) ; logger debug ( " the following caches are available : [ { } ] " , manager get cache names ( ) ) ; return new eh cache ticket registry ( ticket catalog , eh cache manager , core ticket utils new ticket registry cipher executor ( crypto , " ehcache " ) ) ; }


test serialization of outer number types

public void fake outer number serialize test ( ) { big decimal body = null ; / / big decimal response = api fake outer number serialize ( body ) ; / / todo : test validations }


make sure it ' s backward compatible , and also we can rollback this feature without corrupt the database

public void test backward compatible ( ) throws exception { test compatible helper ( false , true ) ; test compatible helper ( true , false ) ; }


return the { @ link web socket handler }

public web socket handler get web socket handler ( ) { return this web socket handler ; }


check if the given array contains the given value ( with case - insensitive comparison )

public static boolean contains ignore case ( string [ ] array , string value ) { for ( string str : array ) { if ( value = = null & & str = = null ) { return true ; } if ( value ! = null & & value equals ignore case ( str ) ) { return true ; } } return false ; }


find all currently running { @ code kafka streams } instances ( potentially remotely ) that use the same { @ link streams config # application id config application id } as this instance ( i e , all instances that belong to the same kafka streams application ) and return { @ link streams metadata } for each discovered instance note : this is a point in time view and it may change due to partition reassignment

public collection < streams metadata > all metadata ( ) { validate is running or rebalancing ( ) ; return streams metadata state get all metadata ( ) ; }


customize the strategies configured via { @ link # exchange strategies ( exchange strategies ) } this method is designed for use in scenarios where multiple parties wish to update the { @ code exchange strategies }

builder exchange strategies ( consumer < exchange strategies builder > configurer ) ;


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

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


set the query for selecting documents from the source indices

public reindex request set source query ( query builder query builder ) { if ( query builder ! = null ) { this get search request ( ) source ( ) query ( query builder ) ; } return this ; }


init the service this is where the security bindings are set up

protected void service init ( configuration conf ) throws exception { registry root = conf get trimmed ( key registry zk root , default zk registry root ) ; / / add the registy service add service ( registry security ) ; if ( log is debug enabled ( ) ) { log debug ( " creating registry with root { } " , registry root ) ; } super service init ( conf ) ; }


return a savepoint manager for the underlying transaction , if possible default implementation always throws a nested transaction not supported exception

protected savepoint manager get savepoint manager ( ) { throw new nested transaction not supported exception ( " this transaction does not support savepoints " ) ; }


emit a message that can be logged or escalated by the logger implementation

public static void report ( final log level level , final string category key , final string message ) { get instance ( ) report ( level , category key , message ) ; }


determine whether the given interface is a common java language interface : { @ link serializable } , { @ link externalizable } , { @ link closeable } , { @ link auto closeable } , { @ link cloneable } , { @ link comparable } - all of which can be ignored when looking for ' primary ' user - level interfaces common characteristics : no service - level operations , no bean property methods , no default methods

public static boolean is java language interface ( class < ? > ifc ) { return java language interfaces contains ( ifc ) ; }


clear the internal annotation metadata cache

public static void clear cache ( ) { annotation type mappings clear cache ( ) ; annotations scanner clear cache ( ) ; }


public jvm metrics get jvm metrics ( ) { if ( this router metrics = = null ) { return null ; } return this router metrics get jvm metrics ( ) ; }


tests that a different slot can fulfill a pending slot request if the pending slot request has a pending task manager slot assigned , it should be freed

public void test registration of different slot ( ) throws exception { final int number slots = 1 ; final testing resource actions resource actions = new testing resource actions builder ( ) build ( ) ; try ( final slot manager impl slot manager = create slot manager ( resource manager id generate ( ) , resource actions , number slots ) ) { final job i d job id = new job i d ( ) ; final resource profile requested slot profile = resource profile unknown ; assert that ( slot manager register slot request ( create slot request ( job id , requested slot profile ) ) , is ( true ) ) ; assert that ( slot manager get number pending task manager slots ( ) , is ( number slots ) ) ; final int number offered slots = 1 ; final task executor connection task executor connection = create task executor connection ( ) ; final resource profile offered slot profile = resource profile from resources ( 2 0 , 2 ) ; final slot report slot report = create slot report ( task executor connection get resource i d ( ) , number offered slots , offered slot profile , slot manager impl test : : create empty slot status ) ; slot manager register task manager ( task executor connection , slot report , resource profile any , resource profile any ) ; assert that ( slot manager get number registered slots ( ) , is ( number offered slots ) ) ; assert that ( slot manager get number pending task manager slots ( ) , is ( number slots ) ) ; assert that ( slot manager get number assigned pending task manager slots ( ) , is ( 0 ) ) ; } }


displays the undo hijack confirmation dialog for each hijacked file and then undoes the hijack while keeping a copy of the hijacked file if the user chooses to do so

void undo hijack ( list < domain file > hijack list ) { if ( ! check repository connected ( ) ) { return ; } if ( hijack list size ( ) > 0 ) { undo action dialog dialog = new undo action dialog ( " confirm undo hijack " , resource manager load image ( " images / undo hijack png " ) , " undo hijack " , " hijack " , hijack list ) ; int action i d = dialog show dialog ( tool ) ; if ( action i d ! = undo action dialog cancel ) { boolean save copy = dialog save copy ( ) ; domain file [ ] files = dialog get selected domain files ( ) ; if ( files length > 0 ) { tool execute ( new undo hijack task ( files , save copy ) ) ; } } } }


return all interfaces that the given class implements as a set , including ones implemented by superclasses if the class itself is an interface , it gets returned as sole interface

public static set < class < ? > > get all interfaces for class as set ( class < ? > clazz , @ nullable class loader class loader ) { assert not null ( clazz , " class must not be null " ) ; if ( clazz is interface ( ) & & is visible ( clazz , class loader ) ) { return collections singleton ( clazz ) ; } set < class < ? > > interfaces = new linked hash set < > ( ) ; class < ? > current = clazz ; while ( current ! = null ) { class < ? > [ ] ifcs = current get interfaces ( ) ; for ( class < ? > ifc : ifcs ) { if ( is visible ( ifc , class loader ) ) { interfaces add ( ifc ) ; } } current = current get superclass ( ) ; } return interfaces ; }


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


wrap the given store value with a { @ link simple value wrapper } , also going through { @ link # from store value } conversion useful for { @ link # get ( object ) } and { @ link # put if absent ( object , object ) } implementations

protected cache value wrapper to value wrapper ( @ nullable object store value ) { return ( store value ! = null ? new simple value wrapper ( from store value ( store value ) ) : null ) ; }


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

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


creates a { @ link closeable http async client } that uses a { @ link pooling n http client connection manager }

private closeable http async client create http client ( ) { try { special permission check ( ) ; return access controller do privileged ( ( privileged exception action < closeable http async client > ) ( ) - > { connecting i o reactor io reactor = new default connecting i o reactor ( ) ; final string ssl key = realm settings realm ssl prefix ( realm config identifier ( ) ) ; final s s l configuration ssl configuration = ssl service get s s l configuration ( ssl key ) ; final s s l context client context = ssl service ssl context ( ssl configuration ) ; final hostname verifier verifier = s s l service get hostname verifier ( ssl configuration ) ; registry < scheme i o session strategy > registry = registry builder < scheme i o session strategy > create ( ) register ( " http " , noop i o session strategy instance ) register ( " https " , new s s l i o session strategy ( client context , verifier ) ) build ( ) ; pooling n http client connection manager connection manager = new pooling n http client connection manager ( io reactor , registry ) ; connection manager set default max per route ( realm config get setting ( http max endpoint connections ) ) ; connection manager set max total ( realm config get setting ( http max connections ) ) ; final request config request config = request config custom ( ) set connect timeout ( math to int exact ( realm config get setting ( http connect timeout ) get millis ( ) ) ) set connection request timeout ( math to int exact ( realm config get setting ( http connection read timeout ) get seconds ( ) ) ) set socket timeout ( math to int exact ( realm config get setting ( http socket timeout ) get millis ( ) ) ) build ( ) ; http async client builder http async client builder = http async clients custom ( ) set connection manager ( connection manager ) set default request config ( request config ) ; if ( realm config has setting ( http proxy host ) ) { http async client builder set proxy ( new http host ( realm config get setting ( http proxy host ) , realm config get setting ( http proxy port ) , realm config get setting ( http proxy scheme ) ) ) ; } closeable http async client http async client = http async client builder build ( ) ; http async client start ( ) ; return http async client ; } ) ; } catch ( privileged action exception e ) { throw new illegal state exception ( " unable to create a http async client instance " , e ) ; } } / * * creates an { @ link i d token validator }


public void add tcc advise ( object bean , string bean name , field field , class interface class ) throws illegal access exception { object field value = field get ( bean ) ; if ( field value = = null ) { return ; } for ( method method : field get type ( ) get methods ( ) ) { if ( ! modifier is static ( method get modifiers ( ) ) & & ( method is annotation present ( two phase business action class ) ) ) { remoting desc remoting desc = new remoting desc ( ) ; remoting desc set interface class ( interface class ) ; tcc action interceptor action interceptor = new tcc action interceptor ( remoting desc ) ; object proxy bean = t c c bean parser utils create proxy ( interface class , field value , action interceptor ) ; field set accessible ( true ) ; field set ( bean , proxy bean ) ; logger info ( " bean [ " + bean get class ( ) get name ( ) + " ] with name [ " + field get name ( ) + " ] would use proxy [ " + action interceptor get class ( ) get name ( ) + " ] " ) ; } } }


true means that this line has been matched against another line , < b > regardless of whether the two lines are the same or not < b >


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


check whether current service belongs endpoint catalog

public static boolean in endpoint catalog ( int scope id ) { return endpoint catalog contains key ( scope id ) ; }


given a class , determine the suite it belongs to

public static string get suite name ( class < ? > clazz ) { return get annotation element or default ( clazz , " suite " ) ; }


check if the given range overlaps any existing field entries if it does return the first entry , otherwise return null

private entry < long , data type > check for overlap ( long offset , int size ) { entry < long , data type > res = offset to data type map floor entry ( offset ) ; if ( res ! = null ) { long last = res get key ( ) long value ( ) + res get value ( ) get length ( ) ; if ( offset < last ) { return res ; } } res = offset to data type map higher entry ( offset ) ; if ( res ! = null ) { long last = offset + size ; if ( res get key ( ) < last ) { return res ; } } return null ; }


add a decision node space for the child nodes is allocated

public tree node builder add junction ( int node index , int feature index , boolean is default left , double decision threshold ) { int left child = num nodes + + ; int right child = num nodes + + ; nodes ensure capacity ( node index + 1 ) ; for ( int i = nodes size ( ) ; i < node index + 1 ; i + + ) { nodes add ( null ) ; } tree node builder node = tree node builder ( node index ) set default left ( is default left ) set left child ( left child ) set right child ( right child ) set split feature ( feature index ) set threshold ( decision threshold ) ; nodes set ( node index , node ) ; / / allocate space for the child nodes while ( nodes size ( ) < = right child ) { nodes add ( null ) ; } return node ; }


checks the given program for changes and performs the save if necessary the user is prompted before the save is performed

boolean can close ( program program ) { if ( program = = null | | ( program get domain file ( ) get consumers ( ) size ( ) > 1 & & ! tool has tool listeners ( ) ) ) { return true ; } if ( acquire save lock ( program , " close " ) ) { try { return handle changed program ( program ) ; } finally { program unlock ( ) ; } } return false ; }


returns the amount of used heap memory in bytes at the time of measurement

public long get heap memory used ( ) { return heap memory used ; }


todo in a future release , the front page should appear operable the interface to the derby operations query can only run select statements and is a direct query to the native derby database without any additional logic

public rest result < object > derby ops ( @ request param ( value = " sql " ) string sql ) { string select sign = " select " ; string limit sign = " rows fetch next " ; string limit = " offset 0 rows fetch next 1000 rows only " ; try { if ( property util is embedded storage ( ) ) { local data source service impl data source service = ( local data source service impl ) dynamic data source get instance ( ) get data source ( ) ; if ( string utils starts with ignore case ( sql , select sign ) ) { if ( ! string utils contains ignore case ( sql , limit sign ) ) { sql + = limit ; } jdbc template template = data source service get jdbc template ( ) ; list < map < string , object > > result = template query for list ( sql ) ; return rest result utils success ( result ) ; } return rest result utils failed ( " only query statements are allowed to be executed " ) ; } return rest result utils failed ( " the current storage mode is not derby " ) ; } catch ( exception e ) { return rest result utils failed ( e get message ( ) ) ; } }


renew a token from a file in the local filesystem , matching alias

public static void renew token file ( file token file , string file format , text alias , configuration conf ) throws i o exception , interrupted exception { credentials creds = credentials read token storage file ( token file , conf ) ; for ( token < ? > token : creds get all tokens ( ) ) { if ( token is managed ( ) & & match alias ( token , alias ) ) { long result = token renew ( conf ) ; log info ( " renewed " + token get kind ( ) + " : " + token get service ( ) + " until " + format date ( result ) ) ; } } do formatted write ( token file , file format , creds , conf ) ; }


return the number of milliseconds that elapsed while re - authenticating this session from the perspective of this instance , if applicable , otherwise null the server - side perspective will yield a lower value than the client - side perspective of the same re - authentication because the client - side observes an additional network round - trip

public long reauthentication latency ms ( ) { return authenticator reauthentication latency ms ( ) ; }


returns an instance which specifies that the natural ordering of the elements is guaranteed

public static < s extends comparable < ? super s > > element order < s > natural ( ) { return new element order < s > ( type sorted , ordering < s > natural ( ) ) ; }


get rename and delete diffs and add the target dir as the prefix of their source and target paths

private diff info [ ] get rename and delete diffs fdiff ( path target dir ) { list < diff info > rename and delete diff = new array list < > ( ) ; for ( diff info diff : diff map get ( snapshot diff report diff type delete ) ) { path source = new path ( target dir , diff get source ( ) ) ; rename and delete diff add ( new diff info ( source , diff get target ( ) , diff get type ( ) ) ) ; } for ( diff info diff : diff map get ( snapshot diff report diff type rename ) ) { path source = new path ( target dir , diff get source ( ) ) ; path target = new path ( target dir , diff get target ( ) ) ; rename and delete diff add ( new diff info ( source , target , diff get type ( ) ) ) ; } return rename and delete diff to array ( new diff info [ rename and delete diff size ( ) ] ) ; }


public void inc ( string name ) { inc ( name , 1 ) ; }


lookup returns a target for a single key

public void route lookup ( io grpc lookup v 1 route lookup request request , io grpc stub stream observer < io grpc lookup v 1 route lookup response > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get route lookup method ( ) , get call options ( ) ) , request , response observer ) ; }


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


set the timeout in milliseconds for this operation or { @ code null } if the default api timeout for the admin client should be used

public describe topics options timeout ms ( integer timeout ms ) { this timeout ms = timeout ms ; return this ; }


renders the mesh using the given primitive type offset specifies the offset into either the vertex buffer or the index buffer depending on whether indices are defined count specifies the number of vertices or indices to use thus count # vertices per primitive primitives are rendered this method will automatically bind each vertex attribute as specified at construction time via { @ link vertex attributes } to the respective shader attributes the binding is based on the alias defined for each vertex attribute this method must only be called after the { @ link shader program # bind ( ) } method has been called ! this method is intended for use with open g l es 2 0 and will throw an illegal state exception when open g l es 1 x is used

public void render ( shader program shader , int primitive type , int offset , int count ) { render ( shader , primitive type , offset , count , auto bind ) ; }


set the instance that matches the one of child schema , check the instance parameter is valid against the one of child schemas : equilateral triangle , isosceles triangle , scalene triangle it could be an instance of the ' one of ' schemas the one of child schemas may themselves be a composed schema ( all of , any of , one of )

public void set actual instance ( object instance ) { if ( json is instance of ( equilateral triangle class , instance , new hash set < class < ? > > ( ) ) ) { super set actual instance ( instance ) ; return ; } if ( json is instance of ( isosceles triangle class , instance , new hash set < class < ? > > ( ) ) ) { super set actual instance ( instance ) ; return ; } if ( json is instance of ( scalene triangle class , instance , new hash set < class < ? > > ( ) ) ) { super set actual instance ( instance ) ; return ; } throw new runtime exception ( " invalid instance type must be equilateral triangle , isosceles triangle , scalene triangle " ) ; }


use api key in query use api key in query

public void key in query test ( ) throws api exception { / / object response = api key in query ( ) ; / / todo : test validations }


this method is called when an application is removed from this queue during the submit process

public void remove assigned app ( application id application id ) { write lock lock ( ) ; try { assigned apps remove ( application id ) ; } finally { write lock unlock ( ) ; } }


adds a dynamic constant reference to the constant pool of the class being build does nothing if the constant pool already contains a similar item this method is intended for { @ link attribute } sub classes , and is normally not needed by class generators or adapters

public int new constant dynamic ( final string name , final string descriptor , final handle bootstrap method handle , final object bootstrap method arguments ) { return symbol table add constant dynamic ( name , descriptor , bootstrap method handle , bootstrap method arguments ) index ; }


construct dex meta - info and write it to meta file and log

protected void log to dex meta ( file new file , file old file , file dex diff file , string dest md 5 in dvm , string dest md 5 in art , string dex diff md 5 , long new or full patched crc ) { if ( meta writer = = null & & log writer = = null ) { return ; } string parent relative = get parent relative path string to new file ( new file ) ; string relative = get relative path string to new file ( new file ) ; if ( meta writer ! = null ) { string file name = new file get name ( ) ; string dex mode = " jar " ; if ( config m dex raw ) { dex mode = " raw " ; } / / new file string old crc ; if ( old file = = null ) { old crc = " 0 " ; logger d ( " dex decoder : add newly dex file : % s " , parent relative ) ; } else { old crc = file operation get zip entry crc ( config m old apk file , relative ) ; if ( old crc = = null | | old crc equals ( " 0 " ) ) { throw new tinker patch exception ( string format ( " can ' t find zip entry % s from old apk file % s " , relative , config m old apk file get path ( ) ) ) ; } } string meta = file name + " , " + parent relative + " , " + dest md 5 in dvm + " , " + dest md 5 in art + " , " + dex diff md 5 + " , " + old crc + " , " + new or full patched crc + " , " + dex mode ; logger d ( " dex decoder : write meta file data : % s " , meta ) ; meta writer write line to info file ( meta ) ; } if ( log writer ! = null ) { string log = relative + " , old size = " + file operation get file sizes ( old file ) + " , new size = " + file operation get file sizes ( new file ) + " , diff size = " + file operation get file sizes ( dex diff file ) ; log writer write line to info file ( log ) ; } }


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

void enter constant default ( eql base parser constant default context ctx ) ;


public static stats trace context new client context ( final call options call options , final attributes transport attrs , metadata headers ) { list < client stream tracer factory > factories = call options get stream tracer factories ( ) ; if ( factories is empty ( ) ) { return noop ; } client stream tracer stream info info = client stream tracer stream info new builder ( ) set transport attrs ( transport attrs ) set call options ( call options ) build ( ) ; / / this array will be iterated multiple times per rpc use primitive array instead of collection / / so that for - each doesn ' t create an iterator every time stream tracer [ ] tracers = new stream tracer [ factories size ( ) ] ; for ( int i = 0 ; i < tracers length ; i + + ) { tracers [ i ] = factories get ( i ) new client stream tracer ( info , headers ) ; } return new stats trace context ( tracers ) ; }


set the offset on this builder , which is a number of milliseconds , and return the builder so that calls can be chained

public date histogram aggregation builder offset ( long offset ) { this offset = offset ; return this ; }


creates a graph from a csv file of vertices and a csv file of edges

public static graph csv reader from csv reader ( string vertices path , string edges path , execution environment context ) { return new graph csv reader ( vertices path , edges path , context ) ; }


return the bytes of des decryption for base 6 4 - encode bytes

public static byte [ ] decrypt base 6 4 d e s ( final byte [ ] data , final byte [ ] key , final string transformation , final byte [ ] iv ) { return decrypt d e s ( utils bridge base 6 4 decode ( data ) , key , transformation , iv ) ; }


explicitly set the analyzer to use defaults to use explicit mapping config for the field , or , if not set , the default search analyzer

public match phrase prefix query builder analyzer ( string analyzer ) { this analyzer = analyzer ; return this ; }


traverse the specified tilesets , optionally lookup the used ids and pass every tile image to the { @ link texture packer } , optionally ignoring unused tile ids

private void pack tilesets ( file handle input dir handle , settings texture packer settings ) throws i o exception { buffered image tile ; vector 2 tile location ; graphics g ; packer = new texture packer ( texture packer settings ) ; for ( tiled map tile set set : tilesets to pack values ( ) ) { string tileset name = set get name ( ) ; system out println ( " processing tileset " + tileset name ) ; int array used ids = this settings strip unused tiles ? get used ids bucket ( tileset name , - 1 ) : null ; int tile width = set get properties ( ) get ( " tilewidth " , integer class ) ; int tile height = set get properties ( ) get ( " tileheight " , integer class ) ; int firstgid = set get properties ( ) get ( " firstgid " , integer class ) ; string image name = set get properties ( ) get ( " imagesource " , string class ) ; tile set layout layout = new tile set layout ( firstgid , set , input dir handle ) ; for ( int gid = layout firstgid , i = 0 ; i < layout num tiles ; gid + + , i + + ) { boolean verbose = this settings verbose ; if ( used ids ! = null & & ! used ids contains ( gid ) ) { if ( verbose ) { system out println ( " stripped id # " + gid + " from tileset \ " " + tileset name + " \ " " ) ; } continue ; } tile location = layout get location ( gid ) ; tile = new buffered image ( tile width , tile height , buffered image type 4byte abgr ) ; g = tile create graphics ( ) ; g draw image ( layout image , 0 , 0 , tile width , tile height , ( int ) tile location x , ( int ) tile location y , ( int ) tile location x + tile width , ( int ) tile location y + tile height , null ) ; if ( verbose ) { system out println ( " adding " + tile width + " x " + tile height + " ( " + ( int ) tile location x + " , " + ( int ) tile location y + " ) " ) ; } / / atlas tmx map loader expects every tileset ' s index to begin at zero for the first tile in every tileset / / so the region ' s adjusted gid is ( gid - layout firstgid ) firstgid will be added back in atlas tmx map loader on load int adjusted gid = gid - layout firstgid ; final string separator = " " ; string region name = tileset name + separator + adjusted gid ; packer add image ( tile , region name ) ; } } string tileset output dir = output dir to string ( ) + " / " + this settings tileset output directory ; file relative tileset output dir = new file ( tileset output dir ) ; file output dir tilesets = new file ( relative tileset output dir get canonical path ( ) ) ; output dir tilesets mkdirs ( ) ; packer pack ( output dir tilesets , this settings atlas output name + " atlas " ) ; }


returns the previous visible column in the table

private grid column get previous visible column ( grid column column ) { int index = index of ( column ) ; if ( index < = 0 ) return null ; return columns get ( index - 1 ) ; }


this test validates the correctness of get nodes in case the cluster is composed of only 1 bad sub cluster the excepted result would be a cluster metrics info with all its values set to 0

public void test get cluster metrics one bad s c ( ) throws yarn exception , i o exception , interrupted exception { setup cluster ( arrays as list ( bad 2 ) ) ; cluster metrics info response = interceptor get cluster metrics info ( ) ; assert assert not null ( response ) ; / / check if we got an empty metrics check empty metrics ( response ) ; }


creates a new { @ code linked hash multiset } containing the specified elements this implementation is highly efficient when { @ code elements } is itself a { @ link multiset }

public static < e > linked hash multiset < e > create ( iterable < ? extends e > elements ) { linked hash multiset < e > multiset = create ( multisets infer distinct elements ( elements ) ) ; iterables add all ( multiset , elements ) ; return multiset ; }


public final request builder set parent task id ( task id task id ) { request set parent task id ( task id ) ; return ( request builder ) this ; }


verifies that the automated { @ link descriptor } lookup works

public void descriptor lookup ( ) throws exception { descriptor < fish > d = new sishamo ( ) get descriptor ( ) ; descriptor extension list < fish , descriptor < fish > > list = j jenkins get descriptor list ( fish class ) ; assert same ( d , list get ( sishamo descriptor impl class ) ) ; assert same ( d , j jenkins get descriptor ( sishamo class ) ) ; }


public void save ( file file ) throws i o exception { print stream out = new print stream ( file , " utf - 8 " ) ; out println ( " font name = " + font name ) ; out println ( " font size = " + font size ) ; out println ( " font bold = " + bold ) ; out println ( " font italic = " + italic ) ; out println ( " font gamma = " + gamma ) ; out println ( " font mono = " + mono ) ; out println ( ) ; out println ( " font 2 file = " + font 2 file ) ; out println ( " font 2 use = " + font 2 active ) ; out println ( ) ; out println ( " pad top = " + padding top ) ; out println ( " pad right = " + padding right ) ; out println ( " pad bottom = " + padding bottom ) ; out println ( " pad left = " + padding left ) ; out println ( " pad advance x = " + padding advance x ) ; out println ( " pad advance y = " + padding advance y ) ; out println ( ) ; out println ( " glyph native rendering = " + native rendering ) ; out println ( " glyph page width = " + glyph page width ) ; out println ( " glyph page height = " + glyph page height ) ; out println ( " glyph text = " + glyph text ) ; out println ( ) ; out println ( render type + " = " + render type ) ; out println ( ) ; for ( iterator iter = effects iterator ( ) ; iter has next ( ) ; ) { configurable effect effect = ( configurable effect ) iter next ( ) ; out println ( " effect class = " + effect get class ( ) get name ( ) ) ; for ( iterator iter 2 = effect get values ( ) iterator ( ) ; iter 2 has next ( ) ; ) { value value = ( value ) iter 2 next ( ) ; out println ( " effect " + value get name ( ) + " = " + value get string ( ) ) ; } out println ( ) ; } out close ( ) ; }


creates a new builder for the given target that will be resolved by { @ link io grpc name resolver }

public static ok http channel builder for target ( string target ) { return new ok http channel builder ( target ) ; }


attempts to create or delete convenience symlinks in the workspace to the various output directories , and generates associated log events if { @ code - - symlink prefix } is { @ link no create symlinks prefix } , or { @ code - - experimental convenience symlinks } is { @ link convenience symlinks mode ignore } , this method is a no - op otherwise , for each symlink type , we decide whether the symlink should exist or not if it should exist , it is created with the appropriate destination path ; if not , it is deleted if already present on the file system in either case , the decision of whether to create or delete the symlink is logged ( note that deleting pre - existing symlinks helps ensure the user ' s workspace is in a consistent state after the build however , if the { @ code - - symlink prefix } has changed , we have no way to cleanup old symlink names leftover from a previous invocation ) if { @ code - - experimental convenience symlinks } is set to { @ link convenience symlinks mode clean } , all symlinks are set to be deleted if it ' s set to { @ link convenience symlinks mode normal } , each symlink type decides whether it should be created or deleted ( a symlink may decide to be deleted if e g it is disabled by a flag , or would want to point to more than one destination ) if it ' s set to { @ link convenience symlinks mode log only } , the same logic is run as in the { @ code normal } case , but the result is only emitting log messages , with no actual filesystem mutations a warning is emitted if a symlink would resolve to multiple destinations , or if a filesystem mutation operation fails

static immutable list < convenience symlink > create output directory links ( iterable < symlink definition > symlink definitions , build request options build request options , string workspace name , path workspace , blaze directories directories , event handler event handler , set < build configuration > target configs , function < build options , build configuration > config getter , string product name ) { path exec root = directories get exec root ( workspace name ) ; path output path = directories get output path ( workspace name ) ; path output base = directories get output base ( ) ; string symlink prefix = build request options get symlink prefix ( product name ) ; convenience symlinks mode mode = build request options experimental convenience symlinks ; if ( no create symlinks prefix equals ( symlink prefix ) ) { return immutable list of ( ) ; } immutable list builder < convenience symlink > convenience symlinks builder = immutable list builder ( ) ; list < string > failures = new array list < > ( ) ; list < string > ambiguous links = new array list < > ( ) ; set < string > created links = new linked hash set < > ( ) ; string workspace base name = workspace get base name ( ) ; repository name repository name = repository name create from valid stripped name ( workspace name ) ; boolean log only = mode = = convenience symlinks mode log only ; for ( symlink definition symlink : get all link definitions ( symlink definitions , ! build request options experimental no product name out symlink ) ) { string link name = symlink get link name ( symlink prefix , product name , workspace base name ) ; if ( ! created links add ( link name ) ) { / / already created a link by this name continue ; } if ( mode = = convenience symlinks mode clean ) { remove link ( workspace , link name , failures , convenience symlinks builder , log only ) ; } else { set < path > candidate paths = symlink get link paths ( build request options , target configs , config getter , repository name , output path , exec root ) ; if ( candidate paths size ( ) = = 1 ) { create link ( workspace , link name , output base , iterables get only element ( candidate paths ) , failures , convenience symlinks builder , log only ) ; } else { remove link ( workspace , link name , failures , convenience symlinks builder , log only ) ; / / candidate paths can be empty if the symlink decided not to be created this can happen / / if the symlink is disabled by a flag , or it intercepts an error while computing its / / target path in that case , don ' t trigger a warning about an ambiguous link if ( candidate paths size ( ) > 1 ) { ambiguous links add ( link name ) ; } } } } if ( ! failures is empty ( ) ) { event handler handle ( event warn ( string format ( " failed to create one or more convenience symlinks for prefix ' % s ' : \ n % s " , symlink prefix , joiner on ( " \ n " ) join ( failures ) ) ) ) ; } if ( ! ambiguous links is empty ( ) ) { event handler handle ( event warn ( string format ( " cleared convenience symlink ( s ) % s because their destinations would be ambiguous " , joiner on ( " , " ) join ( ambiguous links ) ) ) ) ; } return convenience symlinks builder build ( ) ; }


creates a new data set that contains the given elements the framework will determine the type according to the based type user supplied the elements should be the same or be the subclass to the based type the sequence of elements must not be empty note that this operation will result in a non - parallel data stream source , i e a data stream source with a degree of parallelism one

public final < out > data stream source < out > from elements ( class < out > type , out data ) { if ( data length = = 0 ) { throw new illegal argument exception ( " from elements needs at least one element as argument " ) ; } type information < out > type info ; try { type info = type extractor get for class ( type ) ; } catch ( exception e ) { throw new runtime exception ( " could not create type information for type " + type get name ( ) + " ; please specify the type information manually via " + " stream execution environment # from elements ( collection , type information ) " , e ) ; } return from collection ( arrays as list ( data ) , type info ) ; }


test that { @ link monitoring doc } rendered using { @ link to x content # to x content ( x content builder , to x content params ) } contain a common set of fields

public final void test to x content contains common fields ( ) throws i o exception { final x content type x content type = random from ( x content type values ( ) ) ; final t document = create monitoring doc ( cluster , timestamp , interval , node , system , type , id ) ; final bytes reference bytes = x content helper to x content ( document , x content type , false ) ; try ( x content parser parser = x content type x content ( ) create parser ( named x content registry empty , logging deprecation handler instance , bytes stream input ( ) ) ) { final map < string , ? > map = parser map ( ) ; assert that ( map get ( " cluster uuid " ) , equal to ( cluster ) ) ; assert that ( map get ( " timestamp " ) , equal to ( monitoring doc to u t c ( timestamp ) ) ) ; assert that ( map get ( " interval ms " ) , equal to ( document get interval millis ( ) ) ) ; assert that ( map get ( " type " ) , equal to ( document get type ( ) ) ) ; if ( document get type ( ) equals ( shard monitoring doc type ) ) { assert that ( map get ( " shard " ) , not null value ( ) ) ; } else { assert that ( map get ( document get type ( ) ) , not null value ( ) ) ; } @ suppress warnings ( " unchecked " ) final map < string , ? > source node = ( map < string , ? > ) map get ( " source node " ) ; if ( node = = null ) { assert that ( source node , null value ( ) ) ; } else { assert that ( source node get ( " uuid " ) , equal to ( node get u u i d ( ) ) ) ; assert that ( source node get ( " transport address " ) , equal to ( node get transport address ( ) ) ) ; assert that ( source node get ( " ip " ) , equal to ( node get ip ( ) ) ) ; assert that ( source node get ( " host " ) , equal to ( node get host ( ) ) ) ; assert that ( source node get ( " name " ) , equal to ( node get name ( ) ) ) ; assert that ( source node get ( " timestamp " ) , equal to ( monitoring doc to u t c ( node get timestamp ( ) ) ) ) ; } } }


create a file context for specified default uri using the specified config

public static file context get file context ( final uri default fs uri , final configuration a conf ) throws unsupported file system exception { user group information current user = null ; abstract file system default afs = null ; if ( default fs uri get scheme ( ) = = null ) { return get file context ( a conf ) ; } try { current user = user group information get current user ( ) ; default afs = get abstract file system ( current user , default fs uri , a conf ) ; } catch ( unsupported file system exception ex ) { throw ex ; } catch ( i o exception ex ) { log error ( ex to string ( ) ) ; throw new runtime exception ( ex ) ; } return get file context ( default afs , a conf ) ; }


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


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


create a config validating only structure , not exact analyzertokenizerfilter names

public categorization analyzer config build ( ) { if ( analyzer = = null & & tokenizer = = null ) { throw new illegal argument exception ( categorization analyzer + " that is not a global analyzer must specify a [ " + tokenizer + " ] field " ) ; } if ( analyzer ! = null & & char filters is empty ( ) = = false ) { throw new illegal argument exception ( categorization analyzer + " that is a global analyzer cannot also specify a [ " + char filters + " ] field " ) ; } if ( analyzer ! = null & & tokenizer ! = null ) { throw new illegal argument exception ( categorization analyzer + " that is a global analyzer cannot also specify a [ " + tokenizer + " ] field " ) ; } if ( analyzer ! = null & & token filters is empty ( ) = = false ) { throw new illegal argument exception ( categorization analyzer + " that is a global analyzer cannot also specify a [ " + token filters + " ] field " ) ; } return new categorization analyzer config ( analyzer , char filters , tokenizer , token filters ) ; }


creates a { @ link future combiner } requiring that all passed in futures are successful if any input fails , the returned future fails immediately

public static < v > future combiner < v > when all succeed ( iterable < ? extends listenable future < ? extends v > > futures ) { return new future combiner < v > ( true , immutable list copy of ( futures ) ) ; }


returns < code > true < code > if the search execution should skip this shard since it can not match any documents given the query


return the value of the { @ code access - control - allow - headers } response header

public list < string > get access control allow headers ( ) { return get values as list ( access control allow headers ) ; }


returns the logical xor of this long value and the given particular long value

public long value xor ( particular long value other ) { return xor ( ( specific long value ) other ) ; }


returns file id for original buffer file which may be produced with this version file

long get original file i d ( ) { return original file id ; }


determine the validation mode for the specified { @ link resource } if no explicit validation mode has been configured , then the validation mode gets { @ link # detect validation mode detected } from the given resource override this method if you would like full control over the validation mode , even when something other than { @ link # validation auto } was set

protected int get validation mode for resource ( resource resource ) { int validation mode to use = get validation mode ( ) ; if ( validation mode to use ! = validation auto ) { return validation mode to use ; } int detected mode = detect validation mode ( resource ) ; if ( detected mode ! = validation auto ) { return detected mode ; } / / hmm , we didn ' t get a clear indication let ' s assume xsd , / / since apparently no dtd declaration has been found up until / / detection stopped ( before finding the document ' s root tag ) return validation xsd ; }


resolves a pattern to one ( potentially compound meaning that spawns multiple indices ) mapping

public void resolve as merged mapping ( string index wildcard , string java regex , boolean include frozen , action listener < index resolution > listener ) { field capabilities request field request = create field caps request ( index wildcard , include frozen ) ; client field caps ( field request , action listener wrap ( response - > listener on response ( merged mappings ( type registry , index wildcard , response get indices ( ) , response get ( ) ) ) , listener : : on failure ) ) ; }


return the appropriate type of the bzip 2 compressor

public static class < ? extends compressor > get bzip 2 compressor type ( configuration conf ) { return is native bzip 2 loaded ( conf ) ? bzip 2 compressor class : b zip 2 dummy compressor class ; }


callback method intended to be implemented by the caller to { @ link file system service # get derived file ( fsrl , string , derived file producer , task monitor ) } the implementation needs to return an { @ link input stream } that contains the bytes of the derived file

public input stream produce derived stream ( file src file ) throws i o exception , cancelled exception ;


returns a new block scope with the current scope as its parent

public block scope new local scope ( ) { return new block scope ( this ) ; }


the { @ link channel } of the { @ link channel handler context } was registered is now inactive and reached its end of lifetime

void channel inactive ( channel handler context ctx ) throws exception ;