returns the elements of { @ code unfiltered } that satisfy a predicate the returned set is a live view of { @ code unfiltered } ; changes to one affect the other the resulting set ' s iterator does not support { @ code remove ( ) } , but all other set methods are supported when given an element that doesn ' t satisfy the predicate , the set ' s { @ code add ( ) } and { @ code add all ( ) } methods throw an { @ link illegal argument exception } when methods such as { @ code remove all ( ) } and { @ code clear ( ) } are called on the filtered set , only elements that satisfy the filter will be removed from the underlying set the returned set isn ' t threadsafe or serializable , even if { @ code unfiltered } is many of the filtered set ' s methods , such as { @ code size ( ) } , iterate across every element in the underlying set and determine which elements satisfy the filter when a live view is not needed , it may be faster to copy { @ code iterables filter ( unfiltered , predicate ) } and use the copy < b > warning : < b > { @ code predicate } must be consistent with equals , as documented at { @ link predicate # apply } do not provide a predicate such as { @ code predicates instance of ( array list class ) } , which is inconsistent with equals ( see { @ link iterables # filter ( iterable , class ) } for related functionality ) < b > java 8 users : < b > many use cases for this method are better addressed by { @ link java util stream stream # filter } this method is not being deprecated , but we gently encourage you to migrate to streams

public static < e > set < e > filter ( set < e > unfiltered , predicate < ? super e > predicate ) { if ( unfiltered instanceof sorted set ) { return filter ( ( sorted set < e > ) unfiltered , predicate ) ; } if ( unfiltered instanceof filtered set ) { / / support clear ( ) , remove all ( ) , and retain all ( ) when filtering a filtered / / collection filtered set < e > filtered = ( filtered set < e > ) unfiltered ; predicate < e > combined predicate = predicates < e > and ( filtered predicate , predicate ) ; return new filtered set < e > ( ( set < e > ) filtered unfiltered , combined predicate ) ; } return new filtered set < e > ( check not null ( unfiltered ) , check not null ( predicate ) ) ; }


helper method for parsing specs into an intermediary open a p i structure for pre - processing use this method only for tests targeting processing helpers such as { @ link org openapitools codegen utils model utils } or { @ link inline model resolver } using this for testing generators will mean you ' re not testing the open a p i document in a state the generator will be presented at runtime

public static open a p i parse spec ( string spec file path ) { open a p i open a p i = new open a p i parser ( ) read location ( spec file path , null , new parse options ( ) ) get open a p i ( ) ; / / invoke helper function to get the original swagger version / / see https : / / github com / swagger - api / swagger - parser / pull / 1374 / / also see https : / / github com / swagger - api / swagger - parser / issues / 1369 model utils get open api version ( open a p i , spec file path , null ) ; return open a p i ; }


register member ( nested ) classes that happen to be configuration classes themselves

private void process member classes ( configuration class config class , source class source class , predicate < string > filter ) throws i o exception { collection < source class > member classes = source class get member classes ( ) ; if ( ! member classes is empty ( ) ) { list < source class > candidates = new array list < > ( member classes size ( ) ) ; for ( source class member class : member classes ) { if ( configuration class utils is configuration candidate ( member class get metadata ( ) ) & & ! member class get metadata ( ) get class name ( ) equals ( config class get metadata ( ) get class name ( ) ) ) { candidates add ( member class ) ; } } order comparator sort ( candidates ) ; for ( source class candidate : candidates ) { if ( this import stack contains ( config class ) ) { this problem reporter error ( new circular import problem ( config class , this import stack ) ) ; } else { this import stack push ( config class ) ; try { process configuration class ( candidate as config class ( config class ) , filter ) ; } finally { this import stack pop ( ) ; } } } } }


convenience method that creates an http < code > url < code > for the http f s server file system operations < p >

static url create u r l ( path path , map < string , string > params , map < string , list < string > > multi valued params ) throws i o exception { uri uri = path to uri ( ) ; string real scheme ; if ( uri get scheme ( ) equals ignore case ( http f s file system scheme ) ) { real scheme = " http " ; } else if ( uri get scheme ( ) equals ignore case ( https f s file system scheme ) ) { real scheme = " https " ; } else { throw new illegal argument exception ( message format format ( " invalid scheme [ { 0 } ] it should be ' " + http f s file system scheme + " ' " + " or ' " + https f s file system scheme + " ' " , uri ) ) ; } string builder sb = new string builder ( ) ; sb append ( real scheme ) append ( " : / / " ) append ( uri get authority ( ) ) append ( service path ) append ( uri get path ( ) ) ; string separator = " ? " ; for ( map entry < string , string > entry : params entry set ( ) ) { sb append ( separator ) append ( entry get key ( ) ) append ( " = " ) append ( u r l encoder encode ( entry get value ( ) , " utf8 " ) ) ; separator = " & " ; } if ( multi valued params ! = null ) { for ( map entry < string , list < string > > multi valued entry : multi valued params entry set ( ) ) { string name = u r l encoder encode ( multi valued entry get key ( ) , " utf8 " ) ; list < string > values = multi valued entry get value ( ) ; for ( string value : values ) { sb append ( separator ) append ( name ) append ( " = " ) append ( u r l encoder encode ( value , " utf8 " ) ) ; separator = " & " ; } } } return new url ( sb to string ( ) ) ; }


report a line to the listener about this cause

public void print ( task listener listener ) { listener get logger ( ) println ( get short description ( ) ) ; }


returns the stored { @ link sky key } or throws { @ link target parsing exception } if one was thrown when computing the key

target pattern key get sky key ( ) throws target parsing exception ;


public void set restitution ( float restitution ) { jni set restitution ( addr , restitution ) ; }


public boolean is empty ( ) { return task times is empty ( ) ; }


set the { @ code m bean exporter listener } s that should be notified of m bean registration and unregistration events

public void set listeners ( m bean exporter listener listeners ) { this listeners = listeners ; }


apply the given cache seconds and generate corresponding http headers , i e allow caching for the given number of seconds in case of a positive value , prevent caching if given a 0 value , do nothing else does not tell the browser to revalidate the resource

protected final void apply cache seconds ( http servlet response response , int cache seconds ) { if ( this use expires header | | ! this use cache control header ) { / / deprecated http 1 0 cache behavior , as in previous spring versions if ( cache seconds > 0 ) { cache for seconds ( response , cache seconds ) ; } else if ( cache seconds = = 0 ) { prevent caching ( response ) ; } } else { cache control c control ; if ( cache seconds > 0 ) { c control = cache control max age ( cache seconds , time unit seconds ) ; if ( this always must revalidate ) { c control = c control must revalidate ( ) ; } } else if ( cache seconds = = 0 ) { c control = ( this use cache control no store ? cache control no store ( ) : cache control no cache ( ) ) ; } else { c control = cache control empty ( ) ; } apply cache control ( response , c control ) ; } }


returns a copy of the model ' s current field selection

public field selection get selection ( ) { return new field selection ( this selection ) ; }


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

public void verify not equals ( boolean s 1 , boolean s 2 ) { stb verify not equals ( s 1 , s 2 ) ; }


register necessary component to distro protocol for http implement

public void do register ( ) { component holder register data storage ( key builder instance list key prefix , new distro data storage impl ( data store , distro mapper ) ) ; component holder register transport agent ( key builder instance list key prefix , new distro http agent ( member manager ) ) ; component holder register failed task handler ( key builder instance list key prefix , new distro http combined key task failed handler ( global config , task engine holder ) ) ; task engine holder register nacos task processor ( key builder instance list key prefix , new distro http delay task processor ( global config , task engine holder ) ) ; component holder register data processor ( consistency service ) ; }


similar to { @ link # create proxy ( object ) } but adds an additional argument before the argument of type { @ code t } note that they may potentially be of the same time when invoked !

public static < t > t create named proxy ( string name , t object ) { return null ; }


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


public double get double ( string key , double def ) { object tmp = m map get ( key ) ; return tmp instanceof number ? ( ( number ) tmp ) double value ( ) : def ; }


maps the given path to the given web socket handler this is currently only available in the embedded server mode

public static void web socket ( string path , class < ? > handler ) { get instance ( ) web socket ( path , handler ) ; }


inserts the string representation of the specified { @ code float } value at the specified { @ code offset } the { @ code float } value is converted to a string according to the rule defined by { @ link string # value of ( float ) }

public string builder insert ( int offset , float f ) { insert 0 ( offset , float to string ( f ) ) ; return this ; }


returns a newly - created immutable bimap the iteration order of the returned bimap is the order in which entries were inserted into the builder , unless { @ link # order entries by value } was called , in which case entries are sorted by value

public immutable bi map < k , v > build ( ) { switch ( size ) { case 0 : return of ( ) ; case 1 : return of ( entries [ 0 ] get key ( ) , entries [ 0 ] get value ( ) ) ; default : / * * if entries is full , or if hash flooding is detected , then this implementation may end * up using the entries array directly and writing over the entry objects with * non - terminal entries , but this is safe ; if this builder is used further , it will grow * the entries array ( so it can ' t affect the original array ) , and future build ( ) calls * will always copy any entry objects that cannot be safely reused * / if ( value comparator ! = null ) { if ( entries used ) { entries = arrays copy of ( entries , size ) ; } arrays sort ( entries , 0 , size , ordering from ( value comparator ) on result of ( maps < v > value function ( ) ) ) ; } entries used = true ; return regular immutable bi map from entry array ( size , entries ) ; } }


a utility method to create a new { @ link clock mock } and immediately call its { @ link # freeze ( ) } method

public static clock mock frozen ( ) { return new clock mock ( ) freeze ( ) ; }


returns the object that this proxy represents or null if the represented object no longer exists


format the given parameter object into string

public string parameter to string ( object param ) { if ( param = = null ) { return " " ; } else if ( param instanceof date ) { return format date ( ( date ) param ) ; } else if ( param instanceof offset date time ) { return format offset date time ( ( offset date time ) param ) ; } else if ( param instanceof collection ) { string builder b = new string builder ( ) ; for ( object o : ( collection ) param ) { if ( b length ( ) > 0 ) { b append ( ' , ' ) ; } b append ( string value of ( o ) ) ; } return b to string ( ) ; } else { return string value of ( param ) ; } } / * * format to { @ code pair }


returns the members injector used to inject dependencies into methods and fields on instances of the given type { @ code t } the returned members injector will not be valid until the main injector has been created the members injector will throw an { @ code illegal state exception } if you try to use it beforehand

< t > members injector < t > get members injector ( type literal < t > type literal ) ;


public builder add provider ( transitive info provider provider ) { preconditions check not null ( provider ) ; add provider ( transitive info provider effective class helper get ( provider ) , provider ) ; return this ; }


public static < t > t to obj ( byte [ ] json , type cls ) { try { return to obj ( string utils new string for utf 8 ( json ) , cls ) ; } catch ( exception e ) { throw new nacos deserialization exception ( e ) ; } }


public static void main ( string [ ] args ) { spring application run ( app class , args ) ; }


freeze the clock if not frozen and rewind it by the given number of seconds

public void rewind seconds ( int seconds ) { rewind ( time value time value seconds ( seconds ) ) ; }


public static string fix null ( @ check for null string s ) { return fix null ( s , " " ) ; }


return true if the specified schema is an object with a fixed number of properties a object schema differs from an map schema in the following way : - an object schema is not extensible , i e it has a fixed number of properties - a map schema is an object that can be extended with an arbitrary set of properties the payload may include dynamic properties for example , an open a p i schema is considered an object schema in the following scenarios : type : object additional properties : false properties : name : type : string address : type : string

public static boolean is object schema ( schema schema ) { if ( schema instanceof object schema ) { return true ; } / / must not be a map if ( schema type util object type equals ( schema get type ( ) ) & & ! ( schema instanceof map schema ) ) { return true ; } / / must have at least one property if ( schema get type ( ) = = null & & schema get properties ( ) ! = null & & ! schema get properties ( ) is empty ( ) ) { return true ; } return false ; }


generate a new create snapshot request from this policy the name of the snapshot is generated at this time based on any date math expressions in the " name " field

public create snapshot request to request ( ) { create snapshot request req = new create snapshot request ( repository , generate snapshot name ( this name ) ) ; map < string , object > merged configuration = configuration = = null ? new hash map < > ( ) : new hash map < > ( configuration ) ; @ suppress warnings ( " unchecked " ) map < string , object > metadata = ( map < string , object > ) merged configuration get ( " metadata " ) ; map < string , object > metadata with added policy name = add policy name to metadata ( metadata ) ; merged configuration put ( " metadata " , metadata with added policy name ) ; req source ( merged configuration ) ; req wait for completion ( true ) ; return req ; }


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


get offsets that the sink task has submitted to be reset used by the kafka connect framework

public map < topic partition , long > offsets ( ) { return offsets ; }


run various fs operations while the nn is in safe mode , assert that they are either allowed or fail as expected

public void test operations while in safe mode ( ) throws i o exception , interrupted exception { final path file 1 = new path ( " / file 1 " ) ; assert false ( dfs set safe mode ( safe mode action safemode get ) ) ; d f s test util create file ( fs , file 1 , 1024 , ( short ) 1 , 0 ) ; assert true ( " could not enter sm " , dfs set safe mode ( safe mode action safemode enter ) ) ; run fs fun ( " set quota while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { ( ( distributed file system ) fs ) set quota ( file 1 , 1 , 1 ) ; } } ) ; run fs fun ( " set perm while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs set permission ( file 1 , fs permission get default ( ) ) ; } } ) ; run fs fun ( " set owner while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs set owner ( file 1 , " user " , " group " ) ; } } ) ; run fs fun ( " set repl while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs set replication ( file 1 , ( short ) 1 ) ; } } ) ; run fs fun ( " append file while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { d f s test util append file ( fs , file 1 , " new bytes " ) ; } } ) ; run fs fun ( " truncate file while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs truncate ( file 1 , 0 ) ; } } ) ; run fs fun ( " delete file while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs delete ( file 1 , false ) ; } } ) ; run fs fun ( " rename file while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs rename ( file 1 , new path ( " file 2 " ) ) ; } } ) ; run fs fun ( " set time while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs set times ( file 1 , 0 , 0 ) ; } } ) ; run fs fun ( " modify acl entries while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs modify acl entries ( file 1 , lists < acl entry > new array list ( ) ) ; } } ) ; run fs fun ( " remove acl entries while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs remove acl entries ( file 1 , lists < acl entry > new array list ( ) ) ; } } ) ; run fs fun ( " remove default acl while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs remove default acl ( file 1 ) ; } } ) ; run fs fun ( " remove acl while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs remove acl ( file 1 ) ; } } ) ; run fs fun ( " set acl while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs set acl ( file 1 , lists < acl entry > new array list ( ) ) ; } } ) ; run fs fun ( " set x attr while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs set x attr ( file 1 , " user a 1 " , null ) ; } } ) ; run fs fun ( " remove x attr while in sm " , new f s run ( ) { @ override public void run ( file system fs ) throws i o exception { fs remove x attr ( file 1 , " user a 1 " ) ; } } ) ; try { d f s test util read file ( fs , file 1 ) ; } catch ( i o exception ioe ) { fail ( " set times failed while in sm " ) ; } try { fs get acl status ( file 1 ) ; } catch ( i o exception ioe ) { fail ( " get acl status failed while in sm " ) ; } / / test access user group information ugi x = user group information create remote user ( " user x " ) ; file system myfs = ugi x do as ( new privileged exception action < file system > ( ) { @ override public file system run ( ) throws i o exception { return file system get ( conf ) ; } } ) ; myfs access ( file 1 , fs action read ) ; try { myfs access ( file 1 , fs action write ) ; fail ( " the access call should have failed " ) ; } catch ( access control exception e ) { / / expected } e c schema to add schema = new e c schema ( " testcodec " , 3 , 2 ) ; erasure coding policy new policy = new erasure coding policy ( to add schema , 128 * 1024 ) ; erasure coding policy [ ] policy array = new erasure coding policy [ ] { new policy } ; try { dfs add erasure coding policies ( policy array ) ; fail ( " add erasure coding policies should have failed " ) ; } catch ( i o exception ioe ) { generic test utils assert exception contains ( " cannot add erasure coding policy " , ioe ) ; / / expected } try { dfs remove erasure coding policy ( " test e c name " ) ; fail ( " remove erasure coding policy should have failed " ) ; } catch ( i o exception ioe ) { generic test utils assert exception contains ( " cannot remove erasure coding policy " , ioe ) ; / / expected } assert false ( " could not leave sm " , dfs set safe mode ( safe mode action safemode leave ) ) ; }


returns true if the two sets contain function tags with the same namecomment pairs

static boolean equivalent tag sets ( set < function tag > set a , set < function tag > set b ) { / / to do this easily , just convert the sets to sorted lists and use a equals call since / / function tag d b overrides the equals method to compare the internal name / comment , / / this will do the job / / / / note that the lists must be sorted first , which works since function tag d b is a / / comparable list < function tag > list a = new array list < > ( set a ) ; list < function tag > list b = new array list < > ( set b ) ; collections sort ( list a ) ; collections sort ( list b ) ; return list a equals ( list b ) ; }


stops all published endpoints , taking the web services offline

public void destroy ( ) { for ( endpoint endpoint : this published endpoints ) { endpoint stop ( ) ; } }


public void add ( texture texture , float x , float y ) { final float fx 2 = x + texture get width ( ) ; final float fy 2 = y + texture get height ( ) ; temp vertices [ 0 ] = x ; temp vertices [ 1 ] = y ; temp vertices [ 2 ] = color packed ; temp vertices [ 3 ] = 0 ; temp vertices [ 4 ] = 1 ; temp vertices [ 5 ] = x ; temp vertices [ 6 ] = fy 2 ; temp vertices [ 7 ] = color packed ; temp vertices [ 8 ] = 0 ; temp vertices [ 9 ] = 0 ; temp vertices [ 10 ] = fx 2 ; temp vertices [ 11 ] = fy 2 ; temp vertices [ 12 ] = color packed ; temp vertices [ 13 ] = 1 ; temp vertices [ 14 ] = 0 ; if ( mesh get num indices ( ) > 0 ) { temp vertices [ 15 ] = fx 2 ; temp vertices [ 16 ] = y ; temp vertices [ 17 ] = color packed ; temp vertices [ 18 ] = 1 ; temp vertices [ 19 ] = 1 ; add ( texture , temp vertices , 0 , 20 ) ; } else { temp vertices [ 15 ] = fx 2 ; temp vertices [ 16 ] = fy 2 ; temp vertices [ 17 ] = color packed ; temp vertices [ 18 ] = 1 ; temp vertices [ 19 ] = 0 ; temp vertices [ 20 ] = fx 2 ; temp vertices [ 21 ] = y ; temp vertices [ 22 ] = color packed ; temp vertices [ 23 ] = 1 ; temp vertices [ 24 ] = 1 ; temp vertices [ 25 ] = x ; temp vertices [ 26 ] = y ; temp vertices [ 27 ] = color packed ; temp vertices [ 28 ] = 0 ; temp vertices [ 29 ] = 1 ; add ( texture , temp vertices , 0 , 30 ) ; } }


make the specified icon semi - transparent using the default transparency alpha

public static icon make transparent ( icon icon ) { return make transparent ( icon , default transparency alpha ) ; }


returns a view of a table where each value is transformed by a function all other properties of the table , such as iteration order , are left intact changes in the underlying table are reflected in this view conversely , this view supports removal operations , and these are reflected in the underlying table it ' s acceptable for the underlying table to contain null keys , and even null values provided that the function is capable of accepting null input the transformed table might contain null values , if the function sometimes gives a null result the returned table is not thread - safe or serializable , even if the underlying table is the function is applied lazily , invoked when needed this is necessary for the returned table to be a view , but it means that the function will be applied many times for bulk operations like { @ link table # contains value } and { @ code table to string ( ) } for this to perform well , { @ code function } should be fast to avoid lazy evaluation when the returned table doesn ' t need to be a view , copy the returned table into a new table of your choosing

public static < r , c , v1 , v2 > table < r , c , v2 > transform values ( table < r , c , v1 > from table , function < ? super v1 , v2 > function ) { return new transformed table < > ( from table , function ) ; }


returns the remote fs root absolute path or { @ code null } if the agent is off - line the absolute path may change between connections if the connection method does not provide a consistent working directory and the node ' s remote fs is specified as a relative path

public string get absolute remote fs ( ) { return channel = = null ? null : absolute remote fs ; }


serialize the key and namespace to bytes the format is - int : length of serialized namespace - byte [ ] : serialized namespace - int : length of serialized key - byte [ ] : serialized key

memory segment serialize to segment ( k key , n namespace ) { output stream reset ( ) ; try { / / serialize namespace output stream set position ( integer bytes ) ; namespace serializer serialize ( namespace , output view ) ; } catch ( i o exception e ) { throw new runtime exception ( " failed to serialize namespace " , e ) ; } int key start pos = output stream get position ( ) ; try { / / serialize key output stream set position ( key start pos + integer bytes ) ; key serializer serialize ( key , output view ) ; } catch ( i o exception e ) { throw new runtime exception ( " failed to serialize key " , e ) ; } final byte [ ] result = output stream to byte array ( ) ; final memory segment segment = memory segment factory wrap ( result ) ; / / set length of namespace and key segment put int ( 0 , key start pos - integer bytes ) ; segment put int ( key start pos , result length - key start pos - integer bytes ) ; return segment ; }


read bytes into the reference from the file this method will return the offset in the file where the read completed

public long read file bytes ( string file name , bytes reference reference ) throws i o exception { combined rate limiter rate limiter = ccr settings get rate limiter ( ) ; long throttle time = rate limiter maybe pause ( reference length ( ) ) ; throttle listener accept ( throttle time ) ; return restore session read file bytes ( file name , reference ) ; }


private static void check egl error ( string msg ) throws transcoding exception { boolean failed = false ; int error ; while ( ( error = egl14 egl get error ( ) ) ! = egl14 egl success ) { log e ( tag , msg + " : egl error : 0x " + integer to hex string ( error ) ) ; failed = true ; } if ( failed ) { throw new transcoding exception ( " egl error encountered ( see log ) " ) ; } }


public object get anytype 1 ( ) { return anytype 1 ; }


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


prompts the user to enter the password and returns it

string read password ( string prompt ) throws user exception ;


configures rocks d b to use a fixed amount of memory shared between all instances ( operators ) in a slot see { @ link rocks d b options # fix per slot memory size } for details

public void set fixed memory per slot ( memory size fixed memory per slot ) { check argument ( fixed memory per slot = = null | | fixed memory per slot get bytes ( ) > 0 , " total memory per slot must be > 0 " ) ; this fixed memory per slot = fixed memory per slot ; }


installs and returns the defaults for dark lafs

public u i defaults get defaults ( ) { final u i defaults defaults = super get defaults ( ) ; m t laf installer install defaults ( defaults ) ; / / install material defaults m t laf installer install m t defaults ( defaults ) ; return defaults ; }


polls the timestamp if required and returns whether it was updated if { @ code true } , the latest timestamp is available via { @ link # get timestamp system time us ( ) } and { @ link # get timestamp position frames ( ) } , and the caller should call { @ link # accept timestamp ( ) } if the timestamp was valid , or { @ link # reject timestamp ( ) } otherwise the values returned by { @ link # has timestamp ( ) } and { @ link # has advancing timestamp ( ) } may be updated

public boolean maybe poll timestamp ( long system time us ) { if ( audio timestamp = = null | | ( system time us - last timestamp sample time us ) < sample interval us ) { return false ; } last timestamp sample time us = system time us ; boolean updated timestamp = audio timestamp maybe update timestamp ( ) ; switch ( state ) { case state initializing : if ( updated timestamp ) { if ( audio timestamp get timestamp system time us ( ) > = initialize system time us ) { / / we have an initial timestamp , but don ' t know if it ' s advancing yet initial timestamp position frames = audio timestamp get timestamp position frames ( ) ; update state ( state timestamp ) ; } else { / / drop the timestamp , as it was sampled before the last reset updated timestamp = false ; } } else if ( system time us - initialize system time us > initializing duration us ) { / / we haven ' t received a timestamp for a while , so they probably aren ' t available for the / / current audio route poll infrequently in case the route changes later / / todo : ideally we should listen for audio route changes in order to detect when a / / timestamp becomes available again update state ( state no timestamp ) ; } break ; case state timestamp : if ( updated timestamp ) { long timestamp position frames = audio timestamp get timestamp position frames ( ) ; if ( timestamp position frames > initial timestamp position frames ) { update state ( state timestamp advancing ) ; } } else { reset ( ) ; } break ; case state timestamp advancing : if ( ! updated timestamp ) { / / the audio route may have changed , so reset polling reset ( ) ; } break ; case state no timestamp : if ( updated timestamp ) { / / the audio route may have changed , so reset polling reset ( ) ; } break ; case state error : / / do nothing if the caller accepts any new timestamp we ' ll reset polling break ; default : throw new illegal state exception ( ) ; } return updated timestamp ; }


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


creates a map entry ( for use with { @ link utils # mk map ( java util map entry [ ] ) } )

public static < k , v > map entry < k , v > mk entry ( final k k , final v v ) { return new abstract map simple entry < > ( k , v ) ; }


removes the given margin provider from this panel

public void remove margin provider ( margin provider provider ) { margin providers remove ( provider ) ; build panels ( ) ; }


serialises new x content type vnd values in a bwc manner todo remove in es v 9

public static void write to ( stream output out , x content type x content type ) throws i o exception { if ( out get version ( ) before ( version v 8 0 0 ) ) { / / when sending an enumeration to < v 8 node it does not have new vnd x content type instances out write v int ( x content type canonical ( ) ordinal ( ) ) ; } else { out write v int ( x content type ordinal ( ) ) ; } }


set an array of string values as optional parameter for the builder

public b opt ( @ nonnull final string key , @ nonnull final string values ) { mandatory keys remove ( key ) ; options set strings ( key , values ) ; return get this builder ( ) ; }


verify that the specified root directory passes all criteria to be an indexed filesystem

static int verify indexed file structure ( file root ) throws index read exception { int item count = 0 ; for ( file f : root list files ( ) ) { if ( f is directory ( ) ) { if ( ! is hidden dir name ( f get name ( ) ) ) { item count + = verify indexed directory ( f ) ; } } else { string fname = f get name ( ) ; if ( fname ends with ( property ext ) ) { throw new index read exception ( " unexpected property file in filesystem root : " + fname ) ; } } } return item count ; }


returns the table row associated with the top of the viewport

public int get viewport position as row ( ) { return viewport get view position ( ) y / table get row height ( ) ; }


public type bearer get or null ( int idx ) { return locals [ idx ] ; }


indicate whether the field was created during the process or not

public boolean field was initialized ( ) { return was initialized ; }


the level parameter is needed so that we can have different hash functions when we recursively apply the partitioning , so that the working set eventually fits into memory

public static int hash ( int hash code , int level ) { final int rotation = level * 11 ; int code = integer rotate left ( hash code , rotation ) ; return code > = 0 ? code : - ( code + 1 ) ; }


public final void create index ( string name , settings index settings ) { assert acked ( prepare create ( name ) set settings ( index settings ) ) ; }


joins the group without starting the heartbeat thread if this function returns true , the state must always be in stable and heartbeat enabled if this function returns false , the state can be in one of the following : unjoined : got error response but times out before being able to re - join , heartbeat disabled preparing rebalance : not yet received join - group response before timeout , heartbeat disabled completing rebalance : not yet received sync - group response before timeout , hearbeat enabled visible for testing

boolean join group if needed ( final timer timer ) { while ( rejoin needed or pending ( ) ) { if ( ! ensure coordinator ready ( timer ) ) { return false ; } / / call on join prepare if needed we set a flag to make sure that we do not call it a second / / time if the client is woken up before a pending rebalance completes this must be called / / on each iteration of the loop because an event requiring a rebalance ( such as a metadata / / refresh which changes the matched subscription set ) can occur while another rebalance is / / still in progress if ( needs join prepare ) { / / need to set the flag before calling on join prepare since the user callback may throw / / exception , in which case upon retry we should not retry on join prepare either needs join prepare = false ; on join prepare ( generation generation id , generation member id ) ; } final request future < byte buffer > future = initiate join group ( ) ; client poll ( future , timer ) ; if ( ! future is done ( ) ) { / / we ran out of time return false ; } if ( future succeeded ( ) ) { generation generation snapshot ; member state state snapshot ; / / generation data maybe concurrently cleared by heartbeat thread / / can ' t use synchronized for { @ code on join complete } , because it can be long enough / / and shouldn ' t block heartbeat thread / / see { @ link plaintext consumer test # test max poll interval ms delay in assignment } synchronized ( abstract coordinator this ) { generation snapshot = this generation ; state snapshot = this state ; } if ( ! generation snapshot equals ( generation no generation ) & & state snapshot = = member state stable ) { / / duplicate the buffer in case ` on join complete ` does not complete and needs to be retried byte buffer member assignment = future value ( ) duplicate ( ) ; on join complete ( generation snapshot generation id , generation snapshot member id , generation snapshot protocol name , member assignment ) ; / / generally speaking we should always reset join group future once the future is done , but here / / we can only reset the join group future after the completion callback returns this ensures / / that if the callback is woken up , we will retry it on the next join group if needed / / and because of that we should explicitly trigger reset join group future in other conditions below reset join group future ( ) ; needs join prepare = true ; } else { log info ( " generation data was cleared by heartbeat thread to { } and state is now { } before " + " the rebalance callback is triggered , marking this rebalance as failed and retry " , generation snapshot , state snapshot ) ; reset state and rejoin ( ) ; reset join group future ( ) ; } } else { final runtime exception exception = future exception ( ) ; / / we do not need to log error for member id required , / / since it is not really an error and is transient if ( ! ( exception instanceof member id required exception ) ) { log info ( " rebalance failed " , exception ) ; } reset join group future ( ) ; if ( exception instanceof unknown member id exception | | exception instanceof rebalance in progress exception | | exception instanceof illegal generation exception | | exception instanceof member id required exception ) continue ; else if ( ! future is retriable ( ) ) throw exception ; reset state and rejoin ( ) ; timer sleep ( rebalance config retry backoff ms ) ; } } return true ; }


gets the size in bytes of this binary data


uploads the blob ' s metadata to the storage service using the specified lease id , request options , and operation context

void upload metadata ( operation context op context ) throws storage exception ;


writes { @ code value } as a string literal to { @ code sink } this wraps the value in double quotes and escapes those characters that require it

private static void string ( buffered sink sink , string value ) throws i o exception { string [ ] replacements = replacement chars ; sink write byte ( ' " ' ) ; int last = 0 ; int length = value length ( ) ; for ( int i = 0 ; i < length ; i + + ) { char c = value char at ( i ) ; string replacement ; if ( c < 128 ) { replacement = replacements [ c ] ; if ( replacement = = null ) { continue ; } } else if ( c = = ' \ u 2 0 2 8 ' ) { replacement = " \ \ u 2 0 2 8 " ; } else if ( c = = ' \ u 2 0 2 9 ' ) { replacement = " \ \ u 2 0 2 9 " ; } else { continue ; } if ( last < i ) { sink write utf 8 ( value , last , i ) ; } sink write utf 8 ( replacement ) ; last = i + 1 ; } if ( last < length ) { sink write utf 8 ( value , last , length ) ; } sink write byte ( ' " ' ) ; }


get the number of bytes gathered , starting at the entry point of a function

public int get num first bytes ( ) { return num first bytes ; }


shutdown tolerable number of datanode before reading verify the decoding works correctly

public void test read with d n failure ( ) throws exception { try { / / setup a new cluster with no dead datanode setup ( ) ; read striped file with decoding helper test read with d n failure ( cluster , dfs , file length , dn failure num ) ; } catch ( i o exception ioe ) { string file type = file length < ( block size * num data units ) ? " small file " : " large file " ; log error ( " failed to read file with dn failure : " + " file type = " + file type + " , dn failure num = " + dn failure num ) ; } finally { / / tear down the cluster tear down ( ) ; } }


get user by user name < b > 200 < b > - successful operation < b > 400 < b > - invalid username supplied < b > 404 < b > - user not found

public user get user by name ( string username ) throws rest client exception { return get user by name with http info ( username ) get body ( ) ; }


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


public void minus equal ( vector other ) { if ( other instanceof dense vector ) { blas axpy ( - 1 0 , ( dense vector ) other , this ) ; } else { blas axpy ( - 1 0 , ( sparse vector ) other , this ) ; } }


find the count of remaining objects of current iterable

public final int get remaining elements count ( ) { var counter = 0 ; for ( var ignored : this ) { counter + + ; } return counter ; }


determines whether a character is a breaking whitespace ( that is , a whitespace which can be interpreted as a break between words for formatting purposes ) see { @ link # whitespace ( ) } for a discussion of that term

public static char matcher breaking whitespace ( ) { return breaking whitespace instance ; }


called after the controller released the fetched image

void on release ( long id , vito image request image request , controller listener 2 extras extras ) ;


modifies { @ code multiset to modify } so that its count for an element { @ code e } is at most { @ code multiset to retain count ( e ) } to be precise , { @ code multiset to modify count ( e ) } is set to { @ code math min ( multiset to modify count ( e ) , multiset to retain count ( e ) ) } this is similar to { @ link # intersection ( multiset , multiset ) intersection } { @ code ( multiset to modify , multiset to retain ) } , but mutates { @ code multiset to modify } instead of returning a view in contrast , { @ code multiset to modify retain all ( multiset to retain ) } keeps all occurrences of elements that appear at all in { @ code multiset to retain } , and deletes all occurrences of all other elements

public static boolean retain occurrences ( multiset < ? > multiset to modify , multiset < ? > multiset to retain ) { return retain occurrences impl ( multiset to modify , multiset to retain ) ; }


checks whether or not the user scripts directory should be linked into the project

public boolean should link users scripts ( ) { return user scripts checkbox button get selection ( ) ; }


set whether local properties override properties from files default is " false " : properties from files override local defaults can be switched to " true " to let local properties override defaults from files

public void set local override ( boolean local override ) { this local override = local override ; }


to test \ & quot ; client \ & quot ; model ( asynchronously ) to test \ & quot ; client \ & quot ; model

public okhttp 3 call test client model async ( client body , final api callback < client > callback ) throws api exception { okhttp 3 call local var call = test client model validate before call ( body , callback ) ; type local var return type = new type token < client > ( ) { } get type ( ) ; local var api client execute async ( local var call , local var return type , callback ) ; return local var call ; }


refreshes the displayed diff details for the indicated program location address

void refresh details ( program location p 1 location ) { if ( p 1 location = = null ) { return ; } current location = p 1 location ; update manager update ( ) ; }


invoked with the result of the { @ code future } computation when it is successful

void on success ( @ nullable v result ) ;


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / inputs return inputs ; case 2 : / / streams return streams ; case 3 : / / parallelism hint return parallelism hint ; case 4 : / / json conf return json conf ; default : return null ; } }


must be called by subclasses to initialize the handler and channel

protected final void init channel ( http 2 headers decoder headers decoder ) throws exception { content = unpooled copied buffer ( " hello world " , utf 8 ) ; frame writer = mock ( http 2 frame writer class , delegates to ( new default http 2 frame writer ( ) ) ) ; frame reader = new default http 2 frame reader ( headers decoder ) ; channel = new fake clock supported chanel ( ) ; handler = new handler ( ) ; channel pipeline ( ) add last ( handler ) ; ctx = channel pipeline ( ) context ( handler ) ; write queue = init write queue ( ) ; }


return the uniform value at the passed location in the passed program

public final native boolean get uniformb ( web g l program program , web g l uniform location location ) / * - { return this get uniform ( program , location ) ; }


public method list get methods ( ) { parse to end if necessary ( ) ; return methods ; }


sets the time by which elements are allowed to be late elements that arrive behind the watermark by more than the specified time will be dropped by default , the allowed lateness is { @ code 0l } setting an allowed lateness is only valid for event - time windows

public windowed stream < t , k , w > allowed lateness ( time lateness ) { builder allowed lateness ( lateness ) ; return this ; }


gets the persisted version of the already - deployed process definition note that this is different from { @ link # get most recent version of process definition } as it looks specifically for a process definition that is already persisted and attached to a particular deployment , rather than the latest version across all deployments

public process definition entity get persisted instance of process definition ( process definition entity process definition ) { string deployment id = process definition get deployment id ( ) ; if ( string utils is empty ( process definition get deployment id ( ) ) ) { throw new illegal state exception ( " provided process definition must have a deployment id " ) ; } process definition entity manager process definition manager = context get command context ( ) get process engine configuration ( ) get process definition entity manager ( ) ; process definition entity persisted process definition = null ; if ( process definition get tenant id ( ) = = null | | process engine configuration no tenant id equals ( process definition get tenant id ( ) ) ) { persisted process definition = process definition manager find process definition by deployment and key ( deployment id , process definition get key ( ) ) ; } else { persisted process definition = process definition manager find process definition by deployment and key and tenant id ( deployment id , process definition get key ( ) , process definition get tenant id ( ) ) ; } return persisted process definition ; }


batch delete instance ' s metadata old key exist = delete , old key not exist = not operate

public object node batch delete instance matadata ( http servlet request request ) throws exception { final string namespace id = web utils optional ( request , common params namespace id , constants default namespace id ) ; string service name = web utils required ( request , common params service name ) ; string consistency type = web utils optional ( request , " consistency type " , string utils empty ) ; string instances = web utils optional ( request , " instances " , string utils empty ) ; list < instance > target instances = parse batch instances ( instances ) ; string metadata = web utils required ( request , " metadata " ) ; map < string , string > target metadata = utils and commons parse metadata ( metadata ) ; list < instance > operated instances = batch operate metadata ( namespace id , build operation info ( service name , consistency type , target instances ) , target metadata , update instance metadata action remove ) ; object node result = jackson utils create empty json node ( ) ; array node ip array = jackson utils create empty array node ( ) ; for ( instance ip : operated instances ) { ip array add ( ip get datum key ( ) + " : " + ( ip is ephemeral ( ) ? ephemeral : persist ) ) ; } result replace ( " updated " , ip array ) ; return result ; }


set the current working directory for the default file system

public void set working directory ( path dir ) throws i o exception { ensure state ( job state define ) ; conf set working directory ( dir ) ; }


public address set view get address set ( namespace namespace ) { lock acquire ( ) ; try { if ( namespace = = last body namespace ) { return last body ; } address set view my set = get address set ( namespace get i d ( ) ) ; address set set = new address set ( my set ) ; symbol iterator it = symbol mgr get symbols ( namespace ) ; while ( it has next ( ) ) { symbol s = it next ( ) ; object obj = s get object ( ) ; if ( obj instanceof namespace ) { set add ( ( ( namespace ) obj ) get body ( ) ) ; } } last body namespace = namespace ; last body = set ; return set ; } finally { lock release ( ) ; } }


convert a bytes into a hexadecimal string

public static string convert bytes to string ( iterable < byte > bytes , string delimiter ) { return convert bytes to string ( collection utils as stream ( bytes ) , delimiter ) ; }


configure custom deserializers each deserializer is registered for the type returned by { @ link json deserializer # handled type ( ) } , which must not be { @ code null }

public void set deserializers ( json deserializer < ? > deserializers ) { this builder deserializers ( deserializers ) ; }


get the readers that must be registered for this aggregation ' s results

public map < string , writeable reader < ? extends internal aggregation > > get result readers ( ) { return result readers ; }


public string [ ] get variable comments ( ) { return var comments ; }


public void set file filter ( ghidra file filter filter ) { item listener [ ] listeners = filter combo get item listeners ( ) ; for ( item listener listener : listeners ) { filter combo remove item listener ( listener ) ; } filter combo remove all items ( ) ; add file filter ( ghidra file filter all ) ; if ( filter ! = ghidra file filter all ) { add file filter ( filter ) ; } for ( item listener listener : listeners ) { filter combo add item listener ( listener ) ; } filter combo set selected item ( filter ) ; }


returns a new { @ link top docs } with the top n from the incoming one , or the same top docs if the number of hits is already & lt ; = top n

private top docs top n ( top docs in , int top n ) { if ( in score docs length < top n ) { return in ; } score doc [ ] subset = new score doc [ top n ] ; system arraycopy ( in score docs , 0 , subset , 0 , top n ) ; return new top docs ( in total hits , subset ) ; }


gets the java configuration ' s compiler compliance level that was used to build the associated installation

public string get compiler compliance level ( ) { return compiler compliance level ; }


archives this directory into the specified archive format , to the given { @ link output stream } , by using { @ link dir scanner } to choose what files to include

public int archive ( final archiver factory factory , output stream os , final dir scanner scanner ) throws i o exception , interrupted exception { return archive ( factory , os , scanner , null , false ) ; }


get a future for the topic partitions for which a leader election was attempted a partition will be present in this result if an election was attempted even if the election was not successful this method is provided to discover the partitions attempted when { @ link admin # elect preferred leaders ( collection ) } is called with a null { @ code partitions } argument

public kafka future < set < topic partition > > partitions ( ) { final kafka future impl < set < topic partition > > result = new kafka future impl < > ( ) ; election result partitions ( ) when complete ( new kafka future bi consumer < map < topic partition , optional < throwable > > , throwable > ( ) { @ override public void accept ( map < topic partition , optional < throwable > > topic partitions , throwable throwable ) { if ( throwable ! = null ) { result complete exceptionally ( throwable ) ; } else { result complete ( topic partitions key set ( ) ) ; } } } ) ; return result ; }


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


removes correlated variables from the tree at root cor rel

private void remove cor var from tree ( correlate correlate ) { if ( cm map cor to cor rel get ( correlate get correlation id ( ) ) = = correlate ) { cm map cor to cor rel remove ( correlate get correlation id ( ) ) ; } }


returns a comparator that compares two { @ code boolean } arrays < a href = " http : en wikipedia orgwiki lexicographical order " > lexicographically that is , it compares , using { @ link # compare ( boolean , boolean ) } ) , the first pair of values that follow any common prefix , or when one array is a prefix of the other , treats the shorter array as the lesser for example , { @ code [ ] < [ false ] < [ false , true ] < [ true ] } the returned comparator is inconsistent with { @ link object # equals ( object ) } ( since arrays support only identity equality ) , but it is consistent with { @ link arrays # equals ( boolean [ ] , boolean [ ] ) }

public static comparator < boolean [ ] > lexicographical comparator ( ) { return lexicographical comparator instance ; }


dependent compiled resources to be included in the binary

public resource linker include ( list < compiled resources > include ) { this include = include ; return this ; }


returns a new instance of { @ code class name } that is a shadowed built - in core type ( e g { @ code javatime month day } ) of the current desugar - mirrored core type , assuming { @ code this } instance is a desugar - mirrored core type

public final class name mirrored to shadowed ( ) { immutable bi map < string , string > verbatim type mappings = shadowed to mirrored type prefix mappings inverse ( ) ; return verbatim type mappings key set ( ) stream ( ) filter ( this : : has package prefix ) map ( prefix - > replace package prefix ( prefix , verbatim type mappings get ( prefix ) ) ) find any ( ) or else ( this ) ; }


get the length of a stored record optimized if record offset already known

private int get record length ( int index , int offset ) { if ( index = = 0 ) { return buffer length ( ) - offset ; } return get record data offset ( index - 1 ) - offset ; }


the attributes of this element < code > repeated aapt pb xml attribute attribute = 4 ; < code >

private void add attribute ( com android aapt resources xml attribute builder builder for value ) { ensure attribute is mutable ( ) ; attribute add ( builder for value build ( ) ) ; }


notification that a field edit has ended

public void end field editing ( ) { if ( ! is editing field ( ) ) { return ; } for ( composite editor model listener listener : listeners ) { listener end field editing ( ) ; } }


a more human - friendly version of arrays # to string ( byte [ ] ) that uses hex representation

private static string byte array to string ( byte [ ] bytes ) { string builder builder = new string builder ( " [ " ) ; for ( int i = 0 ; i < bytes length ; i + + ) { if ( i > 0 ) { builder append ( " , " ) ; } builder append ( byte to string ( bytes [ i ] ) ) ; } return builder append ( ' ] ' ) to string ( ) ; }


public byte [ ] get source as bytes ( ) { return get result source ( ) ; }


appends { @ code values } , in order , to the end of the values the built { @ link immutable long array } will contain

public builder add all ( collection < long > values ) { ensure room for ( values size ( ) ) ; for ( long value : values ) { array [ count + + ] = value ; } return this ; }


test modify operations ( create , mkdir , rename , etc ) on internal dirs of mount table these operations should fail since the mount table is read - only or because the internal dir that it is trying to create already exits

public void test internal mkdir slash ( ) throws i o exception { fc view mkdir ( file context test helper get test root path ( fc view , " / " ) , file context default perm , false ) ; }


set a unique name for this service ( mainly for logging purposes )

public void set name ( string name ) { this name = name ; }


returns the ssl related configuration settings given the location of a key and certificate and the location of the pem certificates to be trusted

public static void add s s l settings for p e m files ( settings builder builder , string key path , string password , string certificate path , list < string > trusted certificates ) { add s s l settings for p e m files ( builder , " " , key path , password , certificate path , trusted certificates , true ) ; }


tests allocation with requests comprising only opportunistic containers

public void test opportunistic allocation ( ) throws yarn exception , i o exception { / / setup container request assert equals ( 0 , am client ask size ( ) ) ; assert equals ( 0 , am client release size ( ) ) ; am client add container request ( new a m r m client container request ( capability , null , null , priority 3 , 0 , true , null , execution type request new instance ( execution type opportunistic , true ) ) ) ; am client add container request ( new a m r m client container request ( capability , null , null , priority 3 , 0 , true , null , execution type request new instance ( execution type opportunistic , true ) ) ) ; int opp containers requested any = am client get table ( 0 ) get ( priority 3 , resource request any , execution type opportunistic , capability ) remote request get num containers ( ) ; assert equals ( 2 , opp containers requested any ) ; assert equals ( 1 , am client ask size ( ) ) ; assert equals ( 0 , am client release size ( ) ) ; / / rm should allocate container within 2 calls to allocate ( ) int allocated container count = 0 ; int iterations left = 10 ; set < container id > releases = new tree set < > ( ) ; am client get n m token cache ( ) clear cache ( ) ; assert assert equals ( 0 , am client get n m token cache ( ) number of tokens in cache ( ) ) ; hash map < string , token > received n m tokens = new hash map < > ( ) ; while ( allocated container count < opp containers requested any & & iterations left - - > 0 ) { allocate response alloc response = am client allocate ( 0 1f ) ; assert equals ( 0 , am client ask size ( ) ) ; assert equals ( 0 , am client release size ( ) ) ; for ( container container : alloc response get allocated containers ( ) ) { allocated container count + + ; container id reject container id = container get id ( ) ; releases add ( reject container id ) ; } for ( n m token token : alloc response get n m tokens ( ) ) { string node i d = token get node id ( ) to string ( ) ; received n m tokens put ( node i d , token get token ( ) ) ; } if ( allocated container count < opp containers requested any ) { / / sleep to let nm ' s heartbeat to rm and trigger allocations sleep ( 100 ) ; } } assert equals ( opp containers requested any , allocated container count ) ; assert equals ( 1 , received n m tokens values ( ) size ( ) ) ; }


returns the pattern in ( lucene ) wildcard format

public string as lucene wildcard ( ) { return wildcard ; }


public float get float ( ) { return float ; }


wrapper for { @ link build options # get } that throws an { @ link illegal argument exception } if the given { @ link fragment options } isn ' t in the " permitted " set

public < t extends fragment options > t get ( class < t > options class ) { return options get ( check fragment ( options class ) ) ; }


receives validated object or throws exception when invalid

public t get ( ) throws illegal state exception { if ( exceptions is empty ( ) ) { return obj ; } var e = new illegal state exception ( ) ; exceptions for each ( e : : add suppressed ) ; throw e ; }


add a new pet to the store ( asynchronously )

public okhttp 3 call add pet async ( pet body , final api callback < void > callback ) throws api exception { okhttp 3 call local var call = add pet validate before call ( body , callback ) ; local var api client execute async ( local var call , callback ) ; return local var call ; }


called when there was an error loading ads

default void on ad load error ( ad load exception error , data spec data spec ) { }


return the default charset , used when the { @ linkplain # set supported media types ( list ) content type } does not contain one

public charset get default charset ( ) { return this default charset ; }


iterate through concurrent hash map is ' safe ' , it will reflect the state of the map at the time iteration began , may miss update while iterating , given this is used in the commands to get a general idea of the watches state , we don ' t care about missing some update

public watches path report get watches by path ( ) { map < string , set < long > > path 2ids = new hash map < string , set < long > > ( ) ; for ( entry < string , bit hash set > e : path watches entry set ( ) ) { bit hash set watchers = e get value ( ) ; synchronized ( watchers ) { set < long > ids = new hash set < long > ( watchers size ( ) ) ; path 2ids put ( e get key ( ) , ids ) ; for ( integer wbit : watchers ) { watcher watcher = watcher bit id map get ( wbit ) ; if ( watcher instanceof server cnxn ) { ids add ( ( ( server cnxn ) watcher ) get session id ( ) ) ; } } } } return new watches path report ( path 2ids ) ; }


invert a left shift of { @ code n } positions , that is shift right this is different from a normal shift right , in that it inserts unknowns at the left the normal right shift inserts zeros or sign bits additionally , if any ones would fall off the right , the inversion is undefined

public masked long inv shift left ( long n ) throws solver exception { if ( n = = 0 ) { return this ; } long check def = ~ ( - 1l < < n ) & val ; if ( check def ! = 0 ) { throw new solver exception ( " cannot invert left shift where ones appear on the right " ) ; } return shift right positional ( n ) ; }


asynchronously fulfills the request into the specified { @ link remote views } object with the given { @ code view id } this is used for loading bitmaps into a { @ link notification }

public void into ( @ non null remote views remote views , @ id res int view id , int notification id , @ non null notification notification ) { into ( remote views , view id , notification id , notification , null ) ; }


convert the given masked long to a pattern block ( having offset 0 ) note : the result will be 8 bytes in length

public static assembly pattern block from masked long ( masked long ml ) { byte [ ] mask = new byte [ 8 ] ; byte [ ] vals = new byte [ 8 ] ; long lmask = ml get mask ( ) ; long value = ml long value ( ) ; for ( int i = vals length ; i > = 0 ; i - - ) { mask [ i ] = ( byte ) ( lmask & 0xff ) ; vals [ i ] = ( byte ) ( value & 0xff ) ; lmask > > = 8 ; value > > = 8 ; } assembly pattern block res = new assembly pattern block ( 0 , mask , vals ) ; return res ; }


the test server will not implement this method it will be used to test the behavior when clients call unimplemented methods

public io grpc testing integration empty protos empty unimplemented call ( io grpc testing integration empty protos empty request ) { return io grpc stub client calls blocking unary call ( get channel ( ) , get unimplemented call method ( ) , get call options ( ) , request ) ; }


this saves scripts that not only have keybindings , but that are also marked as " in tool " from the gui

void save scripts that are in tool ( save state save state ) { set < resource file > action script files = action map key set ( ) ; set < string > script paths = new hash set < > ( action script files size ( ) ) ; for ( resource file file : action script files ) { script paths add ( generic util path to path string ( file ) ) ; } string [ ] array = script paths to array ( new string [ script paths size ( ) ] ) ; save state put strings ( script actions key , array ) ; }


public okhttp 3 call test enum parameters call ( list < string > enum header string array , string enum header string , list < string > enum query string array , string enum query string , integer enum query integer , double enum query double , list < string > enum form string array , string enum form string , final api callback callback ) throws api exception { object local var post body = null ; / / create path and map variables string local var path = " / fake " ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; if ( enum form string array ! = null ) { local var form params put ( " enum form string array " , enum form string array ) ; } if ( enum form string ! = null ) { local var form params put ( " enum form string " , enum form string ) ; } if ( enum query string array ! = null ) { local var collection query params add all ( local var api client parameter to pairs ( " csv " , " enum query string array " , enum query string array ) ) ; } if ( enum query string ! = null ) { local var query params add all ( local var api client parameter to pair ( " enum query string " , enum query string ) ) ; } if ( enum query integer ! = null ) { local var query params add all ( local var api client parameter to pair ( " enum query integer " , enum query integer ) ) ; } if ( enum query double ! = null ) { local var query params add all ( local var api client parameter to pair ( " enum query double " , enum query double ) ) ; } if ( enum header string array ! = null ) { local var header params put ( " enum header string array " , local var api client parameter to string ( enum header string array ) ) ; } if ( enum header string ! = null ) { local var header params put ( " enum header string " , local var api client parameter to string ( enum header string ) ) ; } final string [ ] local var accepts = { } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { " application / x - www - form - urlencoded " } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , " get " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


returns true if this value corresponds to a file or symlink to an existing regular or special file if so , its parent directory is guaranteed to exist

public boolean is file ( ) { return real file state value ( ) get type ( ) = = file state type regular file | | real file state value ( ) get type ( ) = = file state type special file ; }


< code > boolean < code > argument that is equal to the given value see examples in javadoc for { @ link argument matchers } class

public static boolean eq ( boolean value ) { report matcher ( new equals ( value ) ) ; return false ; }


to test \ & quot ; client \ & quot ; model to test \ & quot ; client \ & quot ; model

public client test client model ( @ valid client body ) ;


creates new action cache entry using given compressed entry data data will stay in the compressed format until entry is actually used by the dependency checker

private static action cache entry decode ( string indexer indexer , byte [ ] data ) throws i o exception { try { byte buffer source = byte buffer wrap ( data ) ; byte [ ] action key bytes = new byte [ var int get var int ( source ) ] ; source get ( action key bytes ) ; string action key = new string ( action key bytes , iso 8859 1 ) ; byte [ ] digest = metadata digest utils read ( source ) ; int count = var int get var int ( source ) ; if ( count ! = no input discovery count & & count < 0 ) { throw new i o exception ( " negative discovered file count : " + count ) ; } immutable list < string > files = null ; if ( count ! = no input discovery count ) { immutable list builder < string > builder = immutable list builder with expected size ( count ) ; for ( int i = 0 ; i < count ; i + + ) { int id = var int get var int ( source ) ; string filename = ( id > = 0 ? indexer get string for index ( id ) : null ) ; if ( filename = = null ) { throw new i o exception ( " corrupted file index " ) ; } builder add ( filename ) ; } files = builder build ( ) ; } byte [ ] used client env digest = metadata digest utils read ( source ) ; if ( source remaining ( ) > 0 ) { throw new i o exception ( " serialized entry data has not been fully decoded " ) ; } return new action cache entry ( action key , used client env digest , files , digest ) ; } catch ( buffer underflow exception e ) { throw new i o exception ( " encoded entry data is incomplete " , e ) ; } }


called when a plugin is loaded to make the { @ link servlet context } object available to a plugin this object allows plugins to talk to the surrounding environment the default implementation is no - op

public void set servlet context ( servlet context context ) { }


returns an iterator over all of the children of this node with the specfied name

public iterator < xml tree node > get children ( string name ) { return new tag iterator ( name ) ; }


public string get quadrilateral type ( ) { return quadrilateral type ; }


creates a { @ code time evictor } that keeps the given number of elements eviction is done before the window function

public static < w extends window > time evictor < w > of ( time window size ) { return new time evictor < > ( window size to milliseconds ( ) ) ; }


add an args definition for a define with arguments # define bubba ( a , b ) ( a or b )

public void put arg ( string string , vector < p p token > val ) { args put ( string , val ) ; }


returns a { @ link collection } of { @ link system index descriptor } s that describe this plugin ' s system indices , including name , mapping , and settings

default collection < system index descriptor > get system index descriptors ( settings settings ) { return collections empty list ( ) ; }


accepts a declaration for further processing parsing

void declaration ( file fragment fragment ) throws generic parsing exception , i o exception ;


creates the given number of { @ link io reactivex rxjava 3 core scheduler worker } instances that are possibly backed by distinct threads and calls the specified { @ code consumer } with them

void create workers ( int number , @ non null worker callback callback ) ;


an implementation of { @ link list # hash code ( ) }

static int hash code impl ( list < ? > list ) { / / todo ( lowasser ) : worth optimizing for random access ? int hash code = 1 ; for ( object o : list ) { hash code = 31 * hash code + ( o = = null ? 0 : o hash code ( ) ) ; hash code = ~ ~ hash code ; / / needed to deal with gwt integer overflow } return hash code ; }


< code > replace function calling convention < code > changes the function calling convention in program 1 if it doesn ' t match the function calling convention in program 2 at the specified entry point address

public void replace function calling convention ( address origin entry point , task monitor monitor ) { address result entry point = origin to result translator get address ( origin entry point ) ; function f 1 = result program get function manager ( ) get function at ( result entry point ) ; function f 2 = origin program get function manager ( ) get function at ( origin entry point ) ; if ( f 1 ! = null & & f 2 ! = null ) { string name 1 = f 1 get calling convention name ( ) ; string name 2 = f 2 get calling convention name ( ) ; if ( ! name 1 equals ( name 2 ) ) { try { f 1 set calling convention ( name 2 ) ; } catch ( invalid input exception e ) { error msg append ( " invalid input exception replacing calling convention : " + e get message ( ) + " \ n " ) ; } } } }


public final list < aggregation > as list ( ) { return collections unmodifiable list ( aggregations ) ; }


< code > optional double money = 1 ; < code >

public builder set money ( double value ) { bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; money = value ; on changed ( ) ; return this ; }


replaces the existing container under test with a new container this is useful when a single test method needs to create multiple containers while retaining the ability to use { @ link # expect contents ( object [ ] ) expect contents ( e ) } and other convenience methods the creation of multiple containers in a single method is discouraged in most cases , but it is vital to the iterator tests

protected c reset container ( c new value ) { container = new value ; return container ; }


calculate the md5 digest of the given stream this method does not close the input stream

public static byte [ ] md 5 digest ( input stream input stream ) throws i o exception { return digest ( md5 algorithm name , input stream ) ; }


send an exception to every element in a collection of kafka future impls

private static < t > void complete all exceptionally ( collection < kafka future impl < t > > futures , throwable exc ) { complete all exceptionally ( futures stream ( ) , exc ) ; }


public final long get long bits ( ) { return bits ; }


tests that artifact function rethrows transitive { @ link i o exception } s as { @ link missing input file exception } s

public void test i o exception end to end ( ) throws throwable { final i o exception exception = new i o exception ( " beep " ) ; setup root ( new custom in memory fs ( ) { @ override public file status stat if found ( path path , boolean follow symlinks ) throws i o exception { if ( path get base name ( ) equals ( " bad " ) ) { throw exception ; } return super stat if found ( path , follow symlinks ) ; } } ) ; i o exception e = assert throws ( i o exception class , ( ) - > evaluate artifact value ( create source artifact ( " bad " ) ) ) ; assert that ( e ) has message that ( ) contains ( exception get message ( ) ) ; }


registers a new { @ link org apache flink metrics gauge } with flink

< t , g extends gauge < t > > g gauge ( int name , g gauge ) ;


modifies the http response and body based on the provided halt exception

public static void modify ( http servlet response http response , body body , halt exception halt ) { http response set status ( halt status code ( ) ) ; if ( halt body ( ) ! = null ) { body set ( halt body ( ) ) ; } else { body set ( " " ) ; } }


converts a sql expression to a { @ link rex node } expression

rex node convert to rex node ( string expr ) ;


a specialized simplified mapping source method , takes the form of simple properties definition : ( " field 1 " , " type = string , store = true " )

public create index request simple mapping ( string source ) { mapping ( put mapping request simple mapping ( source ) ) ; return this ; }


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


static long parse size ( string arg ) { string [ ] args = arg split ( " \ \ d " , 2 ) ; / / get digits assert args length < = 2 ; long nr bytes = long parse long ( args [ 0 ] ) ; string bytes mult = arg substring ( args [ 0 ] length ( ) ) ; / / get byte multiple return nr bytes * byte multiple parse string ( bytes mult ) value ( ) ; }


open paypal open collective link and add event

private static void on paypal click ( final notification notification , final hyperlink event event ) { final url url = event get u r l ( ) ; try { @ non nls final j s o n object props = new j s o n object ( ) ; props put ( " url " , url ) ; m t analytics get instance ( ) track with data ( m t analytics update notification , props ) ; } catch ( final j s o n exception ignored ) { } if ( url = = null ) { browser util browse ( event get description ( ) ) ; } else { browser util browse ( url ) ; } notification expire ( ) ; }


gets the prefix from the given text field , used to query the model

protected string get prefix ( j text field field ) { try { return field get text ( 0 , field get caret position ( ) ) ; } catch ( bad location exception e ) { throw new assertion error ( " internal : should not be here " , e ) ; } }


returns a path to a file that can be written tries multiple locations and verifies writing succeeds

private @ null file get extracted file ( string dir name , string file name ) { / / temp directory with username in path file ideal file = new file ( system get property ( " java io tmpdir " ) + " / libgdx " + system get property ( " user name " ) + " / " + dir name , file name ) ; if ( can write ( ideal file ) ) return ideal file ; / / system provided temp directory try { file file = file create temp file ( dir name , null ) ; if ( file delete ( ) ) { file = new file ( file , file name ) ; if ( can write ( file ) ) return file ; } } catch ( i o exception ignored ) { } / / user home file file = new file ( system get property ( " user home " ) + " / libgdx / " + dir name , file name ) ; if ( can write ( file ) ) return file ; / / relative directory file = new file ( " temp / " + dir name , file name ) ; if ( can write ( file ) ) return file ; / / we are running in the os x sandbox if ( system getenv ( " app sandbox container id " ) ! = null ) return ideal file ; return null ; }


the number of words of outgoing argument space required by this code for method invocation

public short get outgoing size ( ) { return outgoing size ; }


returns the name of the { @ link byte provider } for example , the underlying file name


get the current code comparison panel being viewed

code comparison panel < ? extends field panel coordinator > get current component ( ) { return ( code comparison panel < ? > ) tabbed pane get selected component ( ) ; }


create a counter builder by given meter name

public static histogram builder histogram ( string name ) { return new histogram builder ( name ) ; }


removes the field identified by the provided path

public void remove field ( template script factory field path template ) { remove field ( render template ( field path template ) ) ; }


decorates the stream by wrapping it into a stream that applies a compression important : for streams returned by this method , { @ link output stream # close ( ) } is not propagated to the inner stream the inner stream must be closed separately

public final output stream decorate with compression ( output stream stream ) throws i o exception { return decorate with compression ( new non closing outpus stream decorator ( stream ) ) ; }


private void refresh reference key list ( ) { active reference key = null ; reference keys clear ( ) ; u i utils sync exec ( ( ) - > { data viewer clear data ( ) ; fk combo remove all ( ) ; data viewer show empty presentation ( ) ; } ) ; list < d b d attribute binding > visible attributes = parent controller get model ( ) get visible attributes ( ) ; if ( visible attributes is empty ( ) ) { return ; } parent data container = parent controller get data container ( ) ; if ( parent data container = = null ) { return ; } set < d b s entity > all entities = new linked hash set < > ( ) ; for ( d b d attribute binding attr : visible attributes ) { d b s entity attribute entity attribute = attr get entity attribute ( ) ; if ( entity attribute ! = null ) { all entities add ( entity attribute get parent object ( ) ) ; } } if ( all entities is empty ( ) & & parent data container instanceof d b s entity ) { all entities add ( ( d b s entity ) parent data container ) ; } list < reference key memo > ref key memos = new array list < > ( ) ; { d b v entity v entity owner = d b v utils get virtual entity ( parent data container , false ) ; if ( v entity owner ! = null ) { object active associations = v entity owner get property ( v prop active associations ) ; if ( active associations instanceof collection ) { for ( object ref key memo map : ( collection ) active associations ) { if ( ref key memo map instanceof map ) { ref key memos add ( new reference key memo ( ( map ) ref key memo map ) ) ; } } } } } if ( ! all entities is empty ( ) ) { new abstract job ( " load reference keys " ) { @ override protected i status run ( d b r progress monitor monitor ) { monitor begin task ( " load references " , all entities size ( ) ) ; try { list < reference key > refs = new array list < > ( ) ; for ( d b s entity entity : all entities ) { monitor sub task ( entity get name ( ) ) ; if ( entity instanceof d b v entity ) { / / skip virtual entities continue ; } / / foreign keys collection < ? extends d b s entity association > associations = d b v utils get all associations ( monitor , entity ) ; for ( d b s entity association assoc : associations ) { if ( assoc instanceof d b s entity referrer ) { list < ? extends d b s entity attribute ref > attrs = ( ( d b s entity referrer ) assoc ) get attribute references ( monitor ) ; if ( ! common utils is empty ( attrs ) ) { reference key reference key = new reference key ( monitor , false , assoc get associated entity ( ) , assoc , attrs ) ; refs add ( reference key ) ; } } } / / references collection < ? extends d b s entity association > references = d b v utils get all references ( monitor , entity ) ; { for ( d b s entity association assoc : references ) { if ( assoc instanceof d b s entity referrer ) { list < ? extends d b s entity attribute ref > attrs = ( ( d b s entity referrer ) assoc ) get attribute references ( monitor ) ; if ( ! common utils is empty ( attrs ) ) { reference key reference key = new reference key ( monitor , true , entity , assoc , attrs ) ; refs add ( reference key ) ; } } } } monitor worked ( 1 ) ; } synchronized ( reference keys ) { reference keys clear ( ) ; reference keys add all ( refs ) ; / / detect active ref key from memo if ( ! reference keys is empty ( ) ) { if ( ! ref key memos is empty ( ) ) { for ( reference key key : reference keys ) { for ( reference key memo memo : ref key memos ) { if ( key matches ( memo ) ) { active reference key = key ; break ; } } if ( active reference key ! = null ) break ; } } if ( active reference key = = null ) { active reference key = reference keys get ( 0 ) ; } } } u i utils sync exec ( ( ) - > fill keys combo ( ) ) ; } catch ( d b exception e ) { log debug ( " error reading references " , e ) ; / / do not show errors references or f ks may be unsupported by current database } finally { monitor done ( ) ; } return status ok status ; } } schedule ( ) ; } }


returns { @ code true } if a request with the given path and headers passes all the rules specified by this route match the request ' s headers are given as a key - values mapping , where multiple values can be mapped to the same key match is not deterministic if a runtime fraction match rule presents in this route match

boolean matches ( string path , map < string , iterable < string > > headers ) { if ( ! path match matches ( path ) ) { return false ; } for ( header matcher header matcher : header matchers ) { iterable < string > header values = headers get ( header matcher get name ( ) ) ; / / special cases for hiding headers : " grpc - previous - rpc - attempts " if ( header matcher get name ( ) equals ( " grpc - previous - rpc - attempts " ) ) { header values = null ; } / / special case for exposing headers : " content - type " if ( header matcher get name ( ) equals ( " content - type " ) ) { header values = collections singleton list ( " application / grpc " ) ; } if ( ! header matcher matches value ( header values ) ) { return false ; } } return fraction match = = null | | fraction match matches ( ) ; }


create mem references for the external entry points ; then delete the table

private void process old external entry points ( task monitor monitor ) throws i o exception , cancelled exception { table table = program get d b handle ( ) get table ( old external entry table name ) ; if ( table = = null ) { return ; } address map old addr map = addr map get old address map ( ) ; monitor set message ( " upgrading external entry points " ) ; monitor initialize ( table get record count ( ) ) ; int cnt = 0 ; record iterator iter = table iterator ( ) ; while ( iter has next ( ) ) { monitor check canceled ( ) ; d b record rec = iter next ( ) ; address addr = old addr map decode address ( rec get key ( ) ) ; ref manager add external entry point ref ( addr ) ; monitor set progress ( + + cnt ) ; } program get d b handle ( ) delete table ( old external entry table name ) ; }


type - inferring factory method for creating a { @ link queuing removal listener }

static < k , v > queuing removal listener < k , v > queuing removal listener ( ) { return new queuing removal listener < > ( ) ; }


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

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


gets the repository name associated with the url

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


returns the image height if known , else - 1

public int get height ( ) { parse metadata if needed ( ) ; return m height ; }


callback for when the photo is experiencing a drag event this cannot be invoked when the user is scaling


set whether savepoints are allowed within this transaction the default is { @ code false }

public void set savepoint allowed ( boolean savepoint allowed ) { this savepoint allowed = savepoint allowed ; }


returns true if we should share identical native libraries between different targets

public boolean share native deps ( ) { return cpp options share native deps ; }


adds a dependency on a skyframe - external event if the given future is already complete , this method silently returns without doing anything ( to avoid unnecessary function restarts ) otherwise , skyframe adds a listener to the passed - in future , and only re - enqueues the current node after the future completes and all requested deps are done the added listener will perform the minimum amount of work on the thread completing the future necessary for skyframe bookkeeping callers of this method must check { @ link # values missing } before returning { @ code null } from a { @ link sky function } this api is intended for performing async computations ( e g , remote execution ) in another thread pool without blocking the current skyframe thread

void depend on future ( listenable future < ? > future ) ;


creates a media type with the " video " type and the given subtype

static media type create video type ( string subtype ) { return create ( video type , subtype ) ; }


returns the time when this task will be executed in milliseconds

public long get execute time millis ( ) { return execute time millis ; }


flush all unsaved table changes to the underlying buffer mgr this method may only be invoked while a database transaction is in progress

void flush ( ) throws i o exception { for ( int i = 0 ; i < table records length ; i + + ) { d b record rec = table records [ i ] get record ( ) ; if ( rec is dirty ( ) ) { table put record ( rec ) ; } } }


this method returns the next step to execute based on the predicate if the predicate returned true , then next step key on true is the key of the next step to run , otherwise next step key on false is throws { @ link unsupported operation exception } if perform action was not called yet

public final step key get next step key ( ) { if ( predicate value get ( ) = = null ) { throw new illegal state exception ( " cannot call get next step key before perform action " ) ; } return predicate value get ( ) ? next step key on true : next step key on false ; }


tests that track selector will prefer audio tracks with lower channel count over tracks with lower sample rate when other factors are the same , and tracks are within renderer ' s capabilities

public void select tracks exceeding capabilities prefer lower num channel before sample rate ( ) throws exception { format builder format builder = audio format build upon ( ) ; format lower channel higher sample rate format = format builder set channel count ( 2 ) set sample rate ( 44100 ) build ( ) ; format higher channel lower sample rate format = format builder set channel count ( 6 ) set sample rate ( 22050 ) build ( ) ; track group array track groups = wrap formats ( higher channel lower sample rate format , lower channel higher sample rate format ) ; track selector result result = track selector select tracks ( new renderer capabilities [ ] { all audio format exceeded renderer capabilities } , track groups , period id , timeline ) ; assert fixed selection ( result selections get ( 0 ) , track groups , lower channel higher sample rate format ) ; }


checks whether next index is valid ; if so setting next item stops iterator when either hits put index or sees null item

private void check next ( ) { if ( next index = = put index ) { next index = - 1 ; next item = null ; } else { next item = items [ next index ] ; if ( next item = = null ) next index = - 1 ; } }


clear the internal annotation metadata cache

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


public string get enum string required ( ) { if ( enum string required = = null ) { return null ; } return enum string required value ( ) ; }


test correctness of successive snapshot creation and deletion on a system with encryption zones

public void test snapshots on encryption zones ( ) throws exception { final string test key2 = " testkey 2 " ; d f s test util create key ( test key2 , cluster , conf ) ; final int len = 8196 ; final path zone parent = new path ( " / zones " ) ; final path zone = new path ( zone parent , " zone " ) ; final path zone file = new path ( zone , " zone file " ) ; fs wrapper mkdir ( zone , fs permission get dir default ( ) , true ) ; dfs admin allow snapshot ( zone parent ) ; dfs admin create encryption zone ( zone , test key , no trash ) ; d f s test util create file ( fs , zone file , len , ( short ) 1 , 0x f e e d ) ; string contents = d f s test util read file ( fs , zone file ) ; final path snap 1 = fs create snapshot ( zone parent , " snap 1 " ) ; final path snap 1 zone = new path ( snap 1 , zone get name ( ) ) ; assert equals ( " got unexpected ez path " , zone to string ( ) , dfs admin get encryption zone for path ( snap 1 zone ) get path ( ) to string ( ) ) ; / / now delete the encryption zone , recreate the dir , and take another / / snapshot fs wrapper delete ( zone , true ) ; fs wrapper mkdir ( zone , fs permission get dir default ( ) , true ) ; final path snap 2 = fs create snapshot ( zone parent , " snap 2 " ) ; final path snap 2 zone = new path ( snap 2 , zone get name ( ) ) ; assert equals ( " got unexpected ez path " , zone to string ( ) , dfs admin get encryption zone for path ( snap 1 zone ) get path ( ) to string ( ) ) ; assert null ( " expected null ez path " , dfs admin get encryption zone for path ( snap 2 zone ) ) ; / / create the encryption zone again , and that shouldn ' t affect old snapshot dfs admin create encryption zone ( zone , test key2 , no trash ) ; encryption zone ez snap 1 = dfs admin get encryption zone for path ( snap 1 zone ) ; assert equals ( " got unexpected ez path " , zone to string ( ) , ez snap 1 get path ( ) to string ( ) ) ; assert equals ( " unexpected ez key " , test key , ez snap 1 get key name ( ) ) ; assert null ( " expected null ez path " , dfs admin get encryption zone for path ( snap 2 zone ) ) ; final path snap 3 = fs create snapshot ( zone parent , " snap 3 " ) ; final path snap 3 zone = new path ( snap 3 , zone get name ( ) ) ; / / check that snap 3 ' s ez has the correct settings encryption zone ez snap 3 = dfs admin get encryption zone for path ( snap 3 zone ) ; assert equals ( " got unexpected ez path " , zone to string ( ) , ez snap 3 get path ( ) to string ( ) ) ; assert equals ( " unexpected ez key " , test key2 , ez snap 3 get key name ( ) ) ; / / check that older snapshots still have the old ez settings ez snap 1 = dfs admin get encryption zone for path ( snap 1 zone ) ; assert equals ( " got unexpected ez path " , zone to string ( ) , ez snap 1 get path ( ) to string ( ) ) ; assert equals ( " unexpected ez key " , test key , ez snap 1 get key name ( ) ) ; assert null ( " expected null ez path " , dfs admin get encryption zone for path ( snap 2 zone ) ) ; / / check that list e zs only shows the current filesystem state array list < encryption zone > list zones = lists new array list ( ) ; remote iterator < encryption zone > it = dfs admin list encryption zones ( ) ; while ( it has next ( ) ) { list zones add ( it next ( ) ) ; } for ( encryption zone z : list zones ) { system out println ( z ) ; } assert equals ( " did not expect additional encryption zones ! " , 1 , list zones size ( ) ) ; encryption zone list zone = list zones get ( 0 ) ; assert equals ( " got unexpected ez path " , zone to string ( ) , list zone get path ( ) to string ( ) ) ; assert equals ( " unexpected ez key " , test key2 , list zone get key name ( ) ) ; / / verify contents of the snapshotted file final path snapshotted zone file = new path ( snap 1 to string ( ) + " / " + zone get name ( ) + " / " + zone file get name ( ) ) ; assert equals ( " contents of snapshotted file have changed unexpectedly " , contents , d f s test util read file ( fs , snapshotted zone file ) ) ; / / now delete the snapshots out of order and verify the zones are still / / correct fs delete snapshot ( zone parent , snap 2 get name ( ) ) ; assert equals ( " got unexpected ez path " , zone to string ( ) , dfs admin get encryption zone for path ( snap 1 zone ) get path ( ) to string ( ) ) ; assert equals ( " got unexpected ez path " , zone to string ( ) , dfs admin get encryption zone for path ( snap 3 zone ) get path ( ) to string ( ) ) ; fs delete snapshot ( zone parent , snap 1 get name ( ) ) ; assert equals ( " got unexpected ez path " , zone to string ( ) , dfs admin get encryption zone for path ( snap 3 zone ) get path ( ) to string ( ) ) ; }


returns a string that can be used to parse an equivalent { @ code cache builder spec } the order and form of this representation is not guaranteed , except that reparsing its output will produce a { @ code cache builder spec } equal to this instance

public string to parsable string ( ) { return specification ; }


public static byte [ ] base 6 4 encode ( final byte [ ] input ) { if ( input = = null | | input length = = 0 ) return new byte [ 0 ] ; return base 6 4 encode ( input , base 6 4 no wrap ) ; }


public static int compare ( final int x , final int y ) { / / do not subtract for comparison , it could overflow return x < y ? - 1 : ( x > y ? 1 : 0 ) ; }


read from a file channel into a byte buffer , starting at a certain position

public static int read from file channel ( file channel channel , long channel position , byte buffer dest ) throws i o exception { if ( dest is direct ( ) | | ( dest remaining ( ) < read chunk size ) ) { return read single chunk ( channel , channel position , dest ) ; } else { int bytes read = 0 ; int bytes to read = dest remaining ( ) ; / / duplicate the buffer in order to be able to change the limit byte buffer tmp buffer = dest duplicate ( ) ; try { while ( dest has remaining ( ) ) { tmp buffer limit ( math min ( dest limit ( ) , tmp buffer position ( ) + read chunk size ) ) ; int read = read single chunk ( channel , channel position , tmp buffer ) ; if ( read < 0 ) { return read ; } bytes read + = read ; channel position + = read ; dest position ( tmp buffer position ( ) ) ; } } finally { / / make sure we update byte buffer to indicate how far we came dest position ( tmp buffer position ( ) ) ; } assert bytes read = = bytes to read : " failed to read an entire buffer but also didn ' t get an eof ( read [ " + bytes read + " ] needed [ " + bytes to read + " ] " ; return bytes read ; } }


namenode registration get registration ( ) { return bn registration ; }


returns a human readable presentation of how long this item is already in the queue e g something like ' 3 minutes 40 seconds '

public string get in queue for string ( ) { long duration = system current time millis ( ) - this in queue since ; return util get time span string ( duration ) ; }


handles a change in viewport this method should not be called outside of the method { @ link on scroll listener # on scrolled ( recycler view , int , int ) }

void on viewport changed ( @ viewport info state int state ) { final int first visible position = m layout info find first visible item position ( ) ; final int last visible position = m layout info find last visible item position ( ) ; final int first fully visible item position = m layout info find first fully visible item position ( ) ; final int last fully visible item position = m layout info find last fully visible item position ( ) ; final int total item count = m layout info get item count ( ) ; if ( first visible position < 0 | | last visible position < 0 ) { return ; } if ( first visible position = = m current first visible position & & last visible position = = m current last visible position & & first fully visible item position = = m current first fully visible position & & last fully visible item position = = m current last fully visible position & & total item count = = m total item count & & state ! = viewport info state data changes ) { return ; } m current first visible position = first visible position ; m current last visible position = last visible position ; m current first fully visible position = first fully visible item position ; m current last fully visible position = last fully visible item position ; m total item count = total item count ; m should update = false ; final list < viewport changed > viewport changed listeners ; synchronized ( this ) { if ( m viewport changed listeners is empty ( ) ) { return ; } viewport changed listeners = new array list < > ( m viewport changed listeners ) ; } for ( int i = 0 , size = viewport changed listeners size ( ) ; i < size ; i + + ) { final viewport changed viewport changed listener = viewport changed listeners get ( i ) ; viewport changed listener viewport changed ( first visible position , last visible position , first fully visible item position , last fully visible item position , state ) ; } }


clears all text from the information buffer

void clear resolve info ( ) { if ( info buf length ( ) > 0 ) { info buf = new string buffer ( ) ; } }


protected file get log file ( ) { file base = get base dir ( ) ; base mkdirs ( ) ; return new file ( base , " log " ) ; }


assert that the loginpass details from a uri match that expected

private s 3x login helper login assert matches login ( string user , string pass , uri uri ) { s 3x login helper login expected = new s 3x login helper login ( user , pass ) ; s 3x login helper login actual = s 3x login helper extract login details ( uri ) ; if ( ! expected equals ( actual ) ) { assert fail ( " source " + uri + " login expected = : " + to string ( expected ) + " actual = " + to string ( actual ) ) ; } return actual ; }


return the size of the structure being viewed in bytes

public int get length ( ) { if ( view composite ! = null & & ! view composite is not yet defined ( ) ) { return view composite get length ( ) ; } return 0 ; }


creates an event reporting an absent input artifact

event get root cause error ( value t value , key t key , label cause root cause , environment env ) throws interrupted exception ;


normalize type by wrapping primitive types with single quotes

private string normalize type ( string type ) { return type replace all ( " \ \ b ( boolean | integer | number | string | date | blob ) \ \ b " , " ' $ 1 ' " ) ; }


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