sets the uncompressed size of the entry data in bytes

public void set size ( long size ) { if ( size < 0 ) { throw new illegal argument exception ( " invalid entry size " ) ; } if ( size > 0xffffffff l ) { feature set add ( feature zip64 size ) ; } else { feature set remove ( feature zip64 size ) ; } this size = size ; }


set the strategy to use for resolving errors into message codes applies the given strategy to the underlying errors holder default is a default message codes resolver

public void set message codes resolver ( @ nullable message codes resolver message codes resolver ) { assert state ( this message codes resolver = = null , " data binder is already initialized with message codes resolver " ) ; this message codes resolver = message codes resolver ; if ( this binding result ! = null & & message codes resolver ! = null ) { this binding result set message codes resolver ( message codes resolver ) ; } }


convert a value given in meters to a value of this unit

public double from meters ( double distance ) { return convert ( distance , distance unit meters , this ) ; }


returns a state over a range that is the intersection between this handle ' s key - group range and the provided key - group range

keyed state handle get intersection ( key group range key group range ) ;


the series of types defined by the package < code > repeated aapt pb type type = 3 ; < code >

public builder add type ( com android aapt resources type value ) { copy on write ( ) ; instance add type ( value ) ; return this ; }


get the storage uuid of the volume that stores this replica

public string get storage uuid ( ) { return volume get storage i d ( ) ; }


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


process a multi object delete exception by building two paths from the delete request : one of all deleted files , one of all undeleted values the latter are those rejected in the delete call

public pair < list < key path > , list < key path > > split undeleted keys ( final multi object delete exception delete exception , final collection < delete objects request key version > keys to delete ) { log debug ( " processing delete failure ; keys to delete count = { } ; " + " errors in exception { } ; successful deletions = { } " , keys to delete size ( ) , delete exception get errors ( ) size ( ) , delete exception get deleted objects ( ) size ( ) ) ; / / convert the collection of keys being deleted into paths final list < key path > paths being deleted = keys to key paths ( keys to delete ) ; / / take this ist of paths / / extract all undeleted entries contained in the exception and / / then remove them from the original list list < key path > undeleted = remove undeleted paths ( delete exception , paths being deleted , get store context ( ) : : key to path ) ; return pair of ( undeleted , paths being deleted ) ; }


check if there are duplicate pattern names if yes , it throws a { @ link malformed pattern exception }

private void check pattern name uniqueness ( ) { / / make sure there is no pattern with name " $ end state $ " state name handler check name uniqueness ( ending state name ) ; pattern pattern to check = current pattern ; while ( pattern to check ! = null ) { check pattern name uniqueness ( pattern to check ) ; pattern to check = pattern to check get previous ( ) ; } state name handler clear ( ) ; }


sets whether to use the orientation sensor for rotation during spherical playbacks ( if available )

public void set use sensor rotation ( boolean use sensor rotation ) { if ( this use sensor rotation ! = use sensor rotation ) { this use sensor rotation = use sensor rotation ; if ( surface view instanceof spherical g l surface view ) { ( ( spherical g l surface view ) surface view ) set use sensor rotation ( use sensor rotation ) ; } } }


returns pet inventories by status returns a map of status codes to quantities

public void get inventory test ( ) { / / map < string , integer > response = api get inventory ( ) ; / / todo : test validations }


public final boolean is array ( ) { return array element type ( ) is present ( ) ; }


this method is used to send transactional messages

public transaction send result send message in transaction ( message msg , object arg ) throws m q client exception { throw new runtime exception ( " send message in transaction not implement , please use transaction m q producer class " ) ; }


decreases the volume by one for the current audio stream it will be ignored if the current volume is equal to { @ link # get min volume ( ) }

public void decrease volume ( ) { if ( volume < = get min volume ( ) ) { return ; } audio manager adjust stream volume ( stream type , audio manager adjust lower , volume flags ) ; update volume and notify if changed ( ) ; }


returns true if the given tier name is a valid tier

public static boolean valid tier name ( string tier name ) { return data content equals ( tier name ) | | data hot equals ( tier name ) | | data warm equals ( tier name ) | | data cold equals ( tier name ) ; }


get { @ link context } of current thread

public static context get context ( ) { return context holder get ( ) ; }


merges a { @ link download request } into a { @ link default download index }

/ * package * / static void merge request ( download request request , default download index download index , boolean add new download as completed , long now ms ) throws i o exception { @ nullable download download = download index get download ( request id ) ; if ( download ! = null ) { download = download manager merge request ( download , request , download stop reason , now ms ) ; } else { download = new download ( request , add new download as completed ? download state completed : state queued , / * start time ms = * / now ms , / * update time ms = * / now ms , / * content length = * / c length unset , download stop reason none , download failure reason none ) ; } download index put download ( download ) ; }


hashes { @ link string } , using unsigned 3 2 bit mod , which the user should ensure is < = 0xffffffff returns an unsigned integer value ( 32 - bit ) returned as a long

protected long hash string 3 2 ( string string , long unsigned 3 2 bit mod ) throws pdb exception { byte [ ] bytes = string get bytes ( ) ; pdb byte reader reader = new pdb byte reader ( bytes ) ; int count = bytes length ; / / int count = length > > 2 ; / / processing 32 bits at a time long hash = 0 ; / / represents unsigned int while ( count > = 4 ) { count - = 4 ; hash ^ = reader parse unsigned int val ( ) ; } if ( bytes length - reader get index ( ) > = 2 ) { hash ^ = reader parse unsigned short val ( ) ; } if ( bytes length - reader get index ( ) = = 1 ) { hash ^ = reader parse unsigned byte val ( ) ; } hash | = 0x 2 0 2 0 2 0 2 0 ; / / to - lower mask ( not sure of effect after the above hashing ) hash ^ = ( hash > > 11 ) ; / / mask down to 32 - bits hash & = 0xffffffff ; / / apply modulus return ( hash ^ ( hash > > 16 ) ) % unsigned 3 2 bit mod ; }


public user group information get owner ( ) { return owner ; }


public static void short 2bytes ( short v , byte [ ] b , int off ) { b [ off + 1 ] = ( byte ) v ; b [ off + 0 ] = ( byte ) ( v > > > 8 ) ; }


returns true if this range contains ( if the value is in between ) the given value , false if not

public boolean contains ( float value ) { if ( value > from & & value < = to ) return true ; else return false ; }


gets called after the { @ link byte to message decoder } was removed from the actual context and it doesn ' t handle events anymore

protected void handler removed 0 ( channel handler context ctx ) throws exception { }


public void upload file ( long pet id , string additional metadata , async file file , api client auth info auth info , handler < async result < model api response > > result handler ) { delegate upload file ( pet id , additional metadata , file , auth info , result handler ) ; }


public final list < ? extends transitive info collection > get dependencies ( ) { return targets treated as deps ( classpath type both ) ; }


checks to see if the given project is a ghidra project

public static boolean is ghidra project ( i project project ) { return is java project ( project ) & & project get folder ( ghidra folder name ) exists ( ) ; }


update the repository with the incoming cluster state this method is invoked from { @ link repositories service # apply cluster state } and thus the same semantics as with { @ link org elasticsearch cluster cluster state applier # apply cluster state } apply for the { @ link cluster state } that is passed here

void update state ( cluster state state ) ;


creates a new blocking - style stub that supports unary and streaming output calls on the service

public static aggregated mesh config service blocking stub new blocking stub ( io grpc channel channel ) { return new aggregated mesh config service blocking stub ( channel ) ; }


enables per - message compression , if an encoding type has been negotiated if no message encoding has been negotiated , this is a no - op by default per - message compression is enabled , but may not have any effect if compression is not enabled on the call

void set message compression ( boolean enable ) ;


verify that more than 3 network error retries result fatal error

public void test stat node retry ( ) { elector join election ( data ) ; elector process result ( code connectionloss int value ( ) , zk lock name , mock z k , ( stat ) null ) ; elector process result ( code connectionloss int value ( ) , zk lock name , mock z k , ( stat ) null ) ; elector process result ( code connectionloss int value ( ) , zk lock name , mock z k , ( stat ) null ) ; elector process result ( code connectionloss int value ( ) , zk lock name , mock z k , ( stat ) null ) ; mockito verify ( mock app , mockito times ( 1 ) ) notify fatal error ( " received stat error from zookeeper code : connectionloss " + " not retrying further znode monitoring connection errors " ) ; }


returns whether the given label is in the allowlist provided

public static boolean is available for allowlist ( transitive info collection allowlist , label relevant label ) { package specification provider package specification provider = allowlist get provider ( package specification provider class ) ; return is available for ( package specification provider get package specifications ( ) , relevant label ) ; }


principal instance must be injected even when no authentication is required

public string principal entity without auth ( json principal principal ) { assert that ( principal ) is not null ( ) ; return principal get name ( ) ; }


public mock http servlet request builder flash attrs ( map < string , object > flash attributes ) { assert not empty ( flash attributes , " ' flash attributes ' must not be empty " ) ; flash attributes for each ( this : : flash attr ) ; return this ; }


initializes the reduce - part of the job with the appropriate output settings

public static void set output ( job job , string table name , int field count ) throws i o exception { d b configuration db conf = set output ( job , table name ) ; db conf set output field count ( field count ) ; }


all other methods like next int ( ) next double ( ) depends on this , so we just need to overwrite this

public int next ( int bits ) { long next seed = seed ^ ( seed < < 21 ) ; next seed ^ = ( next seed > > > 35 ) ; next seed ^ = ( next seed < < 4 ) ; seed = next seed ; return ( int ) ( next seed & ( ( 1l < < bits ) - 1 ) ) ; }


draws a polyline in the xy plane using { @ link shape type # line } the vertices must contain at least 2 points ( 4 floats x , y )

public void polyline ( float [ ] vertices , int offset , int count ) { if ( count < 4 ) throw new illegal argument exception ( " polylines must contain at least 2 points " ) ; if ( count % 2 ! = 0 ) throw new illegal argument exception ( " polylines must have an even number of vertices " ) ; check ( shape type line , null , count ) ; float color bits = color to float bits ( ) ; for ( int i = offset , n = offset + count - 2 ; i < n ; i + = 2 ) { float x 1 = vertices [ i ] ; float y 1 = vertices [ i + 1 ] ; float x 2 ; float y 2 ; x 2 = vertices [ i + 2 ] ; y 2 = vertices [ i + 3 ] ; renderer color ( color bits ) ; renderer vertex ( x 1 , y 1 , 0 ) ; renderer color ( color bits ) ; renderer vertex ( x 2 , y 2 , 0 ) ; } }


url - encode the given input string with the given encoding scheme the default implementation uses { @ code u r l encoder encode ( input , enc ) }

protected string url encode ( string input , string encoding scheme ) throws unsupported encoding exception { return u r l encoder encode ( input , encoding scheme ) ; }


tests that snapshots are only created if a new snapshot has been reported or updated

public void test create snapshot ( ) throws exception { execution job vertex job vertex = mock ( execution job vertex class ) ; when ( job vertex get job vertex id ( ) ) then return ( new job vertex i d ( ) ) ; when ( job vertex get parallelism ( ) ) then return ( 1 ) ; checkpoint stats tracker tracker = new checkpoint stats tracker ( 10 , collections singleton list ( job vertex ) , mock ( checkpoint coordinator configuration class ) , new unregistered metrics group ( ) ) ; checkpoint stats snapshot snapshot 1 = tracker create snapshot ( ) ; / / pending checkpoint = > new snapshot pending checkpoint stats pending = tracker report pending checkpoint ( 0 , 1 , checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) ) ; pending report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 0 ) ) ; checkpoint stats snapshot snapshot 2 = tracker create snapshot ( ) ; assert not equals ( snapshot 1 , snapshot 2 ) ; assert equals ( snapshot 2 , tracker create snapshot ( ) ) ; / / complete checkpoint = > new snapshot pending report completed checkpoint ( null ) ; checkpoint stats snapshot snapshot 3 = tracker create snapshot ( ) ; assert not equals ( snapshot 2 , snapshot 3 ) ; / / restore operation = > new snapshot tracker report restored checkpoint ( new restored checkpoint stats ( 12 , checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) , 12 , null ) ) ; checkpoint stats snapshot snapshot 4 = tracker create snapshot ( ) ; assert not equals ( snapshot 3 , snapshot 4 ) ; assert equals ( snapshot 4 , tracker create snapshot ( ) ) ; }


given a file input it will unzip it in the unzip directory passed as the second parameter

public static void un zip ( file in file , file unzip dir ) throws i o exception { enumeration < ? extends zip entry > entries ; zip file zip file = new zip file ( in file ) ; try { entries = zip file entries ( ) ; string target dir path = unzip dir get canonical path ( ) + file separator ; while ( entries has more elements ( ) ) { zip entry entry = entries next element ( ) ; if ( ! entry is directory ( ) ) { input stream in = zip file get input stream ( entry ) ; try { file file = new file ( unzip dir , entry get name ( ) ) ; if ( ! file get canonical path ( ) starts with ( target dir path ) ) { throw new i o exception ( " expanding " + entry get name ( ) + " would create file outside of " + unzip dir ) ; } if ( ! file get parent file ( ) mkdirs ( ) ) { if ( ! file get parent file ( ) is directory ( ) ) { throw new i o exception ( " mkdirs failed to create " + file get parent file ( ) to string ( ) ) ; } } output stream out = files new output stream ( file to path ( ) ) ; try { byte [ ] buffer = new byte [ 8192 ] ; int i ; while ( ( i = in read ( buffer ) ) ! = - 1 ) { out write ( buffer , 0 , i ) ; } } finally { out close ( ) ; } } finally { in close ( ) ; } } } } finally { zip file close ( ) ; } }


creates a new workspace rule event for a download and extract event

public static workspace rule event new download and extract event ( list < url > urls , string output , string sha 2 5 6 , string integrity , string type , string strip prefix , string rule label , location location ) { workspace log protos download and extract event builder e = workspace log protos download and extract event new builder ( ) set output ( output ) set sha 2 5 6 ( sha 2 5 6 ) set integrity ( integrity ) set type ( type ) set strip prefix ( strip prefix ) ; for ( url u : urls ) { e add url ( u to string ( ) ) ; } workspace log protos workspace event builder result = workspace log protos workspace event new builder ( ) ; result = result set download and extract event ( e build ( ) ) ; if ( location ! = null ) { result = result set location ( location to string ( ) ) ; } if ( rule label ! = null ) { result = result set rule ( rule label ) ; } return new workspace rule event ( result build ( ) ) ; }


returns the element at the specified depth in this stack 0 indicates the bottom of the stack size ( ) - 1 indicates the top of the stack

public e get ( int depth ) { return list get ( depth ) ; }


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


each language - specific initialization method will call this to construct artifacts representing its protocol compiler outputs

public static immutable list < artifact > get generated outputs ( rule context rule context , immutable list < artifact > proto sources , string extension , boolean python names ) { immutable list builder < artifact > outputs builder = new immutable list builder < > ( ) ; artifact root genfiles = rule context get genfiles directory ( ) ; for ( artifact src : proto sources ) { path fragment src path = src get output dir relative path ( rule context get configuration ( ) is sibling repository layout ( ) ) ; if ( python names ) { src path = src path replace name ( src path get base name ( ) replace ( ' - ' , ' ' ) ) ; } / / note that two proto library rules can have the same source file , so this is actually a / / shared action nb : this can probably result in action conflicts if the proto library rules / / are not the same outputs builder add ( rule context get shareable artifact ( file system utils replace extension ( src path , extension ) , genfiles ) ) ; } return outputs builder build ( ) ; }


get the list of partitions whose leader is this node

public list < partition info > partitions for node ( int node id ) { return partitions by node get or default ( node id , collections empty list ( ) ) ; }


public boolean tree callback ( int proxy id ) ;


clicks the button with the given name in the { @ link function tag button panel }

private void click button ( string name ) { function tag button panel btn panel = provider get button panel ( ) ; press button by name ( btn panel , name ) ; wait for swing ( ) ; }


returns list of journalnode addresses from the configuration

public static set < string > get journal node addresses ( configuration conf ) throws u r i syntax exception , i o exception { set < string > journal node list = new hash set < > ( ) ; string journals uri = " " ; try { journals uri = conf get ( dfs namenode shared edits dir key ) ; if ( journals uri = = null ) { collection < string > nameservice ids = d f s util client get name service ids ( conf ) ; for ( string ns id : nameservice ids ) { journals uri = d f s util client get conf value ( null , ns id , conf , dfs namenode shared edits dir key ) ; if ( journals uri = = null ) { collection < string > nn ids = d f s util client get name node ids ( conf , ns id ) ; for ( string nn id : nn ids ) { string suffix = d f s util client concat suffixes ( ns id , nn id ) ; journals uri = d f s util client get conf value ( null , suffix , conf , dfs namenode shared edits dir key ) ; if ( journals uri = = null | | ! journals uri starts with ( " qjournal : / / " ) ) { return journal node list ; } else { log warn ( dfs namenode shared edits dir key + " is to be " + " configured as nameservice " + " specific key ( append it with nameservice id ) , no need " + " to append it with namenode id " ) ; uri uri = new uri ( journals uri ) ; list < inet socket address > socket addresses = util get addresses list ( uri ) ; for ( inet socket address is : socket addresses ) { journal node list add ( is get host name ( ) ) ; } } } } else if ( ! journals uri starts with ( " qjournal : / / " ) ) { return journal node list ; } else { uri uri = new uri ( journals uri ) ; list < inet socket address > socket addresses = util get addresses list ( uri ) ; for ( inet socket address is : socket addresses ) { journal node list add ( is get host name ( ) ) ; } } } } else { if ( ! journals uri starts with ( " qjournal : / / " ) ) { return journal node list ; } else { uri uri = new uri ( journals uri ) ; list < inet socket address > socket addresses = util get addresses list ( uri ) ; for ( inet socket address is : socket addresses ) { journal node list add ( is get host name ( ) ) ; } } } } catch ( unknown host exception e ) { log error ( " the conf property " + dfs namenode shared edits dir key + " is not properly set with correct journal node hostnames " ) ; throw new unknown host exception ( journals uri ) ; } catch ( u r i syntax exception e ) { log error ( " the conf property " + dfs namenode shared edits dir key + " is not set properly with correct journal node uri " ) ; throw new u r i syntax exception ( journals uri , " the conf property " + dfs namenode shared edits dir key + " is not " + " properly set with correct journal node uri " ) ; } return journal node list ; }


excluded nodes are not verified and will be ignored by placement if they are not in the same nameservice as the file

public located block get additional datanode ( final string src , final long file id , final extended block blk , final datanode info [ ] existings , final string [ ] existing storage i ds , final datanode info [ ] excludes , final int num additional nodes , final string client name ) throws i o exception { rpc server check operation ( name node operation category read ) ; remote method method = new remote method ( " get additional datanode " , new class < ? > [ ] { string class , long class , extended block class , datanode info [ ] class , string [ ] class , datanode info [ ] class , int class , string class } , new remote param ( ) , file id , blk , existings , existing storage i ds , excludes , num additional nodes , client name ) ; if ( blk ! = null ) { return rpc client invoke single ( blk , method , located block class ) ; } final list < remote location > locations = rpc server get locations for path ( src , false ) ; return rpc client invoke sequential ( locations , method , located block class , null ) ; }


sets { @ link align # top } and clears { @ link align # bottom } for the alignment of all widgets within the horizontal group

public horizontal group top ( ) { align | = align top ; align & = ~ align bottom ; return this ; }


inserts element at current put position , advances , and signals call only when occupying monitor

private void insert ( e x ) { items [ put index ] = x ; put index = inc ( put index ) ; + + count ; }


method to be overridden by subclasses to prepare to enter a state this method is called without the context being locked , and after { @ link # prepare to exit state ( h a context ) } has been called for the previous state , but before { @ link # exit state ( h a context ) } has been called for the previous state

public void prepare to enter state ( final h a context context ) throws service failed exception { }


generate a fragment name ; if there is a symbol at the start of the fragment , and if it is user defined , then use the label as the fragment name ; otherwise , just use the address as the name

private string generate fragment name ( address addr ) { symbol symbol = program get symbol table ( ) get primary symbol ( addr ) ; if ( symbol = = null | | symbol is dynamic ( ) ) { return addr to string ( ) ; } return symbol get name ( ) ; }


merges the given sorted runs to a smaller number of sorted runs

private list < channel with block count > merge channel list ( final list < channel with block count > channel i ds , final list < memory segment > all read buffers , final list < memory segment > write buffers ) throws i o exception { / / a channel list with length max fan in < sup > i < / sup > can be merged to max fan in files in i - 1 / / rounds where every merge / / is a full merge with max fan in input channels a partial round includes merges with fewer / / than max fan in / / inputs it is most efficient to perform the partial round first final double scale = math ceil ( math log ( channel i ds size ( ) ) / math log ( this max fan in ) ) - 1 ; final int num start = channel i ds size ( ) ; final int num end = ( int ) math pow ( this max fan in , scale ) ; final int num merges = ( int ) math ceil ( ( num start - num end ) / ( double ) ( this max fan in - 1 ) ) ; final int num not merged = num end - num merges ; final int num to merge = num start - num not merged ; / / unmerged channel i ds are copied directly to the result list final list < channel with block count > merged channel i ds = new array list < > ( num end ) ; merged channel i ds add all ( channel i ds sub list ( 0 , num not merged ) ) ; final int channels to merge per step = ( int ) math ceil ( num to merge / ( double ) num merges ) ; / / allocate the memory for the merging step final list < list < memory segment > > read buffers = new array list < > ( channels to merge per step ) ; get segments for readers ( read buffers , all read buffers , channels to merge per step ) ; final list < channel with block count > channels to merge this step = new array list < > ( channels to merge per step ) ; int channel num = num not merged ; while ( is running ( ) & & channel num < channel i ds size ( ) ) { channels to merge this step clear ( ) ; for ( int i = 0 ; i < channels to merge per step & & channel num < channel i ds size ( ) ; i + + , channel num + + ) { channels to merge this step add ( channel i ds get ( channel num ) ) ; } merged channel i ds add ( merge channels ( channels to merge this step , read buffers , write buffers ) ) ; } return merged channel i ds ; }


public void set typeface ( typeface tf ) { m typeface = tf ; }


return the row position relative to the start of the file

public long get file position ( ) { return file position ; }


gets the { @ link extension point } priority

public static int get priority ( class < ? > c ) { extension point properties properties = c get annotation ( extension point properties class ) ; return properties ! = null ? properties priority ( ) : extension point properties default priority ; }


look up a method id return type index from a method index cheaper than : { @ code proto ids ( ) get ( method ids ( ) get ( method dex index ) get proto index ( ) ) get return type index ( ) ; }

public int return type index from method index ( int method index ) { check bounds ( method index , table of contents method ids size ) ; int position = table of contents method ids off + ( size of member id item * method index ) ; position + = size of ushort ; / / declaring class index int proto index = data get short ( position ) & 0x f f f f ; check bounds ( proto index , table of contents proto ids size ) ; position = table of contents proto ids off + ( size of proto id item * proto index ) ; position + = size of uint ; / / shorty index return data get int ( position ) ; / / return type index }


return the magnitude of a draggable child view ' s horizontal range of motion in pixels this method should return 0 for views that cannot move horizontally

public int get view horizontal drag range ( view child ) { return 0 ; }


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


optional , max retry times for jdbc connector

public builder set max retry times ( int max retry times ) { this max retry times = max retry times ; return this ; }


returns this register value in terms of the base register

public register value get base register value ( ) { return new register value ( register get base register ( ) , bytes ) ; }


finish the active span when it is finished , it will be archived by the given { @ link trace segment } , which owners it

public boolean finish ( trace segment owner ) { this end time = system current time millis ( ) ; owner archive ( this ) ; return true ; }


whether this is a private clone of a public token

public boolean is private clone of ( text the public service ) { return false ; }


is called by the { @ link org apache flink streaming api graph stream graph # add operator ( integer , string , stream operator , type information , type information , string ) } method when the { @ link org apache flink streaming api graph stream graph } is generated the method is called with the output { @ link type information } which is also used for the { @ link org apache flink streaming runtime tasks stream task } output serializer

void set output type ( type information < out > out type info , execution config execution config ) ;


saves ( see { @ link # save ( object ) } ) the given entities in the database using a transaction

public void save in tx ( t entities ) { save in tx ( arrays as list ( entities ) ) ; }


public string get workflow adjacencies ( ) { if ( datum get workflow adjacencies ( ) ! = null ) { return datum get workflow adjacencies ( ) to string ( ) ; } return null ; }


names of resources that have been deleted and to be removed from the mcp sink node removed resources for missing resources can be ignored when ` incremental ` is true , this contains an array of resource names to remove for the specified collection this modifies the existing resource collection at the sink when ` incremental ` is false , this field should be ignored < code > repeated string removed resources = 4 ; < code >

public builder add removed resources bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } check byte string is utf 8 ( value ) ; ensure removed resources is mutable ( ) ; removed resources add ( value ) ; on changed ( ) ; return this ; }


returns the multi - architecture dylib binary that apple binary created

public artifact get apple dylib binary ( ) { return dylib binary ; }


puts a keyvalue pair into the array , optimizing for the case where the key is greater than all existing keys in the array

public void append ( int key , int value ) { if ( m size ! = 0 & & key < = m keys [ m size - 1 ] ) { put ( key , value ) ; return ; } m keys = append element into int array ( m keys , m size , key ) ; m values = append element into int array ( m values , m size , value ) ; m size + + ; }


allowed ip address intelligence response

public static i p address intelligence response allowed ( ) { return builder ( ) status ( i p address intelligence status allowed ) score ( i p address intelligence status allowed get score ( ) ) build ( ) ; }


public void add contents ( dex file file ) { / / nothing to do here }


public void set mock index metas return value ( object [ ] [ ] mock index metas return value ) { this mock index metas return value = mock index metas return value = = null ? new object [ ] [ ] { } : mock index metas return value ; }


this provides the source location of the configuration file , the content of which is dumped to dest file post property substitutions , in the format as specified in type typically the src file would point to a source controlled network accessible file maintained by tools like puppet , chef , or hdfs etc currently , only hdfs is supported

public config file src file ( string src file ) { this src file = src file ; return this ; }


public byte get byte ( int index ) { validate index ( index ) ; check initialized ( index ) ; long selected = word & ( 0xff l < < ( word size * index ) ) ; long adjusted = selected > > ( word size * index ) ; return ( byte ) adjusted ; }


centers the axis labels instead of drawing them at their original position this is useful especially for grouped bar chart

public void set center axis labels ( boolean enabled ) { m center axis labels = enabled ; }


returns an instance which specifies that the ordering of the elements is guaranteed to be determined by { @ code comparator }

public static < s > element order < s > sorted ( comparator < s > comparator ) { return new element order < s > ( type sorted , check not null ( comparator ) ) ; }


public boolean is empty ( ) { return size = = 0 ; }


returns a reader wrapping the given reader that only reads half of the maximum number of characters that it could read in read ( char [ ] , int , int )

private static reader new non buffer filling reader ( reader reader ) { return new filter reader ( reader ) { @ override public int read ( char [ ] cbuf , int off , int len ) throws i o exception { / / if a buffer isn ' t being cleared correctly , this method will eventually start being called / / with a len of 0 forever if ( len < = 0 ) { fail ( " read called with a len of " + len ) ; } / / read fewer than the max number of chars to read / / shouldn ' t be a problem unless the buffer is shrinking each call return in read ( cbuf , off , math max ( len - 1024 , 0 ) ) ; } } ; }


adds an inserted range to a new action does not merge ranges nor single actions

void add inserted ( binary content range a range ) { current action add ( a range ) ; end action ( ) ; }


count and queue all destination references flowing out of this block all calls from this block , and all external flow type block references from this block are counted

private static int get destinations ( code block block , linked list < code block reference impl > block ref queue , boolean follow indirect flows , task monitor monitor ) throws cancelled exception { if ( block = = null ) return 0 ; code block model m = block get model ( ) get basic block model ( ) ; if ( ! ( m instanceof simple block model ) ) throw new illegal argument exception ( ) ; simple block model model = ( simple block model ) m ; boolean include externals = model externals included ( ) ; address start = block get min address ( ) ; address end = block get max address ( ) ; if ( start = = null | | start is external address ( ) ) return 0 ; int count = 0 ; listing listing = model get listing ( ) ; reference iterator ref iter = model get program ( ) get reference manager ( ) get reference iterator ( start ) ; instruction instr = null ; while ( ref iter has next ( ) ) { if ( monitor ! = null & & monitor is cancelled ( ) ) throw new cancelled exception ( ) ; reference ref = ref iter next ( ) ; address from addr = ref get from address ( ) ; if ( from addr compare to ( end ) > 0 ) break ; / / examine all flow - type references ref type ref type = ref get reference type ( ) ; if ( ! ( ref type is flow ( ) ) ) continue ; / / handle possible indirection / / indirect flow should be to a data pointer which references code if ( ref type = = ref type indirection ) { instruction dest instr = listing get instruction containing ( ref get to address ( ) ) ; int cnt = 0 ; if ( dest instr = = null & & follow indirect flows ) { if ( instr = = null | | ! instr get min address ( ) equals ( from addr ) ) { instr = listing get instruction at ( from addr ) ; } cnt = follow indirection ( block ref queue , include externals , block , ref , instr get flow type ( ) is call ( ) ? ref type computed call : ref type computed jump , monitor ) ; } if ( cnt = = 0 ) { / / improper indirection - add original reference queue dest reference ( block ref queue , block , from addr , ref get to address ( ) , ref type indirection ) ; cnt = 1 ; } count + = cnt ; } / / handle other flow type reference else { / / add flow type references queue dest reference ( block ref queue , block , from addr , ref get to address ( ) , ( flow type ) ref type ) ; + + count ; } } / / check for implied indirection if no destinations were found if ( follow indirect flows & & count = = 0 & & block get flow type ( ) is computed ( ) ) { instr = listing get instruction containing ( block get max address ( ) ) ; if ( instr ! = null ) { / / search backwards until a non - delay slot instruction is found while ( instr is in delay slot ( ) ) { address fall from = instr get fall from ( ) ; if ( fall from = = null ) { msg warn ( simple dest reference iterator class , " warning : invalid delay slot instruction found at " + instr get min address ( ) ) ; break ; } instr = listing get instruction containing ( fall from ) ; } for ( reference ref : instr get references from ( ) ) { count + = follow indirection ( block ref queue , include externals , block , ref , instr get flow type ( ) is call ( ) ? ref type computed call : ref type computed jump , monitor ) ; } } } / / check for single fall - through destination instr = listing get instruction containing ( end ) ; if ( instr ! = null ) { instr = instr get next ( ) ; if ( instr ! = null ) { address addr = instr get fall from ( ) ; if ( addr ! = null & & addr compare to ( end ) < = 0 ) { queue dest reference ( block ref queue , block , addr , instr get min address ( ) , ref type fall through ) ; + + count ; } } } return count ; }


the number of offsets in the lookup package private for testing


groups all bar data set objects this data object holds together by modifying the x - value of their entries previously set x - values of entries will be overwritten leaves space between bars and groups as specified by the parameters do not forget to call notify data set changed ( ) on your bar chart object after calling this method

public void group bars ( float from x , float group space , float bar space ) { int set count = m data sets size ( ) ; if ( set count < = 1 ) { throw new runtime exception ( " bar data needs to hold at least 2 bar data sets to allow grouping " ) ; } i bar data set max = get max entry count set ( ) ; int max entry count = max get entry count ( ) ; float group space width half = group space / 2f ; float bar space half = bar space / 2f ; float bar width half = m bar width / 2f ; float interval = get group width ( group space , bar space ) ; for ( int i = 0 ; i < max entry count ; i + + ) { float start = from x ; from x + = group space width half ; for ( i bar data set set : m data sets ) { from x + = bar space half ; from x + = bar width half ; if ( i < set get entry count ( ) ) { bar entry entry = set get entry for index ( i ) ; if ( entry ! = null ) { entry set x ( from x ) ; } } from x + = bar width half ; from x + = bar space half ; } from x + = group space width half ; float end = from x ; float inner interval = end - start ; float diff = interval - inner interval ; / / correct rounding errors if ( diff > 0 | | diff < 0 ) { from x + = diff ; } } notify data changed ( ) ; }


public void set client info ( string name , string value ) throws s q l client info exception { }


returns the cache entry listener registrations

public set < registration < k , v > > registrations ( ) { return collections unmodifiable set ( dispatch queues key set ( ) ) ; }


returns the precision levels at which geohash cells neighbours are considered

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


tests that an invalid parameter type entry will generate the proper error message shown in the status box , and not present the user with a stack trace

public void test invalid parameter data type edit ( ) throws exception { / / / / first create the tool and a function we ' ll modify one of the function / / params to have a bogus entry we can test against / / create function at entry ( ) ; function editor dialog dialog = edit function ( ) ; g table param table = find component ( dialog get component ( ) , g table class ) ; table cell editor cell editor = edit cell ( param table , 0 , 1 ) ; set editor text ( cell editor , " a / b / c " ) ; / / if the status field indicates that we have an invalid data type , then we ' re good if / / an exception is thrown on the stop cell editing ( ) call , then this will be skipped and / / the test will fail assert true ( dialog get status text ( ) contains ( " invalid data type " ) ) ; }


find the namenode for a particular file and return the d f s client

private d f s client get file d f s client ( final string path ) { for ( string ns id : cluster get nameservices ( ) ) { log info ( " checking { } for { } " , ns id , path ) ; namenode context nn = cluster get namenode ( ns id , null ) ; try { d f s client nn client protocol = nn get client ( ) ; if ( nn client protocol get file info ( path ) ! = null ) { return nn client protocol ; } } catch ( exception ignore ) { / / ignore } } return null ; }


override this to provide your own offset on every frame

public integer get offset ( lottie frame info < integer > frame info ) { if ( value = = null ) { throw new illegal argument exception ( " you must provide a static value in the constructor " + " , call set value , or override get value " ) ; } return value ; }


advance this instance to the given document id

public abstract boolean advance exact ( int doc ) throws i o exception ;


if container assigned then return the node ' s address , otherwise null

public string get node http address ( ) { read lock lock ( ) ; try { return container = = null ? null : container get node http address ( ) ; } finally { read lock unlock ( ) ; } }


returns the index of the last appearance of the value { @ code target } in { @ code array } note that this always returns { @ code - 1 } when { @ code target } is { @ code na n }

public static int last index of ( double [ ] array , double target ) { return last index of ( array , target , 0 , array length ) ; }


removes any unused filesystems in the cache

public synchronized void close all unused ( ) { list < f s cache info > recs to purge = get unused f ses ( ) ; if ( ! recs to purge is empty ( ) ) { msg info ( this , " removing " + recs to purge size ( ) + " unused filesystems from cache " ) ; } for ( f s cache info fsci : recs to purge ) { release ( fsci ) ; } }


returns the address where the relocation should be performed

public long get address ( ) { return r vaddr ; }


the response resources wrapped in the common mcp resource message these are typed resources that match the type url in the request resources message when ` incremental ` is true , this contains an array of resources to addupdate for the specified collection this modifies the existing collection at the sink when ` incremental ` is false , this contains the full set of resources for the specified collection this replaces any previously delivered resources < code > repeated istio mcp v 1alpha 1 resource resources = 3 ; < code >

public builder add resources ( int index , com alibaba nacos istio model mcp resource builder builder for value ) { if ( resources builder = = null ) { ensure resources is mutable ( ) ; resources add ( index , builder for value build ( ) ) ; on changed ( ) ; } else { resources builder add message ( index , builder for value build ( ) ) ; } return this ; }


construct { @ link phased backoff wait strategy } with fallback to { @ link sleeping wait strategy }

public static phased backoff wait strategy with sleep ( long spin timeout , long yield timeout , time unit units ) { return new phased backoff wait strategy ( spin timeout , yield timeout , units , new sleeping wait strategy ( 0 ) ) ; }


creates an { @ link ad display container } to hold the player for video ads , a container for non - linear ads , and slots for companion ads

ad display container create ad display container ( view group container , video ad player player ) ;


encodes the given string content as an aztec symbol ( without eci code )

public static aztec code encode ( string data , int min e c c percent , int user specified layers ) { return encode ( data get bytes ( standard charsets iso 8859 1 ) , min e c c percent , user specified layers , null ) ; }


compare the remaining shorts of this buffer to another short buffer ' s remaining shorts

public int compare to ( short buffer other buffer ) { int compare remaining = ( remaining ( ) < other buffer remaining ( ) ) ? remaining ( ) : other buffer remaining ( ) ; int this pos = position ; int other pos = other buffer position ; short this byte , other byte ; while ( compare remaining > 0 ) { this byte = get ( this pos ) ; other byte = other buffer get ( other pos ) ; if ( this byte ! = other byte ) { return this byte < other byte ? - 1 : 1 ; } this pos + + ; other pos + + ; compare remaining - - ; } return remaining ( ) - other buffer remaining ( ) ; }


protected sequenced skyframe executor get skyframe executor ( ) { return preconditions check not null ( skyframe executor ) ; }


{ @ link r m app attempt state # finishing }

private void test app attempt finishing state ( container container , final application status final status , string tracking url , string diagnostics ) { assert equals ( r m app attempt state finishing , application attempt get app attempt state ( ) ) ; assert equals ( diagnostics , application attempt get diagnostics ( ) ) ; verify url ( tracking url , application attempt get original tracking url ( ) ) ; assert equals ( get proxy url ( application attempt ) , application attempt get tracking url ( ) ) ; assert equals ( container , application attempt get master container ( ) ) ; assert equals ( final status , application attempt get final application status ( ) ) ; verify token count ( application attempt get app attempt id ( ) , 0 ) ; verify attempt final state saved ( ) ; }


returns the smallest power of two greater than or equal to { @ code x } this is equivalent to { @ code checked pow ( 2 , log 2 ( x , ceiling ) ) }

public static int ceiling power of two ( int x ) { check positive ( " x " , x ) ; if ( x > max signed power of two ) { throw new arithmetic exception ( " ceiling power of two ( " + x + " ) not representable as an int " ) ; } return 1 < < - integer number of leading zeros ( x - 1 ) ; }


whether the given return value represents asynchronous computation

boolean is async return value ( @ nullable object return value , method parameter return type ) ;


doubles size of table and repacks entries , also adding the given node to new table

private void rehash ( hash entry < k , v > node ) { / * * reclassify nodes in each list to new table because we * are using power - of - two expansion , the elements from * each bin must either stay at same index , or move with a * power of two offset we eliminate unnecessary node * creation by catching cases where old nodes can be * reused because their next fields won ' t change * statistically , at the default threshold , only about * one - sixth of them need cloning when a table * doubles the nodes they replace will be garbage * collectable as soon as they are no longer referenced by * any reader thread that may be in the midst of * concurrently traversing table entry accesses use plain * array indexing because they are followed by volatile * table write * / hash entry < k , v > [ ] old table = table ; int old capacity = old table length ; int new capacity = old capacity < < 1 ; threshold = ( int ) ( new capacity * load factor ) ; hash entry < k , v > [ ] new table = new hash entry [ new capacity ] ; int size mask = new capacity - 1 ; for ( int i = 0 ; i < old capacity ; i + + ) { hash entry < k , v > e = old table [ i ] ; if ( e ! = null ) { hash entry < k , v > next = e next ; int idx = e hash & size mask ; if ( next = = null ) { new table [ idx ] = e ; } else { / / reuse consecutive sequence at same slot hash entry < k , v > last run = e ; int last idx = idx ; for ( hash entry < k , v > last = next ; last ! = null ; last = last next ) { int k = last hash & size mask ; if ( k ! = last idx ) { last idx = k ; last run = last ; } } new table [ last idx ] = last run ; / / clone remaining nodes for ( hash entry < k , v > p = e ; p ! = last run ; p = p next ) { v v = p value ; int h = p hash ; int k = h & size mask ; hash entry < k , v > n = new table [ k ] ; new table [ k ] = new hash entry < k , v > ( h , p key , v , n ) ; } } } } int node index = node hash & size mask ; / / add the new node node set next ( new table [ node index ] ) ; new table [ node index ] = node ; table = new table ; }


called when the { @ link command context } is successfully closed at this point , the { @ link transaction context } ( if applicable ) has been successfully committed and no rollback has happened all { @ link session } instances have been closed note that throwing an exception here does not affect the transaction the { @ link command context } will log the exception though

void closed ( command context command context ) ;


returns whether the elements of the two given arrays are the same

public static boolean equal ( int [ ] array 1 , int [ ] array 2 , int size ) { for ( int index = 0 ; index < size ; index + + ) { if ( array 1 [ index ] ! = array 2 [ index ] ) { return false ; } } return true ; }


returns the { @ code char } value whose byte representation is the given 2 bytes , in big - endian order ; equivalent to { @ code chars from byte array ( new byte [ ] { b 1 , b 2 } ) }

public static char from bytes ( byte b 1 , byte b 2 ) { return ( char ) ( ( b 1 < < 8 ) | ( b 2 & 0x f f ) ) ; }


subclasses should implement this method to test { @ link decoder # decode to mono } , possibly using { @ link # test decode to mono all }

public abstract void decode to mono ( ) throws exception ; / / flux


decodes the bounds of an image from its uri and returns a pair of the dimensions

public static @ nullable pair < integer , integer > decode dimensions ( uri uri ) { preconditions check not null ( uri ) ; bitmap factory options options = new bitmap factory options ( ) ; options in just decode bounds = true ; bitmap factory decode file ( uri get path ( ) , options ) ; return ( options out width = = - 1 | | options out height = = - 1 ) ? null : new pair < > ( options out width , options out height ) ; }


return the last page to which create a link around the current page

public int get last linked page ( ) { return math min ( get first linked page ( ) + get max linked pages ( ) - 1 , get page count ( ) - 1 ) ; }


creates a new instance of drawee holder that detaches attaches controller whenever context notifies it about activity ' s on stop and on start callbacks

public static < dh extends drawee hierarchy > drawee holder < dh > create ( @ nullable dh hierarchy , context context ) { drawee holder < dh > holder = new drawee holder < dh > ( hierarchy ) ; holder register with context ( context ) ; return holder ; }


returns all of the request contexts headers

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


append the given parent environment ' s active profiles , default profiles and property sources to this ( child ) environment ' s respective collections of each for any identically - named { @ code property source } instance existing in both parent and child , the child instance is to be preserved and the parent instance discarded this has the effect of allowing overriding of property sources by the child as well as avoiding redundant searches through common property source types , e g system environment and system properties active and default profile names are also filtered for duplicates , to avoid confusion and redundant storage the parent environment remains unmodified in any case note that any changes to the parent environment occurring after the call to { @ code merge } will not be reflected in the child therefore , care should be taken to configure parent property sources and profile information prior to calling { @ code merge }

void merge ( configurable environment parent ) ;


clip path with hardware acceleration only working properly on api level 18 and above

private boolean clip path supported ( ) { return utils get s d k int ( ) > = 18 ; }


browser single version error metrics related source

browser app single version traffic to browser app single version traffic ( ) { browser app single version traffic traffic = new browser app single version traffic ( ) ; to browser app traffic source ( traffic ) ; traffic set name ( service version ) ; traffic set service name ( service ) ; return traffic ; }


notifies the checker that the server went idle at the given timestamp

void reset ( long last idle time nanos ) { this last idle time nanos = last idle time nanos ; }


what is the error header , normally linecharacter position information ?

public string get error header ( recognition exception e ) { int line = e get offending token ( ) get line ( ) ; int char position in line = e get offending token ( ) get char position in line ( ) ; return " line " + line + " : " + char position in line ; }


update the size and offset of the allocation unit since this can affect the size of this component , its bounds will be updated the component repainted

void update allocation ( int byte size , int byte offset ) { this allocation byte offset = byte offset ; this allocation byte size = byte size ; set bounds ( 0 , 0 , get preferred width ( ) , get preferred height ( ) ) ; invalidate ( ) ; if ( bit field allocation ! = null ) { if ( edit mode = = edit mode edit & & edit component get offset ( ) > composite get length ( ) ) { edit mode = edit mode none ; edit ordinal = - 1 ; edit component = null ; } bit field allocation refresh ( true ) ; repaint ( ) ; } }


public static string get date ( ) { return yarn version info get date ( ) ; }


builds a list of position entries , sorted by ascending address

private array list < position list entry > build sorted positions ( ) { int sz = ( positions = = null ) ? 0 : positions size ( ) ; array list < position list entry > result = new array list ( sz ) ; for ( int i = 0 ; i < sz ; i + + ) { result add ( positions get ( i ) ) ; } / / sort ascending by address collections sort ( result , new comparator < position list entry > ( ) { public int compare ( position list entry a , position list entry b ) { return a get address ( ) - b get address ( ) ; } public boolean equals ( object obj ) { return obj = = this ; } } ) ; return result ; }


ensures s 3 guard and retries allow an eventually consistent read

public void test read after eventually consistent write 2 ( ) throws throwable { require s 3 guard ( ) ; amazon s 3 s 3 client spy = spy on filesystem ( ) ; final path testpath 2 = write eventually consistent file version ( " eventually 2 dat " , s 3 client spy , test max retries + 1 , 0 , 0 ) ; try ( f s data input stream instream 2 = fs open ( testpath 2 ) ) { if ( expected exception interactions contains ( interaction type eventually consistent read ) ) { / / keeps retrying and eventually gives up with remote file changed exception expect read failure ( instream 2 ) ; } else { instream 2 read ( ) ; } } }


return whether this helper is in multipart mode , i e whether it holds a multipart message

public final boolean is multipart ( ) { return ( this root mime multipart ! = null ) ; }


public void set autodetect mode ( int autodetect mode ) { if ( ! constants get values ( constant prefix autodetect ) contains ( autodetect mode ) ) { throw new illegal argument exception ( " only values of autodetect constants allowed " ) ; } this autodetect mode = autodetect mode ; }


creates a user with the specified name and options

public v user info create user ( string name , int flags ) { try { return m service create user ( name , flags ) ; } catch ( remote exception re ) { log w ( tag , " could not create a user " , re ) ; return null ; } }


returns a { @ link byte source } view of this char source that encodes chars read from this source as bytes using the given { @ link charset } if { @ link byte source # as char source } is called on the returned source with the same charset , the default implementation of this method will ensure that the original { @ code char source } is returned , rather than round - trip encoding subclasses that override this method should behave the same way

public byte source as byte source ( charset charset ) { return new as byte source ( charset ) ; }


whether the request has been handled fully within the handler

public boolean is request handled ( ) { return this request handled ; }


public void set show vr button ( boolean show vr button ) { control view layout manager set show button ( vr button , show vr button ) ; }


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

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


publish a { @ link prepare test instance event } to the { @ code application context } for the supplied { @ link test context }

public void prepare test instance ( test context test context ) { test context publish event ( prepare test instance event : : new ) ; }


is encryption enabled for registered service ?

protected boolean is encryption enabled for registered service ( final registered service registered service ) { val prop = registered service property registered service properties access token as jwt encryption enabled ; if ( prop is assigned to ( registered service ) ) { return prop get property boolean value ( registered service ) ; } return boolean utils to boolean ( prop get default value ( ) ) ; }


resets the recovery and performs a recovery restart on the currently recovering index shard

public recovery target reset recovery ( final long recovery id , final time value activity timeout ) { recovery target old recovery target = null ; final recovery target new recovery target ; try { synchronized ( on going recoveries ) { / / swap recovery targets in a synchronized block to ensure that the newly added recovery target is picked up by / / cancel recoveries for shard whenever the old recovery target is picked up old recovery target = on going recoveries remove ( recovery id ) ; if ( old recovery target = = null ) { return null ; } new recovery target = old recovery target retry copy ( ) ; start recovery internal ( new recovery target , activity timeout ) ; } / / closes the current recovery target boolean successful reset = old recovery target reset recovery ( new recovery target cancellable threads ( ) ) ; if ( successful reset ) { logger trace ( " { } restarted recovery from { } , id [ { } ] , previous id [ { } ] " , new recovery target shard id ( ) , new recovery target source node ( ) , new recovery target recovery id ( ) , old recovery target recovery id ( ) ) ; return new recovery target ; } else { logger trace ( " { } recovery could not be reset as it is already cancelled , recovery from { } , id [ { } ] , previous id [ { } ] " , new recovery target shard id ( ) , new recovery target source node ( ) , new recovery target recovery id ( ) , old recovery target recovery id ( ) ) ; cancel recovery ( new recovery target recovery id ( ) , " recovery cancelled during reset " ) ; return null ; } } catch ( exception e ) { / / fail shard to be safe old recovery target notify listener ( new recovery failed exception ( old recovery target state ( ) , " failed to retry recovery " , e ) , true ) ; return null ; } }


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

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


set owner of a path ( i e a file or a directory ) the parameters owner and group cannot both be null

public void set owner ( final path path , final string owner , final string group ) throws i o exception { log debug ( " azure blob file system set owner path : { } " , path ) ; if ( ! get is namespace enabled ( ) ) { super set owner ( path , owner , group ) ; return ; } if ( ( owner = = null | | owner is empty ( ) ) & & ( group = = null | | group is empty ( ) ) ) { throw new illegal argument exception ( " a valid owner or group must be specified " ) ; } path qualified path = make qualified ( path ) ; try { abfs store set owner ( qualified path , owner , group ) ; } catch ( azure blob file system exception ex ) { check exception ( path , ex ) ; } }


trims the number of options per suggest text term to the requested size for internal usage

public void trim ( ) { for ( entry < ? > entry : entries ) { entry trim ( size ) ; } }


returns the ciphers preferred to use during tests they may be chosen because they are widely available or because they are fast there is no requirement that they provide confidentiality or integrity

public static list < string > preferred test ciphers ( ) { string [ ] ciphers ; try { ciphers = s s l context get default ( ) get default s s l parameters ( ) get cipher suites ( ) ; } catch ( no such algorithm exception ex ) { throw new runtime exception ( ex ) ; } list < string > ciphers minus gcm = new array list < > ( ) ; for ( string cipher : ciphers ) { / / the gcm implementation in java is very slow ( ~ 1 mb / s ) if ( cipher contains ( " gcm " ) ) { continue ; } ciphers minus gcm add ( cipher ) ; } return collections unmodifiable list ( ciphers minus gcm ) ; }


see https : github com open a p i toolsopenapi - generatorissues 6 7 1 5

public void test rest template with use abstraction for files ( ) throws i o exception { map < string , object > properties = new hash map < > ( ) ; properties put ( java client codegen java8 mode , true ) ; properties put ( codegen constants api package , " xyz abcdef api " ) ; properties put ( java client codegen use abstraction for files , true ) ; file output = files create temp directory ( " test " ) to file ( ) ; output delete on exit ( ) ; final codegen configurator configurator = new codegen configurator ( ) set generator name ( " java " ) set library ( java client codegen resttemplate ) set additional properties ( properties ) set input spec ( " src / test / resources / 3 0 / form - multipart - binary - array yaml " ) set output dir ( output get absolute path ( ) replace ( " \ \ " , " / " ) ) ; default generator generator = new default generator ( ) ; list < file > files = generator opts ( configurator to client opt input ( ) ) generate ( ) ; files for each ( file : : delete on exit ) ; path default api = paths get ( output + " / src / main / java / xyz / abcdef / api / multipart api java " ) ; test utils assert file contains ( default api , / / multiple files " multipart array ( java util collection < org springframework core io resource > files ) " , " multipart array with http info ( java util collection < org springframework core io resource > files ) " , " form params add all ( \ " files \ " , files stream ( ) collect ( collectors to list ( ) ) ) ; " , / / mixed " multipart mixed ( org springframework core io resource file , multipart mixed marker marker ) " , " multipart mixed with http info ( org springframework core io resource file , multipart mixed marker marker ) " , " form params add ( \ " file \ " , file ) ; " , / / single file " multipart single ( org springframework core io resource file ) " , " multipart single with http info ( org springframework core io resource file ) " , " form params add ( \ " file \ " , file ) ; " ) ; }


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


given the size of the array , estimate the number of bytes it will use

public final long ram bytes estimated ( final long size ) { / / rough approximate , we only take into account the size of the values , not the overhead of the array objects return ( ( long ) page index ( size - 1 ) + 1 ) * page size ( ) * num bytes per element ( ) ; }


set the number of units in a group this format does not support groups

public void set group size ( int group size ) { throw new unsupported operation exception ( " groups are not supported " ) ; }


read in the file using positioned read ( offset ) calls

public void test 040 positioned read huge file ( ) throws throwable { assume huge file exists ( ) ; final string encryption = get conf ( ) get trimmed ( server side encryption algorithm ) ; boolean encrypted = encryption ! = null ; if ( encrypted ) { log info ( " file is encrypted with algorithm { } " , encryption ) ; } string filetype = encrypted ? " encrypted file " : " file " ; describe ( " positioned reads of % s % s " , filetype , hugefile ) ; s 3 a file system fs = get file system ( ) ; file status status = fs get file status ( hugefile ) ; long size = status get len ( ) ; int ops = 0 ; final int buffer size = 8192 ; byte [ ] buffer = new byte [ buffer size ] ; long eof = size - 1 ; contract test utils nano timer timer = new contract test utils nano timer ( ) ; contract test utils nano timer read at byte 0 , read at byte 0 again , read at e o f ; try ( f s data input stream in = fs open ( hugefile , upload block size ) ) { read at byte 0 = new contract test utils nano timer ( ) ; in read fully ( 0 , buffer ) ; read at byte 0 end ( " time to read data at start of file " ) ; ops + + ; read at e o f = new contract test utils nano timer ( ) ; in read fully ( eof - buffer size , buffer ) ; read at e o f end ( " time to read data at end of file " ) ; ops + + ; read at byte 0 again = new contract test utils nano timer ( ) ; in read fully ( 0 , buffer ) ; read at byte 0 again end ( " time to read data at start of file again " ) ; ops + + ; log info ( " final stream state : { } " , in ) ; } long mb = math max ( size / 1mb , 1 ) ; log f s state ( ) ; timer end ( " time to perform positioned reads of % s of % d mb " , filetype , mb ) ; log info ( " time per positioned read = { } n s " , to human ( timer nanos per operation ( ops ) ) ) ; }


provides an instance of { @ code t } must never return { @ code null }


returns the number of items in this symbol table ' s constant pool array ( plus 1 )

int get constant pool count ( ) { return constant pool count ; }


an lru sequencing of the values in the cache this sequence is not protected from mutations to the cache ( except for { @ link iterator # remove ( ) } the result of iteration under any other mutation is undefined

public iterable < v > values ( ) { return ( ) - > new iterator < v > ( ) { private cache iterator iterator = new cache iterator ( head ) ; @ override public boolean has next ( ) { return iterator has next ( ) ; } @ override public v next ( ) { return iterator next ( ) value ; } @ override public void remove ( ) { iterator remove ( ) ; } } ; }


returns the desired allocation ids for the slot

public collection < allocation i d > get preferred allocations ( ) { return preferred allocations ; }


returns true iff the value of the specified attribute is explicitly set in the build file ( as opposed to its default value ) this also returns true if the value from the build file is the same as the default value

boolean is attribute value explicitly specified ( attribute attribute ) ;


configure the complete list of supported return value types thus overriding handlers that would otherwise be configured by default

public void set return value handlers ( @ nullable list < handler method return value handler > return value handlers ) { if ( return value handlers = = null ) { this return value handlers = null ; } else { this return value handlers = new handler method return value handler composite ( ) ; this return value handlers add handlers ( return value handlers ) ; } }


sets the ' short ' value at the specified address

public final void set short ( address address , short value ) throws memory access exception { current program get memory ( ) set short ( address , value ) ; }


add an action listener to be invoked when a response has received

void add listener ( action listener < t > listener ) ;


convert person attributes to principal pair

protected pair < string , map < string , list < object > > > convert person attributes to principal ( final string extracted principal id , final map < string , list < object > > attributes ) { val converted attributes = new linked hash map < string , list < object > > ( ) ; attributes for each ( ( key , attr value ) - > { val values = ( ( list < object > ) collection utils to collection ( attr value , array list class ) ) stream ( ) filter ( objects : : non null ) collect ( to list ( ) ) ; logger debug ( " found attribute [ { } ] with value ( s ) [ { } ] " , key , values ) ; converted attributes put ( key , values ) ; } ) ; var principal id = extracted principal id ; if ( string utils is not blank ( context get principal attribute names ( ) ) ) { val attr names = org springframework util string utils comma delimited list to set ( context get principal attribute names ( ) ) ; val result = attr names stream ( ) map ( string : : trim ) filter ( attributes : : contains key ) map ( attributes : : get ) find first ( ) ; if ( result is present ( ) ) { val values = result get ( ) ; if ( ! values is empty ( ) ) { principal id = collection utils first element ( values ) map ( object : : to string ) or else throw ( ) ; logger debug ( " found principal id attribute value [ { } ] and removed it from the collection of attributes " , principal id ) ; } } else { logger warn ( " principal resolution is set to resolve users via attribute ( s ) [ { } ] , and yet " + " the collection of attributes retrieved [ { } ] do not contain any of those attributes this is " + " likely due to misconfiguration and cas will use [ { } ] as the final principal id " , context get principal attribute names ( ) , attributes key set ( ) , principal id ) ; } } return pair of ( principal id , converted attributes ) ; }


select existing partitions from the table < code > { @ link model constants # ts kv partitions cf } < code > for the given entity

private tb result set future fetch partitions ( tenant id tenant id , entity id entity id , string key , long min partition , long max partition ) { select select = query builder select from ( model constants ts kv partitions cf ) column ( model constants partition column ) where column ( model constants entity type column ) is equal to ( literal ( entity id get entity type ( ) name ( ) ) ) where column ( model constants entity id column ) is equal to ( literal ( entity id get id ( ) ) ) where column ( model constants key column ) is equal to ( literal ( key ) ) where column ( model constants partition column ) is greater than or equal to ( literal ( min partition ) ) where column ( model constants partition column ) is less than or equal to ( literal ( max partition ) ) ; return execute async read ( tenant id , select build ( ) ) ; }


public final boolean is public ( ) { return modifier is public ( get modifiers ( ) ) ; }


set an eh cache { @ link net sf ehcache constructs blocking cache entry factory } to use for a self - populating cache if such a factory is specified , the cache will be decorated with eh cache ' s { @ link net sf ehcache constructs blocking self populating cache } the specified factory can be of type { @ link net sf ehcache constructs blocking updating cache entry factory } , which will lead to the use of an { @ link net sf ehcache constructs blocking updating self populating cache } note : any such self - populating cache is automatically a blocking cache

public void set cache entry factory ( cache entry factory cache entry factory ) { this cache entry factory = cache entry factory ; }


see { @ link gif drawable # get loop count ( ) }

public int get loop count ( ) { return m loop count ; }


returns the linker input artifacts from a collection of { @ link linker input } objects

public static iterable < artifact > to library artifacts ( iterable < ? extends linker input > artifacts ) { return iterables transform ( artifacts , linker input : : get artifact ) ; }


check for property values with names that end on { @ code " [ ] " } this is used by some clients for array syntax without an explicit index value if such values are found , drop the brackets to adapt to the expected way of expressing the same for data binding purposes

protected void adapt empty array indices ( mutable property values mpvs ) { for ( property value pv : mpvs get property values ( ) ) { string name = pv get name ( ) ; if ( name ends with ( " [ ] " ) ) { string field = name substring ( 0 , name length ( ) - 2 ) ; if ( get property accessor ( ) is writable property ( field ) & & ! mpvs contains ( field ) ) { mpvs add ( field , pv get value ( ) ) ; } mpvs remove property value ( pv ) ; } } }


post fakeouterstring test serialization of outer string types

default response entity < string > fake outer string serialize ( @ api param ( value = " input string as post body " ) @ valid @ request body ( required = false ) string body ) { return new response entity < > ( http status not implemented ) ; }


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

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


set the { @ link remote invocation factory } to use for this accessor default is a { @ link default remote invocation factory } a custom invocation factory can add further context information to the invocation , for example user credentials

public void set remote invocation factory ( @ nullable remote invocation factory remote invocation factory ) { this remote invocation factory = ( remote invocation factory ! = null ? remote invocation factory : new default remote invocation factory ( ) ) ; }


public expiration policy to ticket expiration policy ( ) { val su = cas properties get authn ( ) get surrogate ( ) ; val surrogate policy = new hard timeout expiration policy ( su get tgt ( ) get time to kill in seconds ( ) ) ; val policy = new surrogate session expiration policy ( ) ; policy add policy ( surrogate session expiration policy policy name surrogate , surrogate policy ) ; policy add policy ( surrogate session expiration policy policy name default , ticket granting ticket expiration policy builder build ticket expiration policy ( ) ) ; return policy ; }


iterate over deferred hi16 relocations iterator may be used to remove entries as they are processed

iterator < mips deferred relocation > iterate hi 1 6 ( ) { return hi 1 6list iterator ( ) ; }


public static list < app info > get apps info ( ) { list < app info > list = new array list < > ( ) ; package manager pm = utils get app ( ) get package manager ( ) ; if ( pm = = null ) return list ; list < package info > installed packages = pm get installed packages ( 0 ) ; for ( package info pi : installed packages ) { app info ai = get bean ( pm , pi ) ; if ( ai = = null ) continue ; list add ( ai ) ; } return list ; }


returns a map from the requested toolchain type to the { @ link toolchain type info } provider

private immutable map < label , toolchain type info > load toolchain types ( environment environment , build configuration configuration , immutable set < label > requested toolchain type labels , boolean should sanity check configuration ) throws invalid toolchain type exception , interrupted exception , value missing exception { immutable set < configured target key > toolchain type keys = requested toolchain type labels stream ( ) map ( label - > configured target key builder ( ) set label ( label ) set configuration ( configuration ) build ( ) ) collect ( to immutable set ( ) ) ; immutable map < label , toolchain type info > resolved toolchain types = toolchain type lookup util resolve toolchain types ( environment , toolchain type keys , should sanity check configuration ) ; if ( environment values missing ( ) ) { throw new value missing exception ( ) ; } return resolved toolchain types ; }


test the property ' sc a e t h flow points '

public void sc a e t h flow points test ( ) { / / todo : test sc a e t h flow points }


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


public static double dot ( vector vec 1 , vector vec 2 ) { return vec 1 dot ( vec 2 ) ; }


returns true if we were able to lock the process ' s address space

public static boolean is memory locked ( ) { return natives is memory locked ( ) ; }


public configuration change listener get target listener ( ) { return this listener ; }


return the destination resolver for this adapter

protected destination resolver get destination resolver ( ) { return this destination resolver ; }


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


creates a changelog row from the given row kind short string and value objects

public static row changelog row ( string row kind , object values ) { row kind kind = parse row kind ( row kind ) ; return row of kind ( kind , values ) ; }


returns true if the file is a directory if so , its parent directory is guaranteed to exist

public boolean is directory ( ) { return this = = directory ; }


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

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


given a target address , returns a proxied address if a proxy should be used if no proxy should be used , then return value will be { @ code null } if the returned { @ code proxied socket address } contains any address that needs to be resolved locally , it should be resolved before it ' s returned , and this method throws if unable to resolve it

proxied socket address proxy for ( socket address target server address ) throws i o exception ;


updates pending message to a new timeline

private static boolean resolve pending message position ( pending message info pending message info , timeline new timeline , timeline previous timeline , @ player repeat mode int repeat mode , boolean shuffle mode enabled , timeline window window , timeline period period ) { if ( pending message info resolved period uid = = null ) { / / position is still unresolved try to find window in new timeline long request position us = pending message info message get position ms ( ) = = c time end of source ? c time unset : c ms to us ( pending message info message get position ms ( ) ) ; @ nullable pair < object , long > period position = resolve seek position ( new timeline , new seek position ( pending message info message get timeline ( ) , pending message info message get window index ( ) , request position us ) , / * try subsequent periods = * / false , repeat mode , shuffle mode enabled , window , period ) ; if ( period position = = null ) { return false ; } pending message info set resolved position ( / * period index = * / new timeline get index of period ( period position first ) , / * period time us = * / period position second , / * period uid = * / period position first ) ; if ( pending message info message get position ms ( ) = = c time end of source ) { resolve pending message end of stream position ( new timeline , pending message info , window , period ) ; } return true ; } / / position has been resolved for a previous timeline try to find the updated period index int index = new timeline get index of period ( pending message info resolved period uid ) ; if ( index = = c index unset ) { return false ; } if ( pending message info message get position ms ( ) = = c time end of source ) { / / re - resolve end of stream in case the duration changed resolve pending message end of stream position ( new timeline , pending message info , window , period ) ; return true ; } pending message info resolved period index = index ; previous timeline get period by uid ( pending message info resolved period uid , period ) ; if ( previous timeline get window ( period window index , window ) is placeholder ) { / / the position needs to be re - resolved because the window in the previous timeline wasn ' t / / fully prepared long window position us = pending message info resolved period time us + period get position in window us ( ) ; int window index = new timeline get period by uid ( pending message info resolved period uid , period ) window index ; pair < object , long > period position = new timeline get period position ( window , period , window index , window position us ) ; pending message info set resolved position ( / * period index = * / new timeline get index of period ( period position first ) , / * period time us = * / period position second , / * period uid = * / period position first ) ; } return true ; }


public long get ( t key ) throws no value exception { int index = indexer get ( key ) ; if ( index < 0 ) { throw no value exception no value exception ; } return values [ index ] ; }


public static boolean does resource exist ( final resource res ) { if ( res = = null ) { return false ; } try { i o utils read ( res get input stream ( ) , new byte [ 1 ] ) ; return res content length ( ) > 0 ; } catch ( final file not found exception e ) { logger trace ( e get message ( ) ) ; return false ; } catch ( final exception e ) { logger trace ( e get message ( ) , e ) ; return false ; } }


returns group settings for the given setting prefix

public map < string , settings > get groups ( string setting prefix , boolean ignore non grouped ) throws settings exception { if ( ! strings has length ( setting prefix ) ) { throw new illegal argument exception ( " illegal setting prefix " + setting prefix ) ; } if ( setting prefix char at ( setting prefix length ( ) - 1 ) ! = ' ' ) { setting prefix = setting prefix + " " ; } return get groups internal ( setting prefix , ignore non grouped ) ; }


updates a pet in the store with form data < b > 405 < b > - invalid input

public mono < void > update pet with form ( long pet id , string name , string status ) throws web client response exception { object post body = null ; / / verify the required parameter ' pet id ' is set if ( pet id = = null ) { throw new web client response exception ( " missing the required parameter ' pet id ' when calling update pet with form " , http status bad request value ( ) , http status bad request get reason phrase ( ) , null , null , null ) ; } / / create path and map variables final map < string , object > path params = new hash map < string , object > ( ) ; path params put ( " pet id " , pet id ) ; final multi value map < string , string > query params = new linked multi value map < string , string > ( ) ; final http headers header params = new http headers ( ) ; final multi value map < string , string > cookie params = new linked multi value map < string , string > ( ) ; final multi value map < string , object > form params = new linked multi value map < string , object > ( ) ; if ( name ! = null ) form params add ( " name " , name ) ; if ( status ! = null ) form params add ( " status " , status ) ; final string [ ] local var accepts = { } ; final list < media type > local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { " application / x - www - form - urlencoded " } ; final media type local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { " petstore auth " } ; parameterized type reference < void > local var return type = new parameterized type reference < void > ( ) { } ; return api client invoke a p i ( " / pet / { pet id } " , http method post , path params , query params , post body , header params , cookie params , form params , local var accept , local var content type , local var auth names , local var return type ) ; }


apply the typeface to all the given view ids , and enable subpixel rendering

public base adapter helper set typeface ( typeface typeface , int view ids ) { for ( int view id : view ids ) { text view view = retrieve view ( view id ) ; view set typeface ( typeface ) ; view set paint flags ( view get paint flags ( ) | paint subpixel text flag ) ; } return this ; }


provide a way to get the instance of lite pal attr

public static lite pal attr get instance ( ) { if ( lite pal attr = = null ) { synchronized ( lite pal attr class ) { if ( lite pal attr = = null ) { lite pal attr = new lite pal attr ( ) ; load lite pal x m l configuration ( ) ; } } } return lite pal attr ; }


public item type item type ( ) { return item type type method id item ; }


opens a new buffered { @ link output stream } for writing to this sink the returned stream is not required to be a { @ link buffered output stream } in order to allow implementations to simply delegate to { @ link # open stream ( ) } when the stream returned by that method does not benefit from additional buffering ( for example , a { @ code byte array output stream } ) this method returns a new , independent stream each time it is called the caller is responsible for ensuring that the returned stream is closed

public output stream open buffered stream ( ) throws i o exception { output stream out = open stream ( ) ; return ( out instanceof buffered output stream ) ? ( buffered output stream ) out : new buffered output stream ( out ) ; }


whether this update applied to the given source config requires analytics task restart

public boolean requires restart ( data frame analytics config source ) { return ( get model memory limit ( ) ! = null & & get model memory limit ( ) equals ( source get model memory limit ( ) ) = = false ) | | ( get max num threads ( ) ! = null & & get max num threads ( ) equals ( source get max num threads ( ) ) = = false ) ; }


public string get o s description ( ) throws i o exception , interrupted exception { if ( channel = = null ) { return " unknown ( agent is offline ) " ; } return channel call ( new detect o s ( ) ) ? " unix " : " windows " ; }


returns everything above the endpoint relative to the specified comparator , with the specified endpoint behavior

static < t > general range < t > down to ( comparator < ? super t > comparator , @ nullable decl t endpoint , bound type bound type ) { return new general range < t > ( comparator , true , endpoint , bound type , false , null , open ) ; }


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


public static builder builder ( s 3 a file system fs ) { return new builder ( fs ) ; }


sets all options equal to incoming options

public builder clone from ( display image options options ) { image res on loading = options image res on loading ; image res for empty uri = options image res for empty uri ; image res on fail = options image res on fail ; image on loading = options image on loading ; image for empty uri = options image for empty uri ; image on fail = options image on fail ; reset view before loading = options reset view before loading ; cache in memory = options cache in memory ; cache on disk = options cache on disk ; image scale type = options image scale type ; decoding options = options decoding options ; delay before loading = options delay before loading ; consider exif params = options consider exif params ; extra for downloader = options extra for downloader ; pre processor = options pre processor ; post processor = options post processor ; displayer = options displayer ; handler = options handler ; is sync loading = options is sync loading ; return this ; }


returns whether the shard is a relocated primary , i e not in charge anymore of replicating changes ( see { @ link replication tracker } )

public boolean is relocated primary ( ) { assert shard routing primary ( ) : " only call is relocated primary on primary shard " ; return replication tracker is relocated ( ) ; }


gets the offset of the vf table address in the type descriptor structure

public int get v f table address offset ( ) { return vf table or hash ordinal ; }


matches resource requirements against available resources in a first round requirements are matched against free slot , and any match results in a slot allocation the remaining unfulfilled requirements are matched against pending slots , allocating more workers if no matching pending slot could be found if the requirements for a job could not be fulfilled then a notification is sent to the job master informing it as such performance notes : at it ' s core this method loops , for each job , over all freepending slots for each required slot , trying to find a matching slot one should generally go in with the assumption that this runs in number of jobs requiring resources number of required slots number of free or pending slots this is especially important when dealing with pending slots , as matches between requirements and pending slots are not persisted and recomputed on each call this may required further refinements in the future ; e g , persisting the matches between requirements and pending slots , or not matching against pending slots at all when dealing with unspecific resource profiles ( i e , { @ link resource profile # any } { @ link resource profile # unknown } ) , then the number of freepending slots is not relevant because we only need exactly 1 comparison to determine whether a slot can be fulfilled or not , since they are all the same anyway when dealing with specific resource profiles things can be a lot worse , with the classical cases where either no matches are found , or only at the very end of the iteration in the absolute worst case , with j jobs , requiring r slots each with a unique resource profile such each pair of these profiles is not matching , and s freepending slots that don ' t fulfill any requirement , then this method does a total of jrs resource profile comparisons

private void check resource requirements ( ) { final map < job i d , collection < resource requirement > > missing resources = resource tracker get missing resources ( ) ; if ( missing resources is empty ( ) ) { return ; } final map < job i d , resource counter > unfulfilled requirements = new linked hash map < > ( ) ; for ( map entry < job i d , collection < resource requirement > > resource requirements : missing resources entry set ( ) ) { final job i d job id = resource requirements get key ( ) ; final resource counter unfulfilled job requirements = try allocate slots for job ( job id , resource requirements get value ( ) ) ; if ( ! unfulfilled job requirements is empty ( ) ) { unfulfilled requirements put ( job id , unfulfilled job requirements ) ; } } if ( unfulfilled requirements is empty ( ) ) { return ; } final resource counter pending slots = new resource counter ( task executor manager get pending task manager slots ( ) stream ( ) collect ( collectors grouping by ( pending task manager slot : : get resource profile , collectors summing int ( x - > 1 ) ) ) ) ; for ( map entry < job i d , resource counter > unfulfilled requirement : unfulfilled requirements entry set ( ) ) { try fulfill requirements with pending slots ( unfulfilled requirement get key ( ) , unfulfilled requirement get value ( ) get resource profiles with count ( ) , pending slots ) ; } }


a check to see if a given keystroke is something that should not be processed , depending upon the current state of the system

private boolean is valid context for key stroke ( key stroke key stroke ) { window active window = focus provider get active window ( ) ; if ( active window instanceof docking dialog ) { / / the choice to ignore modal dialogs was made long ago we cannot remember why the / / choice was made , but speculate that odd things can happen when keybindings are / / processed with modal dialogs open for now , do not let key bindings get processed / / for modal dialogs this can be changed in the future if needed docking dialog dialog = ( docking dialog ) active window ; return ! dialog is modal ( ) ; } return true ; / / default case ; allow it through }


performs the maintenance work , blocking until the lock is acquired any exception thrown , such as by { @ link cache writer # delete } , is propagated to the caller

void perform clean up ( @ nullable runnable task ) { eviction lock lock ( ) ; try { maintenance ( task ) ; } finally { eviction lock unlock ( ) ; } if ( ( drain status ( ) = = required ) & & ( executor = = fork join pool common pool ( ) ) ) { schedule drain buffers ( ) ; } }


returns the given list of exceptions , without the ones that have empty code blocks

private int remove empty exceptions ( exception info [ ] exception infos , int exception info count ) { / / overwrite all empty exceptions int new index = 0 ; for ( int index = 0 ; index < exception info count ; index + + ) { exception info exception info = exception infos [ index ] ; if ( exception info u 2start p c < exception info u 2end p c ) { exception infos [ new index + + ] = exception info ; } } / / clear the unused array entries arrays fill ( exception infos , new index , exception info count , null ) ; return new index ; }


returns a new { @ code cache stats } representing the difference between this { @ code cache stats } and { @ code other } negative values , which aren ' t supported by { @ code cache stats } will be rounded up to zero

public cache stats minus ( cache stats other ) { return new cache stats ( math max ( 0 , saturated subtract ( hit count , other hit count ) ) , math max ( 0 , saturated subtract ( miss count , other miss count ) ) , math max ( 0 , saturated subtract ( load success count , other load success count ) ) , math max ( 0 , saturated subtract ( load exception count , other load exception count ) ) , math max ( 0 , saturated subtract ( total load time , other total load time ) ) , math max ( 0 , saturated subtract ( eviction count , other eviction count ) ) ) ; }


test opening many files via tcp ( not short - circuit ) this is practical when using unbuffer , because it reduces the number of sockets and amount of memory that we use

public void test open many files via tcp ( ) throws exception { final int num opens = 500 ; configuration conf = new configuration ( ) ; conf set boolean ( hdfs client config keys read short circuit key , false ) ; mini d f s cluster cluster = null ; f s data input stream [ ] streams = new f s data input stream [ num opens ] ; try { cluster = new mini d f s cluster builder ( conf ) build ( ) ; distributed file system dfs = cluster get file system ( ) ; final path test path = new path ( " / test file " ) ; d f s test util create file ( dfs , test path , 131072 , ( short ) 1 , 1 ) ; for ( int i = 0 ; i < num opens ; i + + ) { streams [ i ] = dfs open ( test path ) ; log info ( " opening file " + i + " " ) ; assert assert true ( - 1 ! = streams [ i ] read ( ) ) ; streams [ i ] unbuffer ( ) ; } } finally { for ( f s data input stream stream : streams ) { i o utils cleanup ( null , stream ) ; } if ( cluster ! = null ) { cluster shutdown ( ) ; } } }


test when md 5 file exists but incorrect checksum

public void test verify m d 5 file bad digest ( ) throws exception { m d 5 file utils save m d 5 file ( test file , m d 5 hash digest ( new byte [ 0 ] ) ) ; try { m d 5 file utils verify saved m d 5 ( test file , test md5 ) ; fail ( " did not throw " ) ; } catch ( i o exception ioe ) { / / expected } }


maps a range to a specified value , coalescing this range with any existing ranges with the same value that are { @ linkplain range # is connected connected } to this range the behavior of { @ link # get ( comparable ) get ( k ) } after calling this method is identical to the behavior described in { @ link # put ( range , object ) put ( range , value ) } , however the ranges returned from { @ link # as map of ranges } will be different if there were existing entries which connect to the given range and value even if the input range is empty , if it is connected on both sides by ranges mapped to the same value those two ranges will be coalesced < b > note : < b > coalescing requires calling { @ code equals ( ) } on any connected values , which may be expensive depending on the value type using this method on range maps with large values such as { @ link collection } types is discouraged

void put coalescing ( range < k > range , v value ) ;


public void do filter ( servlet request request , servlet response response , filter chain filter chain ) throws i o exception , servlet exception { http servlet request req = ( http servlet request ) request ; string new header = req get header ( delegation token authenticator delegation token header ) ; if ( new header = = null | | new header is empty ( ) ) { / / for backward compatibility , allow use of the old header field / / only when the new header doesn ' t exist final string old header = req get header ( old header ) ; if ( old header ! = null & & ! old header is empty ( ) ) { request = new http servlet request wrapper ( req ) { @ override public string get header ( string name ) { if ( name equals ( delegation token authenticator delegation token header ) ) { return old header ; } return super get header ( name ) ; } } ; } } super do filter ( request , response , filter chain ) ; }


declare a script field on an { @ link object parser }

public static < t > void declare script ( abstract object parser < t , ? > parser , bi consumer < t , script > consumer , parse field parse field ) { parser declare field ( consumer , ( p , c ) - > script parse ( p ) , parse field , value type object or string ) ; }