public static void remove config info 4 tag ( string data id , string group , string tenant , string tag ) { file utils delete quietly ( target tag file ( data id , group , tenant , tag ) ) ; }


returns the { @ link function tag } for the tag id given

private function tag get tag ( long id , program program ) throws i o exception { function manager d b function manager d b = ( function manager d b ) program get function manager ( ) ; function tag tag = function manager d b get function tag manager ( ) get function tag ( id ) ; return tag ; }


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


convert the segments to multiple value object

object convert ( string [ ] segments , int size , class < ? > target type , class < ? > element type ) ;


set a fully qualified static field name to retrieve , e g " example my example class my example field " convenient alternative to specifying target class and target field

public void set static field ( string static field ) { this static field = string utils trim all whitespace ( static field ) ; }


reset the changed bit checked via { @ link # is state changed ( ) } to { @ code false }

public void reset state changed ( ) { this state changed = false ; }


waits for the value returned by the supplier to be non - null if the timeout period expires , then null will be returned most of the < code > wait xyz ( ) < code > methods throw an { @ link assertion failed error } if the timeout period expires this method allows you to setup a longer wait period by repeatedly calling this method < p > most clients should use { @ link # wait for value ( supplier ) }

public static < t > t wait for value without failing ( supplier < t > supplier ) { return wait for value ( supplier , null , false / * fail on timeout * / ) ; }


static object unary op ( token kind op , object x ) throws eval exception { switch ( op ) { case not : return ! starlark truth ( x ) ; case minus : if ( x instanceof starlark int ) { return starlark int uminus ( ( starlark int ) x ) ; / / - int } else if ( x instanceof starlark float ) { return starlark float of ( - ( ( starlark float ) x ) to double ( ) ) ; / / - float } break ; case plus : if ( x instanceof starlark int ) { return x ; / / + int } else if ( x instanceof starlark float ) { return x ; / / + float } break ; case tilde : if ( x instanceof starlark int ) { return starlark int bitnot ( ( starlark int ) x ) ; / / ~ int } break ; default : / * fall through * / } throw starlark errorf ( " unsupported unary operation : % s % s " , op , starlark type ( x ) ) ; }


public int read ( byte [ ] b ) throws i o exception { return read ( b , 0 , b length ) ; }


visit a parse tree produced by the { @ code expr } labeled alternative in { @ link painless parser # dstatement }

t visit expr ( painless parser expr context ctx ) ;


public boolean is read only ( ) throws s q l exception { if ( throw exception ) { throw new s q l exception ( ) ; } return false ; }


returns the currently selected row objects or an empty list if there is no selection

public list < row object > get selected items ( ) { int [ ] rows = table get selected rows ( ) ; if ( rows length = = 0 ) { return collections empty list ( ) ; } list < row object > list = new array list < > ( rows length ) ; for ( int row : rows ) { list add ( text filter model get row object ( row ) ) ; } return list ; }


get petfind by status : finds pets by status multiple status values can be provided with comma separated strings

default mono < response entity < flux < pet > > > find pets by status ( @ not null @ api param ( value = " status values that need to be considered for filter " , required = true , allowable values = " available , pending , sold " ) @ valid @ request param ( value = " status " , required = true ) list < string > status , @ api ignore final server web exchange exchange ) { return get delegate ( ) find pets by status ( status , exchange ) ; }


should each { @ link org elasticsearch search search hit } be returned with an explanation of the hit ( ranking )

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


parses raw load balancing config and returns a { @ link config or error } that contains a { @ link cds config } if parsing is successful

static config or error parse load balancing config policy ( map < string , ? > raw load balancing policy config ) { try { string cluster = json util get string ( raw load balancing policy config , cluster key ) ; return config or error from config ( new cds config ( cluster ) ) ; } catch ( runtime exception e ) { return config or error from error ( status from throwable ( e ) with description ( " failed to parse cds lb config : " + raw load balancing policy config ) ) ; } }


uploads data from the given input stream to the blob server

blob key put input stream ( @ nullable job i d job id , input stream input stream , blob key blob type blob type ) throws i o exception { if ( this socket is closed ( ) ) { throw new illegal state exception ( " blob client is not connected " + " client has been shut down or encountered an error before " ) ; } check not null ( input stream ) ; if ( log is debug enabled ( ) ) { log debug ( " put blob stream to { } " , socket get local socket address ( ) ) ; } try ( blob output stream os = new blob output stream ( job id , blob type , socket ) ) { i o utils copy bytes ( input stream , os , buffer size , false ) ; return os finish ( ) ; } catch ( throwable t ) { blob utils close silently ( socket , log ) ; throw new i o exception ( " put operation failed : " + t get message ( ) , t ) ; } }


finds the index of the entry lower than v

public int lower ( t v ) { return boundary lower apply ( find ( v ) ) ; }


set the name of this parameter in the operation signature

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


manually run this to write binary snapshot data remove @ ignore to run

public void write monitoring source snapshot ( ) throws exception { file test folder = temp folder new folder ( ) ; long file mod time = long min value ; for ( int i = 0 ; i < 1 ; i + + ) { tuple 2 < file , string > file = create file and fill with data ( test folder , " file " , i , " this is test line " ) ; file mod time = file f 0 last modified ( ) ; } text input format format = new text input format ( new path ( test folder get absolute path ( ) ) ) ; final continuous file monitoring function < string > monitoring function = new continuous file monitoring function < > ( format , file processing mode process continuously , 1 , interval ) ; stream source < timestamped file input split , continuous file monitoring function < string > > src = new stream source < > ( monitoring function ) ; final abstract stream operator test harness < timestamped file input split > test harness = new abstract stream operator test harness < > ( src , 1 , 1 , 0 ) ; test harness open ( ) ; final throwable [ ] error = new throwable [ 1 ] ; final one shot latch latch = new one shot latch ( ) ; / / run the source asynchronously thread runner = new thread ( ) { @ override public void run ( ) { try { monitoring function run ( new dummy source context ( ) { @ override public void collect ( timestamped file input split element ) { latch trigger ( ) ; } @ override public void mark as temporarily idle ( ) { } } ) ; } catch ( throwable t ) { t print stack trace ( ) ; error [ 0 ] = t ; } } } ; runner start ( ) ; if ( ! latch is triggered ( ) ) { latch await ( ) ; } final operator subtask state snapshot ; synchronized ( test harness get checkpoint lock ( ) ) { snapshot = test harness snapshot ( 0l , 0l ) ; } operator snapshot util write state handle ( snapshot , " src / test / resources / monitoring - function - migration - test - " + file mod time + " - flink " + flink generate savepoint version + " - snapshot " ) ; monitoring function cancel ( ) ; runner join ( ) ; test harness close ( ) ; }


returns the cumulative number of block input operations for the { @ link action }

public optional < long > cumulative command execution block input operations ( ) { return get cumulative long ( spawn result - > spawn result get num block input operations ( ) ) ; }


gets type literal for the given { @ code class } instance

public static < t > type literal < t > get ( class < t > type ) { return new type literal < > ( type ) ; }


rename , expecting an exception to be thrown

protected void rename to failure ( path src , path dst ) throws i o exception { try { get store ( ) rename ( src , dst ) ; fail ( " expected failure renaming " + src + " to " + dst + " - but got success " ) ; } catch ( swift operation failed exception e ) { log debug ( " rename failed ( expected ) : " + e ) ; } catch ( file not found exception e ) { log debug ( " rename failed ( expected ) : " + e ) ; } }


a block upload has failed recorded it if there has been no previous failure

public void note upload failure ( final i o exception e ) { if ( block upload failure = = null ) { block upload failure = e ; } }


creates a { @ link data set } that represents the strings produced by reading the given file line wise this method is similar to { @ link # read text file ( string , string ) } , but it produces a data set with mutable { @ link string value } objects , rather than java strings string values can be used to tune implementations to be less object and garbage collection heavy the { @ link java nio charset charset } with the given name will be used to read the files

public data source < string value > read text file with value ( string file path , string charset name , boolean skip invalid lines ) { preconditions check not null ( file path , " the file path may not be null " ) ; text value input format format = new text value input format ( new path ( file path ) ) ; format set charset name ( charset name ) ; format set skip invalid lines ( skip invalid lines ) ; return new data source < > ( this , format , new value type info < > ( string value class ) , utils get call location name ( ) ) ; } / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - primitive input format / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


parses the a test result xml file into the corresponding protocol buffer

private test case parse xml to tree ( input stream xml stream ) throws test xml output parser exception { x m l stream reader parser = null ; try { parser = x m l input factory new instance ( ) create x m l stream reader ( xml stream ) ; while ( true ) { int event = parser next ( ) ; if ( event = = x m l stream constants end document ) { return null ; } / / first find the topmost node if ( event = = x m l stream constants start element ) { string element name = parser get local name ( ) ; if ( toplevel element names contains ( element name ) ) { test case result = parse test suite ( parser , element name ) ; return result ; } } } } catch ( x m l stream exception e ) { throw new test xml output parser exception ( e ) ; } catch ( number format exception e ) { / / the parser is definitely ! = null here throw new test xml output parser exception ( " number could not be parsed at " + parser get location ( ) get line number ( ) + " : " + parser get location ( ) get column number ( ) , e ) ; } catch ( uninitialized message exception e ) { / / this happens when the xml does not contain a field that is required / / in the protocol buffer throw new test xml output parser exception ( e ) ; } catch ( runtime exception e ) { / / seems like that an x n i exception can leak through , even though it is not / / specified anywhere / / / / it ' s a bad idea to refer to x n i exception directly because the xerces / / documentation says that it may not be available here soon ( and it / / results in a compile - time warning anyway ) , so we do it the roundabout / / way : check if the class name has something to do with xerces , and if / / so , wrap it in our own exception type , otherwise , let the stack / / unwinding continue string name = e get class ( ) get canonical name ( ) ; if ( name ! = null & & name contains ( " org apache xerces " ) ) { throw new test xml output parser exception ( e ) ; } else { throw e ; } } finally { if ( parser ! = null ) { try { parser close ( ) ; } catch ( x m l stream exception e ) { / / ignore errors during closure so that we do not interfere with an / / already propagating exception } } } }


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

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


public @ non null bitmap render ( @ non null context context , @ nullable point size ) { editor element image = editor element hierarchy get flip rotate ( ) ; rect f crop rect = editor element hierarchy get crop rect ( ) ; point output size = size ! = null ? size : get output size ( ) ; bitmap bitmap = bitmap create bitmap ( output size x , output size y , bitmap config argb 8888 ) ; try { canvas canvas = new canvas ( bitmap ) ; renderer context renderer context = new renderer context ( context , canvas , renderer context ready null , renderer context invalidate null ) ; rect f bitmap area = new rect f ( ) ; bitmap area right = bitmap get width ( ) ; bitmap area bottom = bitmap get height ( ) ; matrix view matrix = new matrix ( ) ; view matrix set rect to rect ( crop rect , bitmap area , matrix scale to fit fill ) ; renderer context set is editing ( false ) ; renderer context set blocking load ( true ) ; editor element overlay = editor element hierarchy get overlay ( ) ; overlay get flags ( ) set visible ( false ) set children visible ( false ) ; try { renderer context canvas matrix initial ( view matrix ) ; image draw ( renderer context ) ; } finally { overlay get flags ( ) reset ( ) ; } } catch ( exception e ) { bitmap recycle ( ) ; throw e ; } return bitmap ; }


public static < t > t register bean into application context ( final configurable application context application context , final class < t > bean clazz , final string bean id ) { val bean factory = application context get bean factory ( ) ; val provider = bean factory create bean ( bean clazz ) ; bean factory initialize bean ( provider , bean id ) ; bean factory autowire bean ( provider ) ; bean factory register singleton ( bean id , provider ) ; return provider ; }


make the name of this filter available to subclasses analogous to generic servlet ' s { @ code get servlet name ( ) } takes the filter config ' s filter name by default if initialized as bean in a spring application context , it falls back to the bean name as defined in the bean factory

protected string get filter name ( ) { return ( this filter config ! = null ? this filter config get filter name ( ) : this bean name ) ; }


get the proxy of { @ link dubbo metadata service } if possible

public dubbo metadata service get proxy ( list < service instance > service instances ) { dubbo metadata service dubbo metadata service = null ; / / attempt to get the proxy of dubbo metadata service in maximum times int attempts = service instances size ( ) ; for ( int i = 0 ; i < attempts ; i + + ) { optional < service instance > service instance = select ( service instances ) ; if ( service instance is present ( ) ) { list < url > dubbo metadata service u r ls = get dubbo metadata service u r ls ( service instance get ( ) ) ; for ( url dubbo metadata service u r l : dubbo metadata service u r ls ) { dubbo metadata service = create proxy if absent ( dubbo metadata service u r l ) ; if ( dubbo metadata service ! = null ) { return dubbo metadata service ; } } } } return dubbo metadata service ; }


public boolean is constant ( ) { return false ; }


upgrade from l dir - based layout to 3 2x 3 2 block id - based layout ( - 57 ) - - change described in hdfs - 6482 and hdfs - 8791

public void test upgrade to id based layout ( ) throws i o exception { test d f s upgrade from image upgrade = new test d f s upgrade from image ( ) ; upgrade unpack storage ( hadoop24 datanode , hadoop datanode dir txt ) ; configuration conf = new configuration ( test d f s upgrade from image upgrade conf ) ; conf set ( d f s config keys dfs datanode data dir key , generic test utils get test dir ( " dfs " + file separator + " data " ) to u r i ( ) to string ( ) ) ; conf set ( d f s config keys dfs namenode name dir key , generic test utils get test dir ( " dfs " + file separator + " name " ) to u r i ( ) to string ( ) ) ; upgrade upgrade and verify ( new mini d f s cluster builder ( conf ) num data nodes ( 1 ) manage data dfs dirs ( false ) manage name dfs dirs ( false ) , null ) ; }


enables automatic reloading of the trust store and key store files when they change on disk

public void enable cert file reloading ( ) throws i o exception { log info ( " enabling cert file reloading " ) ; z k config config = zk config = = null ? new z k config ( ) : zk config ; file change watcher new key store file watcher = new file change watcher ( config get property ( ssl keystore location property ) ) ; if ( new key store file watcher ! = null ) { / / stop old watcher if there is one if ( key store file watcher ! = null ) { key store file watcher stop ( ) ; } key store file watcher = new key store file watcher ; key store file watcher start ( ) ; } file change watcher new trust store file watcher = new file change watcher ( config get property ( ssl truststore location property ) ) ; if ( new trust store file watcher ! = null ) { / / stop old watcher if there is one if ( trust store file watcher ! = null ) { trust store file watcher stop ( ) ; } trust store file watcher = new trust store file watcher ; trust store file watcher start ( ) ; } }


generating aggregated container logs for all containers except container 2 2 2 , which is still running

private static void create aggregated folders ( ) throws exception { map < container id , string > contents app 1 = new hash map < > ( ) ; contents app 1 put ( container 1 1 1 , " hello - " + container 1 1 1 ) ; contents app 1 put ( container 1 1 2 , " hello - " + container 1 1 2 ) ; contents app 1 put ( container 1 2 1 , " hello - " + container 1 2 1 ) ; test container logs utils create container log file in remote f s ( conf , fs , local root log dir , appid 1 , contents app 1 , nm id 1 , file name , user , false ) ; test container logs utils create container log file in remote f s ( conf , fs , local root log dir , appid 1 , collections singleton map ( container 1 1 3 , " hello - " + container 1 1 3 ) , nm id 2 , file name , user , false ) ; map < container id , string > contents app 2 = new hash map < > ( ) ; contents app 2 put ( container 2 1 1 , " hello - " + container 2 1 1 ) ; contents app 2 put ( container 2 2 1 , " hello - " + container 2 2 1 ) ; test container logs utils create container log file in remote f s ( conf , fs , local root log dir , appid 2 , contents app 2 , nm id 1 , file name , user , false ) ; test container logs utils create container log file in remote f s ( conf , fs , local root log dir , appid 2 , collections singleton map ( container 2 2 3 , " hello - " + container 2 2 3 ) , nm id 2 , file name , user , false ) ; }


returns the i fill formatter that is set for this data set

i fill formatter get fill formatter ( ) ;


returns a { @ code listenable future } which has an exception set immediately upon construction the returned { @ code future } can ' t be cancelled , and its { @ code is done ( ) } method always returns { @ code true } calling { @ code get ( ) } will immediately throw the provided { @ code throwable } wrapped in an { @ code execution exception }

public static < v > listenable future < v > immediate failed future ( throwable throwable ) { check not null ( throwable ) ; return new immediate failed future < v > ( throwable ) ; }


gets the time unit for this policy ' s time interval

public time unit get unit ( ) { return unit ; }


private void configure output format ( job job ) throws i o exception { final configuration configuration = job get configuration ( ) ; path target path = context get target path ( ) ; file system target f s = target path get file system ( configuration ) ; target path = target path make qualified ( target f s get uri ( ) , target f s get working directory ( ) ) ; if ( context should preserve ( dist cp options file attribute acl ) ) { dist cp utils check file system acl support ( target f s ) ; } if ( context should preserve ( dist cp options file attribute xattr ) ) { dist cp utils check file system x attr support ( target f s ) ; } if ( context should atomic commit ( ) ) { path work dir = context get atomic work path ( ) ; if ( work dir = = null ) { work dir = target path get parent ( ) ; } work dir = new path ( work dir , wip prefix + target path get name ( ) + rand next int ( ) ) ; file system work f s = work dir get file system ( configuration ) ; if ( ! file util compare fs ( target f s , work f s ) ) { throw new illegal argument exception ( " work path " + work dir + " and target path " + target path + " are in different file system " ) ; } copy output format set working directory ( job , work dir ) ; } else { copy output format set working directory ( job , target path ) ; } copy output format set commit directory ( job , target path ) ; path log path = context get log path ( ) ; if ( log path = = null ) { log path = new path ( meta folder , " logs " ) ; } else { log info ( " dist cp job log path : " + log path ) ; } copy output format set output path ( job , log path ) ; }


add a new processor node that receives and processes records output by one or more parent source or processor node any new record output by this processor will be forwarded to its child processor or sink nodes if { @ code supplier } provides stores via { @ link connected store provider # stores ( ) } , the provided { @ link store builder } s will be added to the topology and connected to this processor automatically

public synchronized < k in , v in , k out , v out > topology add processor ( final string name , final processor supplier < k in , v in , k out , v out > supplier , final string parent names ) { internal topology builder add processor ( name , supplier , parent names ) ; final set < store builder < ? > > stores = supplier stores ( ) ; if ( stores ! = null ) { for ( final store builder store builder : stores ) { internal topology builder add state store ( store builder , name ) ; } } return this ; }


sets the progress message the string is lazily evaluated

public builder set progress message ( @ format string string progress message , object subject 0 , object subject 1 , object subject 2 ) { return set progress message ( new lazy string ( ) { @ override public string to string ( ) { return string format ( progress message , subject 0 , subject 1 , subject 2 ) ; } } ) ; }


test that a notification does not get delayed in the queue waiting for the next event to push it through

public void notification delay ( ) throws interrupted exception { executor service tp 1 = executors new fixed thread pool ( 1 ) ; executor service tp 2 = executors new fixed thread pool ( 1 ) ; try { int n = 10 ; for ( int i = 0 ; i < n ; i + + ) { final count down latch first on next = new count down latch ( 1 ) ; final count down latch on next count = new count down latch ( 2 ) ; final count down latch latch = new count down latch ( 1 ) ; final count down latch running = new count down latch ( 2 ) ; test subscriber ex < string > ts = new test subscriber ex < > ( new default subscriber < string > ( ) { @ override public void on complete ( ) { } @ override public void on error ( throwable e ) { } @ override public void on next ( string t ) { first on next count down ( ) ; / / force it to take time when delivering so the second one is enqueued try { latch await ( ) ; } catch ( interrupted exception e ) { } } } ) ; subscriber < string > subscriber = serialized subscriber ( ts ) ; future < ? > f 1 = tp 1 submit ( new on next thread ( subscriber , 1 , on next count , running ) ) ; future < ? > f 2 = tp 2 submit ( new on next thread ( subscriber , 1 , on next count , running ) ) ; running await ( ) ; / / let one of the on next thread actually run before proceeding first on next await ( ) ; thread t 1 = ts last thread ( ) ; system out println ( " first on next on thread : " + t 1 ) ; latch count down ( ) ; wait on threads ( f 1 , f 2 ) ; / / not completed yet assert equals ( 2 , ts values ( ) size ( ) ) ; thread t 2 = ts last thread ( ) ; system out println ( " second on next on thread : " + t 2 ) ; assert same ( t 1 , t 2 ) ; system out println ( ts values ( ) ) ; subscriber on complete ( ) ; system out println ( ts values ( ) ) ; } } finally { tp 1 shutdown ( ) ; tp 2 shutdown ( ) ; } }


public void set listing model ( listing model new model ) { layout model dispose ( ) ; listing model = new model ; layout model = create layout model ( new model ) ; field panel set layout model ( layout model ) ; swing utilities invoke later ( ( ) - > update providers ( ) ) ; }


start the { @ link test dns server } but drop all { @ code aaaa } queries and not send any response to these at all

public void start ( final boolean drop a a a a queries ) throws i o exception { inet socket address address = new inet socket address ( net util localhost4 , 0 ) ; udp transport transport = new udp transport ( address get host name ( ) , address get port ( ) ) ; set transports ( transport ) ; datagram acceptor acceptor = transport get acceptor ( ) ; acceptor set handler ( new dns protocol handler ( this , store ) { @ override public void session created ( io session session ) { / / u se our own codec to support aaaa testing session get filter chain ( ) add first ( " codec " , new protocol codec filter ( new test dns protocol udp codec factory ( drop a a a a queries ) ) ) ; } } ) ; ( ( datagram session config ) acceptor get session config ( ) ) set reuse address ( true ) ; / / start the listener acceptor bind ( ) ; }


find the meta annotation from the annotation type by meta annotation type

static < a extends annotation > a find meta annotation ( class < ? extends annotation > annotation type , class < a > meta annotation type ) { return first ( find meta annotations ( annotation type , meta annotation type ) ) ; }


create a protected asynchronous resource

async entry async entry ( string name , entry type traffic type , int batch count , object args ) throws block exception ;


get the closure of this item , caching the result

public set < assembly parse state item > get closure ( ) { if ( closure ! = null ) { return closure ; } closure = new linked hash set < > ( kernel ) ; set < assembly parse state item > new items = new linked hash set < > ( ) ; do { new items clear ( ) ; for ( assembly parse state item item : closure ) { new items add all ( item get closure ( grammar ) ) ; } } while ( closure add all ( new items ) ) ; return closure ; }


returns whether there is any time left between the deadline and now

public boolean has time left ( ) { return ! is overdue ( ) ; }


encode string literal according to section 5 2

private void encode string literal ( byte buf out , char sequence string ) { int huffman length ; if ( string length ( ) > = huff code threshold & & ( huffman length = hpack huffman encoder get encoded length ( string ) ) < string length ( ) ) { encode integer ( out , 0x 8 0 , 7 , huffman length ) ; hpack huffman encoder encode ( out , string ) ; } else { encode integer ( out , 0x 0 0 , 7 , string length ( ) ) ; if ( string instanceof ascii string ) { / / fast - path ascii string ascii string = ( ascii string ) string ; out write bytes ( ascii string array ( ) , ascii string array offset ( ) , ascii string length ( ) ) ; } else { / / only ascii is allowed in http 2 headers , so its fine to use this / / https : / / tools ietf org / html / rfc 7 5 4 0 # section - 8 1 2 out write char sequence ( string , charset util iso 8859 1 ) ; } } }


add a new source that consumes from topics matching the given pattern and forwards the records to child processor andor sink nodes the source will use the specified key and value deserializers the provided de - serializers will be used for all matched topics , so care should be taken to specify patterns for topics that share the same key - value data format

public synchronized topology add source ( final auto offset reset offset reset , final string name , final deserializer < ? > key deserializer , final deserializer < ? > value deserializer , final pattern topic pattern ) { internal topology builder add source ( offset reset , name , null , key deserializer , value deserializer , topic pattern ) ; return this ; }


return whether this program selection is equal to obj

public boolean equals ( object obj ) { if ( obj = = null ) { return false ; } if ( this = = obj ) { return true ; } if ( get class ( ) ! = obj get class ( ) ) { return false ; } program selection ps = ( program selection ) obj ; if ( interior selection ! = null ) { return interior selection equals ( ps interior selection ) ; } return address set has same addresses ( ps address set ) ; }


load the filenames of the directories from the i node section

private void load directories in i node section ( input stream in ) throws i o exception { i node section s = i node section parse delimited from ( in ) ; log info ( " loading directories in i node section " ) ; atomic integer num dirs = new atomic integer ( 0 ) ; for ( int i = 0 ; i < s get num inodes ( ) ; + + i ) { i node p = i node parse delimited from ( in ) ; if ( log is debug enabled ( ) & & i % 10000 = = 0 ) { log debug ( " scanned { } inodes " , i ) ; } check node ( p , num dirs ) ; } log info ( " found { } directories in i node section " , num dirs ) ; }


use this function while transaction msg is committed or rollback write a flag ' d ' to operation queue for the msg ' s offset

private boolean add remove tag in transaction op ( message ext message ext , message queue message queue ) { message message = new message ( transactional message util build op topic ( ) , transactional message util removetag , string value of ( message ext get queue offset ( ) ) get bytes ( transactional message util charset ) ) ; write op ( message , message queue ) ; return true ; }


tests basic single threaded set permission scenario

public void test single threaded page blob set permission scenario ( ) throws throwable { create empty file ( get page blob test storage account ( ) , test path ) ; fs delete ( test path , true ) ; fs set owner ( test path , " testowner " , " testgroup " ) ; }


tests the case where one dependency is valid and another one isn ' t

public void one dependency is invalid ( ) throws exception { new environment group maker ( " buildenv / foo " ) set environments ( " a " , " b " ) set defaults ( " a " ) make ( ) ; scratch file ( " hello / build " , get rule def ( " sh library " , " bad dep " , constrained to ( " / / buildenv / foo : b " ) ) , get rule def ( " sh library " , " good dep " , compatible with ( " / / buildenv / foo : b " ) ) , get rule def ( " sh library " , " depender " , constrained to ( " / / buildenv / foo : a " , " / / buildenv / foo : b " ) , get attr def ( " deps " , " good dep " , " bad dep " ) ) ) ; reporter remove handler ( fail fast handler ) ; assert that ( get configured target ( " / / hello : depender " ) ) is null ( ) ; assert contains event ( " / / hello : bad dep doesn ' t support expected environment : / / buildenv / foo : a " ) ; assert does not contain event ( " / / hello : good dep " ) ; }


public static < t > t load ( class < t > klass , iterable < class < ? > > hardcoded , class loader class loader , priority accessor < t > priority accessor ) { return service providers load ( klass , hardcoded , class loader , priority accessor ) ; }


public int hash code ( ) { return method hash code ( ) ; }


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

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


takes a string with a leading " - " and swaps it with the matching alias mapping example case with - - flag alias = foo = bar mapped : swap shorthand alias ( " - c " ) returns " - c " swap shorthand alias ( " - - foo " ) returns " - - bar " swap shorthand alias ( " - - baz " ) returns " - - baz " this method returns immediately when alias flag is not set via the builder , which is an implicit disabling of the aliasing functionality

private string swap shorthand alias ( string arg ) { if ( alias flag = = null | | ! arg starts with ( " - - " ) ) { return arg ; } int equal sign = arg index of ( " = " ) ; / / extracts the < arg > from ' - - < arg > = < value > ' and ' - - < arg > < value > ' formats on the command line string actual arg = ( equal sign ! = - 1 ) ? arg substring ( 2 , equal sign ) : arg substring ( 2 ) ; if ( ! flag alias mappings contains key ( actual arg ) ) { return arg ; } string alias = flag alias mappings get ( actual arg ) ; actual arg = alias ; / / converts the arg back into a command line option , accounting for both ' - - < arg > = < value > ' and / / ' - - < arg > < value > ' formats actual arg = ( equal sign ! = - 1 ) ? " - - " + actual arg + arg substring ( equal sign ) : " - - " + actual arg ; return actual arg ; }


create an instance of { @ link predicate } for { @ link method } to exclude the specified declared class

static predicate < method > excluded declared class ( class < ? > declared class ) { return method - > ! objects equals ( declared class , method get declaring class ( ) ) ; }


default void on audio disabled ( decoder counters counters ) { }


test that program diff can determine the label differences between program 1 and program 2


indicates whether or not trailers were sent to the remote endpoint


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


turn an object of type t into a serialized byte array

default byte [ ] serialize to byte array ( t object ) throws i o exception { byte array output stream out = new byte array output stream ( 1024 ) ; serialize ( object , out ) ; return out to byte array ( ) ; }


public static date date of ( final local date time time ) { return date of ( time to instant ( zone offset utc ) ) ; }


writes bytes in the given byte array , starting from the specified offset , to the current position and increases the position by the number of bytes written

public byte buffer put ( byte [ ] src , int off , int len ) { int length = src length ; if ( ( off < 0 ) | | ( len < 0 ) | | ( ( long ) off + ( long ) len > length ) ) { throw new index out of bounds exception ( ) ; } if ( len > remaining ( ) ) { throw new buffer overflow exception ( ) ; } for ( int i = off ; i < off + len ; i + + ) { put ( src [ i ] ) ; } return this ; }


get the location under the build directory to store the file parameter

private file get location under build ( abstract build build ) { return new file ( get file parameter folder under build ( build ) , location ) ; }


browser single version performance related source

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


public file status [ ] list sub paths ( path path , boolean recursive , boolean newest ) throws i o exception { final collection < file status > file statuses ; file statuses = list directory ( to dir path ( path ) , recursive , newest ) ; return file statuses to array ( new file status [ file statuses size ( ) ] ) ; }


sets the < code > $ special property name < code > property

public special model name $ special property name ( long $ special property name ) { this $ special property name = $ special property name ; return this ; }


delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors

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


tests the resettable iterator with enough memory so that all data is kept locally in a membuffer

public void test resettable iterator in memory ( ) { try { / / create the resettable iterator spilling resettable iterator < int value > iterator = new spilling resettable iterator < int value > ( this reader , this serializer , this memman , this ioman , 20 , this mem owner ) ; / / open the iterator iterator open ( ) ; / / now test walking through the iterator int count = 0 ; while ( iterator has next ( ) ) { assert assert equals ( " in initial run , element " + count + " does not match expected value ! " , count + + , iterator next ( ) get value ( ) ) ; } assert assert equals ( " too few elements were deserialzied in initial run ! " , num testrecords , count ) ; / / test resetting the iterator a few times for ( int j = 0 ; j < 10 ; + + j ) { count = 0 ; iterator reset ( ) ; / / now we should get the same results while ( iterator has next ( ) ) { assert assert equals ( " after reset nr " + j + 1 + " element " + count + " does not match expected value ! " , count + + , iterator next ( ) get value ( ) ) ; } assert assert equals ( " too few elements were deserialzied after reset nr " + j + 1 + " ! " , num testrecords , count ) ; } / / close the iterator iterator close ( ) ; } catch ( exception ex ) { ex print stack trace ( ) ; assert fail ( " test encountered an exception " ) ; } }


converts a hex string with ' ' as wildcard characters to one that yara understands ( ' ? ' ) also makes sure all characters are uppercase

private string to yara format ( string hex string ) { return hex string replace all ( " \ \ " , " ? " ) to upper case ( ) ; }


base 3 2 encode at the given grid coordinate


{ @ code close ( ) } merges the stream statistics into the filesystem ' s instrumentation instance

public void close ( ) { increment ( stream statistic names stream read close operations ) ; merge ( true ) ; }


grows the array the new array capacity will be the maximum of min capacity and twice the current capacity

private void adjust array sizes ( int size ) { if ( size < min size ) { size = min size ; } int len = math min ( size , starts length ) ; int [ ] new starts = new int [ size ] ; short [ ] new lengths = new short [ size ] ; system arraycopy ( starts , 0 , new starts , 0 , len ) ; system arraycopy ( lengths , 0 , new lengths , 0 , len ) ; starts = new starts ; lengths = new lengths ; }


returns the array component of { @ code type } , or null if { @ code type } is not an array

static type name array component ( type name type ) { return type instanceof array type name ? ( ( array type name ) type ) component type : null ; }


returns a path for the root directory for the shared cache

path get root path ( ) { return root ; }


returns a null - terminated unicode string starting at < code > index < code > the end of the string is denoted by two - byte unicode < code > null < code > character

public string read unicode string ( long index ) throws i o exception { string buffer buffer = new string buffer ( ) ; char c = 0 ; int i = 0 ; while ( i < length ( ) ) { c = ( char ) ( ( provider read byte ( index + + ) & 0xff ) ) ; c + = ( char ) ( ( provider read byte ( index + + ) & 0xff ) < < 8 ) ; if ( c = = 0x 0 0 0 0 ) { break ; } buffer append ( c ) ; i + = 2 ; } return buffer to string ( ) trim ( ) ; }


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


checks if the current execution state matches that of the given execution state used to ensure that over a period of time no changes to the policy execution state have occurred

boolean is same state ( enrich policy execution state previous state ) { enrich policy execution state current state = capture execution state ( ) ; return current state any policy in flight = = previous state any policy in flight & & current state executions = = previous state executions ; }


create a cci connection via this template ' s connection factory

protected connection do create connection ( ) throws resource exception { connection factory connection factory = get target connection factory ( ) ; assert state ( connection factory ! = null , " no ' target connection factory ' set " ) ; return connection factory get connection ( ) ; }


public static int get cache disk count ( @ non null final cache double utils cache double utils ) { return cache double utils get cache disk count ( ) ; }


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


returns null on success , otw the message assoc with the failure

public string verify thread count ( array list < quorum peer > peer list , long ecnt ) throws interrupted exception { string failure = null ; for ( int i = 0 ; i < 480 ; i + + ) { thread sleep ( 500 ) ; failure = verify thread count ( peer list , ecnt ) ; if ( failure = = null ) { return null ; } } return failure ; }


nested scroll view does not automatically consume the fling event however , recycler view consumes this event if it ' s either vertically or horizontally scrolling { @ link recycler view # fling } since this view is specifically made for vertically scrolling components , we always consume the nested fling event just like recycler view

public boolean dispatch nested fling ( float velocity x , float velocity y , boolean consumed ) { return super dispatch nested fling ( velocity x , velocity y , true ) ; }


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

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


verify if we get the same cached instance when requesting the same service twice

public void test service cache ( ) { final var service names = list of ( " jndi / service a " , " jndi / service b " ) ; for ( final var service name : service names ) { final var service = service locator get service ( service name ) ; assert not null ( service ) ; assert equals ( service name , service get name ( ) ) ; assert true ( service get id ( ) > 0 ) ; / / the id is generated randomly , but the minimum value is ' 1 ' assert same ( service , service locator get service ( service name ) ) ; } }


set the { @ code value } on the { @ code view } which is at { @ code index } in the list

@ ui thread void set ( @ non null t view , @ nullable v value , int index ) ;


returns whether a spawn can be executed in a sandbox environment

public static boolean may be sandboxed ( spawn spawn ) { return ! spawn get execution info ( ) contains key ( execution requirements legacy nosandbox ) & & ! spawn get execution info ( ) contains key ( execution requirements no sandbox ) & & ! spawn get execution info ( ) contains key ( execution requirements local ) ; }


go over all the mounted items from the leaves to the root and unmount only the items that are not present in the new layout outputs if an item is still present but in a new position move the item inside its host the condition where an item changed host doesn ' t need any special treatment here since we mark them as removed and re - added when calculating the new layout outputs

private prepare mount stats unmount or move old items ( layout state new layout state , list < integer > disappearing items ) { m prepare mount stats reset ( ) ; if ( m layout outputs ids = = null ) { return m prepare mount stats ; } int disappearing items pointer = 0 ; / / traversing from the beginning since m layout outputs ids unmounting won ' t remove entries there / / but only from m index to item map if an host changes we ' re going to unmount it and recursively / / all its mounted children for ( int i = 0 ; i < m layout outputs ids length ; i + + ) { final layout output new layout output = new layout state get layout output ( m layout outputs ids [ i ] ) ; final int new position = new layout output = = null ? - 1 : new layout output get index ( ) ; final mount item old item = get item at ( i ) ; final boolean has unmount delegate = m unmount delegate extension ! = null & & old item ! = null ? m unmount delegate extension should delegate unmount ( m mount delegate get unmount delegate extension state ( ) , old item ) : false ; if ( has unmount delegate ) { continue ; } / / just skip disappearing items here if ( disappearing items size ( ) > disappearing items pointer & & disappearing items get ( disappearing items pointer ) = = i ) { / / updating i to the index of the last member of the disappearing subtree , so the whole / / subtree will be skipped , as it ' s been dealt with at extract disappearing items ( ) i = disappearing items get ( disappearing items pointer + 1 ) ; disappearing items pointer + = 2 ; continue ; } if ( new position = = - 1 ) { unmount item ( i , m hosts by marker ) ; m prepare mount stats unmounted count + + ; } else { final long new host marker = new layout output get host marker ( ) ; if ( old item = = null ) { / / this was previously unmounted m prepare mount stats unmounted count + + ; } else if ( old item get host ( ) ! = m hosts by marker get ( new host marker ) ) { / / if the id is the same but the parent host is different we simply unmount the item and / / re - mount it later if the item to unmount is a component host , all the children will be / / recursively unmounted unmount item ( i , m hosts by marker ) ; m prepare mount stats unmounted count + + ; } else if ( new position ! = i ) { / / if a mount item for this id exists and the host marker has not changed but its position / / in the outputs array has changed we need to update the position in the host to ensure / / the z - ordering old item get host ( ) move item ( old item , i , new position ) ; m prepare mount stats moved count + + ; } else { m prepare mount stats unchanged count + + ; } } } return m prepare mount stats ; }


this function implements a custom stream grouping it takes in as input the number of tasks in the target bolt in prepare and returns the tasks to send the tuples to

list < integer > choose tasks ( int task id , list < object > values ) ;


stops forcing the app into landscape orientation

default void end force landscape ( ) { }


disables dependency checks done by { @ link com google devtools build lib analysis rule context prerequisite validator }

public builder < type > skip prereq validator check ( ) { return set property flag ( property flag skip prereq validator checks , " skip prereq validator checks " ) ; }


create the method argument value of the expected parameter type by reading from the given http input message

protected < t > object read with message converters ( http input message input message , method parameter parameter , type target type ) throws i o exception , http media type not supported exception , http message not readable exception { media type content type ; boolean no content type = false ; try { content type = input message get headers ( ) get content type ( ) ; } catch ( invalid media type exception ex ) { throw new http media type not supported exception ( ex get message ( ) ) ; } if ( content type = = null ) { no content type = true ; content type = media type application octet stream ; } class < ? > context class = parameter get containing class ( ) ; class < t > target class = ( target type instanceof class ? ( class < t > ) target type : null ) ; if ( target class = = null ) { resolvable type resolvable type = resolvable type for method parameter ( parameter ) ; target class = ( class < t > ) resolvable type resolve ( ) ; } http method http method = ( input message instanceof http request ? ( ( http request ) input message ) get method ( ) : null ) ; object body = no value ; empty body checking http input message message ; try { message = new empty body checking http input message ( input message ) ; for ( http message converter < ? > converter : this message converters ) { class < http message converter < ? > > converter type = ( class < http message converter < ? > > ) converter get class ( ) ; generic http message converter < ? > generic converter = ( converter instanceof generic http message converter ? ( generic http message converter < ? > ) converter : null ) ; if ( generic converter ! = null ? generic converter can read ( target type , context class , content type ) : ( target class ! = null & & converter can read ( target class , content type ) ) ) { if ( message has body ( ) ) { http input message msg to use = get advice ( ) before body read ( message , parameter , target type , converter type ) ; body = ( generic converter ! = null ? generic converter read ( target type , context class , msg to use ) : ( ( http message converter < t > ) converter ) read ( target class , msg to use ) ) ; body = get advice ( ) after body read ( body , msg to use , parameter , target type , converter type ) ; } else { body = get advice ( ) handle empty body ( null , message , parameter , target type , converter type ) ; } break ; } } } catch ( i o exception ex ) { throw new http message not readable exception ( " i / o error while reading input message " , ex , input message ) ; } if ( body = = no value ) { if ( http method = = null | | ! supported methods contains ( http method ) | | ( no content type & & ! message has body ( ) ) ) { return null ; } throw new http media type not supported exception ( content type , this all supported media types ) ; } media type selected content type = content type ; object the body = body ; log format utils trace debug ( logger , trace on - > { string formatted = log format utils format value ( the body , ! trace on ) ; return " read \ " " + selected content type + " \ " to [ " + formatted + " ] " ; } ) ; return body ; }


public register tree get parent ( ) { return parent ; }


test the property ' prefix ns wrapped array '

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


invokes a specified callable , timing out after the specified time limit if the target method call finishes before the limit is reached , the return value or a wrapped exception is propagated if , on the other hand , the time limit is reached , we attempt to abort the call to the target , and throw a { @ link timeout exception } to the caller the difference with { @ link # call with timeout ( callable , long , time unit ) } is that this method will ignore interrupts on the current thread

< t > t call uninterruptibly with timeout ( callable < t > callable , long timeout duration , time unit timeout unit ) throws timeout exception , execution exception ;


creates a bitmap of the specified width and height

public closeable reference < bitmap > create bitmap ( int width , int height , bitmap config bitmap config ) { return create bitmap ( width , height , bitmap config , null ) ; }


check that the symbol looks like it is at the start of a function there can be internal symbols that may match a function name

boolean is valid function start ( task monitor monitor , address address ) { / / instruction above falls into this one / / could be non - returning function , but we can ' t tell now instruction instr before = get instruction before ( address ) ; if ( instr before ! = null & & address equals ( instr before get fall through ( ) ) ) { return false ; } / / check if part of a larger code - block reference iterator references to = program get reference manager ( ) get references to ( address ) ; for ( reference reference : references to ) { ref type reference type = reference get reference type ( ) ; if ( reference type is call ( ) ) { continue ; } / / if a function already existed here , then a jump to here would be ok / / but that would be handled by another analyzer if ( reference type is jump ( ) ) { return false ; } } return true ; }


set whether to always apply the { @ code message format } rules , parsing even messages without arguments default is " false " : messages without arguments are by default returned as - is , without parsing them through message format set this to " true " to enforce message format for all messages , expecting all message texts to be written with message format escaping for example , message format expects a single quote to be escaped as " ' ' " if your message texts are all written with such escaping , even when not defining argument placeholders , you need to set this flag to " true " else , only message texts with actual arguments are supposed to be written with message format escaping

public void set always use message format ( boolean always use message format ) { this always use message format = always use message format ; }


state that the rule class being built possibly supplies the specified provider to its direct dependencies when computing the set of aspects required for a rule , only the providers listed here are considered the presence of a provider here does not mean that the rule < b > must < b > implement said provider , merely that it < b > can < b > after the configured target is constructed from this rule , aspects will be filtered according to the set of actual providers this is here so that we can do the loading phase overestimation required for " blaze query " , which does not have the configured targets available it ' s okay for the rule class eventually not to supply it ( possibly based on analysis phase logic ) , but if a provider is not advertised but is supplied , aspects that require the it will not be evaluated for the rule

public builder advertise provider ( class < ? > providers ) { for ( class < ? > provider : providers ) { advertised providers add builtin ( provider ) ; } return this ; }


parse the path component from the given request and return wo decoding

public static string get raw path ( final http servlet request request , string servlet name ) { preconditions check argument ( request get request u r i ( ) starts with ( servlet name + " / " ) ) ; return request get request u r i ( ) substring ( servlet name length ( ) ) ; }


perform some operation on a component and all of its descendents , recursively this applies the operation to all components in the tree , children first

public static tree traversal result for all descendants ( container start , component callback < component > cb ) { return for all descendants ( start , component class , tree traversal order children first , cb ) ; }


public string index ( ) { return index ; }


throws an < code > federation state store retriable exception < code > due to an error in < code > federation state store < code >

public static void log and throw retriable exception ( logger log , string err msg , throwable t ) throws yarn exception { if ( t ! = null ) { log error ( err msg , t ) ; throw new federation state store retriable exception ( err msg , t ) ; } else { log error ( err msg ) ; throw new federation state store retriable exception ( err msg ) ; } }


alternative to { @ link # expect body list ( class ) } that accepts information about a target type with generics

< e > list body spec < e > expect body list ( parameterized type reference < e > element type ) ;


returns the md5 string associated with this file null if no md5 value present

public string get m d 5 ( ) { return md 5 ; }


returns the provider ' s current sub - title ( sub - titles don ' t show up in the window menu )

public string get sub title ( ) { return sub title ; }


static int parse int ( string key , @ nullable string value ) { require argument ( ( value ! = null ) & & ! value is empty ( ) , " value of key % s was omitted " , key ) ; try { return integer parse int ( value ) ; } catch ( number format exception e ) { throw new illegal argument exception ( string format ( " key % s value was set to % s , must be an integer " , key , value ) , e ) ; } }


set the service locator interface to use , which must have one or more methods with the signatures { @ code my type xxx ( ) } or { @ code my type xxx ( my id type id ) } ( typically , { @ code my service get service ( ) } or { @ code my service get service ( string id ) } ) see the { @ link service locator factory bean class - level javadoc } for information on the semantics of such methods

public void set service locator interface ( class < ? > interface type ) { this service locator interface = interface type ; }


public int get volume count ( ) { return volumes get volumes ( ) size ( ) ; }


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


uploads a byte array to a server which cannot create files via the { @ link blob cache service } file transfers should fail

private void test put buffer fails store ( @ nullable final job i d job id , blob key blob type blob type ) throws i o exception { assume true ( ! operating system is windows ( ) ) ; / / set writable doesn ' t work on windows final configuration config = new configuration ( ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; file job store dir = null ; try ( blob server server = new blob server ( config , new void blob store ( ) ) ; blob cache service cache = new blob cache service ( config , new void blob store ( ) , new inet socket address ( " localhost " , server get port ( ) ) ) ) { server start ( ) ; / / make sure the blob server cannot create any files in its storage dir job store dir = server get storage location ( job id , blob key create key ( blob type ) ) get parent file ( ) ; assert true ( job store dir set executable ( true , false ) ) ; assert true ( job store dir set readable ( true , false ) ) ; assert true ( job store dir set writable ( false , false ) ) ; byte [ ] data = new byte [ 2000000 ] ; rnd next bytes ( data ) ; / / upload the file to the server via the cache exception expect ( i o exception class ) ; exception expect message ( " put operation failed : " ) ; try { put ( cache , job id , data , blob type ) ; } finally { / / there should be no remaining incoming files file incoming file dir = new file ( job store dir get parent ( ) , " incoming " ) ; assert array equals ( new string [ ] { } , incoming file dir list ( ) ) ; / / there should be no files in the job directory assert array equals ( new string [ ] { } , job store dir list ( ) ) ; } } finally { / / set writable again to make sure we can remove the directory if ( job store dir ! = null ) { / / noinspection result of method call ignored job store dir set writable ( true , false ) ; } } }


public static boolean validate ( long n ) { if ( n < = 0 ) { rx java plugins on error ( new illegal argument exception ( " n > 0 required but it was " + n ) ) ; return false ; } return true ; }


public test string overloads view model title via value shortcut quantity res ( @ plurals res int plural res , int quantity , object format args ) { on mutation ( ) ; assigned attributes epoxy generated model set ( 2 ) ; title via value shortcut string attribute data set value ( plural res , quantity , format args ) ; return this ; }


test whether different data sources can share the same zk client when the connection parameters are the same

public void test zoo keeper data source same zk client ( ) throws exception { testing server server = new testing server ( 21813 ) ; server start ( ) ; final string remote address = server get connect string ( ) ; final string flow path = " / sentinel - zk - ds - demo / flow - hk " ; final string degrade path = " / sentinel - zk - ds - demo / degrade - hk " ; zookeeper data source < list < flow rule > > flow rule zk data source = new zookeeper data source < > ( remote address , flow path , new converter < string , list < flow rule > > ( ) { @ override public list < flow rule > convert ( string source ) { return json parse object ( source , new type reference < list < flow rule > > ( ) { } ) ; } } ) ; zookeeper data source < list < degrade rule > > degrade rule zk data source = new zookeeper data source < > ( remote address , degrade path , new converter < string , list < degrade rule > > ( ) { @ override public list < degrade rule > convert ( string source ) { return json parse object ( source , new type reference < list < degrade rule > > ( ) { } ) ; } } ) ; assert assert true ( flow rule zk data source get zk client ( ) = = degrade rule zk data source get zk client ( ) ) ; final string group id = " sentinel - zk - ds - demo " ; final string flow data id = " flow - hk " ; final string degrade data id = " degrade - hk " ; final string scheme = " digest " ; final string auth = " root : 123456 " ; auth info auth info = new auth info ( scheme , auth get bytes ( ) ) ; list < auth info > auth info list = collections singleton list ( auth info ) ; zookeeper data source < list < flow rule > > flow rule zk auto data source = new zookeeper data source < list < flow rule > > ( remote address , auth info list , group id , flow data id , new converter < string , list < flow rule > > ( ) { @ override public list < flow rule > convert ( string source ) { return json parse object ( source , new type reference < list < flow rule > > ( ) { } ) ; } } ) ; zookeeper data source < list < degrade rule > > degrade rule zk auto data source = new zookeeper data source < list < degrade rule > > ( remote address , auth info list , group id , degrade data id , new converter < string , list < degrade rule > > ( ) { @ override public list < degrade rule > convert ( string source ) { return json parse object ( source , new type reference < list < degrade rule > > ( ) { } ) ; } } ) ; assert assert true ( flow rule zk auto data source get zk client ( ) = = degrade rule zk auto data source get zk client ( ) ) ; server stop ( ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void exit null literal ( sql base parser null literal context ctx ) { }


see { @ link args # get scheduled executor service }

public builder set scheduled executor service ( scheduled executor service scheduled executor service ) { this scheduled executor service = check not null ( scheduled executor service ) ; return this ; }


called by specific { @ link leader election driver } when the leader information is changed then the { @ link leader election service } could write the leader information again if necessary this method should only be called when { @ link leader election driver # has leadership ( ) } is true duplicated leader change events could happen , so the implementation should check whether the passed leader information is really different with internal confirmed leader information

void on leader information change ( leader information leader information ) ;


private static path task attempt working path ( task attempt context context , string uuid ) throws i o exception { return get task attempt path ( context , paths get local task attempt temp dir ( context get configuration ( ) , uuid , context get task attempt i d ( ) ) ) ; }


converts the java type used for udf parameters of sql time type ( { @ link java sql time } ) to internal representation ( int ) converse of { @ link # internal to time ( int ) }

public static int time to internal ( java sql time time ) { long ts = time get time ( ) + local tz get offset ( time get time ( ) ) ; return ( int ) ( ts % millis per day ) ; }


public register spec map ( register spec register spec ) { if ( register spec = = null ) return null ; int reg = register spec get reg ( ) ; / / for debugging : assert that the mapped types are compatible if ( debug ) { register spec new version = current mapping [ reg ] ; if ( new version get basic type ( ) ! = type bt void & & register spec get basic frame type ( ) ! = new version get basic frame type ( ) ) { throw new runtime exception ( " mapping registers of incompatible types ! " + register spec + " " + current mapping [ reg ] ) ; } } return register spec with reg ( current mapping [ reg ] get reg ( ) ) ; }


highlights any y - value at the given x - value in the given data set provide - 1 as the data set index to undo all highlighting

public void highlight value ( float x , float y , int data set index , int data index , boolean call listener ) { if ( data set index < 0 | | data set index > = m data get data set count ( ) ) { highlight value ( null , call listener ) ; } else { highlight value ( new highlight ( x , y , data set index , data index ) , call listener ) ; } }


convert the supplied month name to its numeric representation < br > for example , < tt > " january " < tt > ( or any substring ) would return < tt > 1 < tt > and < tt > " december " < tt > would return < tt > 12 < tt >

public static int month name to number ( string str ) { if ( str ! = null & & str length ( ) > = 3 ) { string lstr = str to lower case ( ) ; for ( int i = 0 ; i < months length ; i + + ) { if ( lstr starts with ( months [ i ] [ 0 ] ) | | months [ i ] [ 1 ] to lower case ( ) starts with ( lstr ) ) { return i + 1 ; } } } return unset ; }


creates a cc toolchain features from features described in the given toolchain fragment

public static cc toolchain features build features ( rule context rule context , string toolchain ) throws exception { c toolchain builder toolchain builder = c toolchain new builder ( ) ; text format merge ( joiner on ( " " ) join ( toolchain ) , toolchain builder ) ; return new cc toolchain features ( cc toolchain config info from toolchain ( toolchain builder build partial ( ) ) , / * cc toolchain path = * / path fragment empty fragment ) ; }


parse a < code > categorization analyzer < code > from configuration or cluster state a custom parser is needed due to the complexity of the format , with many elements able to be specified as either the name of a built - in element or an object containing a custom definition the parser is strict when parsing config and lenient when parsing cluster state

static categorization analyzer config build from x content fragment ( x content parser parser , boolean ignore unknown fields ) throws i o exception { categorization analyzer config builder builder = new categorization analyzer config builder ( ) ; x content parser token token = parser current token ( ) ; if ( token = = x content parser token value string ) { builder set analyzer ( parser text ( ) ) ; } else if ( token ! = x content parser token start object ) { throw new illegal argument exception ( " [ " + categorization analyzer + " ] should be analyzer ' s name or settings [ " + token + " ] " ) ; } else { string current field name = null ; while ( ( token = parser next token ( ) ) ! = x content parser token end object ) { if ( token = = x content parser token field name ) { current field name = parser current name ( ) ; } else if ( char filters match ( current field name , parser get deprecation handler ( ) ) & & token = = x content parser token start array ) { while ( ( token = parser next token ( ) ) ! = x content parser token end array ) { if ( token = = x content parser token value string ) { builder add char filter ( parser text ( ) ) ; } else if ( token = = x content parser token start object ) { builder add char filter ( parser map ( ) ) ; } else { throw new illegal argument exception ( " [ " + current field name + " ] in [ " + categorization analyzer + " ] array element should contain char filter ' s name or settings [ " + token + " ] " ) ; } } } else if ( tokenizer match ( current field name , parser get deprecation handler ( ) ) ) { if ( token = = x content parser token value string ) { builder set tokenizer ( parser text ( ) ) ; } else if ( token = = x content parser token start object ) { builder set tokenizer ( parser map ( ) ) ; } else { throw new illegal argument exception ( " [ " + current field name + " ] in [ " + categorization analyzer + " ] should be tokenizer ' s name or settings [ " + token + " ] " ) ; } } else if ( token filters match ( current field name , parser get deprecation handler ( ) ) & & token = = x content parser token start array ) { while ( ( token = parser next token ( ) ) ! = x content parser token end array ) { if ( token = = x content parser token value string ) { builder add token filter ( parser text ( ) ) ; } else if ( token = = x content parser token start object ) { builder add token filter ( parser map ( ) ) ; } else { throw new illegal argument exception ( " [ " + current field name + " ] in [ " + categorization analyzer + " ] array element should contain token filter ' s name or settings [ " + token + " ] " ) ; } } / / be lenient when parsing cluster state - assume unknown fields are from future versions } else if ( ignore unknown fields = = false ) { throw new illegal argument exception ( " parameter [ " + current field name + " ] in [ " + categorization analyzer + " ] is unknown or of the wrong type [ " + token + " ] " ) ; } } } return builder build ( ) ; }


returns a new { @ link collection } containing < tt > a - b < tt > the cardinality of each element e in the returned { @ link collection } will be the cardinality of e in a minus the cardinality of e in b , or zero , whichever is greater

public static collection subtract ( final collection a , final collection b ) { array list list = new array list ( a ) ; for ( iterator it = b iterator ( ) ; it has next ( ) ; ) { list remove ( it next ( ) ) ; } return list ; }


returns true iff < code > o < code > is a v long writable with the same value

public boolean equals ( object o ) { if ( ! ( o instanceof v long writable ) ) return false ; v long writable other = ( v long writable ) o ; return this value = = other value ; }


location to write api files you can use the api package ( ) as defined when the class is instantiated

public string api file folder ( ) { return output folder ; }


finalize the block and close the block file

private void finalize block ( long start time ) throws i o exception { long end time = 0 ; / / hold a volume reference to finalize block try ( replica handler handler = block receiver this claim replica handler ( ) ) { block receiver this close ( ) ; end time = client trace log is info enabled ( ) ? system nano time ( ) : 0 ; block set num bytes ( replica info get num bytes ( ) ) ; datanode data finalize block ( block , dir sync on finalize ) ; } if ( pinning ) { datanode data set pinning ( block ) ; } datanode close block ( block , null , replica info get storage uuid ( ) , replica info is on transient storage ( ) ) ; if ( client trace log is info enabled ( ) & & is client ) { long offset = 0 ; datanode registration dn r = datanode get d n registration for b p ( block get block pool id ( ) ) ; client trace log info ( string format ( dn clienttrace format , in addr , my addr , block get num bytes ( ) , " hdfs write " , clientname , offset , dn r get datanode uuid ( ) , block , end time - start time ) ) ; } else { log info ( " received " + block + " size " + block get num bytes ( ) + " from " + in addr ) ; } }


it ' s whether the implementation of { @ link watch service } is based on { @ linkplain sun nio fs polling watch service } or not

protected static boolean is based pooling watch service ( ) { return based pooling watch service ; }


returns the user ' s preferred locale this may have been overridden for this process with { @ link # set default } since the user ' s locale changes dynamically , avoid caching this value instead , use this method to look it up for each use

public static locale get default ( ) { return default locale ; }


encode the header field into the header block the given { @ link char sequence } s must be immutable !

public void encode headers ( int stream id , byte buf out , http 2 headers headers , sensitivity detector sensitivity detector ) throws http 2 exception { if ( ignore max header list size ) { encode headers ignore max header list size ( out , headers , sensitivity detector ) ; } else { encode headers enforce max header list size ( stream id , out , headers , sensitivity detector ) ; } }


adds a field proto annotation that , when set , overrides the default field name serializationdeserialization for example , if you add the ' { @ code serialized name } ' annotation and you define a field in your proto like the one below : string client app id = 1 [ ( serialized name ) = " app id " ] ; the adapter will serialize the field using ' { @ code app id } ' instead of the default ' { @ code client app id } ' this lets you customize the name serialization of any proto field

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


a convenient method to create an { @ link i o exception }

public static i o exception create i o exception ( list < i o exception > exceptions ) { if ( exceptions = = null | | exceptions is empty ( ) ) { return null ; } if ( exceptions size ( ) = = 1 ) { return exceptions get ( 0 ) ; } return new multiple i o exception ( exceptions ) ; }


serialize an outgoing response message the returned input stream should be closed by the caller

public input stream stream response ( resp t response ) { return response marshaller stream ( response ) ; }


private void is same with counter ( meter data meter data , boolean first data , meter id meter id , long count ) { assert assert not null ( meter data ) ; if ( first data ) { assert assert equals ( meter data get service ( ) , " test service " ) ; assert assert equals ( meter data get service instance ( ) , " test service instance " ) ; assert assert true ( meter data get timestamp ( ) > 0 ) ; } else { assert assert equals ( meter data get service ( ) , " " ) ; assert assert equals ( meter data get service instance ( ) , " " ) ; assert assert true ( meter data get timestamp ( ) = = 0l ) ; } assert assert equals ( meter data get metric case ( ) , meter data metric case singlevalue ) ; assert assert not null ( meter data get single value ( ) ) ; final meter single value single value = meter data get single value ( ) ; assert assert equals ( single value get name ( ) , meter id get name ( ) ) ; assert assert equals ( single value get labels list ( ) , meter id transform tags ( ) ) ; assert assert equals ( single value get value ( ) , count , 0 0 ) ; }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( java lang object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


queue an " event " to be run on the gl rendering thread

public void queue event ( runnable r ) { if ( r = = null ) { throw new illegal argument exception ( " r must not be null " ) ; } synchronized ( gl thread manager ) { event queue add ( r ) ; gl thread manager notify all ( ) ; } }


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

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


returns the percentage of the desired amount of time spent for io in the event loop

public int get io ratio ( ) { return io ratio ; }


this implementation always returns { @ code true }

public boolean is results parameter ( ) { return true ; }


public synchronized boolean is closed ( ) { return m bitmap reference = = null ; }


public void update recognizer test 5 ( ) { string sql = " update t 1 set name 1 = ' name 1 ' , name 2 = ' name 2 ' where id between ? and ? " ; s q l statement statement = get s q l statement ( sql ) ; my s q l update recognizer my s q l update recognizer = new my s q l update recognizer ( sql , statement ) ; assertions assert equals ( sql , my s q l update recognizer get original s q l ( ) ) ; assertions assert equals ( " t 1 " , my s q l update recognizer get table name ( ) ) ; assertions assert equals ( 2 , my s q l update recognizer get update columns ( ) size ( ) ) ; assertions assert equals ( " name 1 " , my s q l update recognizer get update columns ( ) get ( 0 ) ) ; assertions assert equals ( " name 1 " , my s q l update recognizer get update values ( ) get ( 0 ) ) ; assertions assert equals ( " name 2 " , my s q l update recognizer get update columns ( ) get ( 1 ) ) ; assertions assert equals ( " name 2 " , my s q l update recognizer get update values ( ) get ( 1 ) ) ; array list < list < object > > param appender list = new array list < > ( ) ; string where condition = my s q l update recognizer get where condition ( new parameters holder ( ) { @ override public map < integer , array list < object > > get parameters ( ) { array list < object > id 1 param = new array list < > ( ) ; id 1 param add ( " id 1 " ) ; array list < object > id 2 param = new array list < > ( ) ; id 2 param add ( " id 2 " ) ; map result = new hash map ( ) ; result put ( 1 , id 1 param ) ; result put ( 2 , id 2 param ) ; return result ; } } , param appender list ) ; assertions assert equals ( collections singleton list ( arrays as list ( " id 1 " , " id 2 " ) ) , param appender list ) ; assertions assert equals ( " id between ? and ? " , where condition ) ; }


returns a retained slice of this buffer ' s sub - region modifying the content of the returned buffer or this buffer affects each other ' s content while they maintain separate indexes and marks this method does not modify { @ code reader index } or { @ code writer index } of this buffer note that this method returns a { @ linkplain # retain ( ) retained } buffer unlike { @ link # slice ( int , int ) } this method behaves similarly to { @ code slice ( ) retain ( ) } except that this method may return a buffer implementation that produces less garbage

public abstract byte buf retained slice ( int index , int length ) ;


this method replicates the json response that would be given by the jobs overview handler when listing both running and finished jobs every job archive contains a joboverview json file containing the same structure since jobs are archived on their own however the list of finished jobs only contains a single job for the display in the history server web frontend we have to combine these overviews

private static void update job overview ( file web overview dir , file web dir ) { try ( json generator gen = jackson factory create generator ( history server create or get file ( web dir , jobs overview headers url ) ) ) { file [ ] overviews = new file ( web overview dir get path ( ) ) list files ( ) ; if ( overviews ! = null ) { collection < job details > all jobs = new array list < > ( overviews length ) ; for ( file overview : overviews ) { multiple jobs details sub jobs = mapper read value ( overview , multiple jobs details class ) ; all jobs add all ( sub jobs get jobs ( ) ) ; } mapper write value ( gen , new multiple jobs details ( all jobs ) ) ; } } catch ( i o exception ioe ) { log error ( " failed to update job overview " , ioe ) ; } }


build call for fake outer number serialize

public okhttp 3 call fake outer number serialize call ( big decimal body , final api callback callback ) throws api exception { object local var post body = body ; / / create path and map variables string local var path = " / fake / outer / number " ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " * / * " } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , " post " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


compare two i ds and return { @ code true } iff the two ids are the same normally we expect that this should be the same as { @ link # compare ( string , string ) } being equal to { @ code 0 } , however there may be a specific reason for going beyond that , such as sorting id ' s case insensitively while treating them as case sensitive subclasses may want to override this naïve implementation that calls { @ code compare ( id 1 , id 2 ) = = 0 } for a more performant implementation

public boolean equals ( @ non null string id 1 , @ non null string id 2 ) { return compare ( id 1 , id 2 ) = = 0 ; }


test equal objects after adding multiple instances at once with a null

public void test add two equal objects at once with null ( ) { try { equals tester add equality group ( reference , equal object 1 , null ) ; fail ( " should fail on null equal object " ) ; } catch ( null pointer exception e ) { } }


gets the { @ code settings max concurrent streams } value if unavailable , returns { @ code null }

public long max concurrent streams ( ) { return get ( settings max concurrent streams ) ; }


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


returns the url patterns of this { @ link request mapping info } ; or instance with 0 patterns , never { @ code null }

public patterns request condition get patterns condition ( ) { return this patterns condition ; }


resets the column to default state - fills the is null array with false - sets no nulls to true

public void reset ( ) { if ( ! no nulls ) { arrays fill ( is null , false ) ; } no nulls = true ; }


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


set the value of the ' { @ code value } ' attribute

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


convenience method to get this array as a primitive short if it contains a single element

public short get as short ( ) { if ( elements size ( ) = = 1 ) { return elements get ( 0 ) get as short ( ) ; } throw new illegal state exception ( ) ; }


private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


this method is executed once per superstep before the gather function is invoked for each vertex

public void pre superstep ( ) throws exception { }


consume tokens until one matches the given token set

protected void consume until ( parser recognizer , interval set set ) { / / system err println ( " consume until ( " + set to string ( recognizer get token names ( ) ) + " ) " ) ; int ttype = recognizer get input stream ( ) la ( 1 ) ; while ( ttype ! = token eof & & ! set contains ( ttype ) ) { / / system out println ( " consume during recover la ( 1 ) = " + get token names ( ) [ input la ( 1 ) ] ) ; / / recognizer get input stream ( ) consume ( ) ; recognizer consume ( ) ; ttype = recognizer get input stream ( ) la ( 1 ) ; } }


checkpoint lock in { @ link stream task } is replaced by { @ link stream task action executor } < code > get checkpoint lock < code > method was moved from to the { @ link org apache flink streaming runtime tasks source stream task source stream task }

public object get checkpoint lock ( ) { return checkpoint lock ; }


creates an xml item this route creates an xml item

public void create xml item ( xml item xml item ) { / / todo : implement }


puts the given byte value in the byte array at the given index

public void put ( int index , byte value ) { if ( value = = 0 ) { remove ( index ) ; return ; } if ( index > = bytes length ) { adjust array ( math max ( index + 1 , bytes length * 2 ) ) ; } bytes [ index ] = value ; if ( index > last non zero index ) { last non zero index = index ; } }


waits until the job has reached a certain state this method is based on polling and might miss very fast state transitions !

public static void wait until job status ( execution graph eg , job status status , long max wait millis ) throws timeout exception { check not null ( eg ) ; check not null ( status ) ; check argument ( max wait millis > = 0 ) ; / / this is a poor implementation - we may want to improve it eventually final long deadline = max wait millis = = 0 ? long max value : system nano time ( ) + ( max wait millis * 1 000 000 ) ; while ( eg get state ( ) ! = status & & system nano time ( ) < deadline ) { try { thread sleep ( 2 ) ; } catch ( interrupted exception ignored ) { } } if ( system nano time ( ) > = deadline ) { throw new timeout exception ( string format ( " the job did not reach status % s in time current status is % s " , status , eg get state ( ) ) ) ; } }


this method creates an internal { @ link extended block } at the given index of a block group

public static extended block construct internal block ( extended block block group , int cell size , int data blk num , int idx in block group ) { extended block block = new extended block ( block group ) ; block set block id ( block group get block id ( ) + idx in block group ) ; block set num bytes ( get internal block length ( block group get num bytes ( ) , cell size , data blk num , idx in block group ) ) ; return block ; }


creates the { @ link python function runner } which is responsible for python user - defined function execution

public abstract python function runner create python function runner ( ) throws exception ;


overides equals method by comparing keys

public boolean equals ( object obj ) { if ( obj instanceof edge ) { return key = = ( ( edge ) obj ) key ( ) ; } return false ; }


obtain the aggregated number of bytes read over the network

public long get network bytes read ( ) { return sys get network bytes read ( ) ; }


define a new configuration with no group , no order in group , no width , no display name , no dependents and no custom recommender

public config def define ( string name , type type , object default value , validator validator , importance importance , string documentation ) { return define ( name , type , default value , validator , importance , documentation , null , - 1 , width none , name ) ; }


creates an returns a new { @ link object } that can be used and later recycled via { @ link handle # recycle ( object ) }


public string get prefix ns string ( ) { return prefix ns string ; }


returns dividend divisor , where the dividend and divisor are treated as unsigned 32 - bit quantities

public static int divide ( int dividend , int divisor ) { return ( int ) ( to long ( dividend ) / to long ( divisor ) ) ; }


deselect all options that have a value matching the argument that is , when given " foo " this would deselect an option like : & lt ; option value = " foo " & gt ; bar & lt ; option & gt ;

public void deselect by value ( string value ) { if ( ! is multiple ( ) ) { throw new unsupported operation exception ( " you may only deselect options of a multi - select " ) ; } for ( web element option : find options by value ( value ) ) { set selected ( option , false ) ; } }


replace the rolling averages windows for a { @ link mutable rolling averages } metric

public static void replace rolling averages scheduler ( mutable rolling averages mutable rolling averages , int num windows , long interval , time unit time unit ) { mutable rolling averages replace scheduled task ( num windows , interval , time unit ) ; }


retrieve the { @ code object name } instance corresponding to the supplied name

public static object name get instance ( object object name ) throws malformed object name exception { if ( object name instanceof object name ) { return ( object name ) object name ; } if ( ! ( object name instanceof string ) ) { throw new malformed object name exception ( " invalid object name value type [ " + object name get class ( ) get name ( ) + " ] : only object name and string supported " ) ; } return get instance ( ( string ) object name ) ; }


test serialization of outer number types

public api response < big decimal > fake outer number serialize with http info ( big decimal body ) throws api exception { okhttp 3 call local var call = fake outer number serialize validate before call ( body , null ) ; type local var return type = new type token < big decimal > ( ) { } get type ( ) ; return local var api client execute ( local var call , local var return type ) ; }


@ t c description : nacos ， @ test step : @ expect result :

public void nacos add listener 2 ( ) throws exception { iconfig add listener ( data id , group , null ) ; }


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


public status get open status ( ) { view surface view = get surface view ( ) ; if ( surface view = = null ) { return status close ; } int surface left = surface view get left ( ) ; int surface top = surface view get top ( ) ; if ( surface left = = get padding left ( ) & & surface top = = get padding top ( ) ) return status close ; if ( surface left = = ( get padding left ( ) - m drag distance ) | | surface left = = ( get padding left ( ) + m drag distance ) | | surface top = = ( get padding top ( ) - m drag distance ) | | surface top = = ( get padding top ( ) + m drag distance ) ) return status open ; return status middle ; }


gets { @ linkplain # get secret key ( ) the secret key } as a key for aes - 128

public secret key get secret key as a e s 1 2 8 ( ) { return util to aes 1 2 8 key ( secret key ) ; }


creates the list of { @ link list view column } s to be used for a { @ link list view } s and their likes

public static list < list view column > create default initial column list ( view view ) { return create default initial column list ( descriptor visibility filter apply ( view , list view column all ( ) ) ) ; }


updates the node ' s location in the policy ' s deque

static < k , v > void reorder ( linked deque < node < k , v > > deque , node < k , v > node ) { / / an entry may be scheduled for reordering despite having been removed this can occur when the / / entry was concurrently read while a writer was removing it if the entry is no longer linked / / then it does not need to be processed if ( deque contains ( node ) ) { deque move to back ( node ) ; } }


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


returns the { @ link dns server addresses } that yields the specified { @ code addresses } in a shuffled order once all addresses are yielded , the addresses are shuffled again

public static dns server addresses shuffled ( inet socket address addresses ) { return shuffled 0 ( sanitize ( addresses ) ) ; }


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


public void update ( ) { logger info ( " update physics game component " ) ; / / process physics int stream range ( 0 , num entities ) filter ( i - > physics components length > i & & physics components [ i ] ! = null ) for each ( i - > physics components [ i ] update ( ) ) ; }


private void check invoke start bundle ( ) throws exception { if ( ! bundle started ) { start bundle ( ) ; bundle started = true ; } }


returns the number of modules in the executable

public short get c mod ( ) { return c mod ; }


assert that the two list sizes match ; failure message includes the lists

private < t > void assert list size equal ( string message , list < t > expected , list < t > actual ) { string left contents = expected stream ( ) map ( n - > n to string ( ) ) collect ( collectors joining ( " \ n " ) ) ; string right contents = actual stream ( ) map ( n - > n to string ( ) ) collect ( collectors joining ( " \ n " ) ) ; string summary = " \ n expected : " + left contents + " \ n - - - - - - - - - - - \ n " + " actual : " + right contents + " \ n - - - - - - - - - - - \ n " ; if ( expected size ( ) ! = actual size ( ) ) { log error ( message + summary ) ; } assert equals ( message + summary , expected size ( ) , actual size ( ) ) ; }


unmaps the block from memory see munmap ( 2 ) there isn ' t any portable way to unmap a memory region in java so we use the sun nio method here note that unmapping a memory region could cause crashes if code continues to reference the unmapped code however , if we don ' t manually unmap the memory , we are dependent on the finalizer to do it , and we have no idea when the finalizer will run

public static void munmap ( mapped byte buffer buffer ) { if ( cleaner util unmap supported ) { try { cleaner util get cleaner ( ) free buffer ( buffer ) ; } catch ( i o exception e ) { log info ( " failed to unmap the buffer " , e ) ; } } else { log trace ( cleaner util unmap not supported reason ) ; } }


generates an initial session id high order 1 byte is server id , next 5 bytes are from timestamp , and low order 2 bytes are 0s use { @ literal " > > > 8 " } , not { @ literal " > > 8 " } to make sure that the high order 1 byte is entirely up to the server id see also http : jira apache orgjirabrowse z o o k e e p e r - 1622

public static long initialize next session id ( long id ) { long next sid ; next sid = ( time current elapsed time ( ) < < 24 ) > > > 8 ; next sid = next sid | ( id < < 56 ) ; if ( next sid = = ephemeral type container ephemeral owner ) { + + next sid ; / / this is an unlikely edge case , but check it just in case } return next sid ; }


creates the netty handler to be used in the channel pipeline

private netty server handler create handler ( server transport listener transport listener , channel promise channel unused ) { return netty server handler new handler ( transport listener , channel unused , stream tracer factories , transport tracer , max streams , auto flow control , flow control window , max header list size , max message size , keep alive time in nanos , keep alive timeout in nanos , max connection idle in nanos , max connection age in nanos , max connection age grace in nanos , permit keep alive without calls , permit keep alive time in nanos , eag attributes ) ; }


sets the doc source of the update request to be used when the document does not exists

public update request upsert ( string source , x content type x content type ) { safe upsert request ( ) source ( source , x content type ) ; return this ; }


returns the maximum number of bytes that this cache should use to store its data

public synchronized long get max size ( ) { return max size ; }


public transferable get transferable ( point p ) { int index = table row at point ( p ) ; int num rows = model get row count ( ) ; if ( index > = num rows ) { index = num rows ; } data type dt = default data type data type ; / / if we are on a component then get the data type if ( ( index > = 0 ) ) { dt = model get component ( index ) get data type ( ) ; } return new data type transferable ( dt ) ; }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


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