given the path fragment of a java source file , returns the java root of the specified path or ' null ' if no java root can be determined example 1 : " { workspace } javafoobarwiz " and " { workspace } javatestsfoobarwiz " result in " { workspace } java " and " { workspace } javatests " example 2 : " javafoobarwiz " and " javatestsfoobarwiz " result in " java " and " javatests " todo ( bazel - team ) : ( 2011 ) we need to have a more robust way to determine the java root of a relative path rather than simply trying to find the " java " or " javatests " directory

public static path fragment get java root ( path fragment path ) { int index = java segment index ( path ) ; if ( index > = 0 ) { return path sub fragment ( 0 , index + 1 ) ; } return null ; }


returns a collection with additional input artifacts relevant to the action by reading the dynamically - discovered dependency information from the parsed dependency set after the action has run artifacts are considered inputs but not " mandatory " inputs

nested set < artifact > discover inputs from dependencies ( path exec root , artifact resolver artifact resolver , boolean sibling repository layout ) throws action execution exception { nested set builder < artifact > inputs = nested set builder stable order ( ) ; if ( dependencies = = null ) { return inputs build ( ) ; } / / check inclusions include problems problems = new include problems ( ) ; for ( path exec path : dependencies ) { path fragment exec path fragment = exec path as fragment ( ) ; if ( exec path fragment is absolute ( ) ) { / / absolute includes from system paths are ignored if ( file system utils starts with any ( exec path , permitted system include prefixes ) ) { continue ; } / / since gcc is given only relative paths on the command line , / / non - system include paths here should never be absolute if they / / are , it ' s probably due to a non - hermetic # include , & we should stop / / the build with an error if ( exec path starts with ( exec root ) ) { exec path fragment = exec path relative to ( exec root ) ; / / funky but tolerable path } else if ( sibling repository layout & & exec path starts with ( exec root get parent directory ( ) ) ) { / / for - - experimental sibling repository layout exec path fragment = label constants experimental external path prefix get relative ( exec path relative to ( exec root get parent directory ( ) ) ) ; } else { problems add ( exec path fragment get path string ( ) ) ; continue ; } } artifact artifact = allowed derived inputs map get ( exec path fragment ) ; if ( artifact = = null ) { repository name repository = package identifier discover from exec path ( exec path fragment , false , sibling repository layout ) get repository ( ) ; artifact = artifact resolver resolve source artifact ( exec path fragment , repository ) ; } if ( artifact ! = null ) { / / we don ' t need to add the source file itself as it is a mandatory input if ( ! artifact equals ( source file ) ) { inputs add ( artifact ) ; } continue ; } artifact tree artifact = find owning tree artifact ( exec path fragment ) ; if ( tree artifact ! = null ) { inputs add ( tree artifact ) ; continue ; } / / abort if we see files that we can ' t resolve , likely caused by / / undeclared includes or illegal include constructs problems add ( exec path fragment get path string ( ) ) ; } if ( should validate inclusions ) { problems assert problem free ( action , source file ) ; } return inputs build ( ) ; }


should be called when the globber is no longer needed


note : it should be guaranteed that { @ link # create result partition writer ( int ) } has been called before creating the receiver otherwise it might cause unexpected behaviors when { @ link org apache flink runtime io network partition partition not found exception } happens in { @ link single input gate benchmark factory test remote input channel }

public serializing long receiver create receiver ( ) throws exception { task manager location sender location = new task manager location ( resource i d generate ( ) , local address , data port ) ; input gate receiver gate = create input gate ( sender location ) ; serializing long receiver receiver = new serializing long receiver ( receiver gate , channels * partition ids length ) ; receiver start ( ) ; return receiver ; }


parses request for use in the explain action { @ link request } is reused across { @ link put data frame analytics action } and { @ link explain data frame analytics action } but parsing differs between these two usages

public static request parse request for explain ( x content parser parser ) { data frame analytics config builder config builder = data frame analytics config strict parser apply ( parser , null ) ; data frame analytics config config = config builder build for explain ( ) ; return new put data frame analytics action request ( config ) ; }


parses a trun atom ( defined in 14496 - 12 )

private static int parse trun ( track bundle track bundle , int index , @ flags int flags , parsable byte array trun , int track run start ) throws parser exception { trun set position ( atom header size ) ; int full atom = trun read int ( ) ; int atom flags = atom parse full atom flags ( full atom ) ; track track = track bundle moov sample table track ; track fragment fragment = track bundle fragment ; default sample values default sample values = cast non null ( fragment header ) ; fragment trun length [ index ] = trun read unsigned int to int ( ) ; fragment trun data position [ index ] = fragment data position ; if ( ( atom flags & 0x 0 1 / * data offset present * / ) ! = 0 ) { fragment trun data position [ index ] + = trun read int ( ) ; } boolean first sample flags present = ( atom flags & 0x 0 4 / * first sample flags present * / ) ! = 0 ; int first sample flags = default sample values flags ; if ( first sample flags present ) { first sample flags = trun read int ( ) ; } boolean sample durations present = ( atom flags & 0x 1 0 0 / * sample duration present * / ) ! = 0 ; boolean sample sizes present = ( atom flags & 0x 2 0 0 / * sample size present * / ) ! = 0 ; boolean sample flags present = ( atom flags & 0x 4 0 0 / * sample flags present * / ) ! = 0 ; boolean sample composition time offsets present = ( atom flags & 0x 8 0 0 / * sample composition time offsets present * / ) ! = 0 ; / / offset to the entire video timeline in the presence of b - frames this is usually used to / / ensure that the first frame ' s presentation timestamp is zero long edts offset us = 0 ; / / currently we only support a single edit that moves the entire media timeline ( indicated by / / duration = = 0 ) other uses of edit lists are uncommon and unsupported if ( track edit list durations ! = null & & track edit list durations length = = 1 & & track edit list durations [ 0 ] = = 0 ) { edts offset us = util scale large timestamp ( cast non null ( track edit list media times ) [ 0 ] , c micros per second , track timescale ) ; } int [ ] sample size table = fragment sample size table ; int [ ] sample composition time offset us table = fragment sample composition time offset us table ; long [ ] sample decoding time us table = fragment sample decoding time us table ; boolean [ ] sample is sync frame table = fragment sample is sync frame table ; boolean workaround every video frame is sync frame = track type = = c track type video & & ( flags & flag workaround every video frame is sync frame ) ! = 0 ; int track run end = track run start + fragment trun length [ index ] ; long timescale = track timescale ; long cumulative time = fragment next fragment decode time ; for ( int i = track run start ; i < track run end ; i + + ) { / / use trun values if present , otherwise tfhd , otherwise trex int sample duration = check non negative ( sample durations present ? trun read int ( ) : default sample values duration ) ; int sample size = check non negative ( sample sizes present ? trun read int ( ) : default sample values size ) ; int sample flags = sample flags present ? trun read int ( ) : ( i = = 0 & & first sample flags present ) ? first sample flags : default sample values flags ; if ( sample composition time offsets present ) { / / the bmff spec ( iso 14496 - 12 ) states that sample offsets should be unsigned integers in / / version 0 trun boxes , however a significant number of streams violate the spec and use / / signed integers instead it ' s safe to always decode sample offsets as signed integers / / here , because unsigned integers will still be parsed correctly ( unless their top bit is / / set , which is never true in practice because sample offsets are always small ) int sample offset = trun read int ( ) ; sample composition time offset us table [ i ] = ( int ) ( ( sample offset * c micros per second ) / timescale ) ; } else { sample composition time offset us table [ i ] = 0 ; } sample decoding time us table [ i ] = util scale large timestamp ( cumulative time , c micros per second , timescale ) - edts offset us ; if ( ! fragment next fragment decode time includes moov ) { sample decoding time us table [ i ] + = track bundle moov sample table duration us ; } sample size table [ i ] = sample size ; sample is sync frame table [ i ] = ( ( sample flags > > 16 ) & 0x 1 ) = = 0 & & ( ! workaround every video frame is sync frame | | i = = 0 ) ; cumulative time + = sample duration ; } fragment next fragment decode time = cumulative time ; return track run end ; }


inserts the specified element at the tail of this queue , waiting for space to become available if the queue is full

public void put ( e e ) throws interrupted exception { if ( e = = null ) throw new null pointer exception ( ) ; final monitor monitor = this monitor ; monitor enter when ( not full ) ; try { insert ( e ) ; } finally { monitor leave ( ) ; } }


checks to see if the basic block is a subroutine caller block

private boolean is subroutine caller ( basic block bb ) { int list successors = bb get successors ( ) ; if ( successors size ( ) < 2 ) return false ; int sub label = successors get ( 1 ) ; return ( sub label < subroutines length ) & & ( subroutines [ sub label ] ! = null ) ; }


return the underlying m bean server that is being used to register m bean ' s the returned m bean server may be a new empty m bean server if running through ikvm

public m bean server get platform m bean server ( ) { return m bean server ; }


register a field error for the specified field of the current object ( respecting the current nested path , if any ) , using the given error description the field name may be { @ code null } or empty string to indicate the current object itself rather than a field of it this may result in a corresponding field error within the nested object graph or a global error if the current object is the top object

void reject value ( @ nullable string field , string error code , @ nullable object [ ] error args , @ nullable string default message ) ;


register a listener that will be called when this model is unbound from a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public base model view model on unbind ( on model unbound listener < base model view model , base model view > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


get the maximum number of bytes that can be locked into memory at any given point

static long get memlock limit ( ) { return is available ( ) ? get memlock limit 0 ( ) : 0 ; }


sort { @ link extension component } s in the descending order of { @ link # ordinal ( ) }

public int compare to ( extension component < t > that ) { double a = this ordinal ( ) ; double b = that ordinal ( ) ; if ( double compare ( a , b ) > 0 ) return - 1 ; if ( double compare ( a , b ) < 0 ) return 1 ; boolean this is descriptor = false ; string this label = this instance get class ( ) get name ( ) ; if ( this instance instanceof descriptor ) { try { this label = util fix null ( ( ( descriptor ) this instance ) get display name ( ) ) ; this is descriptor = true ; } catch ( runtime exception | linkage error x ) { log log ( level warning , " failure during descriptor # get display name for " + this instance get class ( ) get name ( ) , x ) ; } } boolean that is descriptor = false ; string that label = that instance get class ( ) get name ( ) ; if ( that instance instanceof descriptor ) { try { that label = util fix null ( ( ( descriptor ) that instance ) get display name ( ) ) ; that is descriptor = true ; } catch ( runtime exception | linkage error x ) { log log ( level warning , " failure during descriptor # get display name for " + that instance get class ( ) get name ( ) , x ) ; } } if ( this is descriptor ) { if ( that is descriptor ) { return this label compare to ( that label ) ; } else { return 1 ; } } else { if ( that is descriptor ) { return - 1 ; } } return this label compare to ( that label ) ; }


public shape get main shape ( ) { return main shape ; }


protected event new event ( final string id , final attribute map attributes ) { return new event ( this , id , attributes ) ; }


initializes the write for the log aggregation controller in the rolling case it sets up modifies checksum and meta files if needed

private pair < path , boolean > initialize writer in rolling ( final path remote log file , final application id app id , final string node id ) throws exception { boolean created new = false ; path aggregated log file = null ; / / check uuid / / if we can not find uuid , we would load the uuid / / from previous aggregated log files , and at the same / / time , we would delete any aggregated log files which / / has invalid uuid if ( uuid = = null ) { uuid = load u u i d from log file ( fc , remote log file get parent ( ) , app id , node id ) ; } path current remote log file = get current remote log file ( fc , remote log file get parent ( ) , node id ) ; / / check checksum file boolean overwrite check sum = true ; remote log check sum file = new path ( remote log file get parent ( ) , ( remote log file get name ( ) + check sum file suffix ) ) ; if ( fc util ( ) exists ( remote log check sum file ) ) { / / if the checksum file exists , we should reset cached / / indexed logs meta indexed logs meta get log metas ( ) clear ( ) ; if ( current remote log file ! = null ) { f s data input stream checksum file input stream = null ; try { checksum file input stream = fc open ( remote log check sum file ) ; int name length = checksum file input stream read int ( ) ; byte [ ] b = new byte [ name length ] ; int actual length = checksum file input stream read ( b ) ; if ( actual length = = name length ) { string recovered log file = new string ( b , charset for name ( " utf - 8 " ) ) ; if ( recovered log file equals ( current remote log file get name ( ) ) ) { overwrite check sum = false ; long end index = checksum file input stream read long ( ) ; indexed logs meta recovered logs meta = load indexed logs meta ( current remote log file , end index , app id ) ; if ( recovered logs meta ! = null ) { indexed logs meta = recovered logs meta ; } } } } finally { i o utils cleanup with logger ( log , checksum file input stream ) ; } } } / / check whether we need roll over old logs if ( current remote log file = = null | | is rollover ( fc , current remote log file ) ) { indexed logs meta get log metas ( ) clear ( ) ; overwrite check sum = true ; aggregated log file = new path ( remote log file get parent ( ) , remote log file get name ( ) + " " + sys clock get time ( ) ) ; fs data o stream = fc create ( aggregated log file , enum set of ( create flag create , create flag overwrite ) , new options create opts [ ] { } ) ; / / writes the uuid fs data o stream write ( uuid ) ; fs data o stream flush ( ) ; created new = true ; } else { aggregated log file = current remote log file ; fs data o stream = fc create ( current remote log file , enum set of ( create flag create , create flag append ) , new options create opts [ ] { } ) ; } / / recreate checksum file if needed before aggregate the logs if ( overwrite check sum ) { long current aggregated log file length ; if ( created new ) { current aggregated log file length = 0 ; } else { current aggregated log file length = fc get file status ( aggregated log file ) get len ( ) ; } f s data output stream checksum file output stream = null ; try { checksum file output stream = fc create ( remote log check sum file , enum set of ( create flag create , create flag overwrite ) , new options create opts [ ] { } ) ; string file name = aggregated log file get name ( ) ; checksum file output stream write int ( file name length ( ) ) ; checksum file output stream write ( file name get bytes ( charset for name ( " utf - 8 " ) ) ) ; checksum file output stream write long ( current aggregated log file length ) ; checksum file output stream flush ( ) ; } finally { i o utils cleanup with logger ( log , checksum file output stream ) ; } } return pair of ( aggregated log file , created new ) ; }


test the handling of sessionless responses pre - kip - 227 brokers always supply this kind of response

public void test sessionless ( ) { fetch session handler handler = new fetch session handler ( log context , 1 ) ; fetch session handler builder builder = handler new builder ( ) ; builder add ( new topic partition ( " foo " , 0 ) , new fetch request partition data ( 0 , 100 , 200 , optional empty ( ) ) ) ; builder add ( new topic partition ( " foo " , 1 ) , new fetch request partition data ( 10 , 110 , 210 , optional empty ( ) ) ) ; fetch session handler fetch request data data = builder build ( ) ; assert maps equal ( req map ( new req entry ( " foo " , 0 , 0 , 100 , 200 ) , new req entry ( " foo " , 1 , 10 , 110 , 210 ) ) , data to send ( ) , data session partitions ( ) ) ; assert equals ( invalid session id , data metadata ( ) session id ( ) ) ; assert equals ( initial epoch , data metadata ( ) epoch ( ) ) ; fetch response < memory records > resp = new fetch response < > ( errors none , resp map ( new resp entry ( " foo " , 0 , 0 , 0 ) , new resp entry ( " foo " , 1 , 0 , 0 ) ) , 0 , invalid session id ) ; handler handle response ( resp ) ; fetch session handler builder builder 2 = handler new builder ( ) ; builder 2 add ( new topic partition ( " foo " , 0 ) , new fetch request partition data ( 0 , 100 , 200 , optional empty ( ) ) ) ; fetch session handler fetch request data data 2 = builder 2 build ( ) ; assert equals ( invalid session id , data 2 metadata ( ) session id ( ) ) ; assert equals ( initial epoch , data 2 metadata ( ) epoch ( ) ) ; assert maps equal ( req map ( new req entry ( " foo " , 0 , 0 , 100 , 200 ) ) , data to send ( ) , data session partitions ( ) ) ; }


public static boolean is bit on ( int value , int bit number ) { if ( bit number < = 0 | | bit number > 8 ) { throw new illegal argument exception ( " only bits 1 through 8 are supported " ) ; } return ( ( value & masks [ bit number - 1 ] ) = = masks [ bit number - 1 ] ) ; }


returns a new { @ link file system ref } to an existing , already open { @ link g file system filesystem } caller is responsible for { @ link file system ref # close ( ) closing } it returns null if the requested filesystem isn ' t already open and mounted in the cache

public synchronized file system ref get ref ( f s r l root fsrl ) { if ( root f s r l equals ( fsrl ) ) { return root f s get ref manager ( ) create ( ) ; } f s cache info fsci = filesystems get ( fsrl ) ; if ( fsci ! = null ) { return fsci ref dup ( ) ; } / / if the query fsrl doesn ' t have a md5 , do a slow scan / / for filesystems that match by equiv if ( fsrl get m d 5 ( ) = = null ) { for ( entry < f s r l root , f s cache info > entry : filesystems entry set ( ) ) { if ( entry get key ( ) is equivalent ( fsrl ) ) { return entry get value ( ) ref dup ( ) ; } } } return null ; }


public set < string > get photo urls ( ) { return photo urls ; }


adds a namevalue pair to the formatted output in { @ code name = value } format if { @ code value } is { @ code null } , the string { @ code " null " } is used , unless { @ link # omit null values ( ) } is called , in which case this namevalue pair will not be added

public to string helper add ( string name , @ nullable decl object value ) { return add holder ( name , value ) ; }


generates a file at openapi - generator v e r s i o n to track the version of user ' s latest run

private void generate version metadata ( list < file > files ) { string version metadata = config output folder ( ) + file separator + metadata dir + file separator + " version " ; if ( generate metadata ) { file version metadata file = new file ( version metadata ) ; try { file written = this template processor write to file ( version metadata , implementation version read ( ) get bytes ( standard charsets utf 8 ) ) ; if ( written ! = null ) { files add ( version metadata file ) ; if ( config is enable post process file ( ) & & ! dry run ) { config post process file ( written , " openapi - generator - version " ) ; } } } catch ( i o exception e ) { throw new runtime exception ( " could not generate supporting file ' " + version metadata + " ' " , e ) ; } } else { path metadata = java nio file paths get ( version metadata ) ; this template processor skip ( metadata , " skipped by generate metadata option supplied by user " ) ; } }


sets the { @ link repeat mode } to be used for playback

void set repeat mode ( @ repeat mode int repeat mode ) ;


a variant of { @ link # set allowed origins ( collection ) } that accepts flexible domain patterns , e g { @ code " https : domain 1 com " } furthermore it always sets the { @ code access - control - allow - origin } response header to the matched origin and never to { @ code " " } , nor to any other pattern

public void set allowed origin patterns ( collection < string > allowed origin patterns ) { assert not null ( allowed origin patterns , " allowed origin patterns collection must not be null " ) ; this cors configuration set allowed origin patterns ( new array list < > ( allowed origin patterns ) ) ; }


checks that the statistics agreement popup has been displayed

private static boolean is agreement shown ( ) { return properties component get instance ( ) is value set ( m t statistics notification show statistics agreement ) ; }


returns the index of the last appearance of the value { @ code target } in { @ code array }

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


return true if this storage dir can roll back to the previous storage state , false otherwise the nn will refuse to run the rollback operation unless at least one jm or fsimage storage directory can roll back

static boolean can roll back ( storage directory sd , storage info storage , storage info prev storage , int target layout version ) throws i o exception { file prev dir = sd get previous dir ( ) ; if ( ! prev dir exists ( ) ) { / / use current directory then log info ( " storage directory " + sd get root ( ) + " does not contain previous fs state " ) ; / / read and verify consistency with other directories storage read properties ( sd ) ; return false ; } / / read and verify consistency of the prev dir prev storage read previous version properties ( sd ) ; if ( prev storage get layout version ( ) ! = target layout version ) { throw new i o exception ( " cannot rollback to storage version " + prev storage get layout version ( ) + " using this version of the name node , which uses storage version " + target layout version + " " + " please use the previous version of hdfs to perform the rollback " ) ; } return true ; }


returns random capacity , if the size is smaller than 10 they are t bs otherwise the size is assigned to gb range

private long get random capacity ( ) { int size = disk sizes [ rand next int ( disk sizes length ) ] ; if ( size < 10 ) { return size * tb ; } else { return size * gb ; } }


copies an existing blob ' s contents , properties , and metadata to this instance of the < code > cloud blob < code > class , using the specified operation context

public abstract void start copy from blob ( cloud blob wrapper source blob , blob request options options , operation context op context , boolean overwrite destination ) throws storage exception , u r i syntax exception ;


accepts a declaration for further processing parsing

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


deserialize the body of the { @ link abstract symbol information } according to the gsi versions prior to 7 00 specification

private void deserialize gsi pre 7 0 hash table ( pdb byte reader reader , task monitor monitor ) throws pdb exception , cancelled exception { int num buckets bytes = 4 * ( num hash records + 1 ) ; if ( reader num remaining ( ) < num buckets bytes ) { throw new pdb exception ( " not enough data for gsi " ) ; } int num records bytes = ( reader num remaining ( ) - num buckets bytes ) ; pdb byte reader hash records reader = reader get sub pdb byte reader ( num records bytes ) ; pdb byte reader buckets reader = reader get sub pdb byte reader ( num buckets bytes ) ; if ( reader has more ( ) ) { throw new pdb exception ( " unexpected extra information at and of gsi stream " ) ; } hash bucket offsets = new array list < > ( ) ; while ( buckets reader has more ( ) ) { monitor check canceled ( ) ; hash bucket offsets add ( buckets reader parse int ( ) ) ; } / / note : each offset value is into an array of structures that are 12 bytes in length , but / / whose on - disk size is 8 bytes these are the structures in the hash records reader so / / take the offset and multiple by 2 / 3 to get the byte offset into the reader for the / / actual record still need to deal with the collision logic after that deserialize hash records ( hash records reader , monitor ) ; }


get the class name of the class which associated with self class

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


maps all non - parameter , non - local variable registers

private void handle normal unassociated ( ) { int sz ssa regs = ssa meth get reg count ( ) ; for ( int ssa reg = 0 ; ssa reg < sz ssa regs ; ssa reg + + ) { if ( ssa regs mapped get ( ssa reg ) ) { / / we already did this one continue ; } register spec ssa spec = get definition spec for ssa reg ( ssa reg ) ; if ( ssa spec = = null ) continue ; int category = ssa spec get category ( ) ; / / find a rop reg that does not interfere int rop reg = find next unreserved rop reg ( param range end , category ) ; while ( ! can map reg ( ssa spec , rop reg ) ) { rop reg = find next unreserved rop reg ( rop reg + 1 , category ) ; } add mapping ( ssa spec , rop reg ) ; } }


parses the specified string as a single - precision floating point value the ascii character { @ code ' - ' } ( < code > ' & # 92 ; u 0 0 2 d ' < code > ) is recognized as the minus sign unlike { @ link float # parse float ( string ) } , this method returns { @ code null } instead of throwing an exception if parsing fails valid inputs are exactly those accepted by { @ link float # value of ( string ) } , except that leading and trailing whitespace is not permitted this implementation is likely to be faster than { @ code float parse float } if many failures are expected

public static float try parse ( string string ) { if ( doubles floating point pattern matcher ( string ) matches ( ) ) { / / todo ( lowasser ) : could be potentially optimized , but only with / / extensive testing try { return float parse float ( string ) ; } catch ( number format exception e ) { / / float parse float has changed specs several times , so fall through / / gracefully } } return null ; }


restores the array of objects from the configuration

public static < k > k [ ] load array ( configuration conf , string key name , class < k > item class ) throws i o exception { default stringifier < k > stringifier = new default stringifier < k > ( conf , item class ) ; try { string item str = conf get ( key name ) ; array list < k > list = new array list < k > ( ) ; string [ ] parts = item str split ( separator ) ; for ( string part : parts ) { if ( ! part is empty ( ) ) list add ( stringifier from string ( part ) ) ; } return generics util to array ( item class , list ) ; } finally { stringifier close ( ) ; } }


calculates the local and world transform of all { @ link node } instances in this model , recursively first each { @ link node # local transform } transform is calculated based on the translation , rotation and scale of each node then each { @ link node # calculate world transform ( ) } is calculated , based on the parent ' s world transform and the local transform of each node finally , the animation bone matrices are updated accordingly this method can be used to recalculate all transforms if any of the node ' s local properties ( translation , rotation , scale ) was modified

public void calculate transforms ( ) { final int n = nodes size ; for ( int i = 0 ; i < n ; i + + ) { nodes get ( i ) calculate transforms ( true ) ; } for ( int i = 0 ; i < n ; i + + ) { nodes get ( i ) calculate bone transforms ( true ) ; } }


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

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


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


attempts to get the text value for the cell so that the data will match what the user sees

private static string get table cell value ( j table table , table model model , int row , int column ) { table cell renderer renderer = table get cell renderer ( row , column ) ; table column model column model = table get column model ( ) ; table column table column = column model get column ( column ) ; int model index = table column get model index ( ) ; object value = model get value at ( row , model index ) ; component component = renderer get table cell renderer component ( table , value , false , false , row , column ) ; if ( component instanceof j label ) { j label label = ( j label ) component ; return get text for label ( label ) ; } string text = look for text inside of component ( component ) ; if ( text ! = null ) { return text ; } return value = = null ? " " : value to string ( ) ; }


during normal use cases the { @ link ascii string } should be immutable , but if the underlying array is shared , and changes then this needs to be called

public void array changed ( ) { string = null ; hash = 0 ; }


format < code > obj < code > using the provided { @ link doc value format } if the format is equals to { @ link doc value format # raw } , the object is returned as is for numbers and a string for { @ link bytes ref } s

static object format object ( object obj , doc value format format ) { if ( obj = = null ) { return null ; } if ( obj get class ( ) = = bytes ref class ) { bytes ref value = ( bytes ref ) obj ; if ( format = = doc value format raw ) { return value utf 8 to string ( ) ; } else { return format format ( value ) ; } } else if ( obj get class ( ) = = long class ) { long value = ( long ) obj ; if ( format = = doc value format raw ) { return value ; } else { return format format ( value ) ; } } else if ( obj get class ( ) = = double class ) { double value = ( double ) obj ; if ( format = = doc value format raw ) { return value ; } else { return format format ( value ) ; } } return obj ; }


normalize a path by stripping off any trailing { @ link # path separator }

private static string normalize network location path ( string path ) { if ( path = = null | | path length ( ) = = 0 ) { return root ; } if ( path char at ( 0 ) ! = path separator ) { throw new illegal argument exception ( " network location " + " path doesn ' t start with " + path separator + " : " + path ) ; } int len = path length ( ) ; if ( path char at ( len - 1 ) = = path separator ) { return path substring ( 0 , len - 1 ) ; } return path ; }


retrieve the current locale from the given request , using the locale resolver bound to the request by the dispatcher servlet ( if available ) , falling back to the request ' s accept - header locale this method serves as a straightforward alternative to the standard servlet { @ link javax servlet http http servlet request # get locale ( ) } method , falling back to the latter if no more specific locale has been found consider using { @ link org springframework context i 1 8n locale context holder # get locale ( ) } which will normally be populated with the same locale

public static locale get locale ( http servlet request request ) { locale resolver locale resolver = get locale resolver ( request ) ; return ( locale resolver ! = null ? locale resolver resolve locale ( request ) : request get locale ( ) ) ; }


see { @ link visibility events test # test multiple visible and invisible events ( ) }

public void test multiple inc items ( ) { incremental item impl item 1 = new incremental item impl ( left , 0 , right , 5 , " id 1 " ) ; incremental item impl item 2 = new incremental item impl ( left , 5 , right , 10 , " id 2 " ) ; incremental item impl item 3 = new incremental item impl ( left , 10 , right , 15 , " id 3 " ) ; final list < incremental module item > items = new array list < > ( ) ; items add ( item 1 ) ; items add ( item 2 ) ; items add ( item 3 ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 15 ) , items ) ; assert that ( item 1 m enter range called ) is true ( ) ; assert that ( item 2 m enter range called ) is true ( ) ; assert that ( item 3 m enter range called ) is true ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 15 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 0 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is true ( ) ; assert that ( item 2 m exit range called ) is true ( ) ; assert that ( item 3 m exit range called ) is true ( ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 0 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 3 ) , items ) ; assert that ( item 1 m enter range called ) is true ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 3 , right , 11 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is true ( ) ; assert that ( item 3 m enter range called ) is true ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 5 , right , 11 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is true ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; }


adding a new key - value pair to the t file this is synonymous to append ( key , 0 , key length , value , 0 , value length )

public void append ( byte [ ] key , byte [ ] value ) throws i o exception { append ( key , 0 , key length , value , 0 , value length ) ; }


public static void add file to zip file ( file zip file , file out zip file , file file , string dest path , boolean overwrite ) throws i o exception { byte [ ] buf = new byte [ 1024 ] ; zip input stream zin = new zip input stream ( new file input stream ( zip file ) ) ; zip output stream out = new zip output stream ( new file output stream ( out zip file ) ) ; zip entry entry = zin get next entry ( ) ; boolean add file = true ; while ( entry ! = null ) { boolean add entry = true ; string name = entry get name ( ) ; if ( string utils equals ignore case ( name , dest path ) ) { if ( overwrite ) { add entry = false ; } else { add file = false ; } } if ( add entry ) { zip entry zip entry = null ; if ( stored = = entry get method ( ) ) { zip entry = new zip entry ( entry ) ; } else { zip entry = new zip entry ( name ) ; } out put next entry ( zip entry ) ; int len ; while ( ( len = zin read ( buf ) ) > 0 ) { out write ( buf , 0 , len ) ; } } entry = zin get next entry ( ) ; } if ( add file ) { input stream in = new file input stream ( file ) ; / / add zip entry to output stream zip entry zip entry = new zip entry ( dest path ) ; out put next entry ( zip entry ) ; / / transfer bytes from the file to the zip file int len ; while ( ( len = in read ( buf ) ) > 0 ) { out write ( buf , 0 , len ) ; } / / complete the entry out close entry ( ) ; in close ( ) ; } / / close the streams zin close ( ) ; out close ( ) ; }


public int get dependency check ( ) { return this dependency check ; }


complete the last request that was sent to a particular node

public network client in flight request complete last sent ( string node ) { network client in flight request in flight request = request queue ( node ) poll first ( ) ; in flight request count decrement and get ( ) ; return in flight request ; }


encodes the abgr int color as a float the alpha is compressed to use only even numbers between 0 - 254 to avoid using bits in the na n range ( see { @ link float # int bits to float ( int ) } javadocs ) rendering which uses colors encoded as floats should expand the 0 - 254 back to 0 - 255 , else colors cannot be fully opaque

public static float int to float color ( int value ) { return float int bits to float ( value & 0xfeffffff ) ; }


determines the long value of the system property with the specified name this behaves just like { @ link long # get long ( java lang string ) } , except that it also consults the { @ link servlet context } ' s " init " parameters

public static long get long ( string name ) { return get long ( name , null ) ; }


finds the index of the segment in a java path fragment that precedes the source root starts from the first " java " or " javatests " or " src " or " testsrc " segment if the found item was " src " , check if this is followed by " main " or " test " and then " java " or " resources " ( maven layout ) if the found item was " src " , or " java " " javatests " at the first segment , check for a nested root directory ( src , java or javatests ) a nested root must be followed by ( com | net | org ) , or matching maven structure for nested " src " , to be accepted , to avoid false positives

private static int java segment index ( path fragment path ) { if ( path is absolute ( ) ) { throw new illegal argument exception ( " path must not be absolute : ' " + path + " ' " ) ; } int root index = path get first segment ( known source roots ) ; if ( root index < 0 ) { return root index ; } final boolean is src = " src " equals ( path get segment ( root index ) ) ; int check maven index = is src ? root index : - 1 ; if ( root index = = 0 | | is src ) { / / check for a nested root directory for ( int i = root index + 1 , max = path segment count ( ) - 2 ; i < = max ; i + + ) { string segment = path get segment ( i ) ; if ( " src " equals ( segment ) | | ( is src & & ( " javatests " equals ( segment ) | | " java " equals ( segment ) ) ) ) { string next = path get segment ( i + 1 ) ; if ( " com " equals ( next ) | | " org " equals ( next ) | | " net " equals ( next ) ) { / / check for common first element of java package , to avoid false positives root index = i ; } else if ( " src " equals ( segment ) ) { / / also accept maven style src / ( main | test ) / ( java | resources ) check maven index = i ; } break ; } } } / / check for ( main | test ) / ( java | resources ) after / src / if ( check maven index > = 0 & & check maven index + 2 < path segment count ( ) ) { string next = path get segment ( check maven index + 1 ) ; if ( " main " equals ( next ) | | " test " equals ( next ) ) { next = path get segment ( check maven index + 2 ) ; if ( " java " equals ( next ) | | " resources " equals ( next ) ) { root index = check maven index + 2 ; } } } return root index ; }


returns true if the graph is too large for animation ( usually due to performance issues )

protected boolean is too big to animate ( ) { return graph get vertex count ( ) > = too big to animate ; }


set whether the { @ code j m x connector server } should be started in a separate thread

public void set threaded ( boolean threaded ) { this threaded = threaded ; }


private feature check feature ( point location ) { for ( feature feature : features ) { if ( feature get location ( ) get latitude ( ) = = location get latitude ( ) & & feature get location ( ) get longitude ( ) = = location get longitude ( ) ) { return feature ; } } / / no feature was found , return an unnamed feature return feature new builder ( ) set name ( " " ) set location ( location ) build ( ) ; }


configures the maximum weight and returns if set

private boolean configure maximum weight ( ) { if ( config get maximum weight ( ) is present ( ) ) { caffeine maximum weight ( config get maximum weight ( ) get as long ( ) ) ; weigher < k , v > weigher = config get weigher factory ( ) map ( factory : : create ) or else throw ( ( ) - > new illegal state exception ( " weigher not configured " ) ) ; caffeine weigher ( ( k key , expirable < v > expirable ) - > { return weigher weigh ( key , expirable get ( ) ) ; } ) ; } return config get maximum weight ( ) is present ( ) ; }


set the timeout to use for receiving the response message for a request ( in milliseconds ) the default is 0 , which indicates a blocking receive without timeout

public void set receive timeout ( long receive timeout ) { this receive timeout = receive timeout ; }


generate the default classpath resource locations array based on the supplied class for example , if the supplied class is { @ code com example my test } , the generated locations will contain a single string with a value of { @ code " classpath : comexample my test < suffix > " } , where { @ code < suffix > } is the value of the first configured { @ linkplain # get resource suffixes ( ) resource suffix } for which the generated location actually exists in the classpath as of spring 3 1 , the implementation of this method adheres to the contract defined in the { @ link smart context loader } spi specifically , this method will preemptively verify that the generated default location actually exists if it does not exist , this method will log a warning and return an empty array subclasses can override this method to implement a different default location generation strategy

protected string [ ] generate default locations ( class < ? > clazz ) { assert not null ( clazz , " class must not be null " ) ; string [ ] suffixes = get resource suffixes ( ) ; for ( string suffix : suffixes ) { assert has text ( suffix , " resource suffix must not be empty " ) ; string resource path = class utils convert class name to resource path ( clazz get name ( ) ) + suffix ; class path resource class path resource = new class path resource ( resource path ) ; if ( class path resource exists ( ) ) { string prefixed resource path = resource utils classpath url prefix + resource path ; if ( logger is info enabled ( ) ) { logger info ( string format ( " detected default resource location \ " % s \ " for test class [ % s ] " , prefixed resource path , clazz get name ( ) ) ) ; } return new string [ ] { prefixed resource path } ; } else if ( logger is debug enabled ( ) ) { logger debug ( string format ( " did not detect default resource location for test class [ % s ] : " + " % s does not exist " , clazz get name ( ) , class path resource ) ) ; } } if ( logger is info enabled ( ) ) { logger info ( string format ( " could not detect default resource locations for test class [ % s ] : " + " no resource found for suffixes % s " , clazz get name ( ) , object utils null safe to string ( suffixes ) ) ) ; } return empty string array ; }


returns the name of the metric ( which may differ to the writeable name )


output the type declaration of the property

public string get type declaration ( schema p ) { schema < ? > schema = model utils unalias schema ( this open a p i , p , import mapping ) ; schema < ? > target = model utils is generate alias as model ( ) ? p : schema ; if ( model utils is array schema ( target ) ) { schema < ? > items = get schema items ( ( array schema ) schema ) ; return get schema type ( target ) + " < " + get type declaration ( items ) + " > " ; } else if ( model utils is map schema ( target ) ) { / / note : model utils is map schema ( p ) returns true when p is a composed schema that also defines / / additionalproperties : true schema < ? > inner = get additional properties ( target ) ; if ( inner = = null ) { logger error ( " ` { } ` ( map property ) does not have a proper inner type defined default to type : string " , p get name ( ) ) ; inner = new string schema ( ) description ( " todo default missing map inner type to string " ) ; p set additional properties ( inner ) ; } return get schema type ( target ) + " < kotlin string , " + get type declaration ( inner ) + " > " ; } return super get type declaration ( target ) ; }


public format test integer ( integer integer ) { this integer = integer ; return this ; }


public void apply angular impulse ( float impulse ) { if ( m type ! = body type dynamic ) { return ; } if ( is awake ( ) = = false ) { set awake ( true ) ; } m angular velocity + = m inv i * impulse ; }


disables registration lock the user keeps their pin

void disable registration lock ( ) throws i o exception ;


populates the holder with data parsed from id3 { @ link metadata }

public boolean set from metadata ( metadata metadata ) { for ( int i = 0 ; i < metadata length ( ) ; i + + ) { metadata entry entry = metadata get ( i ) ; if ( entry instanceof comment frame ) { comment frame comment frame = ( comment frame ) entry ; if ( gapless description equals ( comment frame description ) & & set from comment ( comment frame text ) ) { return true ; } } else if ( entry instanceof internal frame ) { internal frame internal frame = ( internal frame ) entry ; if ( gapless domain equals ( internal frame domain ) & & gapless description equals ( internal frame description ) & & set from comment ( internal frame text ) ) { return true ; } } } return false ; }


write a byte sequences to the current entry ;

default block builder write bytes ( slice source , int source index , int length ) { throw new unsupported operation exception ( get class ( ) get name ( ) ) ; }


applies { @ link circle crop } to all default types and throws an exception if asked to transform an unknown type this will override previous calls to { @ link # dont transform ( ) }

public t circle crop ( ) { return transform ( downsample strategy center inside , new circle crop ( ) ) ; } / / calling optional transform ( ) on the result of clone ( ) requires greater access / / calling downsample is guaranteed to modify the current object by the is auto clone enabled check @ suppress warnings ( { " weaker access " , " check result " }


optional sets the number of shard results that should be reduced at once on the coordinating node this value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large defaults to 5

public void set batched reduce size ( int batched reduce size ) { this batched reduce size = batched reduce size ; }


build type definition with the type or class

type definition build ( type type , class < ? > clazz , map < class < ? > , type definition > type cache ) ;


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


calculates the maximum size allowed before rehashing

private int calc max size ( int capacity ) { / / clip the upper bound so that there will always be at least one available slot int upper bound = capacity - 1 ; return math min ( upper bound , ( int ) ( capacity * load factor ) ) ; }


add a configuration resource the properties of this resource will override properties of previously added resources , unless they were marked < a href = " # final " > final

public void add resource ( input stream in , string name ) { add resource object ( new resource ( in , name ) ) ; }


if the stream is only closed , we remove the produced file ( cleanup through the auto close feature , for example ) this method throws no exception if the deletion fails , but only logs the error

public void close ( ) { if ( ! closed ) { closed = true ; / / make sure write requests need to go to ' flush to file ( ) ' where they recognized / / that the stream is closed pos = write buffer length ; if ( out stream ! = null ) { try { out stream close ( ) ; } catch ( throwable throwable ) { log warn ( " could not close the state stream for { } " , state path , throwable ) ; } finally { try { fs delete ( state path , false ) ; } catch ( exception e ) { log warn ( " cannot delete closed and discarded state stream for { } " , state path , e ) ; } } } } }


invoked before transaction commit ( before " before completion " ) can e g flush transactional or mapping sessions to the database this callback does not mean that the transaction will actually be committed a rollback decision can still occur after this method has been called this callback is rather meant to perform work that ' s only relevant if a commit still has a chance to happen , such as flushing sql statements to the database note that exceptions will get propagated to the commit caller and cause a rollback of the transaction

default void before commit ( boolean read only ) { }


set a custom x stream { @ link converter registry } to use

public void set converter registry ( converter registry converter registry ) { this converter registry = converter registry ; }


returns an immutable multiset containing the given elements , in the " grouped iteration order " described in the class documentation

public static < e > immutable multiset < e > copy of ( iterator < ? extends e > elements ) { return new immutable multiset builder < e > ( ) add all ( elements ) build ( ) ; }


set the type of the constructor argument

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


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


subqueue metrics might be a little out of date because fair shares are recalculated at the update interval , but the root queue metrics needs to be updated synchronously with allocations and completions so that cluster metrics will be consistent

private void update root queue metrics ( ) { root metrics set available resources to queue ( resources subtract ( get cluster resource ( ) , root metrics get allocated resources ( ) ) ) ; }


test a point for containment in this fixture

public boolean test point ( vector 2 p ) { return jni test point ( addr , p x , p y ) ; }


returns after stopping all threads by joining them back

public void stop ( ) throws exception { synchronized ( this ) { stopped = true ; } for ( testing thread t : test threads ) { t join ( ) ; } check exception ( ) ; }


public matrix 3 set to scaling ( vector 2 scale ) { float [ ] val = this val ; val [ m00 ] = scale x ; val [ m10 ] = 0 ; val [ m20 ] = 0 ; val [ m01 ] = 0 ; val [ m11 ] = scale y ; val [ m21 ] = 0 ; val [ m02 ] = 0 ; val [ m12 ] = 0 ; val [ m22 ] = 1 ; return this ; }


like { @ link # create stdout ( ) } , except it tags with the marker ' 3 ' to indicate control flow

public output stream create control ( ) { return new marking stream ( control marker ) ; }


called when an error occurs loading media data

void on load error ( int source id , i o exception e ) ;


reads the first line of this source as a string returns { @ code null } if this source is empty like { @ link buffered reader # read line ( ) } , this method considers a line to be a sequence of text that is terminated by ( but does not include ) one of { @ code \ r \ n } , { @ code \ r } or { @ code \ n } if the source ' s content does not end in a line termination sequence , it is treated as if it does

public @ nullable string read first line ( ) throws i o exception { closer closer = closer create ( ) ; try { buffered reader reader = closer register ( open buffered stream ( ) ) ; return reader read line ( ) ; } catch ( throwable e ) { throw closer rethrow ( e ) ; } finally { closer close ( ) ; } }


return an instance ( possibly shared or independent ) of the object managed by this factory as with a { @ link bean factory } , this allows support for both the singleton and prototype design pattern if this factory bean is not fully initialized yet at the time of the call ( for example because it is involved in a circular reference ) , throw a corresponding { @ link factory bean not initialized exception } as of spring 2 0 , factory beans are allowed to return { @ code null } objects the factory will consider this as normal value to be used ; it will not throw a factory bean not initialized exception in this case anymore factory bean implementations are encouraged to throw factory bean not initialized exception themselves now , as appropriate


none of the blocks can be removed if all blocks are corrupt the test strategy : bring up cluster with 3 data nodes create a file of replication factor 3 corrupt all three replicas verify that all replicas are corrupt and 3 replicas are present set the replication factor to 1 verify that all replicas are corrupt and 3 replicas are present

public void test with all corrupt replicas ( ) throws exception { configuration conf = new hdfs configuration ( ) ; conf set long ( d f s config keys dfs blockreport interval msec key , 1000l ) ; conf set ( d f s config keys dfs namenode reconstruction pending timeout sec key , integer to string ( 2 ) ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( 3 ) build ( ) ; file system fs = cluster get file system ( ) ; final f s namesystem namesystem = cluster get namesystem ( ) ; try { final path file name = new path ( " / foo 1 " ) ; d f s test util create file ( fs , file name , 2 , ( short ) 3 , 0l ) ; d f s test util wait replication ( fs , file name , ( short ) 3 ) ; extended block block = d f s test util get first block ( fs , file name ) ; corrupt block ( cluster , fs , file name , 0 , block ) ; corrupt block ( cluster , fs , file name , 1 , block ) ; corrupt block ( cluster , fs , file name , 2 , block ) ; / / wait for 3 seconds so that all block reports are processed try { thread sleep ( 3000 ) ; } catch ( interrupted exception ignored ) { } assert equals ( 0 , count replicas ( namesystem , block ) live replicas ( ) ) ; assert equals ( 3 , count replicas ( namesystem , block ) corrupt replicas ( ) ) ; namesystem set replication ( file name to string ( ) , ( short ) 1 ) ; / / wait for 3 seconds so that all block reports are processed try { thread sleep ( 3000 ) ; } catch ( interrupted exception ignored ) { } assert equals ( 0 , count replicas ( namesystem , block ) live replicas ( ) ) ; assert equals ( 3 , count replicas ( namesystem , block ) corrupt replicas ( ) ) ; } finally { cluster shutdown ( ) ; } }


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


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


public list iterator < t > list iterator ( ) { throw new unsupported operation exception ( ) ; }


public void anytype 3 test ( ) { / / todo : test anytype 3 }


checks that the two values are equal , and that their hashcodes are equal

private void assert equals ( object a , object b ) { if ( ! a equals ( b ) ) throw new gdx runtime exception ( a get class ( ) get simple name ( ) + " equals ( ) failed : \ n " + a + " \ n ! = \ n " + b ) ; if ( ! b equals ( a ) ) throw new gdx runtime exception ( a get class ( ) get simple name ( ) + " equals ( ) failed ( not symmetric ) : \ n " + b + " \ n ! = \ n " + a ) ; if ( a hash code ( ) ! = b hash code ( ) ) throw new gdx runtime exception ( a get class ( ) get simple name ( ) + " hash code ( ) failed : \ n " + a + " \ n ! = \ n " + b ) ; }


regression test : error on clear maybe dirty value same as the previous test , but the second evaluation is keep going , which should cause an access of the children of top key

public void incomplete direct deps are cleared before keep going ( ) throws exception { initialize tester ( ) ; count down latch slow start = new count down latch ( 1 ) ; count down latch error finish = new count down latch ( 1 ) ; sky key error key = graph tester to sky key ( " error " ) ; tester get or create ( error key ) set builder ( new chained function ( / * notify start = * / null , / * wait to finish = * / slow start , / * notify finish = * / error finish , / * wait for exception = * / false , / * value = * / null , / * deps = * / immutable list < sky key > of ( ) ) ) ; sky key slow key = graph tester to sky key ( " slow " ) ; tester get or create ( slow key ) set builder ( new chained function ( / * notify start = * / slow start , / * wait to finish = * / error finish , / * notify finish = * / null , / * wait for exception = * / true , new string value ( " slow " ) , / * deps = * / immutable list < sky key > of ( ) ) ) ; sky key mid key = graph tester to sky key ( " mid " ) ; tester get or create ( mid key ) add dependency ( slow key ) set computed value ( copy ) ; sky key top key = graph tester to sky key ( " top " ) ; tester get or create ( top key ) add dependency ( mid key ) add dependency ( error key ) set computed value ( concatenate ) ; / / slow key starts - > error key finishes , written to graph - > slow key finishes & ( visitor aborts ) / / - > top key builds evaluation result < string value > result = tester eval ( / * keep going = * / false , top key ) ; assert that evaluation result ( result ) has singleton error that ( top key ) ; / / make sure mid key didn ' t finish building assert that ( tester get existing value ( mid key ) ) is null ( ) ; / / give slow key a nice ordinary builder tester get or create ( slow key , / * mark as modified = * / false ) set builder ( null ) set constant value ( new string value ( " slow " ) ) ; / / put mid key into the graph it won ' t have a reverse dependence on top key tester eval and get ( / * keep going = * / false , mid key ) ; / / top key should not access mid key as if it were already registered as a dependency / / we don ' t invalidate errors , but because top key wasn ' t actually written to the graph last / / build , it should be rebuilt here tester eval ( / * keep going = * / true , top key ) ; }


perform { @ link publishable http resource # do check ( rest client , action listener ) do check } against the { @ code resource } that throws an exception and assert that it returns { @ code on failure ( ) } when performing a { @ code delete } rather than the more common { @ code get }

protected void assert check as delete with exception ( final publishable http resource resource , final string resource base path , final string resource name ) { final string endpoint = concatenate endpoint ( resource base path , resource name ) ; final response exception response exception = response exception ( " delete " , endpoint , failed check status ( ) ) ; final exception e = random from ( new i o exception ( " expected " ) , new runtime exception ( " expected " ) , response exception ) ; final request request = new request ( " delete " , endpoint ) ; add parameters ( request , delete parameters ( resource get default parameters ( ) ) ) ; when perform request async with ( client , request , e ) ; resource do check ( client , wrap mock listener ( check listener ) ) ; verify check listener ( null ) ; }


add a leaf node update node counter & amp ; rack counter if necessary

public void add ( node node ) { if ( node = = null ) return ; int new depth = node base location to depth ( node get network location ( ) ) + 1 ; netlock write lock ( ) lock ( ) ; try { if ( node instanceof inner node ) { throw new illegal argument exception ( " not allow to add an inner node : " + node base get path ( node ) ) ; } if ( ( depth of all leaves ! = - 1 ) & & ( depth of all leaves ! = new depth ) ) { log error ( " error : can ' t add leaf node { } at depth { } to topology : { } \ n " , node base get path ( node ) , new depth , this ) ; throw new invalid topology exception ( " failed to add " + node base get path ( node ) + " : you cannot have a rack and a non - rack node at the same " + " level of the network topology " ) ; } node rack = get node for network location ( node ) ; if ( rack ! = null & & ! ( rack instanceof inner node ) ) { throw new illegal argument exception ( " unexpected data node " + node to string ( ) + " at an illegal network location " ) ; } if ( cluster map add ( node ) ) { log info ( " adding a new node : " + node base get path ( node ) ) ; if ( rack = = null ) { increment racks ( ) ; } if ( depth of all leaves = = - 1 ) { depth of all leaves = node get level ( ) ; } } log debug ( " network topology became : \ n { } " , this ) ; } finally { netlock write lock ( ) unlock ( ) ; } }


choose the next { @ link checkpoint trigger request request } to execute based on the provided candidate and the current state acquires a lock and may update the state

private optional < checkpoint trigger request > choose request to execute ( boolean is triggering , long last completion ms ) { if ( is triggering | | queued requests is empty ( ) | | number of cleaning checkpoints supplier get ( ) > max concurrent checkpoint attempts ) { return optional empty ( ) ; } if ( pending checkpoints size supplier get ( ) > = max concurrent checkpoint attempts ) { return optional of ( queued requests first ( ) ) filter ( checkpoint trigger request : : is force ) map ( unused - > queued requests poll first ( ) ) ; } checkpoint trigger request first = queued requests first ( ) ; if ( ! first is force ( ) & & first is periodic ) { long next trigger delay millis = next trigger delay millis ( last completion ms ) ; if ( next trigger delay millis > 0 ) { queued requests poll first ( ) complete exceptionally ( new checkpoint exception ( minimum time between checkpoints ) ) ; reschedule trigger accept ( next trigger delay millis ) ; return optional empty ( ) ; } } return optional of ( queued requests poll first ( ) ) ; }


child class implements this method to realize { @ code array ( ) }

abstract short [ ] protected array ( ) ;


returns the unique id of this { @ code transformation }


public get pet by id oper req spec ( consumer < request spec builder > req spec customizer ) { req spec customizer accept ( req spec ) ; return this ; }


public org elasticsearch action admin indices shrink resize response shrink ( org elasticsearch action admin indices shrink resize request resize request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( resize request , indices request converters : : shrink , options , org elasticsearch action admin indices shrink resize response : : from x content , empty set ( ) ) ; }


test that server defaults are updated on the client after cache expiration

public void test server defaults with minimal caching ( ) throws exception { / / create cluster with an explicit block size param configuration cluster conf = new hdfs configuration ( ) ; long original block size = dfs block size default * 2 ; cluster conf set long ( dfs block size key , original block size ) ; mini d f s cluster cluster = new mini d f s cluster builder ( cluster conf ) num data nodes ( 0 ) build ( ) ; cluster wait active ( ) ; / / set a spy namesystem inside the namenode and return it f s namesystem spy namesystem = name node adapter spy on namesystem ( cluster get name node ( ) ) ; inet socket address name node addr = cluster get name node ( ) get name node address ( ) ; try { / / create a dfs client and set a minimal validity interval configuration client conf = new hdfs configuration ( ) ; / / invalidate cache in at most 1 ms , see dfs client # get server defaults client conf set long ( dfs client server defaults validity period ms key , 0l ) ; d f s client dfs client = new d f s client ( name node addr , client conf ) ; fs server defaults defaults = dfs client get server defaults ( ) ; assert equals ( original block size , defaults get block size ( ) ) ; / / update the namenode with a new fs server defaults long updated default block size = dfs block size default * 3 ; fs server defaults new defaults = new fs server defaults ( updated default block size , defaults get bytes per checksum ( ) , defaults get write packet size ( ) , defaults get replication ( ) , defaults get file buffer size ( ) , defaults get encrypt data transfer ( ) , defaults get trash interval ( ) , defaults get checksum type ( ) , defaults get key provider uri ( ) , defaults get default storage policy id ( ) ) ; do return ( new defaults ) when ( spy namesystem ) get server defaults ( ) ; / / verify that the value is updated correctly wait for 3 seconds generic test utils wait for ( ( ) - > { try { fs server defaults curr def = dfs client get server defaults ( ) ; return ( curr def get block size ( ) = = updated default block size ) ; } catch ( i o exception e ) { / / do nothing ; return false ; } } , 1 , 3000 ) ; } finally { cluster shutdown ( ) ; } }


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


returns an immutable multiset entry with the specified element and count the entry will be serializable if { @ code e } is

public static < e > multiset entry < e > immutable entry ( @ nullable decl e e , int n ) { return new immutable entry < e > ( e , n ) ; }


markrelease do nothing ; we have entire buffer

public final int mark ( ) { return - 1 ; }


not - null value ; ensure this value is available before it is saved to the database

public void set text ( @ not null string text ) { this text = text ; }


connects the java side of an ml process to the named pipes that connect it to the c + + side , and starts tailing the c + + logs stores references to all the streams except the state persistence stream

public void start ( executor service executor service ) throws i o exception { process pipes connect log stream ( ) ; cpp log handler set ( process pipes get log stream handler ( ) ) ; log tail future = executor service submit ( ( ) - > { try ( cpp log message handler h = cpp log handler get ( ) ) { h tail stream ( ) ; } catch ( i o exception e ) { if ( process killed = = false ) { logger error ( new parameterized message ( " [ { } ] error tailing { } process logs " , job id , get name ( ) ) , e ) ; } } finally { detect crash ( ) ; } } ) ; process pipes connect other streams ( ) ; if ( process pipes get process in stream ( ) is present ( ) ) { process in stream set ( new buffered output stream ( process pipes get process in stream ( ) get ( ) ) ) ; this record writer set ( new length encoded writer ( process in stream get ( ) ) ) ; } process out stream set ( process pipes get process out stream ( ) or else ( null ) ) ; process restore stream set ( process pipes get restore stream ( ) or else ( null ) ) ; }


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

public single < client > rx test client model ( client body , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate test client model ( body , auth info , fut ) ) ) ; }


verify that the iterator is taken from a snapshot of the values

public void test iterator is snapshot ( ) throws throwable { / / set the counters all to 1 increment all counters ( ) ; / / take the snapshot final iterator < map entry < string , long > > it = statistics counters ( ) entry set ( ) iterator ( ) ; / / increment the counters increment all counters ( ) ; / / now assert that all the iterator values are of value 1 while ( it has next ( ) ) { map entry < string , long > next = it next ( ) ; assert that ( next get value ( ) ) described as ( " value of entry % s " , next ) is equal to ( 1 ) ; } }


< code > required uint 6 4 client protocol version = 3 ; < code > protocol version of class declaring the called method


validates file existence and returns the file

private static file validate and get file ( string path ) { file file = new file ( path ) ; if ( ! file exists ( ) ) { system err println ( " path ' " + file get absolute path ( ) + " ' does not exist " ) ; print usage then exit ( ) ; } return file ; }


specifies the border radius for the given corner

public builder radius res ( @ corner int corner , @ dimen res int res ) { check not built ( ) ; return radius px ( corner , m resource resolver resolve dimen size res ( res ) ) ; }


paint each of the given nodes that is inside of the clips

private void paint nodes ( list < g tree node > nodes , graphics g ) { tree cell renderer cell renderer = tree get cell renderer ( ) ; rectangle clip = g get clip bounds ( ) ; container parent = tree get parent ( ) ; int y offset = 0 ; try { for ( g tree node node : nodes ) { int row = tree get row for path ( node get tree path ( ) ) ; rectangle row bounds = tree get row bounds ( row ) ; row bounds = swing utilities convert rectangle ( tree , row bounds , parent ) ; if ( clip y > row bounds y + row bounds height ) { continue ; / / above our clip } if ( clip y + clip height < row bounds y + row bounds height ) { / / painted past the bounds of our clip return ; } component renderer = cell renderer get tree cell renderer component ( tree , node , true , true , node is leaf ( ) , row , false ) ; renderer set size ( renderer get preferred size ( ) ) ; / / move down the point in our graphics space into which we will paint y offset + = row bounds height ; g translate ( 0 , row bounds height ) ; renderer paint ( g ) ; } } finally { / / restore the point into graphics that we will paint g translate ( 0 , - y offset ) ; } }


handle the web socket handshake for the web socket specification < a href = " https : tools ietf orghtmldraft - ietf - hybi - thewebsocketprotocol - 00 " > hy bi version 0 and lower this standard is really a rehash of < a href = " https : tools ietf orghtmldraft - hixie - thewebsocketprotocol - 76 " > hixie - 76 and < a href = " https : tools ietf orghtmldraft - hixie - thewebsocketprotocol - 75 " > hixie - 75 browser request to the server : get demo http1 1 upgrade : web socket connection : upgrade host : example com origin : http : example com sec - web socket - protocol : chat , sample sec - web socket - key 1 : 4 @ 1 4 6 5 4 6x w % 0l 1 5 sec - web socket - key 2 : 12998 5 y3 1 p00 ^ n : ds [ 4u server response : http1 1 101 web socket protocol handshake upgrade : web socket connection : upgrade sec - web socket - origin : http : example com sec - web socket - location : ws : example comdemo sec - web socket - protocol : sample 8j k s ' y : g co , wxa -

protected full http response new handshake response ( full http request req , http headers headers ) { / / serve the web socket handshake request if ( ! req headers ( ) contains value ( http header names connection , http header values upgrade , true ) | | ! http header values websocket content equals ignore case ( req headers ( ) get ( http header names upgrade ) ) ) { throw new web socket server handshake exception ( " not a web socket handshake request : missing upgrade " , req ) ; } / / hixie 75 does not contain these headers while hixie 76 does boolean is hixie 7 6 = req headers ( ) contains ( http header names sec websocket key1 ) & & req headers ( ) contains ( http header names sec websocket key2 ) ; string origin = req headers ( ) get ( http header names origin ) ; / / throw before allocating full http response if ( origin = = null & & ! is hixie 7 6 ) { throw new web socket server handshake exception ( " missing origin header , got only " + req headers ( ) names ( ) , req ) ; } / / create the web socket handshake response full http response res = new default full http response ( http 1 1 , new http response status ( 101 , is hixie 7 6 ? " web socket protocol handshake " : " web socket protocol handshake " ) , req content ( ) alloc ( ) buffer ( 0 ) ) ; if ( headers ! = null ) { res headers ( ) add ( headers ) ; } res headers ( ) set ( http header names upgrade , http header values websocket ) set ( http header names connection , http header values upgrade ) ; / / fill in the headers and contents depending on handshake get method if ( is hixie 7 6 ) { / / new handshake get method with a challenge : res headers ( ) add ( http header names sec websocket origin , origin ) ; res headers ( ) add ( http header names sec websocket location , uri ( ) ) ; string subprotocols = req headers ( ) get ( http header names sec websocket protocol ) ; if ( subprotocols ! = null ) { string selected subprotocol = select subprotocol ( subprotocols ) ; if ( selected subprotocol = = null ) { if ( logger is debug enabled ( ) ) { logger debug ( " requested subprotocol ( s ) not supported : { } " , subprotocols ) ; } } else { res headers ( ) set ( http header names sec websocket protocol , selected subprotocol ) ; } } / / calculate the answer of the challenge string key 1 = req headers ( ) get ( http header names sec websocket key1 ) ; string key 2 = req headers ( ) get ( http header names sec websocket key2 ) ; int a = ( int ) ( long parse long ( beginning digit matcher ( key 1 ) replace all ( " " ) ) / beginning space matcher ( key 1 ) replace all ( " " ) length ( ) ) ; int b = ( int ) ( long parse long ( beginning digit matcher ( key 2 ) replace all ( " " ) ) / beginning space matcher ( key 2 ) replace all ( " " ) length ( ) ) ; long c = req content ( ) read long ( ) ; byte buf input = unpooled wrapped buffer ( new byte [ 16 ] ) set index ( 0 , 0 ) ; input write int ( a ) ; input write int ( b ) ; input write long ( c ) ; res content ( ) write bytes ( web socket util md 5 ( input array ( ) ) ) ; } else { / / old hixie 75 handshake get method with no challenge : res headers ( ) add ( http header names websocket origin , origin ) ; res headers ( ) add ( http header names websocket location , uri ( ) ) ; string protocol = req headers ( ) get ( http header names websocket protocol ) ; if ( protocol ! = null ) { res headers ( ) set ( http header names websocket protocol , select subprotocol ( protocol ) ) ; } } return res ; }


compute a vertex ' s successors < p > the default implementation compute this from the out - edges

public default collection < v > get successors ( v v ) { set < v > result = new linked hash set < > ( ) ; for ( e edge : get out edges ( v ) ) { result add ( edge get end ( ) ) ; } return result ; }


return whether this code unit has an automatic comment ( i e any memory reference from this code unit has a function defined at the reference ' s to address , or if the to address is a pointer )

public boolean has automatic ( ) { return ( display comment arrays [ my automatic ] ! = null ) & & ( display comment arrays [ my automatic ] length > 0 ) ; }


public string read output file ( configuration conf ) throws i o exception { file system local fs = file system get local ( conf ) ; path file = new path ( output dir , " part - r - 00000 " ) ; return utils for tests slurp hadoop ( file , local fs ) ; }


returns more verbose description of the object which include type information


public static void delete state store ( class < ? extends state store driver > driver class ) throws i o exception { if ( state store file base impl class is assignable from ( driver class ) ) { string working directory = system get property ( " user dir " ) ; file dir = new file ( working directory + " / statestore " ) ; if ( dir exists ( ) ) { file utils clean directory ( dir ) ; } } }


returns { @ code true } if a subsequent call to { @ link # next ( ) } returns a { @ link chunk } object ;

public boolean has next ( ) { return data ! = null | | ! initialized ; }


create a { @ link dispatcher servlet } ( or other kind of { @ link framework servlet } - derived dispatcher ) with the specified { @ link web application context } note : this allows for any { @ link framework servlet } subclass as of 4 2 3 previously , it insisted on returning a { @ link dispatcher servlet } or subclass thereof

protected framework servlet create dispatcher servlet ( web application context servlet app context ) { return new dispatcher servlet ( servlet app context ) ; }


< code > repeated org apache dubbo metadata definition protobuf model phone number phone = 8 ; < code >

public builder add phone ( org apache dubbo metadata definition protobuf model google p b phone number builder builder for value ) { if ( phone builder = = null ) { ensure phone is mutable ( ) ; phone add ( builder for value build ( ) ) ; on changed ( ) ; } else { phone builder add message ( builder for value build ( ) ) ; } return this ; }


return an optional message code to use when this is unsatisfied

default optional < string > get code ( ) { return optional empty ( ) ; }


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


public void configure ( ) throws exception { / / main route from ( " { { entry } } " ) split ( ) body ( ) to ( " { { endpoint } } " ) ; }


removes the items between the specified indices , inclusive

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


optional optimization : graph may use internal knowledge to filter out keys in { @ code deps } that have not been recomputed since the last computation of { @ code parent } when determining if { @ code parent } needs to be re - evaluated , this may be used to avoid unnecessary graph accesses returns deps that may have new values since the node of { @ code parent } was last computed , and therefore which may force re - evaluation of the node of { @ code parent }

deps report analyze deps doneness ( sky key parent , collection < sky key > deps ) throws interrupted exception ;


use alternate mutation accessors instead

public java util map < string , phone number > get mutable double map ( ) { return internal get mutable double map ( ) get mutable map ( ) ; }


public model and view get model and view ( final http servlet request request , final boolean is success , final web application service service , final class owner class ) { val view = get view ( request , is success , service , owner class ) ; return new model and view ( view ) ; }


access to request body matchers using a < a href = " https : github comjayway json path " > json path expression to inspect a specific subset of the body and a hamcrest match for asserting the value found at the json path

public static < t > request matcher json path ( string expression , matcher < ? super t > matcher ) { return new json path request matchers ( expression ) value ( matcher ) ; }


flink - 6612 tests that we can release a locked state handles in the zoo keeper state handle store

public void test release ( ) throws exception { final testing long state handle helper long state storage = new testing long state handle helper ( ) ; zoo keeper state handle store < long > zk store = new zoo keeper state handle store < > ( zookeeper get client ( ) , long state storage ) ; final string path = " / state " ; zk store add and lock ( path , 42l ) ; final string lock path = zk store get lock path ( path ) ; stat stat = zookeeper get client ( ) check exists ( ) for path ( lock path ) ; assert not null ( " expected an existing lock " , stat ) ; zk store release ( path ) ; stat = zookeeper get client ( ) check exists ( ) for path ( path ) ; / / release should have removed the lock child assert equals ( " expected no lock nodes as children " , 0 , stat get num children ( ) ) ; zk store release and try remove ( path ) ; stat = zookeeper get client ( ) check exists ( ) for path ( path ) ; assert null ( " state node should have been removed " , stat ) ; }


set whether to let jackson find available modules via the jdk service loader , based on meta - inf metadata in the classpath if this mode is not set , spring ' s jackson 2 object mapper builder itself will try to find the jsr - 310 and joda - time support modules on the classpath - provided that java 8 and joda - time themselves are available , respectively

public jackson 2 object mapper builder find modules via service loader ( boolean find modules ) { this find modules via service loader = find modules ; return this ; }


protected int get relative x ( native event e , canvas element target ) { float x scale ratio = target get width ( ) * 1f / target get client width ( ) ; / / correct for canvas css scaling return math round ( x scale ratio * ( e get client x ( ) - target get absolute left ( ) + target get scroll left ( ) + target get owner document ( ) get scroll left ( ) ) ) ; }


convert a path to a cananonical form all instances of " " and " " are factored out null is returned if the path tries to above its root

public static string canonical ( string path ) { if ( path = = null | | path length ( ) = = 0 ) { return path ; } int end = path length ( ) ; int start = path last index of ( ' / ' , end ) ; search : while ( end > 0 ) { switch ( end - start ) { case 2 : / / possible single dot if ( path char at ( start + 1 ) ! = ' ' ) { break ; } break search ; case 3 : / / possible double dot if ( path char at ( start + 1 ) ! = ' ' | | path char at ( start + 2 ) ! = ' ' ) { break ; } break search ; } end = start ; start = path last index of ( ' / ' , end - 1 ) ; } / / if we have checked the entire string if ( start > = end ) { return path ; } string builder buf = new string builder ( path ) ; int del start = - 1 ; int del end = - 1 ; int skip = 0 ; while ( end > 0 ) { switch ( end - start ) { case 2 : / / possible single dot if ( buf char at ( start + 1 ) ! = ' ' ) { if ( skip > 0 & & - - skip = = 0 ) { del start = start > = 0 ? start : 0 ; if ( del start > 0 & & del end = = buf length ( ) & & buf char at ( del end - 1 ) = = ' ' ) { del start + + ; } } break ; } if ( start < 0 & & buf length ( ) > 2 & & buf char at ( 1 ) = = ' / ' & & buf char at ( 2 ) = = ' / ' ) { break ; } if ( del end < 0 ) { del end = end ; } del start = start ; if ( del start < 0 | | del start = = 0 & & buf char at ( del start ) = = ' / ' ) { del start + + ; if ( del end < buf length ( ) & & buf char at ( del end ) = = ' / ' ) { del end + + ; } break ; } if ( end = = buf length ( ) ) { del start + + ; } end = start - - ; while ( start > = 0 & & buf char at ( start ) ! = ' / ' ) { start - - ; } continue ; case 3 : / / possible double dot if ( buf char at ( start + 1 ) ! = ' ' | | buf char at ( start + 2 ) ! = ' ' ) { if ( skip > 0 & & - - skip = = 0 ) { del start = start > = 0 ? start : 0 ; if ( del start > 0 & & del end = = buf length ( ) & & buf char at ( del end - 1 ) = = ' ' ) { del start + + ; } } break ; } del start = start ; if ( del end < 0 ) { del end = end ; } skip + + ; end = start - - ; while ( start > = 0 & & buf char at ( start ) ! = ' / ' ) { start - - ; } continue ; default : if ( skip > 0 & & - - skip = = 0 ) { del start = start > = 0 ? start : 0 ; if ( del end = = buf length ( ) & & buf char at ( del end - 1 ) = = ' ' ) { del start + + ; } } } / / do the delete if ( skip < = 0 & & del start > = 0 & & del end > = del start ) { buf delete ( del start , del end ) ; del start = del end = - 1 ; } end = start - - ; while ( start > = 0 & & buf char at ( start ) ! = ' / ' ) { start - - ; } } / / too many if ( skip > 0 ) { return null ; } / / do the delete if ( del end > = 0 ) { buf delete ( del start , del end ) ; } return buf to string ( ) ; }


returns the model index of the given item when filtered , this is the index is the larger , set of data ; when unfiltered , this index is the same as that returned by { @ link # get model index ( object ) } this operation will be o ( n ) unless the implementation is sorted , in which case the operation is o ( log n ) , as it uses a binary search

public int get model index ( row object t ) ;


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


public void signal ( ) { try { files delete ( paths get ( stop job marker file ) ) ; } catch ( final i o exception e ) { throw new runtime exception ( e ) ; } }


removes the job ' s execution ' s reference to this job , if the job has an associated execution subclasses may override to provide custom implementations

protected void remove execution link ( job entity job entity ) { if ( job entity get execution id ( ) ! = null ) { execution entity execution = get execution entity manager ( ) find by id ( job entity get execution id ( ) ) ; if ( execution ! = null ) { execution get jobs ( ) remove ( job entity ) ; } } }


adds the keyvalue pair this object represents to the given map of environment variables the value of the entry is expanded with the given { @ code variables }

public void add env entry ( cc toolchain variables variables , immutable map builder < string , string > env builder ) throws expansion exception { string builder value = new string builder ( ) ; for ( string chunk chunk : value chunks ) { value append ( chunk expand ( variables ) ) ; } env builder put ( key , value to string ( ) ) ; }


asserts that { @ code transformation } is vertical with the given value of { @ code x } includes assertions about all the public instance methods of { @ link linear transformation } , including assertions that { @ link linear transformation # slope } and { @ link linear transformation # transform } throw as expected

static void assert vertical linear transformation ( linear transformation transformation , double x ) { assert that ( transformation is horizontal ( ) ) is false ( ) ; assert that ( transformation is vertical ( ) ) is true ( ) ; assert that ( transformation inverse ( ) is horizontal ( ) ) is true ( ) ; assert that ( transformation inverse ( ) is vertical ( ) ) is false ( ) ; try { transformation transform ( 0 0 ) ; fail ( " expected illegal state exception " ) ; } catch ( illegal state exception expected ) { } assert that ( transformation inverse ( ) transform ( - 1 0 ) ) is within ( allowed error ) of ( x ) ; assert that ( transformation inverse ( ) transform ( 1 0 ) ) is within ( allowed error ) of ( x ) ; try { transformation slope ( ) ; fail ( " expected illegal state exception " ) ; } catch ( illegal state exception expected ) { } assert that ( transformation inverse ( ) slope ( ) ) is within ( allowed error ) of ( 0 0 ) ; assert that ( transformation inverse ( ) ) is same instance as ( transformation inverse ( ) ) ; assert that ( transformation inverse ( ) inverse ( ) ) is same instance as ( transformation ) ; }


prepends the given { @ link resource decoder } into the list of all available { @ link resource decoder } s so that it is attempted before all later and default { @ link resource decoder } s for the given types this method allows you to replace the default { @ link resource decoder } because it ensures the registered { @ link resource decoder } will run first you can use the { @ link resource decoder # handles ( object , options ) } to fall back to the default { @ link resource decoder } s if you only want to change the default functionality for certain types of data

public < data , t resource > registry prepend ( @ non null class < data > data class , @ non null class < t resource > resource class , @ non null resource decoder < data , t resource > decoder ) { prepend ( bucket prepend all , data class , resource class , decoder ) ; return this ; }


set this to true to draw the pie center empty

public void set draw hole enabled ( boolean enabled ) { this m draw hole = enabled ; }


customize the { @ link hint strategy table } which contains hint strategies supported by flink

public static hint strategy table create hint strategy table ( ) { return hint strategy table builder ( ) / / configure to always throw when we encounter any hint errors / / ( either the non - registered hint or the hint format ) error handler ( litmus throw ) hint strategy ( flink hints hint name options , hint strategy builder ( hint predicates table scan ) option checker ( ( hint , error handler ) - > error handler check ( hint kv options size ( ) > 0 , " hint [ { } ] only support non empty key value options " , hint hint name ) ) build ( ) ) build ( ) ; }


to formatting string all " | " in { @ link # resource } will be replaced with " " , format is : < br > < code > timestamp | resource | pass qps | block qps | success qps | exception qps | rt | occupied pass qps < code >

public string to thin string ( ) { string builder sb = new string builder ( ) ; sb append ( timestamp ) append ( " | " ) ; string legal name = resource replace all ( " \ \ | " , " " ) ; sb append ( legal name ) append ( " | " ) ; sb append ( pass qps ) append ( " | " ) ; sb append ( block qps ) append ( " | " ) ; sb append ( success qps ) append ( " | " ) ; sb append ( exception qps ) append ( " | " ) ; sb append ( rt ) append ( " | " ) ; sb append ( occupied pass qps ) append ( " | " ) ; sb append ( concurrency ) append ( " | " ) ; sb append ( classification ) ; return sb to string ( ) ; }


bytes to preallocate on the " request " breaker for this aggregation the goal is to request a few more bytes than we expect to use at first to cut down on contention on the " request " breaker when we are constructing the aggs underestimating what we allocate up front will fail to accomplish the goal overestimating will cause requests to fail for no reason

public long bytes to preallocate ( ) { return default preallocation ; }


tests that if a non idempotent operation fails at every attempt after socket timeout exception , then socket timeout exception is thrown

public void test client retries idempotent op with socket timeout exception fails ( ) throws exception { configuration conf = new configuration ( ) ; conf set int ( common configuration keys public kms client failover max retries key , 2 ) ; final string key name = " test " ; final string exception message = " p 1 exception message " ; k m s client provider p 1 = mock ( k m s client provider class ) ; exception original ex = new socket timeout exception ( exception message ) ; when ( p 1 get key versions ( mockito any string ( ) ) ) then throw ( original ex ) ; k m s client provider p 2 = mock ( k m s client provider class ) ; when ( p 2 get key versions ( mockito any string ( ) ) ) then throw ( new socket timeout exception ( " p 2 exception message " ) ) ; when ( p 1 get k m s url ( ) ) then return ( " p 1 " ) ; when ( p 2 get k m s url ( ) ) then return ( " p 2 " ) ; load balancing k m s client provider kp = new load balancing k m s client provider ( new k m s client provider [ ] { p 1 , p 2 } , 0 , conf ) ; exception intercepted ex = intercept ( socket timeout exception class , " socket timeout exception : " + exception message , ( ) - > kp get key versions ( key name ) ) ; assert equals ( original ex , intercepted ex ) ; verify ( p 1 , mockito times ( 2 ) ) get key versions ( mockito eq ( key name ) ) ; verify ( p 2 , mockito times ( 1 ) ) get key versions ( mockito eq ( key name ) ) ; }


sets the output mode for frames rendered by the decoder

public void set output mode ( @ c video output mode int output mode ) { this output mode = output mode ; }


populates a multiset by reading an input stream , as part of deserialization see { @ link # write multiset } for the data format the number of distinct elements is determined by a prior call to { @ link # read count }

static < e > void populate multiset ( multiset < e > multiset , object input stream stream , int distinct elements ) throws i o exception , class not found exception { for ( int i = 0 ; i < distinct elements ; i + + ) { @ suppress warnings ( " unchecked " ) / / reading data stored by write multiset e element = ( e ) stream read object ( ) ; int count = stream read int ( ) ; multiset add ( element , count ) ; } }


returns a new array that appends { @ code element } to { @ code array }

public static < t > t [ ] concat ( t [ ] array , @ nullable t element ) { t [ ] result = arrays copy of ( array , array length + 1 ) ; result [ array length ] = element ; return result ; }


returns the closest highlight object of the given objects based on the touch position inside the chart

protected abstract highlight get closest highlight ( int index , float x , float y ) ;


normalize the path and , if it is absolute , make it relative ( e g , foobar becomes foobar )

private static path fragment relativize ( string path ) { path fragment entry path = path fragment create ( path ) ; if ( entry path is absolute ( ) ) { entry path = entry path to relative ( ) ; } return entry path ; }


return a { @ link java util set } for iterating over and interacting with all keys in the array map < b > note : < b > this is a fairly inefficient way to access the array contents , it requires generating a number of temporary objects

public set < k > key set ( ) { return get collection ( ) get key set ( ) ; }


sets the maximum progress that the animation will end at when playing or looping

public void set max progress ( @ float range ( from = 0f , to = 1f ) float end progress ) { lottie drawable set max progress ( end progress ) ; }


filters all exceptions that match the predicate by applying the given response provider function for instance , the following example creates a filter that returns a 500 response status when an { @ code illegal state exception } occurs < pre class = " code " > router function & lt ; server response & gt ; filtered route = router functions route ( ) get ( " user " , this : : list users ) on error ( e - > e instanceof illegal state exception , ( e , request ) - > server response status ( http status internal server error ) build ( ) ) build ( ) ;

builder on error ( predicate < ? super throwable > predicate , bi function < ? super throwable , server request , mono < server response > > response provider ) ;


the interface used by clients to remove an existing reservation

public abstract reservation delete response delete reservation ( reservation delete request request ) throws yarn exception , i o exception ;


creates a rule instance that initiates & # 064 ; mocks and is a { @ link test rule } use this method only when you need to explicitly need a { @ link test rule } , for example if you need to compose multiple rules using a { @ link org junit rules rule chain } otherwise , always prefer { @ link # rule ( ) } see { @ link mockito rule }

public static mockito test rule test rule ( object test instance ) { return new j unit test rule ( plugins get mockito logger ( ) , strictness warn , test instance ) ; }


adds an enum value proto annotation that , when set , overrides the default < b > enum < b > value serializationdeserialization of this adapter for example , if you add the ' { @ code serialized value } ' annotation and you define an enum in your proto like the one below : enum my enum { unknown = 0 ; client app id = 1 [ ( serialized value ) = " app id " ] ; two = 2 [ ( serialized value ) = " 2 " ] ; } the adapter will serialize the value { @ code client app id } as " { @ code app id } " and the value { @ code two } as " { @ code 2 } " this works for both serialization and deserialization note that you need to set the enum serialization of this adapter to { @ link enum serialization # name } , otherwise these annotations will be ignored

public builder add serialized enum value extension ( extension < enum value options , string > serialized enum value extension ) { serialized enum value extensions add ( check not null ( serialized enum value extension ) ) ; return this ; }


returns the field factorys on a given row

public field factory [ ] get factorys ( int row ) { return ( rows get ( row ) ) get factorys ( ) ; }


returns the hash code for this multimap the hash code of a multimap is defined as the hash code of the map view , as returned by { @ link multimap # as map }

public int hash code ( ) { return as map ( ) hash code ( ) ; }


when a session is connected through a higher - level protocol it has a chance to use heartbeat management to shut down sessions that are too slow to send or receive messages however , after a web socket session is established and before the higher level protocol is fully connected there is a possibility for sessions to hang this method checks and closes any sessions that have been connected for more than 60 seconds without having received a single message

private void check sessions ( ) { long current time = system current time millis ( ) ; if ( ! is running ( ) | | ( current time - this last session check time < get time to first message ( ) ) ) { return ; } if ( this session check lock try lock ( ) ) { try { for ( web socket session holder holder : this sessions values ( ) ) { if ( holder has handled messages ( ) ) { continue ; } long time since created = current time - holder get create time ( ) ; if ( time since created < get time to first message ( ) ) { continue ; } web socket session session = holder get session ( ) ; if ( logger is info enabled ( ) ) { logger info ( " no messages received after " + time since created + " ms " + " closing " + holder get session ( ) + " " ) ; } try { this stats increment no messages received count ( ) ; session close ( close status session not reliable ) ; } catch ( throwable ex ) { if ( logger is warn enabled ( ) ) { logger warn ( " failed to close unreliable " + session , ex ) ; } } } } finally { this last session check time = current time ; this session check lock unlock ( ) ; } } }