fetches the most active namenode memberships for all known nameservices the fetched membership may not or may not be active excludes expired memberships

private list < membership state > get active namenode registrations ( ) throws i o exception { list < membership state > result list = new array list < > ( ) ; if ( membership store = = null ) { return result list ; } get namespace info request request = get namespace info request new instance ( ) ; get namespace info response response = membership store get namespace info ( request ) ; for ( federation namespace info ns info : response get namespace info ( ) ) { / / fetch the most recent namenode registration string ns id = ns info get nameservice id ( ) ; list < ? extends federation namenode context > nns = namenode resolver get namenodes for nameservice id ( ns id ) ; if ( nns ! = null ) { federation namenode context nn = nns get ( 0 ) ; if ( nn instanceof membership state ) { result list add ( ( membership state ) nn ) ; } } } return result list ; }


returns true if the socket mode is not yet known

public boolean is mode known ( ) { return mode ! = mode unknown ; }


checks if the cluster state allows this node to add x - pack metadata to the cluster state , and throws an exception otherwise this check should be called before installing any x - pack metadata to the cluster state , to ensure that the other nodes that are part of the cluster will be able to deserialize that metadata note that if the cluster state already contains x - pack metadata , this check assumes that the nodes are already ready to receive additional x - pack metadata having this check properly in place everywhere allows to install x - pack into a cluster using a rolling restart

public static void check ready for x pack custom metadata ( cluster state cluster state ) { if ( already contains x pack custom metadata ( cluster state ) ) { return ; } list < discovery node > not ready nodes = nodes not ready for x pack custom metadata ( cluster state ) ; if ( not ready nodes is empty ( ) = = false ) { throw new illegal state exception ( " the following nodes are not ready yet for enabling x - pack custom metadata : " + not ready nodes ) ; } }


merge overlapping { @ link time window } s for use by merging { @ link org apache flink streaming api windowing assigners window assigner window assigners }

public static void merge windows ( collection < time window > windows , merging window assigner merge callback < time window > c ) { / / sort the windows by the start time and then merge overlapping windows list < time window > sorted windows = new array list < > ( windows ) ; collections sort ( sorted windows , new comparator < time window > ( ) { @ override public int compare ( time window o 1 , time window o 2 ) { return long compare ( o 1 get start ( ) , o 2 get start ( ) ) ; } } ) ; list < tuple 2 < time window , set < time window > > > merged = new array list < > ( ) ; tuple 2 < time window , set < time window > > current merge = null ; for ( time window candidate : sorted windows ) { if ( current merge = = null ) { current merge = new tuple 2 < > ( ) ; current merge f 0 = candidate ; current merge f 1 = new hash set < > ( ) ; current merge f 1 add ( candidate ) ; } else if ( current merge f 0 intersects ( candidate ) ) { current merge f 0 = current merge f 0 cover ( candidate ) ; current merge f 1 add ( candidate ) ; } else { merged add ( current merge ) ; current merge = new tuple 2 < > ( ) ; current merge f 0 = candidate ; current merge f 1 = new hash set < > ( ) ; current merge f 1 add ( candidate ) ; } } if ( current merge ! = null ) { merged add ( current merge ) ; } for ( tuple 2 < time window , set < time window > > m : merged ) { if ( m f 1 size ( ) > 1 ) { c merge ( m f 1 , m f 0 ) ; } } }


protected string get block output buffer name ( ) { return constants fast upload buffer disk ; }


handles an inbound { @ code ping } acknowledgment

void on ping ack read ( channel handler context ctx , long data ) throws http 2 exception ;


returns the name of this service { @ link abstract idle service } may include the name in debugging output

protected string service name ( ) { return get class ( ) get simple name ( ) ; }


returns the previous sibling of this value

public json value prev ( ) { return prev ; }


estimated number of positions in on the build side

public optional < long > get lookup source positions ( ) { return lookup source positions ; }


aligns the heights in this multi row layout to match those in the give row heights array extra is inserted to align the rows in this layout to match those specified in the given array

public void align ( int [ ] row heights ) { int row = 0 ; int total above = 0 ; int last id = - 1 ; for ( int i = 0 ; i < layouts length ; i + + ) { int id = layouts [ i ] get row i d ( ) ; if ( id ! = last id ) { for ( ; row < id ; row + + ) { total above + = row heights [ row ] ; } int orig height = layouts [ i ] get height ( ) ; layouts [ i ] insert space above ( total above ) ; total above = row heights [ id ] - orig height ; last id = id ; row + + ; } else { total above - = layouts [ i ] get height ( ) ; } } int total below = total above ; for ( ; row < row heights length ; row + + ) { total below + = row heights [ row ] ; } insert space below ( total below ) ; int height = 0 ; for ( int i = 0 ; i < layouts length ; i + + ) { height + = layouts [ i ] get height ( ) ; } height above = layouts [ 0 ] get height above ( ) ; height below = height - height above ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


called by the activity base class from the { @ link activity # on resume } method


creates a { @ link reentrant read write lock } with the given fairness policy the { @ code lock name } is used in the warning or exception output to help identify the locks involved in the detected deadlock

public reentrant read write lock new reentrant read write lock ( string lock name , boolean fair ) { return policy = = policies disabled ? new reentrant read write lock ( fair ) : new cycle detecting reentrant read write lock ( new lock graph node ( lock name ) , fair ) ; }


checks if the runnable arose from asynchronous submission of a task to an executor if an uncaught exception was thrown during the execution of this task , we need to inspect this runnable and see if it is an error that should be propagated to the uncaught exception handler

public static throwable rethrow errors ( runnable runnable ) { if ( runnable instanceof runnable future ) { assert ( ( runnable future ) runnable ) is done ( ) ; try { ( ( runnable future ) runnable ) get ( ) ; } catch ( final exception e ) { / * * in theory , future # get can only throw a cancellation exception , an interrupted exception , or an execution * exception we want to ignore cancellation exceptions , restore the interrupt status on interrupted exceptions , and * inspect the cause of an execution we are going to be extra paranoid here though and completely unwrap the * exception to ensure that there is not a buried error anywhere we assume that a general exception has been * handled by the executed task or the task submitter * / assert e instanceof cancellation exception | | e instanceof interrupted exception | | e instanceof execution exception : e ; final optional < error > maybe error = exceptions helper maybe error ( e ) ; if ( maybe error is present ( ) ) { / / throw this error where it will propagate to the uncaught exception handler throw maybe error get ( ) ; } if ( e instanceof interrupted exception ) { / / restore the interrupt status thread current thread ( ) interrupt ( ) ; } if ( e instanceof execution exception ) { return e get cause ( ) ; } } } return null ; }


register a listener that waits until the ssl context factory has started once it has started we can grab the fully initialized context so we can log the parameters

protected abstract life cycle abstract life cycle listener log ssl info on start ( final ssl context factory ssl context factory ) { return new abstract life cycle abstract life cycle listener ( ) { @ override public void life cycle started ( life cycle event ) { log supported parameters ( ssl context factory ) ; } } ; }


the last arg is expected to be a remote path , if only one argument is given then the destination will be the remote user ' s directory

protected void get remote destination ( linked list < string > args ) throws i o exception { if ( args size ( ) < 2 ) { dst = new path data ( path cur dir , get conf ( ) ) ; } else { string path string = args remove last ( ) ; / / if the path is a glob , then it must match one and only one path path data [ ] items = path data expand as glob ( path string , get conf ( ) ) ; switch ( items length ) { case 0 : throw new path not found exception ( path string ) ; case 1 : dst = items [ 0 ] ; break ; default : throw new path i o exception ( path string , " too many matches " ) ; } } }


applies when sorting , and controls if scores will be tracked as well defaults to { @ code false }

public search source builder track scores ( boolean track scores ) { this track scores = track scores ; return this ; }


returns the { @ link # sum } as an { @ code int } after a narrowing primitive conversion

public int int value ( ) { return ( int ) sum ( ) ; }


test fallback reads on a stream which does not support the byte buffer readable interface

public void test indirect fallback reads ( ) throws exception { final string test path = generic test utils get test dir ( " indirect fallback test file " ) get absolute path ( ) ; final int test file length = 16385 ; final int random seed = 23453 ; file output stream fos = null ; file input stream fis = null ; try { fos = new file output stream ( test path ) ; random random = new random ( random seed ) ; byte original [ ] = new byte [ test file length ] ; random next bytes ( original ) ; fos write ( original ) ; fos close ( ) ; fos = null ; fis = new file input stream ( test path ) ; test fallback impl ( fis , original ) ; } finally { i o utils cleanup with logger ( log , fos , fis ) ; new file ( test path ) delete ( ) ; } }


allow the xml to be extensible by processing any custom element types last , after we finished processing the bean definitions this method is a natural extension point for any other custom post - processing of the xml the default implementation is empty subclasses can override this method to convert custom elements into standard spring bean definitions , for example implementors have access to the parser ' s bean definition reader and the underlying xml resource , through the corresponding accessors

protected void post process xml ( element root ) { }


marks the current { @ code reader index } in this buffer you can reposition the current { @ code reader index } to the marked { @ code reader index } by calling { @ link # reset reader index ( ) } the initial value of the marked { @ code reader index } is { @ code 0 }


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

public void update user test ( ) { string username = null ; user user = null ; / / api update user ( username , user ) ; / / todo : test validations }


since flow execution repository exception is a common ancestor to these exceptions and other error cases we would likely want to hide from the user , it seems reasonable to check for flow execution repository exception badly formatted flow execution key exception is specifically ignored by this handler because redirecting to the requested uri with this exception may cause an infinite redirect loop ( i e when invalid " execution " parameter exists as part of the query string

public model and view resolve exception ( final http servlet request request , final http servlet response response , final object handler , final exception exception ) { if ( ! ( exception instanceof flow execution repository exception ) | | exception instanceof badly formatted flow execution key exception ) { logger debug ( " ignoring the received exception [ { } ] due to a type mismatch with handler [ { } ] " , exception , handler ) ; return null ; } val url to redirect to = request get request u r i ( ) + ( request get query string ( ) ! = null ? ' ? ' + request get query string ( ) : string utils empty ) ; logger debug ( " error getting flow information for url [ { } ] " , url to redirect to , exception ) ; val model = new hash map < string , object > ( ) ; model put ( this model key , string escape utils escape html 4 ( exception get message ( ) ) ) ; return new model and view ( new redirect view ( url to redirect to ) , model ) ; }


public int get login timeout ( ) throws s q l exception { return login timeout ; }


all direct artifacts , bundleable files , etc of the type specified by { @ code key }

public < e > sequence < e > get direct ( key < e > key ) { if ( direct items contains key ( key ) ) { return starlark list immutable copy of ( ( list ) direct items get ( key ) ) ; } return starlark list empty ( ) ; }


bind the configuration ' s { @ code assumed role policy } option to the given policy

public static configuration bind role policy ( final configuration conf , final policy policy ) throws json processing exception { string p = model to json ( policy ) ; log info ( " setting role policy to policy of size { } : \ n { } " , p length ( ) , p ) ; conf set ( assumed role policy , p ) ; return conf ; }


return the target connection factory that this connection factory delegates to

public connection factory get target connection factory ( ) { return this target connection factory ; }


if the image has less than 256 colours , simply create a new 8 bit palette and map the colours to the new palette

private static image data get web safe palette image data ( image data image data ) { palette data palette = image data palette ; rgb [ ] web safe palette = get web safe palette ( ) ; palette data new palette data = new palette data ( web safe palette ) ; image data new image data = new image data ( image data width , image data height , 8 , new palette data ) ; int last pixel = - 1 ; int new pixel = - 1 ; for ( int i = 0 ; i < image data width ; + + i ) { for ( int j = 0 ; j < image data height ; + + j ) { int pixel = image data get pixel ( i , j ) ; if ( pixel ! = last pixel ) { last pixel = pixel ; rgb colour = palette get r g b ( pixel ) ; rgb web safe colour = get web safe colour ( colour ) ; for ( new pixel = 0 ; new pixel < 256 ; + + new pixel ) { if ( web safe palette [ new pixel ] equals ( web safe colour ) ) { break ; } } assert is true ( new pixel < 216 ) ; } new image data set pixel ( i , j , new pixel ) ; } } return new image data ; }


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

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


compares two triangles for equality triangles must have the same winding , but may begin with different vertex values are epsilon compared , with default tolerance triangles are assumed to be valid triangles - no duplicate vertices

private static boolean triangle equals ( float [ ] base , int base offset , int stride , float [ ] comp ) { assert true ( stride > = 3 ) ; assert true ( base length - base offset > = 9 ) ; assert true ( comp length = = 9 ) ; int offset = - 1 ; / / find first comp vertex in base triangle for ( int i = 0 ; i < 3 ; i + + ) { int b = base offset + i * stride ; if ( math utils is equal ( base [ b ] , comp [ 0 ] ) & & math utils is equal ( base [ b + 1 ] , comp [ 1 ] ) & & math utils is equal ( base [ b + 2 ] , comp [ 2 ] ) ) { offset = i ; break ; } } assert true ( " triangles do not have common first vertex " , offset ! = - 1 ) ; / / compare vertices for ( int i = 0 ; i < 3 ; i + + ) { int b = base offset + ( ( offset + i ) * stride ) % ( 3 * stride ) ; int c = i * stride ; if ( ! math utils is equal ( base [ b ] , comp [ c ] ) | | ! math utils is equal ( base [ b + 1 ] , comp [ c + 1 ] ) | | ! math utils is equal ( base [ b + 2 ] , comp [ c + 2 ] ) ) { return false ; } } return true ; }


returns buffer count for original buffer file

public int get original buffer count ( ) { return original buf count ; }


when splitting the reverse zone , return the number of subnets needed , given the range and netmask

protected static long get subnet count for reverse zones ( configuration conf ) { string subnet = conf get ( key dns zone subnet ) ; string mask = conf get ( key dns zone mask ) ; string range = conf get ( key dns split reverse zone range ) ; int parsed range ; try { parsed range = integer parse int ( range ) ; } catch ( number format exception e ) { log error ( " the supplied range is not a valid integer : supplied range : " , range ) ; throw e ; } if ( parsed range < 0 ) { string msg = string format ( " range cannot be negative : supplied range : % d " , parsed range ) ; log error ( msg ) ; throw new illegal argument exception ( msg ) ; } long ip count ; try { subnet utils subnet utils = new subnet utils ( subnet , mask ) ; subnet utils set inclusive host count ( true ) ; ip count = subnet utils get info ( ) get address count long ( ) ; } catch ( illegal argument exception e ) { log error ( " the subnet or mask is invalid : subnet : { } mask : { } " , subnet , mask ) ; throw e ; } if ( parsed range = = 0 ) { return ip count ; } return ip count / parsed range ; }


generates the name of the index that conforms to the default naming convention for backing indices on data streams given the specified data stream name and generation and the current system time

public static string get default backing index name ( string data stream name , long generation ) { return get default backing index name ( data stream name , generation , system current time millis ( ) , version current ) ; }


plugin needs to return { @ link resource handler } when any special isolation required for the resource type this will be added to { @ link resource handler chain } during node manager startup when no special isolation need , return null

resource handler create resource handler ( context nm context , c groups handler c groups handler , privileged operation executor privileged operation executor ) ;


returns the quotient of the given specific integer value and this integer value

public integer value divide of ( specific integer value other ) { return divide of ( ( integer value ) other ) ; }


end an object this method most be called to balance calls to < code > object < code >

public j s o n writer end object ( ) throws j s o n exception { return this end ( ' k ' , ' }


check whether need to continue or kill the cluster

private tuple 2 < boolean , boolean > rep step ( buffered reader in ) throws i o exception , interrupted exception { final long start time = system current time millis ( ) ; while ( ( system current time millis ( ) - start time ) < client polling interval ms & & ( ! in ready ( ) ) ) { thread sleep ( 200l ) ; } / / - - - - - - - - - - - - - handle interactive command by user - - - - - - - - - - - - - - - - - - - - - - if ( in ready ( ) ) { final string command = in read line ( ) ; switch ( command ) { case " quit " : return new tuple 2 < > ( false , false ) ; case " stop " : return new tuple 2 < > ( false , true ) ; case " help " : system err println ( kubernetes cluster help ) ; break ; default : system err println ( " unknown command ' " + command + " ' showing help : " ) ; system err println ( kubernetes cluster help ) ; break ; } } return new tuple 2 < > ( true , false ) ; }


this is used internally by generated models to do validation checking when " validate epoxy model usage " is enabled and the model is used with a { @ link epoxy controller } this method validates that the model ' s hash code hasn ' t been changed since it was added to the controller this is similar to { @ link # on mutation ( ) } , but that method is only used for specific model changes such as calling a setter by checking the hash code , this method allows us to catch more subtle changes , such as through setting a field directly or through changing an object that is set on the model

protected final void validate state has not changed since added ( string description of change , int model position ) { if ( is debug validation enabled ( ) & & ! currently in interceptors & & hash code when added ! = hash code ( ) ) { throw new immutable model exception ( this , description of change , model position ) ; } }


writes the allocated bytes for this stream any { @ link throwable } thrown from this method is considered a programming error a { @ code goaway } frame will be sent and the will be connection closed

void write ( http 2 stream stream , int num bytes ) ;


this method captures the information of a request to terminate a computer instance method is public as it needs to be called from { @ link abstract cloud slave } and { @ link jenkins model nodes } in general you should not need to call this method directly , however if implementing a custom node type or a different path for removing nodes , it may make sense to call this method in order to capture the originating request

public void record termination ( ) { stapler request request = stapler get current request ( ) ; if ( request ! = null ) { terminated by add ( new termination request ( string format ( " termination requested at % s by % s [ id = % d ] from http request for % s " , new date ( ) , thread current thread ( ) , thread current thread ( ) get id ( ) , request get request u r l ( ) ) ) ) ; } else { terminated by add ( new termination request ( string format ( " termination requested at % s by % s [ id = % d ] " , new date ( ) , thread current thread ( ) , thread current thread ( ) get id ( ) ) ) ) ; } }


gets the index of all columns matching the specified name

public list < field > resolve fields ( qualified name name ) { return all fields stream ( ) filter ( input - > input can resolve ( name ) ) collect ( to immutable list ( ) ) ; }


sorting the documents by key lets us bucket the documents into groups with a single linear scan but we can ' t do this by just sorting < code > buffer < code > , because we also need to generate a merge map for every change we make to the list , so that we can apply the changes to the underlying buckets as well by just creating a merge map , we eliminate the need to actually sort < code > buffer < code > we can just use the merge map to find any doc ' s sorted index

private void bucket buffered docs ( final double array buffer , final int buffer size , final int num buckets ) { / / allocate space for the clusters about to be created cluster mins = big arrays ( ) new double array ( 1 ) ; cluster maxes = big arrays ( ) new double array ( 1 ) ; cluster centroids = big arrays ( ) new double array ( 1 ) ; cluster sizes = big arrays ( ) new double array ( 1 ) ; num clusters = 0 ; cluster sorter sorter = new cluster sorter ( buffer , buffer size ) ; long [ ] merge map = sorter generate merge map ( ) ; / / naively use basic linear separation to group the first buffer size docs into initial num buckets buckets / / this will require modifying the merge map , which currently represents a sorted list of buckets with 1 doc / bucket int docs per bucket = ( int ) math ceil ( ( double ) buffer size / ( double ) num buckets ) ; int bucket ord = 0 ; for ( int i = 0 ; i < merge map length ; i + + ) { / / merge map [ i ] is the index of the i ' th smallest doc double val = buffer get ( merge map [ i ] ) ; / / put the i ' th smallest doc into the bucket at bucket ord merge map [ i ] = ( int ) ( merge map [ i ] / docs per bucket ) ; if ( bucket ord = = num clusters ) { create and append new cluster ( val ) ; } else { add to cluster ( bucket ord , val ) ; } if ( ( i + 1 ) % docs per bucket = = 0 ) { / / this bucket is full make a new one bucket ord + = 1 ; } } long unary operator how to rewrite = b - > merge map [ ( int ) b ] ; rewrite buckets ( bucket ord + 1 , how to rewrite ) ; if ( deferring collector ! = null ) { deferring collector rewrite buckets ( how to rewrite ) ; } }


test of get r m principal ( configuration ) method , of class yarn client utils when ha is enabled

public void test get r m principal h a string ( ) throws i o exception { configuration conf = new configuration ( ) ; conf set ( yarn configuration rm address + " rm 0 " , " myhost " ) ; conf set boolean ( yarn configuration rm ha enabled , true ) ; conf set ( yarn configuration rm ha ids , " rm 0 " ) ; string result = yarn client utils get rm principal ( " test / host @ realm " , conf ) ; assert equals ( " the hostname translation did not produce the expected " + " results : " + result , " test / myhost @ realm " , result ) ; try { result = yarn client utils get rm principal ( null , conf ) ; fail ( " the hostname translation succeeded even though the rm principal " + " was null : " + result ) ; } catch ( illegal argument exception ex ) { / / expected } conf = new configuration ( ) ; conf set ( yarn configuration rm address + " rm 0 " , " myhost " ) ; conf set boolean ( yarn configuration rm ha enabled , true ) ; try { yarn client utils get rm principal ( " test / host @ realm " , conf ) ; fail ( " the hostname translation succeeded even though no rm ids were set " ) ; } catch ( i o exception ex ) { / / expected } conf = new configuration ( ) ; conf set ( yarn configuration rm address + " rm 0 " , " myhost " ) ; conf set boolean ( yarn configuration rm ha enabled , true ) ; conf set ( yarn configuration rm ha id , " rm 0 " ) ; result = yarn client utils get rm principal ( " test / host @ realm " , conf ) ; assert equals ( " the hostname translation did not produce the expected " + " results : " + result , " test / myhost @ realm " , result ) ; result = yarn client utils get rm principal ( " test / yourhost @ realm " , conf ) ; assert equals ( " the hostname translation did not produce the expected " + " results : " + result , " test / yourhost @ realm " , result ) ; }


given a key , returns the index of the entry in the tables , or absent if not found

int find entry by key ( @ nullable decl object key ) { return find entry by key ( key , hashing smeared hash ( key ) ) ; }


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


create new { @ code ssl context } instance with configured settings if { @ link # ssl provider ( ssl provider ) } is set to { @ link ssl provider # openssl refcnt } then the caller is responsible for releasing this object , or else native memory may leak

public ssl context build ( ) throws s s l exception { if ( for server ) { return ssl context new server context internal ( provider , ssl context provider , trust cert collection , trust manager factory , key cert chain , key , key password , key manager factory , ciphers , cipher filter , apn , session cache size , session timeout , client auth , protocols , start tls , enable ocsp , key store type ) ; } else { return ssl context new client context internal ( provider , ssl context provider , trust cert collection , trust manager factory , key cert chain , key , key password , key manager factory , ciphers , cipher filter , apn , protocols , session cache size , session timeout , enable ocsp , key store type ) ; } }


creates the consumer that does the " field just arrived " behavior if the target object hasn ' t been built then it queues the value otherwise it just applies the value just like { @ linkplain object parser } does

private < t > bi consumer < target , t > queueing consumer ( bi consumer < value , t > consumer , parse field parse field ) { return ( target , v ) - > { if ( target target object ! = null ) { / / the target has already been built just apply the consumer now consumer accept ( target target object , v ) ; return ; } / * * the target hasn ' t been built queue the consumer the next two lines are the only allocations that constructing object parser * does during parsing other than the boxing the object parser might do the first one is to preserve a snapshot of the current * location so we can add it to the error message if parsing fails the second one ( the lambda ) is the actual operation being * queued note that we don ' t do any of this if the target object has already been built * / x content location location = target parser get token location ( ) ; target queue ( target object - > { try { consumer accept ( target object , v ) ; } catch ( exception e ) { throw new x content parse exception ( location , " [ " + object parser get name ( ) + " ] failed to parse field [ " + parse field get preferred name ( ) + " ] " , e ) ; } } ) ; } ; }


sets the streaming context environment to a test stream environment that runs its programs on the given cluster with the given default parallelism

public static void set as context ( final mini cluster mini cluster , final int parallelism ) { set as context ( mini cluster , parallelism , collections empty list ( ) , collections empty list ( ) ) ; }


convert an array of file status to an array of path if stats if null , return path

public static path [ ] stat 2 paths ( file status [ ] stats , path path ) { if ( stats = = null ) return new path [ ] { path } ; else return stat 2 paths ( stats ) ; }


add comment history records for comments being deleted

private void add comment history records ( address start , address end ) throws i o exception { record iterator iter = comment adapter get records ( start , end , true ) ; while ( iter has next ( ) ) { d b record rec = iter next ( ) ; add comment history record ( rec , code unit pre comment ) ; add comment history record ( rec , code unit post comment ) ; add comment history record ( rec , code unit eol comment ) ; add comment history record ( rec , code unit plate comment ) ; add comment history record ( rec , code unit repeatable comment ) ; } }


get a integer option not smaller than the minimum allowed value

static int int option ( final configuration conf , final string key , final int def val , final int min ) { int v = conf get int ( key , def val ) ; preconditions check argument ( v > = min , string format ( " value of % s : % d is below the minimum value % d " , key , v , min ) ) ; log debug ( " value of { } is { } " , key , v ) ; return v ; }


convenience method that creates a < code > http u r l connection < code > for the http f s server file system operations this methods performs and injects any needed authentication credentials via the { @ link # get connection ( url , string ) } method

private http u r l connection get connection ( final string method , map < string , string > params , path path , boolean make qualified ) throws i o exception { return get connection ( method , params , null , path , make qualified ) ; }


static method with a type parameter number

public static int static number test ( number number ) { return number int value ( ) ; }


this implementation checks for a jstl time zone attribute in page , request , session or application scope ; if not found , returns { @ code null }

protected time zone get fallback time zone ( ) { if ( jstl present ) { time zone time zone = jstl page locale resolver get jstl time zone ( get page context ( ) ) ; if ( time zone ! = null ) { return time zone ; } } return null ; }


abort a multi - part upload retries are attempted on failures i o exceptions are caught ; this is expected to be run as a cleanup process

void abort ( ) { string operation = string format ( " aborting multi - part upload for ' % s ' , id ' % s " , write operation helper , upload id ) ; try { log debug ( operation ) ; write operation helper abort multipart upload ( key , upload id ) ; } catch ( obs exception e ) { log warn ( " unable to abort multipart upload , you may need to purge " + " uploaded parts " , e ) ; } }


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

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


returns true if { @ link endpoint # ipv 4 ( ) } or { @ link endpoint # ipv 6 ( ) } could be parsed from the input returns boolean not this for conditional parsing for example : { @ code if ( ! builder parse ip ( input get header ( " x - forwarded - for " ) ) ) { builder parse ip ( input get remote addr ( ) ) ; } }

public final boolean parse ip ( @ nullable string ip string ) { if ( ip string = = null | | ip string is empty ( ) ) return false ; ip family format = detect family ( ip string ) ; if ( format = = ip family i pv 4 ) { ipv 4 = ip string ; ipv 4 bytes = get ipv 4 bytes ( ipv 4 ) ; } else if ( format = = ip family i pv 4 embedded ) { ipv 4 = ip string substring ( ip string last index of ( ' : ' ) + 1 ) ; ipv 4 bytes = get ipv 4 bytes ( ipv 4 ) ; } else if ( format = = ip family i pv 6 ) { byte [ ] address bytes = text to numeric format v 6 ( ip string ) ; if ( address bytes = = null ) return false ; ipv 6 = write ip v 6 ( address bytes ) ; / / ensures consistent format ipv 6 bytes = address bytes ; } else { return false ; } return true ; }


public cancellable get policy async ( get policy request request , request options options , action listener < get policy response > listener ) { return rest high level client perform request async and parse entity ( request , enrich request converters : : get policy , options , get policy response : : from x content , listener , collections empty set ( ) ) ; }


replaces the resource at the specified index and returns the old resource

public subscription replace resource ( int index , subscription resource ) { for ( ; ; ) { subscription o = get ( index ) ; if ( o = = subscription helper cancelled ) { if ( resource ! = null ) { resource cancel ( ) ; } return null ; } if ( compare and set ( index , o , resource ) ) { return o ; } } }


returns an enumerable collection of blob items whose names begin with the specified prefix , using the specified flat or hierarchical option , listing details options , request options , and operation context

public abstract iterable < list blob item > list blobs ( string prefix , boolean use flat blob listing , enum set < blob listing details > listing details , blob request options options , operation context op context ) throws u r i syntax exception , storage exception ;


creates an date for sql date type from the millis since epoch

public static zoned date time as date only ( long millis ) { return zoned date time of instant ( instant of epoch milli ( millis ) , utc ) to local date ( ) at start of day ( utc ) ; }


public entry table get entry table ( ) { return entry table ; }


return the alias names for the bean , as specified directly for the bean definition

public string [ ] get aliases ( ) { return this aliases ; }


test that a structure can ' t contain another structure that contains it

public void test cyclic dependency problem 4 ( ) { structure another struct = create structure ( " another struct " , 0 ) ; another struct add ( struct ) ; try { struct add ( another struct ) ; assert fail ( " shouldn ' t be able to add another structure , which contains this structure , to this structure " ) ; } catch ( illegal argument exception e ) { / / should get an exception from adding the struct to itself } try { struct insert ( 0 , another struct ) ; assert fail ( " shouldn ' t be able to insert another structure , which contains this structure , to this structure " ) ; } catch ( illegal argument exception e ) { / / should get an exception from inserting the struct to itself } try { struct replace ( 0 , another struct , another struct get length ( ) ) ; assert fail ( " shouldn ' t be able to replace a structure component with another structure which contains this structure " ) ; } catch ( illegal argument exception e ) { / / should get an exception from replacing the struct to itself } }


creates a projection list that removes given columns < b > note : < b > resulting expression are still unresolved

static list < expression > drop fields ( list < string > input fields , list < expression > drop expressions ) { set < string > columns to drop = drop expressions stream ( ) map ( expr - > expr accept ( drop columns extractor ) ) collect ( collectors to set ( ) ) ; columns to drop for each ( c - > { if ( ! input fields contains ( c ) ) { throw new validation exception ( format ( " field % s does not exist in source table " , c ) ) ; } } ) ; return input fields stream ( ) filter ( old name - > ! columns to drop contains ( old name ) ) map ( api expression utils : : unresolved ref ) collect ( collectors to list ( ) ) ; }


replace the existing icon with the provided icon at the specified location

public badged icon set badge ( icon badge , badge position position ) { multi icon multi = null ; if ( badge = = null ) { badge = get empty icon ( width , height , enabled ) ; } multi = new multi icon ( badge , enabled , width , height ) ; badge map put ( position , multi ) ; cached this = null ; return this ; }


a filtering function is one whose outputs are a subset of a single input argument returns the function as a filtering function if it is one and { @ code null } otherwise

default filtering query function as filtering function ( ) { return null ; }


handles the cluster state transition to a version that reflects the provided { @ link alias action } s

public cluster state apply alias actions ( cluster state current state , iterable < alias action > actions ) { list < index > indices to close = new array list < > ( ) ; map < string , index service > indices = new hash map < > ( ) ; try { boolean changed = false ; / / gather all the indexes that must be removed first so : / / 1 we don ' t cause error when attempting to replace an index with a alias of the same name / / 2 we don ' t allow removal of aliases from indexes that we ' re just going to delete anyway that ' d be silly set < index > indices to delete = new hash set < > ( ) ; for ( alias action action : actions ) { if ( action remove index ( ) ) { index metadata index = current state metadata ( ) get indices ( ) get ( action get index ( ) ) ; if ( index = = null ) { throw new index not found exception ( action get index ( ) ) ; } validate alias target is not d s backing index ( current state , action ) ; indices to delete add ( index get index ( ) ) ; changed = true ; } } / / remove the indexes if there are any to remove if ( changed ) { current state = delete index service delete indices ( current state , indices to delete ) ; } metadata builder metadata = metadata builder ( current state metadata ( ) ) ; / / run the remaining alias actions final set < string > maybe modified indices = new hash set < > ( ) ; for ( alias action action : actions ) { if ( action remove index ( ) ) { / / handled above continue ; } index metadata index = metadata get ( action get index ( ) ) ; if ( index = = null ) { throw new index not found exception ( action get index ( ) ) ; } validate alias target is not d s backing index ( current state , action ) ; new alias validator new alias validator = ( alias , index routing , filter , write index ) - > { / * it is important that we look up the index using the metadata builder we are modifying so we can remove an * index and replace it with an alias * / function < string , index metadata > index lookup = name - > metadata get ( name ) ; alias validator validate alias ( alias , action get index ( ) , index routing , index lookup ) ; if ( strings has length ( filter ) ) { index service index service = indices get ( index get index ( ) get name ( ) ) ; if ( index service = = null ) { index service = indices service index service ( index get index ( ) ) ; if ( index service = = null ) { / / temporarily create the index and add mappings so we can parse the filter try { index service = indices service create index ( index , empty list ( ) , false ) ; indices to close add ( index get index ( ) ) ; } catch ( i o exception e ) { throw new elasticsearch exception ( " failed to create temporary index for parsing the alias " , e ) ; } index service mapper service ( ) merge ( index , mapper service merge reason mapping recovery ) ; } indices put ( action get index ( ) , index service ) ; } / / the context is only used for validation so it ' s fine to pass fake values for the shard id , / / but the current timestamp should be set to real value as we may use ` now ` in a filtered alias alias validator validate alias filter ( alias , filter , index service new query shard context ( 0 , 0 , null , ( ) - > system current time millis ( ) , null , empty map ( ) ) , x content registry ) ; } } ; if ( action apply ( new alias validator , metadata , index ) ) { changed = true ; maybe modified indices add ( index get index ( ) get name ( ) ) ; } } for ( final string maybe modified index : maybe modified indices ) { final index metadata current index metadata = current state metadata ( ) index ( maybe modified index ) ; final index metadata new index metadata = metadata get ( maybe modified index ) ; / / only increment the aliases version if the aliases actually changed for this index if ( current index metadata get aliases ( ) equals ( new index metadata get aliases ( ) ) = = false ) { assert current index metadata get aliases version ( ) = = new index metadata get aliases version ( ) ; metadata put ( new index metadata builder ( new index metadata ) aliases version ( 1 + current index metadata get aliases version ( ) ) ) ; } } if ( changed ) { cluster state updated state = cluster state builder ( current state ) metadata ( metadata ) build ( ) ; / / even though changes happened , they resulted in 0 actual changes to metadata / / i e remove and add the same alias to the same index if ( ! updated state metadata ( ) equals aliases ( current state metadata ( ) ) ) { return updated state ; } } return current state ; } finally { for ( index index : indices to close ) { indices service remove index ( index , no longer assigned , " created for alias processing " ) ; } } }


sets the previous nested level as current nested level and removes and returns the current nested level

public object mapper previous level ( ) { return level stack pop ( ) ; }


return true if this child cat all of object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } child cat all of child cat all of = ( child cat all of ) o ; return objects equals ( this name , child cat all of name ) & & objects equals ( this pet type , child cat all of pet type ) ; }


private void corrupt f s image m d 5 ( boolean corrupt all ) throws i o exception { list < uri > name dirs = ( list < uri > ) f s namesystem get namespace dirs ( config ) ; / / corrupt the md 5 files in all the namedirs for ( uri uri : name dirs ) { / / directory layout looks like : / / test / data / dfs / name n / current / { fsimage , edits , } file name dir = new file ( uri get path ( ) ) ; file dfs dir = name dir get parent file ( ) ; assert equals ( dfs dir get name ( ) , " dfs " ) ; / / make sure we got right dir / / set the md 5 file to all zeros file image file = new file ( name dir , storage storage dir current + " / " + n n storage get image file name ( 0 ) ) ; m d 5 file utils save m d 5 file ( image file , new m d 5 hash ( new byte [ 16 ] ) ) ; / / only need to corrupt one if ! corrupt all if ( ! corrupt all ) { break ; } } }


set the request factory that this accessor uses for obtaining { @ link org springframework http client client http request http requests }

public void set async request factory ( org springframework http client async client http request factory async request factory ) { assert not null ( async request factory , " async client http request factory must not be null " ) ; this async request factory = async request factory ; }


set the finished time and then update the statistics if the operation failed then the key + failures counter will be incremented by one the operation minmeanmax values will be updated with the duration ; on a failure these will all be the failures metrics

public void close ( ) { finished ( ) ; string name = key ; if ( failed ) { / / failure : name = key + store statistic names suffix failures ; iostats increment counter ( name ) ; } iostats add timed operation ( name , as duration ( ) ) ; }


this test adds random fields and objects to the x content rendered out to ensure we can parse it back to be forward compatible with additions to the x content we test this with a " minimal " search response , adding random fields to search hits , aggregations etc is tested in their own tests

public void test from x content with random fields ( ) throws i o exception { do from x content test with random fields ( create minimal test item ( ) , true ) ; }


sets the < code > prefix ns number < code > property

public void set prefix ns number ( big decimal prefix ns number ) { this prefix ns number = prefix ns number ; }


a single place to customize the response body of all exception types the default implementation sets the { @ link web utils # error exception attribute } request attribute and creates a { @ link response entity } from the given body , headers , and status

protected response entity < object > handle exception internal ( exception ex , @ nullable object body , http headers headers , http status status , web request request ) { if ( http status internal server error equals ( status ) ) { request set attribute ( web utils error exception attribute , ex , web request scope request ) ; } return new response entity < > ( body , headers , status ) ; }


public void wrapped array test ( ) { / / todo : test wrapped array }


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


applies the given window function to each window the window function is called for each evaluation of the window the output of the window function is interpreted as a regular non - windowed stream note that this function requires that all data in the windows is buffered until the window is evaluated , as the function provides no means of incremental aggregation

public < r > single output stream operator < r > process ( process all window function < t , r , w > function , type information < r > result type ) { string call location = utils get call location name ( ) ; function = input get execution environment ( ) clean ( function ) ; return apply ( new internal iterable process all window function < > ( function ) , result type , call location ) ; }


execute sql scripts configured via { @ link sql @ sql } for the supplied { @ link test context } before the current test method

public void before test method ( test context test context ) { execute sql scripts ( test context , execution phase before test method ) ; }


public rack node get rack by name ( string name ) ;


returns a formatted , comma - separated list of the user i ds associated with this { @ code request } , or { @ code null } if no user i ds were found the return value is used for audit logging while it may be easy on the eyes , it is underspecified : it does not mention the corresponding { @ code scheme } , nor are its components escaped this is not a security feature

public string get users for audit ( ) { return auth util get users ( auth info ) ; }


this implementation returns the name of the file

public string get filename ( ) { return ( this file ! = null ? this file get name ( ) : this file path get file name ( ) to string ( ) ) ; }


marks the action as no longer scanning because we may receive events out of order , this does nothing if the action is already scheduled or running

synchronized void set stop scanning ( long nano change time ) { if ( scheduling strategies bitmap = = 0 & & running strategies bitmap = = 0 ) { scanning = false ; nano start time = nano change time ; } }


returns a view of the { @ linkplain range # is connected disconnected } ranges that make up this range set the returned set may be empty the iterators returned by its { @ link iterable # iterator } method return the ranges in increasing order of lower bound ( equivalently , of upper bound )


specify one or more modules by class ( or class name in xml ) to be registered with the { @ link object mapper } modules specified here will be registered after spring ' s autodetection of jsr - 310 and joda - time , or jackson ' s finding of modules ( see { @ link # set find modules via service loader } ) , allowing to eventually override their configuration specify either this or { @ link # set modules } , not both

public final void set modules to install ( class < ? extends module > modules ) { this builder modules to install ( modules ) ; }


lookup offsets without any known min or max time this will generally fail if the provided zone isn ' t fixed

public static local time offset fixed offset ( zone id zone ) { return check for fixed zone ( zone , zone get rules ( ) ) ; }


checks that expected is equals to out , and further , if in is equals to expected , then out is successfully optimized to be identical to in , i e that " in " is simply returned

private void assert equals same ( string expected , string in , string out ) { if ( expected equals ( in ) ) { assert same ( in , out ) ; } else { assert equals ( expected , out ) ; } }


set the login for the shared " system " connection used to send messages to the stomp broker from within the application , i e messages not associated with a specific client session ( e g resthttp request handling method ) by default this is set to " guest "

public stomp broker relay registration set system login ( string login ) { assert has text ( login , " system login must not be empty " ) ; this system login = login ; return this ; }


run callable and prepare results for usage in the test methods

public static void setup ( ) { / / create a callable var callable df = new date format callable ( " dd / mm / yyyy " , " 15 / 12 / 2015 " ) ; / / start thread using the callable instance var executor = executors new cached thread pool ( ) ; var future result = executor submit ( callable df ) ; try { result = future result get ( ) ; created date values = convert dates to string ( result ) ; } catch ( exception e ) { fail ( " setup failed : " + e ) ; } executor shutdown ( ) ; }


returns the generation threshold size as sequence numbers can cause multiple generations to be preserved for rollback purposes , we want to keep the size of individual generations from growing too large to avoid excessive disk space consumption therefore , the translog is automatically rolled to a new generation when the current generation exceeds this generation threshold size

public byte size value get generation threshold size ( ) { return generation threshold size ; }


creates a trigger that continuously fires based on the given interval

public static < w extends window > continuous processing time trigger < w > of ( time interval ) { return new continuous processing time trigger < > ( interval to milliseconds ( ) ) ; }


returns this long value , shifted left by the given specific long value

public long value shift left ( specific long value other ) { return this ; }


clears any cached glyphs and adds glyphs for the specified text

public glyph layout set text ( char sequence str , float x , float y ) { clear ( ) ; return add text ( str , x , y , 0 , str length ( ) , 0 , align left , false ) ; }


explicitly update the dependency tree this method is called independently of stream state changes

void update dependency tree ( int child stream id , int parent stream id , short weight , boolean exclusive ) ;


returns the system time taken by the { @ link spawn } ' s execution

optional < duration > get system time ( ) ;


deletes the reference to a script that has previously been pinned subsequent calls to { @ link # execute script ( script key , object ) } will fail for the given { @ code key }

default void unpin ( script key key ) { require non null ( " key to unpin " , key ) ; require state condition ( key instanceof unpinned script key , " script key should have been generated by this driver " ) ; unpinned script key unpin ( this , ( unpinned script key ) key ) ; }


configure code points to be stripped in conversion to { @ code java net uri } that class is more strict than the others

public url component encoding tester strip for uri ( int code points ) { uri stripped code points append ( new string ( code points , 0 , code points length ) ) ; return this ; }


only select tasks with the given { @ link delegation state }

task query task delegation state ( delegation state delegation state ) ;


called when a publisher has published an event to the { @ link ring buffer } the { @ link batch event processor } will read messages from the { @ link ring buffer } in batches , where a batch is all of the events available to be processed without having to wait for any new event to arrive this can be useful for event handlers that need to do slower operations like io as they can group together the data from multiple events into a single operation implementations should ensure that the operation is always performed when end of batch is true as the time between that message and the next one is indeterminate

void on event ( t event , long sequence , boolean end of batch ) throws exception ;


publish the specified sequence this action marks this particular message as being available to be read

public void publish ( long sequence ) { sequencer publish ( sequence ) ; }


protected void check address set options panel ( boolean exclude accepted , boolean limit address sets ) { / / address set options panel wizard panel current wizard panel = wizard manager get current wizard panel ( ) ; assert not null ( current wizard panel ) ; assert true ( current wizard panel instanceof address set options panel ) ; address set options panel address set options panel = ( address set options panel ) current wizard panel ; j check box exclude checkbox = ( j check box ) test utils get instance field ( " exclude checkbox " , address set options panel ) ; assert not null ( exclude checkbox ) ; j check box show address set panels checkbox = ( j check box ) test utils get instance field ( " show address set panels checkbox " , address set options panel ) ; assert not null ( show address set panels checkbox ) ; assert equals ( " exclude accepted matches checkbox " , exclude accepted , exclude checkbox is selected ( ) ) ; assert equals ( " limit address sets checkbox " , limit address sets , show address set panels checkbox is selected ( ) ) ; }


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


tests the independence of the writer index via { @ link read only sliced network buffer # set size ( int ) } , { @ link read only sliced network buffer # get size ( ) }

public void test get set size 2 ( ) { test get set size ( buffer read only slice ( 1 , 2 ) , 2 ) ; }


gets the composite editor actions that are currently added to this action manager the favorites and cycle groups actions that the manager created by default are not part of the actions returned

public composite editor table action [ ] get editor actions ( ) { return editor actions to array ( new composite editor table action [ editor actions size ( ) ] ) ; }


public boolean is arg ( string string ) { return args contains key ( string ) ; }


evaluate the condition and if not null , return it if it is null , return the other value

public typed value get value internal ( expression state state ) throws evaluation exception { typed value value = this children [ 0 ] get value internal ( state ) ; / / if this check is changed , the generate code method will need changing too if ( value get value ( ) ! = null & & ! " " equals ( value get value ( ) ) ) { return value ; } else { typed value result = this children [ 1 ] get value internal ( state ) ; compute exit type descriptor ( ) ; return result ; } }


disk balancer cluster get cluster ( ) { return cluster ; }


similar to { @ link runtime service # start process instance by message ( string , map < string , object > ) } , but with tenant context

process instance start process instance by message and tenant id ( string message name , map < string , object > process variables , string tenant id ) ;


removes the items between the specified indices , inclusive

public void remove range ( int start , int end ) { int n = size ; if ( end > = n ) throw new index out of bounds exception ( " end can ' t be > = size : " + end + " > = " + size ) ; if ( start > end ) throw new index out of bounds exception ( " start can ' t be > end : " + start + " > " + end ) ; int count = end - start + 1 , last index = n - count ; if ( ordered ) system arraycopy ( items , start + count , items , start , n - ( start + count ) ) ; else { int i = math max ( last index , end + 1 ) ; system arraycopy ( items , i , items , start , n - i ) ; } size = n - count ; }


see { @ link file status # get block size ( ) }


public cancellable evaluate data frame async ( evaluate data frame request request , request options options , action listener < evaluate data frame response > listener ) { return rest high level client perform request async and parse entity ( request , m l request converters : : evaluate data frame , options , evaluate data frame response : : from x content , listener , collections empty set ( ) ) ; }


get all the unique principals from keytabfile which matches a pattern

public static final string [ ] get principal names ( string keytab , pattern pattern ) throws i o exception { string [ ] principals = get principal names ( keytab ) ; if ( principals length ! = 0 ) { list < string > matching principals = new array list < string > ( ) ; for ( string principal : principals ) { if ( pattern matcher ( principal ) matches ( ) ) { matching principals add ( principal ) ; } } principals = matching principals to array ( new string [ 0 ] ) ; } return principals ; }


returns an { @ link index range iterator } over all ranges that have associated objects

public index range iterator get index range iterator ( ) { return new simple index range iterator ( ) ; }


configures a listener which is notified when a new access token is received

public api client register access token listener ( access token listener access token listener ) { for ( interceptor api authorization : api authorizations values ( ) ) { if ( api authorization instanceof o auth ) { o auth oauth = ( o auth ) api authorization ; oauth register access token listener ( access token listener ) ; return this ; } } return this ; }


public void set data id ( string data id ) { this data id = data id ; }


returns the list of { @ link update center job } representing scheduled installation attempts

public list < update center job > get jobs ( ) { synchronized ( jobs ) { return new array list < > ( jobs ) ; } }


returns a predicate that always evaluates to { @ code true }

public static < t > predicate < t > always true ( ) { return object predicate always true with narrowed type ( ) ; }


gets the repository browser descriptor by name primarily used for making them web - visible

public descriptor < repository browser < ? > > get repository browser ( string short class name ) { return find descriptor ( short class name , repository browser all ( ) ) ; }


returns the minimal window covers both this window and the given window

public time window cover ( time window other ) { return new time window ( math min ( start , other start ) , math max ( end , other end ) ) ; }


check whether this operation has been compiled already ; lazily compile it if not already compiled automatically called by { @ code do execute }


test that ask directory method auto - populates dialog with value in properties file also test that subsequent calls to the dialog show the last - used value

public void test ask directory ( ) throws exception { / / create temporary directories , then create a temporary properties file that contains / / the path to one of the temporary directory string temp dir path = abstract g test get test directory path ( ) ; file temp dir = new file ( temp dir path ) ; file temp sub dir = new file ( temp dir , temp sub dir ) ; file another temp sub dir = new file ( temp dir , " another temp dir " ) ; file temp properties file = new file ( temp dir , " temp properties file properties " ) ; temp properties file delete on exit ( ) ; file utilities delete dir ( temp sub dir ) ; file utilities delete dir ( another temp sub dir ) ; temp properties file delete ( ) ; / / first , create temporary dirs assert true ( " directory ' " + temp sub dir get absolute path ( ) + " ' should have been created ! " , temp sub dir mkdir ( ) ) ; assert true ( " directory ' " + another temp sub dir get absolute path ( ) + " ' should have been created ! " , another temp sub dir mkdir ( ) ) ; / / next , create properties file that contains the path to one of the dirs assert true ( " file ' " + temp properties file get absolute path ( ) + " ' should have been created ! " , temp properties file create new file ( ) ) ; / / write the path to the file to the properties file file writer output = new file writer ( temp properties file ) ; buffered writer writer = new buffered writer ( output ) ; writer write ( " choose your directory : choose ! = " + temp sub dir get absolute path ( ) ) ; writer close ( ) ; create script ( ) ; final file [ ] my dir = new file [ 1 ] ; / / load properties value ( s ) script set properties file ( temp properties file ) ; execute on swing without blocking ( ( ) - > { try { my dir [ 0 ] = script ask directory ( " choose your directory : " , " choose ! " ) ; } catch ( exception e ) { fail with exception ( " exception was caught in this test : " + e get message ( ) , e ) ; } } ) ; ghidra file chooser file chooser = wait for dialog component ( ghidra file chooser class ) ; wait for update on directory ( file chooser ) ; assert not null ( file chooser ) ; press button by text ( file chooser , " choose ! " ) ; wait for swing ( ) ; / / compare default value to expected properties value assert equals ( temp sub dir , my dir [ 0 ] ) ; / / choose another directory execute on swing without blocking ( ( ) - > { try { my dir [ 0 ] = script ask directory ( " choose your directory : " , " choose ! " ) ; } catch ( exception e ) { fail with exception ( " exception was caught in this test : " + e get message ( ) , e ) ; } } ) ; file chooser = wait for dialog component ( ghidra file chooser class ) ; file chooser set selected file ( another temp sub dir ) ; wait for update on directory ( file chooser ) ; press button by text ( file chooser , " choose ! " ) ; wait for swing ( ) ; / / verify the directory we chose is auto - populated when the dialog comes up again execute on swing without blocking ( ( ) - > { try { my dir [ 0 ] = script ask directory ( " choose your directory : " , " choose ! " ) ; } catch ( exception e ) { fail with exception ( " exception was caught in this test : " + e get message ( ) , e ) ; } } ) ; file chooser = wait for dialog component ( ghidra file chooser class ) ; wait for update on directory ( file chooser ) ; press button by text ( file chooser , " choose ! " ) ; wait for swing ( ) ; assert equals ( another temp sub dir , my dir [ 0 ] ) ; file utilities delete dir ( temp sub dir ) ; file utilities delete dir ( another temp sub dir ) ; }


public void handle ( container scheduler event event ) { switch ( event get type ( ) ) { case schedule container : schedule container ( event get container ( ) ) ; break ; / / note : is sent only after container state has changed to paused case container paused : / / note : is sent only after container state has changed to done case container completed : on resources reclaimed ( event get container ( ) ) ; break ; case update container : if ( event instanceof update container scheduler event ) { on update container ( ( update container scheduler event ) event ) ; } else { log error ( " unknown event type on update c ontainer : " + event get type ( ) ) ; } break ; case shed queued containers : shed queued opportunistic containers ( ) ; break ; case recovery completed : start pending containers ( max opp queue length < = 0 ) ; metrics set queued containers ( queued opportunistic containers size ( ) , queued guaranteed containers size ( ) ) ; break ; default : log error ( " unknown event arrived at container scheduler : " + event to string ( ) ) ; } }


public disk balancer data node get node by name ( string host name ) { return host names get ( host name ) ; }


loads a text resource that is located in a directory on the java classpath that corresponds to the package of < code > relative to class < code > using utf8 encoding e g < code > load resource ( class for name ( " com google foo foo " , " bar txt " ) ) < code > will look for < code > comgooglefoobar txt < code > in the classpath

public static string load resource ( class < ? > relative to class , string resource name ) throws i o exception { try ( input stream stream = get resource as stream ( relative to class , resource name ) ) { if ( stream = = null ) { throw new i o exception ( resource name + " not found " ) ; } return new string ( byte streams to byte array ( stream ) , utf 8 ) ; } }


by default delegates to { @ link object # equals } so instances are only equal if they are identical { @ code proxy equals ( argument ) } returns true if : { @ code proxy } and { @ code argument } are of the same type and this method returns true for the { @ link invocation handler } of { @ code argument } subclasses can override this method to provide custom equality

public boolean equals ( object obj ) { return super equals ( obj ) ; }


public static zoned date time convert to zoned date time ( final string value ) { val dt = zoned date time of ( value ) ; if ( dt ! = null ) { return dt ; } val lt = local date time of ( value ) ; return zoned date time of ( lt at zone ( zone offset utc ) ) ; }


invoked before the folders of a shard are deleted from disk the list of folders contains { @ link path } s that may or may not exist on disk shard locks are expected to be acquired at the time this method is invoked

void before shard folders deleted ( shard id shard id , index settings index settings , path [ ] shard paths ) ;


return the sum of { @ link term # get doc freq ( ) } for all terms that exist in this field , or { @ code - 1 } if this statistic is not available

public long get sum doc freq ( ) { return sum doc freq ; }


called when a session expiration update occurs , to inform the app about the change in expiration time

void on expiration update ( exo media drm media drm , byte [ ] session id , long expiration time ms ) ;


instantiates a new instance which uses widevine cdm call { @ link # release ( ) } when the instance is no longer required

public static offline license helper new widevine instance ( string default license url , boolean force default license url , http data source factory http data source factory , drm session event listener event dispatcher event dispatcher ) { return new widevine instance ( default license url , force default license url , http data source factory , / * optional key request parameters = * / null , event dispatcher ) ; }


sets the { @ link skip callback } to handle skip backward and skip forward

public session callback builder set skip callback ( @ nullable skip callback skip callback ) { this skip callback = skip callback ; return this ; }


loads the internal doc id and sequence number of the latest copy for a given uid from the provided reader the result is either null or the live and latest version of the given uid

public static doc id and seq no load doc id and seq no ( index reader reader , term term ) throws i o exception { final per thread i d version and seq no lookup [ ] lookups = get lookup state ( reader , term field ( ) ) ; final list < leaf reader context > leaves = reader leaves ( ) ; / / iterate backwards to optimize for the frequently updated documents / / which are likely to be in the last segments for ( int i = leaves size ( ) - 1 ; i > = 0 ; i - - ) { final leaf reader context leaf = leaves get ( i ) ; final per thread i d version and seq no lookup lookup = lookups [ leaf ord ] ; final doc id and seq no result = lookup lookup seq no ( term bytes ( ) , leaf ) ; if ( result ! = null ) { return result ; } } return null ; }


index the map in { @ link requests # index content type } format

public index request source ( map < string , ? > source ) throws elasticsearch generation exception { return source ( source , requests index content type ) ; }


create a codegen parameter for a form property we have a custom version of this method so we can invoke set parameter example value ( codegen parameter , parameter ) rather than set parameter example value ( codegen parameter ) this ensures that all of our samples are generated in to example value recursive

public codegen parameter from form property ( string name , schema property schema , set < string > imports ) { codegen parameter cp = super from form property ( name , property schema , imports ) ; parameter p = new parameter ( ) ; p set schema ( property schema ) ; p set name ( cp param name ) ; set parameter example value ( cp , p ) ; return cp ; }


this method is called when files have been successfully dropped

public abstract void files dropped ( java io file [ ] files ) ;


gets whether to set filter bitmap flag flag to paint

public boolean get paint filter bitmap ( ) { return m paint filter bitmap ; }


should the node indices info be returned

public nodes info request builder set indices ( boolean indices ) { add or remove metric ( indices , nodes info request metric indices ) ; return this ; }


returns the name of the test method invoked by this test instance

public final string get test method name ( ) { return super get name ( ) ; }


returns the precision of this { @ link decimal data } the precision is the number of digits in the unscaled value

public int precision ( ) { return precision ; }


adds a route to the given handler function that handles all http { @ code head } requests that match the given pattern

builder head ( string pattern , handler function < server response > handler function ) ;


repeated weak compare and set succeeds in changing value when equal to expected

public void test weak compare and set ( ) { double prev = math e ; double unused = math e + math pi ; atomic double at = new atomic double ( prev ) ; for ( double x : values ) { assert bit equals ( prev , at get ( ) ) ; assert false ( at weak compare and set ( unused , x ) ) ; assert bit equals ( prev , at get ( ) ) ; while ( ! at weak compare and set ( prev , x ) ) { ; } assert bit equals ( x , at get ( ) ) ; prev = x ; } }


public static < e > array deque < e > new array deque ( ) { return new array deque < e > ( ) ; }


like assert false , but fails at the end of the test ( during tear down )

public void verify false ( boolean b ) { stb verify false ( b ) ; }


set the bean name generator to use for detected bean classes default is a { @ link annotation bean name generator }

public void set bean name generator ( @ nullable bean name generator bean name generator ) { this bean name generator = ( bean name generator ! = null ? bean name generator : annotation bean name generator instance ) ; }


creates a new { @ code set multimap } that uses the provided map and factory it can generate a multimap based on arbitrary { @ link map } and { @ link set } classes the { @ code factory } - generated and { @ code map } classes determine the multimap iteration order they also specify the behavior of the { @ code equals } , { @ code hash code } , and { @ code to string } methods for the multimap and its returned views however , the multimap ' s { @ code get } method returns instances of a different class than { @ code factory get ( ) } does the multimap is serializable if { @ code map } , { @ code factory } , the sets generated by { @ code factory } , and the multimap contents are all serializable the multimap is not threadsafe when any concurrent operations update the multimap , even if { @ code map } and the instances generated by { @ code factory } are concurrent read operations will work correctly to allow concurrent update operations , wrap the multimap with a call to { @ link # synchronized set multimap } call this method only when the simpler methods { @ link hash multimap # create ( ) } , { @ link linked hash multimap # create ( ) } , { @ link tree multimap # create ( ) } , and { @ link tree multimap # create ( comparator , comparator ) } won ' t suffice note : the multimap assumes complete ownership over of { @ code map } and the sets returned by { @ code factory } those objects should not be manually updated and they should not use soft , weak , or phantom references

public static < k , v > set multimap < k , v > new set multimap ( map < k , collection < v > > map , final supplier < ? extends set < v > > factory ) { return new custom set multimap < > ( map , factory ) ; }


public kind get kind ( ) { return generating rule get rule class object ( ) get output file kind ( ) ; }


tests that the size of { @ link file archived execution graph store } is no more than the configured max capacity and the old execution graphs will be purged if the total added number exceeds the max capacity

public void test maximum capacity ( ) throws i o exception { final file root dir = temporary folder new folder ( ) ; final int max capacity = 10 ; final int number execution graphs = 10 ; final collection < archived execution graph > old execution graphs = generate terminal execution graphs ( number execution graphs ) ; final collection < archived execution graph > new execution graphs = generate terminal execution graphs ( number execution graphs ) ; final collection < job details > job details = generate job details ( new execution graphs ) ; try ( final file archived execution graph store execution graph store = new file archived execution graph store ( root dir , time hours ( 1l ) , max capacity , 10000l , testing utils default scheduled executor ( ) , ticker system ticker ( ) ) ) { for ( archived execution graph execution graph : old execution graphs ) { execution graph store put ( execution graph ) ; / / no more than the configured maximum capacity assert true ( execution graph store size ( ) < = max capacity ) ; } for ( archived execution graph execution graph : new execution graphs ) { execution graph store put ( execution graph ) ; / / equals to the configured maximum capacity assert equals ( max capacity , execution graph store size ( ) ) ; } / / the older execution graphs are purged assert that ( execution graph store get available job details ( ) , matchers contains in any order ( job details to array ( ) ) ) ; } }


returns the shard criteria to get store information on

public enum set < cluster health status > shard statuses ( ) { return statuses ; }


creates a new solution set update output collector this collector is used by { @ link iteration intermediate task } or { @ link iteration tail task } to update the solution set of workset iterations depending on the task configuration , either a fast ( non - probing ) { @ link org apache flink runtime iterative io solution set fast update output collector } or normal ( re - probing ) { @ link solution set update output collector } is created if a non - null delegate is given , the new { @ link collector } will write back to the solution set and also call collect ( t ) of the delegate

protected collector < ot > create solution set update output collector ( collector < ot > delegate ) { broker < object > solution set broker = solution set broker instance ( ) ; object ss = solution set broker get ( broker key ( ) ) ; if ( ss instanceof compacting hash table ) { @ suppress warnings ( " unchecked " ) compacting hash table < ot > solution set = ( compacting hash table < ot > ) ss ; return new solution set update output collector < ot > ( solution set , delegate ) ; } else if ( ss instanceof join hash map ) { @ suppress warnings ( " unchecked " ) join hash map < ot > map = ( join hash map < ot > ) ss ; return new solution set objects update output collector < ot > ( map , delegate ) ; } else { throw new runtime exception ( " unrecognized solution set handle : " + ss ) ; } }


returns the current index of the pdb byte reader

public int get index ( ) { return index ; }


flushes both the adapter and the underlying { @ link media codec }


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

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


exception to be thrown when a feature action requires a valid license , but license has expired < code > feature < code > accessible through { @ link # expired feature metadata } in the exception ' s rest header

public static elasticsearch security exception new compliance exception ( string feature ) { elasticsearch security exception e = new elasticsearch security exception ( " current license is non - compliant for [ { } ] " , rest status forbidden , feature ) ; e add metadata ( expired feature metadata , feature ) ; return e ; }


get the covariance between the two fields

public double get covariance ( string field x , string field y ) { if ( results = = null ) { return double na n ; } return results get covariance ( field x , field y ) ; }


returns a generic iso date parser for parsing local dates the returned formatter can only be used for parsing , printing is unsupported this parser is initialised with the local ( utc ) time zone it accepts formats described by the following syntax : date - element = std - date - element | ord - date - element | week - date - element std - date - element = yyyy [ ' - ' mm [ ' - ' dd ] ] ord - date - element = yyyy [ ' - ' ddd ] week - date - element = xxxx ' - w ' ww [ ' - ' e ]

public static date time formatter local date parser ( ) { return constants ldp ; }


returns a formatter for a full date as four digit year , two digit month of year , and two digit day of month ( yyyy - mm - dd ) the returned formatter prints and parses only this format see { @ link # date parser ( ) } for a more flexible parser that accepts different formats

public static date time formatter date ( ) { return year month day ( ) ; }


get a cci connection , either from the current transaction or a new one

protected final connection get connection ( ) throws org springframework jca cci cannot get cci connection exception { connection factory connection factory = get connection factory ( ) ; assert state ( connection factory ! = null , " no connection factory set " ) ; return org springframework jca cci connection connection factory utils get connection ( connection factory ) ; }


creates list of users with given input array

public api response < void > create users with array input with http info ( list < user > body ) throws api exception { http request builder local var request builder = create users with array input request builder ( body ) ; try { http response < input stream > local var response = member var http client send ( local var request builder build ( ) , http response body handlers of input stream ( ) ) ; if ( member var response interceptor ! = null ) { member var response interceptor accept ( local var response ) ; } if ( local var response status code ( ) / 100 ! = 2 ) { throw new api exception ( local var response status code ( ) , " create users with array input call received non - success response " , local var response headers ( ) , local var response body ( ) = = null ? null : new string ( local var response body ( ) read all bytes ( ) ) ) ; } return new api response < void > ( local var response status code ( ) , local var response headers ( ) map ( ) , null ) ; } catch ( i o exception e ) { throw new api exception ( e ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new api exception ( e ) ; } }


public static string get u s week ( final date date ) { return new simple date format ( " eeee " , locale us ) format ( date ) ; }


determine if the current resource should replaced the checked one based on its version ( or lack thereof ) this expects a response like ( where { @ code resource name } is replaced with its value ) : < code > { " resource name " : { " version " : 6000002 } } < code >

protected boolean should replace resource ( final response response , final x content x content , final string resource name , final int minimum version ) throws i o exception { / / no named content used ; so empty is fine final map < string , object > resources = x content helper convert to map ( x content , response get entity ( ) get content ( ) , false ) ; / / if it ' s empty , then there ' s no version in the response thanks to filter path if ( resources is empty ( ) = = false ) { @ suppress warnings ( " unchecked " ) final map < string , object > resource = ( map < string , object > ) resources get ( resource name ) ; final object version = resource ! = null ? resource get ( " version " ) : null ; / / the version in the template is expected to include the alpha / beta / rc codes as well if ( version instanceof number ) { return ( ( number ) version ) int value ( ) < minimum version ; } } return true ; }


return a { @ link sorted numeric double values } that doesn ' t contain any value

public static multi geo point values empty multi geo points ( ) { return singleton ( empty geo point ( ) ) ; }


return the part size for multipart upload used by { @ link o b s block output stream }

long get part size ( ) { return part size ; }


public boolean match ( string value ) { return expression = = null | | expression matcher ( value ) matches ( ) ; }


returns the client environment with all settings from - - action env and - - repo env

public map < string , string > get repo env ( ) { return collections unmodifiable map ( repo env ) ; }


tests that if the remote end closes connection ungracefully during ssl handshake while writing data , the disconnection is not treated as an authentication failure

public void test ungraceful remote close during handshake write ( args args ) throws exception { server = create echo server ( args , security protocol ssl ) ; test i o exceptions during handshake ( args , failure action no op , server : : close socket channels ) ; }


perform the given callback operation on all matching methods of the given class and superclasses the same named method occurring on subclass and superclass will appear twice , unless excluded by a { @ link method filter }

public static void do with methods ( class < ? > clazz , method callback mc ) { do with methods ( clazz , mc , null ) ; }


accepts all visitors but honors only hayes visitor

public void accept ( modem visitor modem visitor ) { if ( modem visitor instanceof hayes visitor ) { ( ( hayes visitor ) modem visitor ) visit ( this ) ; } else { logger info ( " only hayes visitor is allowed to visit hayes modem " ) ; } }


get a datanode which does not contain the block

private datanode info get datanode out of the block ( located striped block blk ) throws exception { datanode info [ ] all dn infos = client datanode report ( datanode report type live ) ; datanode info [ ] blk dn inos = blk get locations ( ) ; for ( datanode info dn info : all dn infos ) { boolean in = false ; for ( datanode info blk dn info : blk dn inos ) { if ( blk dn info equals ( dn info ) ) { in = true ; } } if ( ! in ) { return dn info ; } } return null ; }


the offset of the transform from the world origin ( which at the time of writing is the ( 0 , 0 ) at the upper left - hand corner of the gui this is for the view transformer , which also potentially has a scale applied to the transform

public point get view translate coordinates ( ) { return view translate coordinates ; }


updates the progress message details associated with this phase of the merge

protected void update progress message ( string message ) { merge manager update progress ( message ) ; }


add an action to set the alpha of a view can be called multiple times alpha between 0 - 1

public base adapter helper set alpha ( int view id , float value ) { if ( build version sdk int > = build version codes honeycomb ) { retrieve view ( view id ) set alpha ( value ) ; } else { / / pre - honeycomb hack to set alpha value alpha animation alpha = new alpha animation ( value , value ) ; alpha set duration ( 0 ) ; alpha set fill after ( true ) ; retrieve view ( view id ) start animation ( alpha ) ; } return this ; }


protected void init object readers ( ) { this object readers clear ( ) ; if ( ! this register defaults ) { return ; } if ( kotlin serialization json present ) { add codec ( this object readers , new decoder http message reader < > ( get kotlin serialization json decoder ( ) ) ) ; } if ( jackson 2 present ) { add codec ( this object readers , new decoder http message reader < > ( get jackson 2 json decoder ( ) ) ) ; } if ( jackson 2 smile present ) { add codec ( this object readers , new decoder http message reader < > ( this jackson 2 smile decoder ! = null ? ( jackson 2 smile decoder ) this jackson 2 smile decoder : new jackson 2 smile decoder ( ) ) ) ; } if ( jaxb 2 present & & ! should ignore xml ) { add codec ( this object readers , new decoder http message reader < > ( this jaxb 2 decoder ! = null ? ( jaxb 2 xml decoder ) this jaxb 2 decoder : new jaxb 2 xml decoder ( ) ) ) ; } / / client vs server extend object readers ( this object readers ) ; }


testing read ahead counters in abfs input stream with 30 seconds timeout

public void test read ahead counters ( ) throws i o exception { describe ( " test to check correct values for read ahead counters in " + " abfs input stream " ) ; azure blob file system fs = get file system ( ) ; azure blob file system store abfss = fs get abfs store ( ) ; path read ahead counters path = path ( get method name ( ) ) ; / * * setting the block size for read ahead as 4kb * / abfss get abfs configuration ( ) set read buffer size ( custom block buffer size ) ; abfs output stream out = null ; abfs input stream in = null ; try { / * * creating a file of 1mb size * / out = create abfs output stream with flush enabled ( fs , read ahead counters path ) ; out write ( def buffer ) ; out close ( ) ; in = abfss open file for read ( read ahead counters path , fs get fs statistics ( ) ) ; / * * reading 1kb after each i * kb positions hence the reads are from 0 * to 1kb , 1kb to 2kb , and so on for 5 operations * / for ( int i = 0 ; i < 5 ; i + + ) { in seek ( one kb * i ) ; in read ( def buffer , one kb * i , one kb ) ; } abfs input stream statistics impl stats = ( abfs input stream statistics impl ) in get stream statistics ( ) ; / * * verifying the counter values of read ahead bytes read and remote bytes read * * read ahead bytes read : since , we read 1 k bs 5 times , that means we go * from 0 to 5kb in the file the buffer size is set to 4kb , and since * we have 8 blocks of read ahead buffer we would have 8 blocks of 4kb * buffer our read is till 5kb , hence read ahead would ideally read 2 * blocks of 4kb which is equal to 8kb but , sometimes to get blocks * from read ahead buffer we might have to wait for background * threads to fill the buffer and hence we might do remote read which * would be faster therefore , read ahead bytes read would be greater than * or equal to the value of bytes from read ahead at the point we measure it * * remote bytes read : since , the buffer size is set to 4kb and the number * of blocks or read ahead queue depth is equal to 8 we would read 8 * 4 * kb buffer on the first read , which is equal to 32kb but , if we are not * able to read some bytes that were in the buffer after doing * read ahead , we might use remote read again thus , the bytes read * remotely would be greater than or equal to the bytes from remote read * value that we measure at some point of the operation * * / assertions assert that ( stats get read ahead bytes read ( ) ) described as ( " mismatch in read ahead bytes read counter value " ) is greater than or equal to ( in get bytes from read ahead ( ) ) ; assertions assert that ( stats get remote bytes read ( ) ) described as ( " mismatch in remote bytes read counter value " ) is greater than or equal to ( in get bytes from remote read ( ) ) ; } finally { i o utils cleanup with logger ( log , out , in ) ; } }


send the { @ link recycler collection component } a request to scroll the content to the next item in the binder

public void request scroll to next position ( boolean animated ) { final int default target = math max ( 0 , m last completely visible item position + 1 ) ; final int snap target = get smooth scroll target ( true , default target ) ; request scroll to position inner ( animated , default target , snap target ) ; }


privileged wrapper that invokes action with subject do as to perform work as given subject

static < t > t do as privileged wrapper ( final subject subject , final privileged exception action < t > action , final access control context acc ) throws privileged action exception { try { return access controller do privileged ( ( privileged exception action < t > ) ( ) - > subject do as privileged ( subject , action , acc ) ) ; } catch ( privileged action exception pae ) { if ( pae get cause ( ) instanceof privileged action exception ) { throw ( privileged action exception ) pae get cause ( ) ; } throw pae ; } }


retrieve the { @ link web application context } reference to expose the default implementation delegates to { @ link faces context utils } , returning { @ code null } if no { @ code web application context } found

protected web application context get web application context ( e l context el context ) { faces context faces context = faces context get current instance ( ) ; return faces context utils get required web application context ( faces context ) ; }


creates a new { @ link request options } instance

public static request options mock request options ( ) { return mock glide options ( request options class ) ; }


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


set the adapter for this { @ link card stack layout }

public void set adapter ( card stack adapter adapter ) { this m adapter = adapter ; m adapter set adapter params ( this ) ; for ( int i = 0 ; i < m adapter get count ( ) ; i + + ) { m adapter add view ( i ) ; } if ( m show init animation ) { post delayed ( this : : restore cards , 500 ) ; } }


returns a range that contains all values strictly greater than { @ code lower } and strictly less than { @ code upper }

public static < c extends comparable < ? > > range < c > open ( c lower , c upper ) { return create ( cut above value ( lower ) , cut below value ( upper ) ) ; }


returns the message producer , only valid after activate options ( ) method has been invoked

protected m q producer get producer ( ) { return producer ; }


copy what we can from buffer if it ' s not enough , fill buffer again and copy again

synchronized public int read ( char [ ] cbuf , int off , int len ) throws i o exception { / / this could be faster , but probably wont be used byte [ ] b = new byte [ 2 ] ; int bytesread = 0 ; while ( len > 0 ) { int read = read ( b , 0 , 2 ) ; bytesread + = read ; if ( read < 2 ) { return bytesread ; } cbuf [ off ] = ( char ) ( ( b [ 0 ] < < 8 ) | ( b [ 1 ] & 0xff ) ) ; off + = read ; len - = read ; } return bytesread ; }


constructs an { @ link options data } object for a parser that knows about the given { @ link options base } classes in addition to the work done to construct the { @ link isolated options data } , this also computes expansion information if an option has static expansions or uses an expansion function that takes a void object , try to precalculate the expansion here

static options data from ( collection < class < ? extends options base > > classes ) { isolated options data isolated data = isolated options data from ( classes ) ; / / all that ' s left is to compute expansions immutable map builder < option definition , immutable list < string > > evaluated expansions builder = immutable map builder ( ) ; for ( map entry < string , option definition > entry : isolated data get all option definitions ( ) ) { option definition option definition = entry get value ( ) ; / / determine either the hard - coded expansion , or the expansion function class the / / option processor checks at compile time that these aren ' t used together string [ ] const expansion = option definition get option expansion ( ) ; class < ? extends expansion function > expansion function class = option definition get expansion function ( ) ; if ( const expansion length > 0 ) { evaluated expansions builder put ( option definition , immutable list copy of ( const expansion ) ) ; } else if ( option definition uses expansion function ( ) ) { if ( modifier is abstract ( expansion function class get modifiers ( ) ) ) { throw new assertion error ( " the expansion function type " + expansion function class + " must be a concrete type " ) ; } / / evaluate the expansion function expansion function instance ; try { constructor < ? > constructor = expansion function class get constructor ( ) ; instance = ( expansion function ) constructor new instance ( ) ; } catch ( exception e ) { / / this indicates an error in the expansion function , and should be discovered the first / / time it is used throw new assertion error ( e ) ; } immutable list < string > expansion = instance get expansion ( isolated data ) ; evaluated expansions builder put ( option definition , expansion ) ; } } return new options data ( isolated data , evaluated expansions builder build ( ) ) ; }


returns the objc provider for this target , or optional absent ( ) if there were no protos to generate

public optional < objc provider > get objc provider ( ) { return objc provider ; }


public order place order ( order body ) throws api exception { object local var post body = body ; / / verify the required parameter ' body ' is set if ( body = = null ) { throw new api exception ( 400 , " missing the required parameter ' body ' when calling place order " ) ; } / / create path and map variables string local var path = " / store / order " replace all ( " \ \ { format \ \ } " , " json " ) ; / / query params list < pair > local var query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " application / xml " , " application / json " } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; generic type < order > local var return type = new generic type < order > ( ) { } ; return api client invoke a p i ( local var path , " post " , local var query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , local var return type ) ; }


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


public void set reserved ( long reserved size ) { this reserved = reserved size ; }


returns the ratio of cache requests which were misses this is defined as { @ code miss count request count } , or { @ code 0 0 } when { @ code request count = = 0 } note that { @ code hit rate + miss rate = ~ 1 0 } cache misses include all requests which weren ' t cache hits , including requests which resulted in either successful or failed loading attempts , and requests which waited for other threads to finish loading it is thus the case that { @ code miss count & gt ; = load success count + load exception count } multiple concurrent misses for the same key will result in a single load operation

public double miss rate ( ) { long request count = request count ( ) ; return ( request count = = 0 ) ? 0 0 : ( double ) miss count / request count ; }


requests an immediate publish of all metrics from sources to sinks

public synchronized void publish metrics now ( ) { if ( sinks size ( ) > 0 ) { publish metrics ( sample metrics ( ) , true ) ; } }


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

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


@ serial data the key class , value class , number of entries , first key , first value , second key , second value , and so on

private void write object ( object output stream stream ) throws i o exception { stream default write object ( ) ; stream write object ( key type ) ; stream write object ( value type ) ; serialization write map ( this , stream ) ; }


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


returns the context for the current selection


returns whether the given class or its subclasses shadow any fields in the given target class

private boolean shadows any fields ( clazz clazz , clazz target class ) { member counter counter = new member counter ( ) ; / / visit all fields , counting the ones that are shadowing non - private / / fields in the class hierarchy of the target class clazz hierarchy accept ( true , false , false , true , new all field visitor ( new similar member visitor ( target class , true , true , true , false , new member access filter ( 0 , class constants acc private , counter ) ) ) ) ; return counter get count ( ) > 0 ; }


public target state target state ( string connector ) { return connector target states get ( connector ) ; }


walk through all regex mount points to see whether the path match any regex expressions e g link : ^ user ( ? < username > \ \ w + ) = > s 3 : $ user apache com $ { user } src path : is userhadoopdir 1 resolve last component : true then return value is s 3 : hadoop apache com hadoop

protected resolve result < t > try resolve in regex mountpoint ( final string src path , final boolean resolve last component ) { for ( regex mount point regex mount point : regex mount point list ) { resolve result resolve result = regex mount point resolve ( src path , resolve last component ) ; if ( resolve result ! = null ) { return resolve result ; } } return null ; }