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


returns { @ link exit code success } if the build event upload was a success , otherwise , return an exit code that corresponds to the error that occurred during the build event upload

public exit code get exit code ( ) { return exit code ; }


takes some amount of range resources ( e g ports )

public list < protos resource > take ranges ( string resource name , int amount , set < string > roles ) { if ( log is debug enabled ( ) ) { log debug ( " allocating { } { } " , amount , resource name ) ; } list < protos resource > result = new array list < > ( 1 ) ; for ( list iterator < protos resource > i = resources list iterator ( ) ; i has next ( ) ; ) { if ( amount < = 0 ) { break ; } / / take from next available range resource that is unreserved or reserved for an / / applicable role protos resource available = i next ( ) ; if ( ! resource name equals ( available get name ( ) ) | | ! available has ranges ( ) ) { continue ; } if ( ! unreserved role equals ( available get role ( ) ) & & ! roles contains ( available get role ( ) ) ) { continue ; } list < protos value range > taken ranges = new array list < > ( ) ; list < protos value range > remaining ranges = new array list < > ( available get ranges ( ) get range list ( ) ) ; for ( list iterator < protos value range > j = remaining ranges list iterator ( ) ; j has next ( ) ; ) { if ( amount < = 0 ) { break ; } / / take from next available range ( note : ranges are inclusive ) protos value range available range = j next ( ) ; long amount to take = math min ( available range get end ( ) - available range get begin ( ) + 1 , amount ) ; protos value range taken range = available range to builder ( ) set end ( available range get begin ( ) + amount to take - 1 ) build ( ) ; amount - = amount to take ; taken ranges add ( taken range ) ; / / keep remaining range ( if any ) long remaining = available range get end ( ) - taken range get end ( ) ; if ( remaining > 0 ) { j set ( available range to builder ( ) set begin ( taken range get end ( ) + 1 ) build ( ) ) ; } else { j remove ( ) ; } } protos resource taken = available to builder ( ) set ranges ( protos value ranges new builder ( ) add all range ( taken ranges ) ) build ( ) ; if ( log is debug enabled ( ) ) { log debug ( " taking { } from { } " , utils to string ( taken get ranges ( ) ) , utils to string ( available ) ) ; } result add ( taken ) ; / / keep remaining ranges ( if any ) if ( remaining ranges size ( ) > 0 ) { i set ( available to builder ( ) set ranges ( protos value ranges new builder ( ) add all range ( remaining ranges ) ) build ( ) ) ; } else { i remove ( ) ; } } if ( log is debug enabled ( ) ) { log debug ( " allocated : { } , unsatisfied : { } " , utils to string ( result ) , amount ) ; } return result ; }


sets the pixel offset to move the gradient up or down the gradient is normally centered on the glyph

public void set offset ( int offset ) { this offset = offset ; }


returns the next element in the queue if the queue is empty , this method waits until at least one element is added the method throws an { @ code illegal state exception } if the queue is closed checking whether the queue is open and removing the next element is one atomic operation

public e get element blocking ( ) throws interrupted exception { lock lock ( ) ; try { while ( open & & elements is empty ( ) ) { non empty await ( ) ; } if ( open ) { return elements remove first ( ) ; } else { throw new illegal state exception ( " queue is closed " ) ; } } finally { lock unlock ( ) ; } }


returns a reader for reading this file as characters @ throw runtime exception if the file handle represents a directory , doesn ' t exist , or could not be read

public reader reader ( string charset ) { try { return new input stream reader ( read ( ) , charset ) ; } catch ( unsupported encoding exception ex ) { throw new runtime exception ( " error reading file : " + this , ex ) ; } }


public tristate is empty directory ( ) { return is empty directory ; }


returns the local state allocation base directory for given checkpoint id w r t our rotation over all available allocation base directories

file allocation base directory ( long checkpoint id ) ;


transfers this buffer ' s data to the specified destination starting at the current { @ code reader index } and increases the { @ code reader index } by the number of the transferred bytes ( = { @ code dst length } )

public abstract byte buf read bytes ( byte [ ] dst ) ;


sets the bytes starting at { @ code address } to the values encoded in { @ code byte string } and then optionally disassembling see { @ link # set bytes ( string , byte [ ] , boolean ) }

public void set bytes ( string address , string byte string , boolean disassemble ) throws exception { byte [ ] bytes = numeric utilities convert string to bytes ( byte string ) ; set bytes ( address , bytes , disassemble ) ; }


public annotation visitor visit annotation ( final string descriptor , final boolean visible ) { if ( fv ! = null ) { return fv visit annotation ( descriptor , visible ) ; } return null ; }


public string get endpoint id ( ) { return endpoint id ; }


deduplicate the failures by exception message and index

public static shard operation failed exception [ ] group by ( shard operation failed exception [ ] failures ) { list < shard operation failed exception > unique failures = new array list < > ( ) ; set < group by > reasons = new hash set < > ( ) ; for ( shard operation failed exception failure : failures ) { group by reason = new group by ( failure ) ; if ( reasons contains ( reason ) = = false ) { reasons add ( reason ) ; unique failures add ( failure ) ; } } return unique failures to array ( new shard operation failed exception [ 0 ] ) ; }


clear the awaiting validation state and enter fetching

private void complete validation ( ) { if ( has position ( ) ) { transition state ( fetch states fetching , ( ) - > this next retry time ms = null ) ; } }


public static immutable double array of ( ) { return empty ; }


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


the directory in which blaze stores the server state - that is , the socket file and a log

private path get server directory ( ) { return get workspace ( ) get directories ( ) get output base ( ) get child ( " server " ) ; }


iterate all of the buckets implementations take into account the { @ link bucket count thresholds } in particular , if the { @ link bucket count thresholds # get min doc count ( ) } is 0 then they ' ll make sure to iterate a bucket even if it was never { { @ link # collect global ord collected } if { @ link bucket count thresholds # get min doc count ( ) } is not 0 then they ' ll skip all global ords that weren ' t collected

abstract void for each ( long owning bucket ord , bucket info consumer consumer ) throws i o exception ;


actually send the given array of mime messages via java mail

protected void do send ( mime message [ ] mime messages , @ nullable object [ ] original messages ) throws mail exception { map < object , exception > failed messages = new linked hash map < > ( ) ; transport transport = null ; try { for ( int i = 0 ; i < mime messages length ; i + + ) { / / check transport connection first if ( transport = = null | | ! transport is connected ( ) ) { if ( transport ! = null ) { try { transport close ( ) ; } catch ( exception ex ) { / / ignore - we ' re reconnecting anyway } transport = null ; } try { transport = connect transport ( ) ; } catch ( authentication failed exception ex ) { throw new mail authentication exception ( ex ) ; } catch ( exception ex ) { / / effectively , all remaining messages failed for ( int j = i ; j < mime messages length ; j + + ) { object original = ( original messages ! = null ? original messages [ j ] : mime messages [ j ] ) ; failed messages put ( original , ex ) ; } throw new mail send exception ( " mail server connection failed " , ex , failed messages ) ; } } / / send message via current transport mime message mime message = mime messages [ i ] ; try { if ( mime message get sent date ( ) = = null ) { mime message set sent date ( new date ( ) ) ; } string message id = mime message get message i d ( ) ; mime message save changes ( ) ; if ( message id ! = null ) { / / preserve explicitly specified message id mime message set header ( header message id , message id ) ; } address [ ] addresses = mime message get all recipients ( ) ; transport send message ( mime message , ( addresses ! = null ? addresses : new address [ 0 ] ) ) ; } catch ( exception ex ) { object original = ( original messages ! = null ? original messages [ i ] : mime message ) ; failed messages put ( original , ex ) ; } } } finally { try { if ( transport ! = null ) { transport close ( ) ; } } catch ( exception ex ) { if ( ! failed messages is empty ( ) ) { throw new mail send exception ( " failed to close server connection after message failures " , ex , failed messages ) ; } else { throw new mail send exception ( " failed to close server connection after message sending " , ex ) ; } } } if ( ! failed messages is empty ( ) ) { throw new mail send exception ( failed messages ) ; } }


it ' s an alias method for { @ link # get services ( ) } , but the more convenient

public set < string > get subscribed services ( ) { return split to set ( get services ( ) , comma separator char ) ; }


sets the minimum and maximum vector to zeros

public bounding box clr ( ) { return this set ( min set ( 0 , 0 , 0 ) , max set ( 0 , 0 , 0 ) ) ; }


adds the given { @ code cell } to the table , making it immutable if necessary duplicate key pairs are not allowed and will cause { @ link # build } to fail

public builder < r , c , v > put ( cell < ? extends r , ? extends c , ? extends v > cell ) { if ( cell instanceof tables immutable cell ) { check not null ( cell get row key ( ) , " row " ) ; check not null ( cell get column key ( ) , " column " ) ; check not null ( cell get value ( ) , " value " ) ; @ suppress warnings ( " unchecked " ) / / all supported methods are covariant cell < r , c , v > immutable cell = ( cell < r , c , v > ) cell ; cells add ( immutable cell ) ; } else { put ( cell get row key ( ) , cell get column key ( ) , cell get value ( ) ) ; } return this ; }


returns the java home directory corresponding to the current " java home " system property ( if it supported )

public file find supported java home from current java home ( java config java config , java filter java filter ) { set < file > potential java home set = new hash set < > ( ) ; string java home property = system get property ( " java home " ) ; if ( java home property ! = null & & ! java home property is empty ( ) ) { file dir = new file ( java home property ) ; if ( java filter equals ( java filter any ) | | java filter equals ( java filter jdk only ) ) { potential java home set add ( get jdk home from java home ( dir ) ) ; } if ( java filter equals ( java filter any ) | | java filter equals ( java filter jre only ) ) { potential java home set add ( get jre home from java home ( dir ) ) ; } for ( file potential java home dir : potential java home set ) { try { if ( java config is java version supported ( java config get java version ( potential java home dir , java filter ) ) ) { return potential java home dir ; } } catch ( parse exception | i o exception e ) { / / skip it } } } return null ; }


public long get start time ( ) { return start time ; }


connect to the specified server via framed transport

public t transport connect ( t transport transport , string server host ) throws i o exception , t transport exception ;


post fakecreate xml item : creates an xml item this route creates an xml item

default response entity < void > create xml item ( @ api param ( value = " xml item body " , required = true ) @ valid @ request body xml item xml item ) { return new response entity < > ( http status not implemented ) ; }


clear the list of events that were last generated

public void clear last events ( ) { event mgr clear last events ( ) ; }


return the i o exception thrown by the remote server wrapped in service exception as cause

public static i o exception get remote exception ( service exception se ) { throwable e = se get cause ( ) ; if ( e = = null ) { return new i o exception ( se ) ; } return e instanceof i o exception ? ( i o exception ) e : new i o exception ( se ) ; }


sets the state to state checking adts header

private void set checking adts header state ( ) { state = state checking adts header ; bytes read = 0 ; }


find purchase order by id for valid response try integer i ds with value & lt ; & # x 3 d ; 5 or & gt ; 10 other values will generated exceptions

public single < order > rx get order by id ( long order id , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate get order by id ( order id , auth info , fut ) ) ) ; }


return only the most recent builds warning : this method mutates the original list and then returns it

public run list < r > limit ( final int n ) { return limit ( new counting predicate < r > ( ) { public boolean apply ( int index , r input ) { return index < n ; } } ) ; }


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

public static fields find by name ( string name ) { return by name get ( name ) ; }


public class < ? > get column class ( int column index ) { if ( column index = = read | | column index = = write | | column index = = execute | | column index = = volatile | | column index = = overlay | | column index = = init ) { return boolean class ; } return string class ; }


public abstract security details validate peer object ( object peer object ) throws general security exception ;


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


use { @ link net utils # create socket addr ( string ) } instead

public static inet socket address create socket addr ( string target ) { return net utils create socket addr ( target ) ; }


public static bitmap rotate ( final bitmap src , final int degrees , final float px , final float py , final boolean recycle ) { if ( is empty bitmap ( src ) ) return null ; if ( degrees = = 0 ) return src ; matrix matrix = new matrix ( ) ; matrix set rotate ( degrees , px , py ) ; bitmap ret = bitmap create bitmap ( src , 0 , 0 , src get width ( ) , src get height ( ) , matrix , true ) ; if ( recycle & & ! src is recycled ( ) & & ret ! = src ) src recycle ( ) ; return ret ; }


a " certainty " threshold which defines the weight - of - evidence required before a term found in this field is identified as a useful connection

public vertex request shard min doc count ( int value ) { shard min doc count = value ; return this ; }


namespaces defined on this element < code > repeated aapt pb xml namespace namespace declaration = 1 ; < code >

private void remove namespace declaration ( int index ) { ensure namespace declaration is mutable ( ) ; namespace declaration remove ( index ) ; }


get the { @ link connect metrics } that uses kafka metrics and manages the jmx reporter

public connect metrics metrics ( ) { return metrics ; }


converts a { @ link file } into a { @ link path } and checks runtime exceptions

public static @ non null path file to path ( @ non null file file ) throws i o exception { try { return file to path ( ) ; } catch ( invalid path exception e ) { throw new i o exception ( e ) ; } }


returns if the path should be included the request is ignored if it is a search query , a page revision , related to users or user management , or talk pages

public boolean is allowed ( string path ) { for ( string filter : starts with filter ) { if ( path starts with ( filter ) ) { return false ; } } for ( string filter : contains filter ) { if ( path contains ( filter ) ) { return false ; } } return true ; }


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


returns an element less than the { @ link # samples ( ) } and less than { @ link # below samples greater ( ) }


set the ( optional ) specification file associated with this language

public void set spec file ( resource file spec file ) { this spec file = spec file ; }


post fakeouterboolean test serialization of outer boolean types

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


adds a route to the given handler function that handles http { @ code put } requests

builder put ( handler function < server response > handler function ) ;


we only rebuild the journal when it will halve the size of the journal and eliminate at least 2000 ops

private boolean journal rebuild required ( ) { final int redundant op compact threshold = 2000 ; return redundant op count > = redundant op compact threshold / / & & redundant op count > = lru entries size ( ) ; }


regression test for hdfs - 3891 : select input streams should throw an exception when a majority of journalnodes have crashed

public void test select input streams majority down ( ) throws exception { / / shut down all of the j ns cluster shutdown ( ) ; list < edit log input stream > streams = lists new array list ( ) ; try { qjm select input streams ( streams , 0 , false ) ; fail ( " did not throw ioe " ) ; } catch ( quorum exception ioe ) { generic test utils assert exception contains ( " got too many exceptions " , ioe ) ; assert true ( streams is empty ( ) ) ; } }


public builder add proto files ( nested set < artifact > proto files ) { this proto files add transitive ( proto files ) ; return this ; }


set the order for the resulting { @ link simple url handler mapping } relative to other handler mappings configured in spring mvc the default value is 1

public void set order ( int order ) { this order = order ; }


postmultiplies this matrix with a scale matrix postmultiplication is also used by open g l es ' 1 x gl translategl rotategl scale

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


set analyzer timeout on a per - file basis

public void set per file analysis timeout ( string string in secs ) throws invalid input exception { try { per file timeout = integer parse int ( string in secs ) ; } catch ( number format exception nfe ) { throw new invalid input exception ( " ' " + string in secs + " ' is not a valid integer representation " ) ; } }


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

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


public void test complex quadrilateral ( ) { / / todo : test complex quadrilateral }


get the aggregated value that an aggregator computed in the previous iteration

public < t extends value > t get previous iteration aggregate ( string name ) { return this runtime context get previous iteration aggregate ( name ) ; }


public string to human ( ) { return integer to string ( get int bits ( ) ) ; }


generate html for preview , using markup formatter can be called from other views

public http response do preview description ( @ query parameter string text ) throws i o exception { string writer w = new string writer ( ) ; translate ( text , w ) ; map < string , string > extra headers = collections empty map ( ) ; if ( previews set csp ) { extra headers = stream of ( " content - security - policy " , " x - web kit - csp " , " x - content - security - policy " ) collect ( collectors to map ( function identity ( ) , v - > " default - src ' none ' ; " ) ) ; } return html ( 200 , w to string ( ) , extra headers ) ; }


returns a fragment of the output directory name for this configuration the output directory for the whole configuration contains all the short names by all fragments

public string get output directory name ( ) { return null ; }


utility to generate the documentation for the connect metrics

public static void main ( string [ ] args ) { connect metrics registry metrics = new connect metrics registry ( ) ; system out println ( metrics to html table ( jmx prefix , metrics get all templates ( ) ) ) ; }


public static short max ( short a , short b ) { return a > = b ? a : b ; }


returns a new { @ link serialization result } with the same future ( if any ) and { @ code new obj } replacing the current { @ link # get object }

public abstract < s > serialization result < s > with ( s new obj ) ;


serializes and deserializes the specified object

static < t > t reserialize ( t object ) { check not null ( object ) ; byte array output stream bytes = new byte array output stream ( ) ; try { object output stream out = new object output stream ( bytes ) ; out write object ( object ) ; object input stream in = new object input stream ( new byte array input stream ( bytes to byte array ( ) ) ) ; return ( t ) in read object ( ) ; } catch ( i o exception | class not found exception e ) { throw new runtime exception ( e ) ; } }


test that a failure to connect to hdfs does not cause the init ( ) method to fail

public void test init with no h d f s ( ) { string path = " hdfs : / / " + cluster get name node ( ) get host and port ( ) + " / tmp " ; shutdown hdfs ( ) ; mock sink errored = false ; init metrics system ( path , true , false ) ; assert true ( " the sink was not initialized as expected " , mock sink initialized ) ; assert false ( " the sink threw an unexpected error on initialization " , mock sink errored ) ; }


specify whether to copy a byte array string into a temporary jdbc blob clob object created through the jdbc 4 0 { @ code create blob } { @ code create clob } methods default is " false " , using the common jdbc 2 0 { @ code set binary stream } { @ code set character stream } method for setting the content switch this to " true " for explicit blob clob creation using jdbc 4 0 this setting affects stream arguments as well as byte array string arguments , requiring jdbc 4 0 support for supporting lob content against jdbc 3 0 , check out the { @ link # set wrap as lob " wrap as lob " } setting

public void set create temporary lob ( boolean create temporary lob ) { this create temporary lob = create temporary lob ; }


tests that the elasticsearch sink works properly with yaml

public void run elasticsearch sink yaml test ( ) throws exception { run elastic search sink test ( " elasticsearch - sink - test - yaml - index " , source sink data test kit : : get yaml sink function ) ; }


test for set owner when authorization is enabled and the userlist is specified as ' '

public void test set owner succeeds for any user when wild card is specified ( ) throws throwable { fs update chown allowed users ( collections singleton list ( " * " ) ) ; final path test path = new path ( " / test set owner positive wildcard " ) ; configuration conf = fs get conf ( ) ; authorizer init ( conf ) ; authorizer add auth rule for owner ( " / " , write , true ) ; fs update wasb authorizer ( authorizer ) ; final string new owner = " newowner " ; final string new group = " newgroup " ; user group information user = user group information create user for testing ( " anyuser " , new string [ ] { " group 1 " } ) ; try { fs mkdirs ( test path ) ; contract test utils assert path exists ( fs , " test path does not exist " , test path ) ; string owner = fs get file status ( test path ) get owner ( ) ; assume assume true ( " changing owner requires original and new owner to be different " , ! string utils equals ignore case ( owner , new owner ) ) ; user do as ( new privileged exception action < void > ( ) { @ override public void run ( ) throws exception { fs set owner ( test path , new owner , new group ) ; assert owner equals ( test path , new owner ) ; assert equals ( new group , fs get file status ( test path ) get group ( ) ) ; return null ; } } ) ; } finally { fs delete ( test path , false ) ; } }


write all built - in data types declarations into ansi - c code those types whose name matches the corresponding primitive c - type are not included

private void write built in declarations ( data type manager manager ) throws i o exception { try { write ( data type default , task monitor adapter dummy monitor ) ; source archive built in archive = manager get source archive ( data type manager built in archive universal id ) ; if ( built in archive = = null ) { return ; } for ( data type dt : manager get data types ( built in archive ) ) { if ( ( dt instanceof pointer ) | | ( dt instanceof factory data type ) | | ( dt instanceof dynamic ) ) { continue ; } write ( dt , task monitor adapter dummy monitor ) ; } } catch ( cancelled exception e ) { / / ignore - should never occur with dummy monitor } writer flush ( ) ; }


sleeps for the specified number of milliseconds

public void pause ( int millisecs ) { stb pause ( millisecs ) ; }


a wrapper around { @ code private static final dalvik system dex path list # make path elements }

private static object [ ] make path elements ( object dex path list , array list < file > files , file optimized directory , array list < i o exception > suppressed exceptions ) throws illegal access exception , invocation target exception , no such method exception { method make path elements ; try { make path elements = share reflect util find method ( dex path list , " make path elements " , list class , file class , list class ) ; } catch ( no such method exception e ) { share tinker log e ( tag , " no such method exception : make path elements ( list , file , list ) failure " ) ; try { make path elements = share reflect util find method ( dex path list , " make path elements " , array list class , file class , array list class ) ; } catch ( no such method exception e 1 ) { share tinker log e ( tag , " no such method exception : make dex elements ( array list , file , array list ) failure " ) ; try { share tinker log e ( tag , " no such method exception : try use v 1 9 instead " ) ; return v19 make dex elements ( dex path list , files , optimized directory , suppressed exceptions ) ; } catch ( no such method exception e 2 ) { share tinker log e ( tag , " no such method exception : make dex elements ( list , file , list ) failure " ) ; throw e 2 ; } } } return ( object [ ] ) make path elements invoke ( dex path list , files , optimized directory , suppressed exceptions ) ; }


de - serializes metrics from the given byte array and returns them as a list of { @ link metric dump }

public list < metric dump > deserialize ( metric dump serialization metric serialization result data ) { data input view counters input view = new data input deserializer ( data serialized counters , 0 , data serialized counters length ) ; data input view gauges input view = new data input deserializer ( data serialized gauges , 0 , data serialized gauges length ) ; data input view meters input view = new data input deserializer ( data serialized meters , 0 , data serialized meters length ) ; data input view histograms input view = new data input deserializer ( data serialized histograms , 0 , data serialized histograms length ) ; list < metric dump > metrics = new array list < > ( data num counters + data num gauges + data num meters + data num histograms ) ; for ( int x = 0 ; x < data num counters ; x + + ) { try { metrics add ( deserialize counter ( counters input view ) ) ; } catch ( exception e ) { log debug ( " failed to deserialize counter " , e ) ; } } for ( int x = 0 ; x < data num gauges ; x + + ) { try { metrics add ( deserialize gauge ( gauges input view ) ) ; } catch ( exception e ) { log debug ( " failed to deserialize gauge " , e ) ; } } for ( int x = 0 ; x < data num meters ; x + + ) { try { metrics add ( deserialize meter ( meters input view ) ) ; } catch ( exception e ) { log debug ( " failed to deserialize meter " , e ) ; } } for ( int x = 0 ; x < data num histograms ; x + + ) { try { metrics add ( deserialize histogram ( histograms input view ) ) ; } catch ( exception e ) { log debug ( " failed to deserialize histogram " , e ) ; } } return metrics ; }


public component get active component ( ) { if ( focused placeholder ! = null ) { return focused placeholder get component ( ) ; } return null ; }


update the { @ link # next flush } variable to the next flush time add an integer number of flush intervals , preserving the initial random offset

protected void update flush time ( date now ) { / / in non - initial rounds , add an integer number of intervals to the last / / flush until a time in the future is achieved , thus preserving the / / original random offset int millis = ( int ) ( ( ( now get time ( ) - next flush get time in millis ( ) ) / roll interval millis + 1 ) * roll interval millis ) ; next flush add ( calendar millisecond , millis ) ; }


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


returns the component that will receive focus when the dialog is shown

public component get focus component ( ) { return focus component ; }


return all of the currently managed bundles

public collection < ghidra bundle > get ghidra bundles ( ) { return file to bundle map values ( ) ; }


test that program merge can determine that function param offsets are different

public void test apply function param offset diff ( ) throws exception { / / 0x 0 1 0 0 3 2d 5 : changed param offset from 0x 8 to 0x 4 in p 2 address set as = new address set ( ) ; as add range ( addr ( 0x 0 1 0 0 3 2d 5 ) , addr ( 0x 0 1 0 0 3 3f 5 ) ) ; program merge = new program merge manager ( p 1 , p 2 , as , task monitor adapter dummy monitor ) ; address set diff as = new address set ( ) ; / / for now , we are not allowing you to set the parameter offset or local size outright / / diff as add range ( addr ( 0x 0 1 0 0 3 2d 5 ) , addr ( 0x 0 1 0 0 3 2d 5 ) ) ; program merge set diff filter ( new program diff filter ( program diff filter function diffs ) ) ; program merge set merge filter ( new program merge filter ( program merge filter functions , program merge filter replace ) ) ; assert equals ( diff as , program merge get filtered differences ( ) ) ; program merge merge ( as , task monitor adapter dummy monitor ) ; assert equals ( new address set ( ) , program merge get filtered differences ( ) ) ; }


public void map number test ( ) { / / todo : test map number }


adds the specified value to the current set


expose the name of the current transaction , if any called by the transaction manager on transaction begin and on cleanup

public static void set current transaction name ( @ nullable string name ) { current transaction name set ( name ) ; }


the full matrix for the { @ link # get main image ( ) } from { @ link # root } down

matrix get main image full matrix ( ) { matrix matrix = new matrix ( ) ; matrix pre concat ( view get local matrix ( ) ) ; matrix pre concat ( get main image full matrix from flip rotate ( ) ) ; return matrix ; }


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 ;


both constructors use this init method , as it is impossible to pass a " this " reference from one constructor to another

private void init ( object delegate ) { assert not null ( delegate , " delegate must not be null " ) ; this delegate = delegate ; implement interfaces on object ( delegate ) ; / / we don ' t want to expose the control interface suppress interface ( introduction interceptor class ) ; suppress interface ( dynamic introduction advice class ) ; }


public void rename ( string new name ) throws failure , form exception { if ( name equals ( new name ) ) return ; / / noop jenkins check good name ( new name ) ; if ( owner get view ( new name ) ! = null ) throw new form exception ( messages hudson view already exists ( new name ) , " name " ) ; string old name = name ; name = new name ; owner on view renamed ( this , old name , new name ) ; }


releases a task executor with the given { @ link resource i d } from the { @ link slot pool }

boolean release task manager ( final resource i d resource id , final exception cause ) ;


are two interval sets equal ? because all intervals are sorted and disjoint , equals is a simple linear walk over both lists to make sure they are the same interval equals ( ) is used by the list equals ( ) method to check the ranges

public boolean equals ( object obj ) { if ( obj = = null | | ! ( obj instanceof interval set ) ) { return false ; } interval set other = ( interval set ) obj ; return this intervals equals ( other intervals ) ; }


populate the put role request from the source and the role ' s name

public put role request builder source ( string name , bytes reference source , x content type x content type ) throws i o exception { / / we pass false as last parameter because we want to reject the request if field permissions / / are given in 2 x syntax role descriptor descriptor = role descriptor parse ( name , source , false , x content type ) ; assert name equals ( descriptor get name ( ) ) ; request name ( name ) ; request cluster ( descriptor get cluster privileges ( ) ) ; request conditional cluster ( descriptor get conditional cluster privileges ( ) ) ; request add index ( descriptor get indices privileges ( ) ) ; request add application privileges ( descriptor get application privileges ( ) ) ; request run as ( descriptor get run as ( ) ) ; request metadata ( descriptor get metadata ( ) ) ; return this ; }


bind view annotated fields and methods in the specified { @ code target } using the { @ code source } { @ link dialog } as the view root

public static unbinder bind ( @ non null object target , @ non null dialog source ) { view source view = source get window ( ) get decor view ( ) ; return bind ( target , source view ) ; }


returns an unmodifiable view of the specified collection of entries the { @ link entry # set value } operation throws an { @ link unsupported operation exception } if the specified collection is a { @ code set } , the returned collection is also a { @ code set }

private static < k , v > collection < entry < k , v > > unmodifiable entries ( collection < entry < k , v > > entries ) { if ( entries instanceof set ) { return maps unmodifiable entry set ( ( set < entry < k , v > > ) entries ) ; } return new maps unmodifiable entries < > ( collections unmodifiable collection ( entries ) ) ; }


should the contents of the directory be shown or just the directory ?

boolean is dir recurse ( ) { return this dir recurse ; }


public int get map value ( ) { return map value ; }


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


used in conjunction with { @ link # get quorum timeout increase millis ( long , int ) } to check for pauses

private void restart quorum stop watch ( ) { quorum stop watch reset ( ) start ( ) ; }


@ t c description : nacos open a p i @ test step : 1 2 @ expect result :

public void nacos open a p i query beta delete ( ) { http rest result < string > result = null ; try { final string content = " test - beta " ; map < string , string > headers = new hash map < > ( ) ; headers put ( " beta ips " , " 127 0 0 1 " ) ; map < string , string > params = new hash map < > ( ) ; params put ( " data id " , data id ) ; params put ( " group " , group ) ; params put ( " content " , content ) ; result = agent http post ( config controller path + " / " , headers , params , agent get encode ( ) , time out ) ; assert assert equals ( http u r l connection http ok , result get code ( ) ) ; assert assert equals ( " true " , result get data ( ) ) ; params clear ( ) ; params put ( " data id " , data id ) ; params put ( " group " , group ) ; params put ( " beta " , " true " ) ; result = agent http delete ( config controller path + " / " , null , params , agent get encode ( ) , time out ) ; assert assert equals ( http u r l connection http ok , result get code ( ) ) ; assert assert true ( jackson utils to obj ( result get data ( ) ) get ( " data " ) boolean value ( ) ) ; } catch ( exception e ) { e print stack trace ( ) ; assert fail ( ) ; } }


add the given { @ link property source } to the end of the chain

public void add property source ( property source < ? > property source ) { this property sources add ( property source ) ; }


void expand ( ) { atomic reference array < reference entry < k , v > > old table = table ; int old capacity = old table length ( ) ; if ( old capacity > = maximum capacity ) { return ; } / * * reclassify nodes in each list to new map because we are using power - of - two expansion , the * elements from each bin must either stay at same index , or move with a power of two offset * we eliminate unnecessary node creation by catching cases where old nodes can be reused * because their next fields won ' t change statistically , at the default threshold , only about * one - sixth of them need cloning when a table doubles the nodes they replace will be garbage * collectable as soon as they are no longer referenced by any reader thread that may be in * the midst of traversing table right now * / int new count = count ; atomic reference array < reference entry < k , v > > new table = new entry array ( old capacity < < 1 ) ; threshold = new table length ( ) * 3 / 4 ; int new mask = new table length ( ) - 1 ; for ( int old index = 0 ; old index < old capacity ; + + old index ) { / / we need to guarantee that any existing reads of old map can / / proceed so we cannot yet null out each bin reference entry < k , v > head = old table get ( old index ) ; if ( head ! = null ) { reference entry < k , v > next = head get next ( ) ; int head index = head get hash ( ) & new mask ; / / single node on list if ( next = = null ) { new table set ( head index , head ) ; } else { / / reuse the consecutive sequence of nodes with the same target / / index from the end of the list tail points to the first / / entry in the reusable list reference entry < k , v > tail = head ; int tail index = head index ; for ( reference entry < k , v > e = next ; e ! = null ; e = e get next ( ) ) { int new index = e get hash ( ) & new mask ; if ( new index ! = tail index ) { / / the index changed we ' ll need to copy the previous entry tail index = new index ; tail = e ; } } new table set ( tail index , tail ) ; / / clone nodes leading up to the tail for ( reference entry < k , v > e = head ; e ! = tail ; e = e get next ( ) ) { int new index = e get hash ( ) & new mask ; reference entry < k , v > new next = new table get ( new index ) ; reference entry < k , v > new first = copy entry ( e , new next ) ; if ( new first ! = null ) { new table set ( new index , new first ) ; } else { remove collected entry ( e ) ; new count - - ; } } } } } table = new table ; this count = new count ; }


computing the features on an empty recon should not fail

public void test compute features ( ) { standard recon config stub stub = new standard recon config stub ( ) ; recon recon = stub create new recon ( 2384738l ) ; stub compute features ( recon , " my string " ) ; assert not null ( recon features ) ; }


null - safe check if the specified collection is empty null returns true

public static boolean is empty ( collection coll ) { return ( coll = = null | | coll is empty ( ) ) ; }


multiply { @ code rhs } by { @ code by } , and add the result to { @ code lhs } without creating any new { @ link resource } object

public static resource multiply and add to ( resource lhs , resource rhs , double by ) { int max length = resource utils get number of countable resource types ( ) ; for ( int i = 0 ; i < max length ; i + + ) { try { resource information rhs value = rhs get resource information ( i ) ; resource information lhs value = lhs get resource information ( i ) ; long converted rhs = ( long ) ( rhs value get value ( ) * by ) ; lhs set resource value ( i , lhs value get value ( ) + converted rhs ) ; } catch ( resource not found exception ye ) { log warn ( " resource is missing : " + ye get message ( ) ) ; } } return lhs ; }


returns the underlying implementation , useful for the footprint benchmark


returns the directories in which to look for headers ( pertains to headers not specifically listed in { @ code declared include srcs } )

public nested set < path fragment > get declared include dirs ( ) { return cc compilation context get loose hdrs dirs ( ) ; }


adds a new action to be added to the toolbar andor drop - down menu

void add action ( docking action if action ) { if ( ! swing utilities is event dispatch thread ( ) ) { throw new assert exception ( " actions must be added from swing thread " ) ; } if ( action get menu bar data ( ) ! = null ) { menu manager add action ( action ) ; } if ( action get tool bar data ( ) ! = null ) { tool bar manager add action ( action ) ; } update tool bar ( ) ; }


tests dynamic configuration of http principals

public void test dynamic principal discovery ( ) throws exception { string [ ] keytab users = new string [ ] { " http / host 1 " , " http / host 2 " , " http2 / host 1 " , " xhttp / host " } ; string keytab = kerberos test utils get keytab file ( ) ; get kdc ( ) create principal ( new file ( keytab ) , keytab users ) ; / / destroy handler created in set up ( ) handler destroy ( ) ; properties props = new properties ( ) ; props set property ( kerberos authentication handler keytab , keytab ) ; props set property ( kerberos authentication handler principal , " * " ) ; handler = get new authentication handler ( ) ; handler init ( props ) ; assert assert equals ( kerberos test utils get keytab file ( ) , handler get keytab ( ) ) ; set < kerberos principal > login principals = handler get principals ( ) ; for ( string user : keytab users ) { principal principal = new kerberos principal ( user + " @ " + kerberos test utils get realm ( ) ) ; boolean expected = user starts with ( " http / " ) ; assert assert equals ( " checking for " + user , expected , login principals contains ( principal ) ) ; } }


validate the given block name : cannot be null , cannot be an empty string , cannot contain control characters ( ascii 0 0x 1 9 ) < br > note : when producing an overlay memory space which corresponds to a block , the space name will be modified to be consistent with address space name restrictions and to ensure uniqueness

public static boolean is valid memory block name ( string name ) { if ( name = = null | | name length ( ) = = 0 ) { return false ; } for ( int i = 0 ; i < name length ( ) ; i + + ) { char c = name char at ( i ) ; if ( c < 0x 2 0 ) { return false ; } } return true ; }


check if hit timeout of retry , if not , throw an exception and start a new round of retry

private void check timeout or retry ( map host host , i o exception ioe ) throws i o exception { / / first time to retry long current time = time monotonic now ( ) ; if ( retry start time = = 0 ) { retry start time = current time ; } / / retry is not timeout , let ' s do retry with throwing an exception if ( current time - retry start time < this fetch retry timeout ) { log warn ( " shuffle output from " + host get host name ( ) + " failed , retry it " , ioe ) ; throw ioe ; } else { / / timeout , prepare to be failed log warn ( " timeout for copying map output with retry on host " + host + " after " + fetch retry timeout + " milliseconds " ) ; } }


create a { @ link cache key invocation context } based on the specified invocation

protected cache key invocation context < a > create cache key invocation context ( cache operation invocation context < o > context ) { return new default cache key invocation context < > ( context get operation ( ) , context get target ( ) , context get args ( ) ) ; }


proxy uses the hash code of the target source

public int hash code ( ) { return jdk dynamic aop proxy class hash code ( ) * 13 + this advised get target source ( ) hash code ( ) ; }


handles an incoming put request from a blob client

private void put ( input stream input stream , output stream output stream , byte [ ] buf ) throws i o exception { file incoming file = null ; try { / / read header contents : job id , ha mode / permanent or transient blob final int mode = input stream read ( ) ; if ( mode < 0 ) { throw new e o f exception ( " premature end of put request " ) ; } final job i d job id ; if ( mode = = job unrelated content ) { job id = null ; } else if ( mode = = job related content ) { byte [ ] jid bytes = new byte [ job i d size ] ; read fully ( input stream , jid bytes , 0 , job i d size , " job i d " ) ; job id = job i d from byte array ( jid bytes ) ; } else { throw new i o exception ( " unknown type of blob addressing " ) ; } final blob key blob type blob type ; { final int read = input stream read ( ) ; if ( read < 0 ) { throw new e o f exception ( " read an incomplete blob type " ) ; } else if ( read = = transient blob ordinal ( ) ) { blob type = transient blob ; } else if ( read = = permanent blob ordinal ( ) ) { blob type = permanent blob ; check argument ( job id ! = null , " invalid blob addressing for permanent b l o bs " ) ; } else { throw new i o exception ( " invalid data received for the blob type : " + read ) ; } } if ( log is debug enabled ( ) ) { log debug ( " received put request for blob of job { } with from { } " , job id , client socket get inet address ( ) ) ; } incoming file = blob server create temporary filename ( ) ; byte [ ] digest = read file fully ( input stream , incoming file , buf ) ; blob key blob key = blob server move temp file to store ( incoming file , job id , digest , blob type ) ; / / return computed key to client for validation output stream write ( return okay ) ; blob key write to output stream ( output stream ) ; } catch ( socket exception e ) { / / happens when the other side disconnects log debug ( " socket connection closed " , e ) ; } catch ( throwable t ) { log error ( " put operation failed " , t ) ; try { write error to stream ( output stream , t ) ; } catch ( i o exception e ) { / / since we are in an exception case , it means not much that we could not send the / / error / / ignore this } client socket close ( ) ; } finally { if ( incoming file ! = null ) { if ( ! incoming file delete ( ) & & incoming file exists ( ) ) { log warn ( " cannot delete blob server staging file " + incoming file get absolute path ( ) ) ; } } } }


select does match necessarily escaping the decoded value is used in the path

public void select name necessary escaping ( ) throws i o exception { json reader options options = json reader options of ( " \ n " , " \ u 0 0 0 0 " , " \ " " ) ; json reader reader = new reader ( " { \ " \ \ n \ " : 5 , \ " \ \ u 0 0 0 0 \ " : 5 , \ " \ \ \ " \ " : 5 } " ) ; reader begin object ( ) ; assert equals ( 0 , reader select name ( options ) ) ; assert equals ( 5 , reader next int ( ) ) ; assert equals ( " $ \ n " , reader get path ( ) ) ; assert equals ( 1 , reader select name ( options ) ) ; assert equals ( 5 , reader next int ( ) ) ; assert equals ( " $ \ u 0 0 0 0 " , reader get path ( ) ) ; assert equals ( 2 , reader select name ( options ) ) ; assert equals ( 5 , reader next int ( ) ) ; assert equals ( " $ \ " " , reader get path ( ) ) ; reader end object ( ) ; }


convenience wrapper around reconfig that takes lists of strings instead of comma - separated servers

public byte [ ] reconfigure ( list < string > joining servers , list < string > leaving servers , list < string > new members , long from config , stat stat ) throws keeper exception , interrupted exception { return reconfigure ( string utils join strings ( joining servers , " , " ) , string utils join strings ( leaving servers , " , " ) , string utils join strings ( new members , " , " ) , from config , stat ) ; }


output the proper model name ( capitalized ) in case the name belongs to the type system it won ' t be renamed

public string to model name ( final string name ) { / / allow for explicitly configured kotlin * and java * types if ( name starts with ( " kotlin " ) | | name starts with ( " java " ) ) { return name ; } / / if import mapping contains name , assume this is a legitimate model name if ( import mapping contains key ( name ) ) { return import mapping get ( name ) ; } string modified name = name replace all ( " \ \ " , " " ) ; string sanitized name = sanitize kotlin specific names ( modified name ) ; string name with prefix suffix = sanitized name ; if ( ! string utils is empty ( model name prefix ) ) { / / add ' ' so that model name can be camelized correctly name with prefix suffix = model name prefix + " " + name with prefix suffix ; } if ( ! string utils is empty ( model name suffix ) ) { / / add ' ' so that model name can be camelized correctly name with prefix suffix = name with prefix suffix + " " + model name suffix ; } / / camelize name of nested properties modified name = camelize ( name with prefix suffix ) ; / / model name cannot use reserved keyword , e g return if ( is reserved word ( modified name ) ) { final string model name = " model " + modified name ; logger warn ( modified name + " ( reserved word ) cannot be used as model name renamed to " + model name ) ; return model name ; } / / model name starts with number if ( modified name matches ( " ^ \ \ d * " ) ) { final string model name = " model " + modified name ; / / e g 2 0 0 response = > model 2 0 0 response ( after camelize ) logger warn ( name + " ( model name starts with number ) cannot be used as model name renamed to " + model name ) ; return model name ; } return title case ( modified name ) ; }


the instances are equal , but do not have object identity interceptors and interfaces and the target are the same

public void test singleton instances are equal ( ) { i test bean test 1 = ( i test bean ) factory get bean ( " test 1 " ) ; i test bean test 1 1 = ( i test bean ) factory get bean ( " test 1 " ) ; / / assert true ( " singleton instances = = " , test 1 = = test 1 1 ) ; assert that ( test 1 1 ) as ( " singleton instances = = " ) is equal to ( test 1 ) ; test 1 set age ( 25 ) ; assert that ( test 1 1 get age ( ) ) is equal to ( test 1 get age ( ) ) ; test 1 set age ( 250 ) ; assert that ( test 1 1 get age ( ) ) is equal to ( test 1 get age ( ) ) ; advised pc 1 = ( advised ) test 1 ; advised pc 2 = ( advised ) test 1 1 ; assert that ( pc 2 get advisors ( ) ) is equal to ( pc 1 get advisors ( ) ) ; int old length = pc 1 get advisors ( ) length ; nop interceptor di = new nop interceptor ( ) ; pc 1 add advice ( 1 , di ) ; assert that ( pc 2 get advisors ( ) ) is equal to ( pc 1 get advisors ( ) ) ; assert that ( pc 2 get advisors ( ) length ) as ( " now have one more advisor " ) is equal to ( ( old length + 1 ) ) ; assert that ( 0 ) is equal to ( di get count ( ) ) ; test 1 set age ( 5 ) ; assert that ( test 1 get age ( ) ) is equal to ( test 1 1 get age ( ) ) ; assert that ( 3 ) is equal to ( di get count ( ) ) ; }


run sql as text using the { @ code format } parameter to specify the format rather than an { @ code accept } header

private tuple < string , string > run sql as text format ( string sql , string format ) throws i o exception { request request = new request ( " post " , sql query rest endpoint ) ; request add parameter ( " error trace " , " true " ) ; request add parameter ( " format " , format ) ; request set json entity ( query ( sql ) to string ( ) ) ; response response = client ( ) perform request ( request ) ; return new tuple < > ( streams copy to string ( new input stream reader ( response get entity ( ) get content ( ) , standard charsets utf 8 ) ) , response get header ( " cursor " ) ) ; }


returns true if the element is package - private

public final boolean is package private ( ) { return ! is private ( ) & & ! is public ( ) & & ! is protected ( ) ; }


creates a { @ code test subscriber } with the given initial request amount

public static < t > test subscriber < t > create ( long initial requested ) { return new test subscriber < > ( initial requested ) ; }


returns a buffered reader for reading this file as characters @ throw gdx runtime exception if the file handle represents a directory , doesn ' t exist , or could not be read

public buffered reader reader ( int buffer size , string charset ) { try { return new buffered reader ( new input stream reader ( read ( ) , charset ) , buffer size ) ; } catch ( unsupported encoding exception ex ) { throw new gdx runtime exception ( " error reading file : " + this , ex ) ; } }


public integer get snake case ( ) { return snake case ; }


returns the repository name of the target pattern

public abstract repository name get repository ( ) ;


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

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


whether a resource handler has already been registered for the given path pattern

public boolean has mapping for pattern ( string path pattern ) { for ( resource handler registration registration : this registrations ) { if ( arrays as list ( registration get path patterns ( ) ) contains ( path pattern ) ) { return true ; } } return false ; }


creates a version - specific elasticsearch sink , using arbitrary transport addresses

protected abstract elasticsearch sink base < tuple 2 < integer , string > , c > create elasticsearch sink ( int bulk flush max actions , string cluster name , list < a > addresses , elasticsearch sink function < tuple 2 < integer , string > > elasticsearch sink function ) ;


gets the partition number of this partition

int get partition number ( ) { return this partition number ; }


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


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

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


switch a namenode in a nameservice to be in standby

public void switch to standby ( string ns id , string nn id ) { try { int total = cluster get num name nodes ( ) ; name node info [ ] nns = cluster get name node infos ( ) ; for ( int i = 0 ; i < total ; i + + ) { name node info nn = nns [ i ] ; if ( nn get nameservice id ( ) equals ( ns id ) & & nn get namenode id ( ) equals ( nn id ) ) { cluster transition to standby ( i ) ; } } } catch ( throwable e ) { log error ( " cannot transition to standby " , e ) ; } }


gets the unique id that identifies the resource manager

public resource i d get resource manager id ( ) { return resource manager resource id ; }


error callback for commit of last re - initialization

public void on commit last re initialization error ( container id container id , throwable t ) { }


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


test that for a large batch write request , the limit is handled correctly

private void do test batch write ( int num delete , int num put , dynamo d b metadata store ms ) throws i o exception { path path = new path ( " / i test dynamo d b metadata store test batch write " + num delete + ' ' + num put ) ; final path root = file system make qualified ( path ) ; final path old dir = new path ( root , " old dir " ) ; final path new dir = new path ( root , " new dir " ) ; log info ( " do test batch write : old dir = { } , new dir = { } " , old dir , new dir ) ; thread current thread ( ) set name ( string format ( " bulk put = % d ; delete = % d " , num put , num delete ) ) ; ancestor state put state = check not null ( ms initiate bulk write ( bulk operation state operation type put , new dir ) , " no state from initiate bulk write ( ) " ) ; ms put ( new path metadata ( dir status ( old dir ) ) , put state ) ; ms put ( new path metadata ( dir status ( new dir ) ) , put state ) ; final list < path metadata > old metas = num delete < 0 ? null : new array list < > ( num delete ) ; for ( int i = 0 ; i < num delete ; i + + ) { old metas add ( new path metadata ( basic file status ( new path ( old dir , " child " + i ) , i , false ) ) ) ; } final list < path metadata > new metas = num put < 0 ? null : new array list < > ( num put ) ; for ( int i = 0 ; i < num put ; i + + ) { new metas add ( new path metadata ( basic file status ( new path ( new dir , " child " + i ) , i , false ) ) ) ; } collection < path > paths to delete = null ; if ( old metas ! = null ) { / / put all metadata of old paths and verify ms put ( new dir listing metadata ( old dir , old metas , false ) , unchanged entries , put state ) ; assert equals ( " child count " , 0 , ms list children ( new dir ) without tombstones ( ) num entries ( ) ) ; assertions assert that ( ms list children ( old dir ) get listing ( ) ) described as ( " old directory listing " ) contains exactly in any order elements of ( old metas ) ; assert true ( collection utils is equal collection ( old metas , ms list children ( old dir ) get listing ( ) ) ) ; paths to delete = new array list < > ( old metas size ( ) ) ; for ( path metadata meta : old metas ) { paths to delete add ( meta get file status ( ) get path ( ) ) ; } } / / move the old paths to new paths and verify ancestor state state = check not null ( ms initiate bulk write ( bulk operation state operation type put , new dir ) , " no state from initiate bulk write ( ) " ) ; assert equals ( " bulk write destination " , new dir , state get dest ( ) ) ; throttle tracker throttle tracker = new throttle tracker ( ms ) ; try ( duration info ignored = new duration info ( log , true , " move " ) ) { ms move ( paths to delete , new metas , state ) ; } log info ( " throttle status { } " , throttle tracker ) ; assert equals ( " number of children in source directory " , 0 , ms list children ( old dir ) without tombstones ( ) num entries ( ) ) ; if ( new metas ! = null ) { assertions assert that ( ms list children ( new dir ) get listing ( ) ) described as ( " directory listing " ) contains all ( new metas ) ; if ( ! new metas is empty ( ) ) { assertions assert that ( state size ( ) ) described as ( " size of ancestor state " ) is greater than ( new metas size ( ) ) ; } } }


convert the order by clause if it contains invalid column names which conflict with s q lite keywords

public static string convert order by clause to valid name ( string order by ) { if ( ! text utils is empty ( order by ) ) { order by = order by trim ( ) to lower case ( locale us ) ; if ( order by contains ( " , " ) ) { string [ ] order by items = order by split ( " , " ) ; string builder builder = new string builder ( ) ; boolean need comma = false ; for ( string order by item : order by items ) { if ( need comma ) { builder append ( " , " ) ; } builder append ( convert order by item ( order by item ) ) ; need comma = true ; } order by = builder to string ( ) ; } else { order by = convert order by item ( order by ) ; } return order by ; } return null ; }


returns the target kind for all input files

public static string target kind ( ) { return " source file " ; }


subclasses may override this to perform custom initialization all bean properties of this filter will have been set before this method is invoked note : this method will be called from standard filter initialization as well as filter bean initialization in a spring application context filter name and servlet context will be available in both cases this default implementation is empty

protected void init filter bean ( ) throws servlet exception { }


returns the tool event name corresponding to the given plugin event class if no corresponding tool event exists , null will be returned

public static string lookup tool event name ( class < ? > plugin event class ) { tool event name event name annotation = plugin event class get annotation ( tool event name class ) ; if ( event name annotation ! = null ) { return event name annotation value ( ) ; } return null ; }


private void append remainder ( ) { if ( iter get index ( ) < iter get length ( ) ) { genericized string append ( iter get string ( ) substring ( iter get index ( ) ) ) ; } }


get the aggregated value that an aggregator computed in the previous iteration

public < t extends value > t get previous iteration aggregate ( string name ) { return this runtime context get previous iteration aggregate ( name ) ; }


determine if the user has at least one " new " token that was created after the last use of the legacy token

public boolean has fresh token ( @ non null user user , api token property token info and stats legacy stats ) { if ( legacy stats = = null ) { return false ; } api token property api token property = user get property ( api token property class ) ; return api token property get token list ( ) stream ( ) filter ( token - > ! token is legacy ) any match ( token - > { date creation date = token creation date ; date last use date = legacy stats last use date ; if ( last use date = = null ) { last use date = legacy stats creation date ; } return creation date ! = null & & last use date ! = null & & creation date after ( last use date ) ; } ) ; }


< code > merge properties < code > merges user defined property differences within the specified address set

public void merge properties ( address set view origin address set , task monitor monitor ) throws cancelled exception , unsupported operation exception { if ( ! origin to result translator is one for one translator ( ) ) { string message = origin to result translator get class ( ) get name ( ) + " is not a one for one translator and can ' t merge properties " ; throw new unsupported operation exception ( message ) ; } monitor set message ( " applying properties " ) ; if ( origin address set is empty ( ) ) { return ; } / / get the addresses in the set address iterator origin iter = origin address set get addresses ( true ) ; / / get each address in the address set and change the property for ( long count = 0 ; origin iter has next ( ) & & ! monitor is cancelled ( ) ; count + + ) { monitor check canceled ( ) ; address origin address = origin iter next ( ) ; if ( count = = progress counter granularity ) { monitor set message ( " applying properties " + origin address to string ( true ) ) ; count = 0 ; } merge properties at address ( origin address ) ; } }


test serialization of object with outer number type

public void fake outer composite serialize test ( test context context ) { async async = context async ( ) ; outer composite body = null ; api fake outer composite serialize ( body , result - > { / / todo : test validations async complete ( ) ; } ) ; }


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


returns the number of { @ link action } objects present in this value

default int get num actions ( ) { return get actions ( ) size ( ) ; }


sets up the change address sets , diffs between the various program versions , and merges from various versions to the resulting program

private void init merge info ( ) { / / memory merge may have limited the changed code units we are working with address set view result set = result pgm get memory ( ) ; this latest set = latest changes get register address set ( ) intersect ( result set ) ; this my set = my changes get register address set ( ) intersect ( result set ) ; original context = original pgm get program context ( ) ; latest context = latest pgm get program context ( ) ; my context = my pgm get program context ( ) ; result context = result pgm get program context ( ) ; registers = my context get registers ( ) ; try { diff original latest = new program diff ( original pgm , latest pgm ) ; diff original my = new program diff ( original pgm , my pgm ) ; diff filter = new program diff filter ( program diff filter program context diffs ) ; merge filter = new program merge filter ( program merge filter program context , program merge filter replace ) ; } catch ( program conflict exception e ) { msg error ( this , " unexpected exception : " + e get message ( ) , e ) ; } catch ( illegal argument exception e ) { msg error ( this , " unexpected exception : " + e get message ( ) , e ) ; } }


public static void close all services ( ) { agent typed s p i registry get all registered service ( plugin boot service class ) for each ( each - > { try { each close ( ) ; / / checkstyle : off } catch ( final throwable ex ) { / / checkstyle : on log error ( " failed to close service " , ex ) ; } } ) ; }


returns the set of all constants referred to by instructions added to this instance

public hash set < constant > get all constants ( ) { hash set < constant > result = new hash set < constant > ( 20 ) ; for ( dalv insn insn : insns ) { add constants ( result , insn ) ; } return result ; }


set the program after all the managers have been created

public void set program ( program d b program ) { this program = program ; equate table = program get equate table ( ) ; symbol table = ( symbol manager ) program get symbol table ( ) ; context mgr = program get program context ( ) ; ref manager = program get reference manager ( ) ; property map mgr = program get usr property manager ( ) ; data manager = program get data type manager ( ) ; proto mgr set program ( program ) ; }


identifier used to encode this strategy , when marshalled as part of a bloom filter only values in the [ - 128 , 127 ] range are valid for the compact serial form non - negative values are reserved for enums defined in bloom filter strategies ; negative values are reserved for any custom , stateful strategy we may define ( e g any kind of strategy that would depend on user input )


returns the { @ link android graphics bitmap config } of the { @ link android graphics bitmap bitmaps }

bitmap config get config ( ) { return config ; }


subclasses should override this method if it is interested when a program is closed this event has no affect on the " current program " a " program deactivated " call will occur that affects the active program

protected void program closed ( program program ) { }


hook method that subclasses may override to post - process compilation this implementation does nothing

protected void on compile internal ( ) { }


override the http2 authority the channel claims to be connecting to this is not generally safe overriding allows advanced users to re - use a single channel for multiple services , even if those services are hosted on different domain names that assumes the server is virtually hosting multiple domains and is guaranteed to continue doing so it is rare for a service provider to make such a guarantee at this time , there is no security verification of the overridden value , such as making sure the authority matches the server ' s tls certificate

public call options with authority ( @ nullable string authority ) { call options new options = new call options ( this ) ; new options authority = authority ; return new options ; }


an expectation for checking web element with given locator has attribute which contains specific value

public static expected condition < boolean > attribute contains ( final by locator , final string attribute , final string value ) { return new expected condition < boolean > ( ) { @ override public boolean apply ( web driver driver ) { return get attribute or css value ( driver find element ( locator ) , attribute ) map ( seen - > seen contains ( value ) ) or else ( false ) ; } @ override public string to string ( ) { return string format ( " value found by % s to contain \ " % s \ " " , locator , value ) ; } } ; }


convenience method to get this element as a { @ link json primitive } if the element is of some other type , a { @ link illegal state exception } will result hence it is best to use this method after ensuring that this element is of the desired type by calling { @ link # is json primitive ( ) } first

public json primitive get as json primitive ( ) { if ( is json primitive ( ) ) { return ( json primitive ) this ; } throw new illegal state exception ( " not a json primitive : " + this ) ; }


sets a task monitor that will be called back with messages that report the status of the initialization process

public void set task monitor ( task monitor monitor ) { this monitor = monitor ; }


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


loads all dependency jars from the default path

public static void add all dependency jars ( map < string , local resource > provider resources , slider file system slider file system , path temp path , string lib dir , string lib local src dir ) throws i o exception , slider exception { if ( service utils is set ( lib local src dir ) ) { file file = new file ( lib local src dir ) ; if ( ! file exists ( ) | | ! file is directory ( ) ) { throw new bad command arguments exception ( " supplied lib src dir % s is not valid " , lib local src dir ) ; } } service utils put all jars ( provider resources , slider file system , temp path , lib dir , lib local src dir ) ; }


immutable list < rule set > requires ( ) ;


look up the entity manager factory that this filter should use the default implementation looks for a bean with the specified name in spring ' s root application context

protected entity manager factory lookup entity manager factory ( ) { web application context wac = web application context utils get required web application context ( get servlet context ( ) ) ; string emf bean name = get entity manager factory bean name ( ) ; string pu name = get persistence unit name ( ) ; if ( string utils has length ( emf bean name ) ) { return wac get bean ( emf bean name , entity manager factory class ) ; } else if ( ! string utils has length ( pu name ) & & wac contains bean ( default entity manager factory bean name ) ) { return wac get bean ( default entity manager factory bean name , entity manager factory class ) ; } else { / / includes fallback search for single entity manager factory bean by type return entity manager factory utils find entity manager factory ( wac , pu name ) ; } }


prepare the request for updating an existing document using a script executes the script and returns a { @ code result } containing either a new { @ code index request } or { @ code delete request } ( depending on the script ' s returned " op " value ) to be executed on the primary and replicas

result prepare update script request ( shard id shard id , update request request , get result get result , long supplier now in millis ) { final index request current request = request doc ( ) ; final string routing = calculate routing ( get result , current request ) ; final tuple < x content type , map < string , object > > source and content = x content helper convert to map ( get result internal source ref ( ) , true ) ; final x content type update source content type = source and content v 1 ( ) ; final map < string , object > source as map = source and content v 2 ( ) ; map < string , object > ctx = new hash map < > ( 16 ) ; ctx put ( context fields op , update op type index to string ( ) ) ; / / the default operation is " index " ctx put ( context fields index , get result get index ( ) ) ; ctx put ( context fields type , mapper service single mapping name ) ; ctx put ( context fields id , get result get id ( ) ) ; ctx put ( context fields version , get result get version ( ) ) ; ctx put ( context fields routing , routing ) ; ctx put ( context fields source , source as map ) ; ctx put ( context fields now , now in millis get as long ( ) ) ; ctx = execute script ( request script , ctx ) ; update op type operation = update op type lenient from string ( ( string ) ctx get ( context fields op ) , logger , request script get id or code ( ) ) ; @ suppress warnings ( " unchecked " ) final map < string , object > updated source as map = ( map < string , object > ) ctx get ( context fields source ) ; switch ( operation ) { case index : final index request index request = requests index request ( request index ( ) ) id ( request id ( ) ) routing ( routing ) source ( updated source as map , update source content type ) set if seq no ( get result get seq no ( ) ) set if primary term ( get result get primary term ( ) ) wait for active shards ( request wait for active shards ( ) ) timeout ( request timeout ( ) ) set refresh policy ( request get refresh policy ( ) ) ; return new result ( index request , doc write response result updated , updated source as map , update source content type ) ; case delete : delete request delete request = requests delete request ( request index ( ) ) id ( request id ( ) ) routing ( routing ) set if seq no ( get result get seq no ( ) ) set if primary term ( get result get primary term ( ) ) wait for active shards ( request wait for active shards ( ) ) timeout ( request timeout ( ) ) set refresh policy ( request get refresh policy ( ) ) ; return new result ( delete request , doc write response result deleted , updated source as map , update source content type ) ; default : / / if it was neither an index or delete operation , treat it as a noop update response update = new update response ( shard id , get result get id ( ) , get result get seq no ( ) , get result get primary term ( ) , get result get version ( ) , doc write response result noop ) ; update set get result ( extract get result ( request , request index ( ) , get result get seq no ( ) , get result get primary term ( ) , get result get version ( ) , updated source as map , update source content type , get result internal source ref ( ) ) ) ; return new result ( update , doc write response result noop , updated source as map , update source content type ) ; } }


helper method to set username for the first http basic authentication

public void set username ( string username ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof http basic auth ) { ( ( http basic auth ) auth ) set username ( username ) ; return ; } } throw new runtime exception ( " no http basic authentication configured ! " ) ; }


check that the given char sequence is neither { @ code null } nor of length 0

public static boolean has length ( char sequence str ) { return ( str ! = null & & str length ( ) > 0 ) ; }


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


shifts full lines of text and fills the new empty space with text

public void shift lines ( string text , boolean forward ) { if ( text length ( ) = = 0 ) return ; int lines in text = ( text length ( ) - 1 ) / number of columns + 1 ; int current limit = math min ( data length ( ) , lines times columns ) ; text changing event event = new text changing event ( this ) ; event start = forward ? 0 : current limit ; event new text = text ; event replace char count = 0 ; event new char count = text length ( ) ; event replace line count = 0 ; event new line count = lines in text ; for ( text change listener my text listener : text listeners ) my text listener text changing ( event ) ; data insert ( event start , text ) ; text changed event changed event = new text changed event ( this ) ; for ( text change listener my text listener : text listeners ) my text listener text changed ( changed event ) ; event = new text changing event ( this ) ; / / event start = forward ? lines times columns : 0 ; event start = forward ? lines times columns - 1 : 0 ; event new text = " " ; event replace char count = lines in text * number of columns - lines times columns + current limit ; event new char count = 0 ; event replace line count = lines in text ; event new line count = 0 ; for ( text change listener my text listener : text listeners ) my text listener text changing ( event ) ; / / data delete ( event start , event start + event replace char count ) ; if ( forward ) data delete ( lines times columns , lines times columns + event replace char count ) ; else data delete ( 0 , event replace char count ) ; changed event = new text changed event ( this ) ; for ( text change listener my text listener : text listeners ) my text listener text changed ( changed event ) ; }


public string get mime type ( ) { return this mime type ; }


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


public void close ( ) { close ( true , true ) ; }


connect to two different servers with two different handles using the same session and make sure we cannot do any changes

public void test session move ( ) throws exception { string [ ] hps = qb host port split ( " , " ) ; disco watcher old watcher = new disco watcher ( ) ; disconnectable zoo keeper zk = new disconnectable zoo keeper ( hps [ 0 ] , client base connection timeout , old watcher ) ; zk create ( " / t 1 " , new byte [ 0 ] , zoo defs ids open acl unsafe , create mode ephemeral ) ; zk dont reconnect ( ) ; / / this should stomp the zk handle disco watcher watcher = new disco watcher ( ) ; disconnectable zoo keeper zknew = new disconnectable zoo keeper ( hps [ 1 ] , client base connection timeout , watcher , zk get session id ( ) , zk get session passwd ( ) ) ; zknew create ( " / t 2 " , new byte [ 0 ] , zoo defs ids open acl unsafe , create mode ephemeral ) ; try { zk create ( " / t 3 " , new byte [ 0 ] , zoo defs ids open acl unsafe , create mode ephemeral ) ; fail ( " should have lost the connection " ) ; } catch ( keeper exception connection loss exception e ) { / / wait up to 30 seconds for the disco to be delivered for ( int i = 0 ; i < 30 ; i + + ) { if ( old watcher zk disco ) { break ; } thread sleep ( 1000 ) ; } assert true ( old watcher zk disco ) ; } array list < zoo keeper > to close = new array list < zoo keeper > ( ) ; to close add ( zknew ) ; / / let ' s just make sure it can still move for ( int i = 0 ; i < 10 ; i + + ) { zknew dont reconnect ( ) ; zknew = new disconnectable zoo keeper ( hps [ 1 ] , client base connection timeout , new disco watcher ( ) , zk get session id ( ) , zk get session passwd ( ) ) ; to close add ( zknew ) ; zknew create ( " / t - " + i , new byte [ 0 ] , zoo defs ids open acl unsafe , create mode ephemeral ) ; } for ( zoo keeper z : to close ) { z close ( ) ; } zk close ( ) ; }


cancels touch focus for all listeners except the specified listener

public void cancel touch focus except ( @ null event listener except listener , @ null actor except actor ) { input event event = pools obtain ( input event class ) ; event set stage ( this ) ; event set type ( input event type touch up ) ; event set stage x ( integer min value ) ; event set stage y ( integer min value ) ; / / cancel all current touch focuses except for the specified listener , allowing for concurrent modification , and never / / cancel the same focus twice snapshot array < touch focus > touch focuses = this touch focuses ; touch focus [ ] items = touch focuses begin ( ) ; for ( int i = 0 , n = touch focuses size ; i < n ; i + + ) { touch focus focus = items [ i ] ; if ( focus listener = = except listener & & focus listener actor = = except actor ) continue ; if ( ! touch focuses remove value ( focus , true ) ) continue ; / / touch focus already gone event set target ( focus target ) ; event set listener actor ( focus listener actor ) ; event set pointer ( focus pointer ) ; event set button ( focus button ) ; focus listener handle ( event ) ; / / cannot return touch focus to pool , as it may still be in use ( eg if cancel touch focus is called from touch dragged ) } touch focuses end ( ) ; pools free ( event ) ; }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case success : return is set success ( ) ; } throw new illegal state exception ( ) ; }


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


closes this input stream as well as the underlying stream @ exception i o exception if an io error occurs while closing the underlying stream

public void close ( ) throws i o exception { if ( false = = closed ) { closed = true ; source close ( ) ; } }


return an iterator over the collection of { @ link schedulable entity } objects which orders them for container assignment

iterator < s > get assignment iterator ( iterator selector sel ) ;


returns the same instance since it is an immutable value

public json null deep copy ( ) { return instance ; }


public boolean is failed ( ) { return failure ! = null ; }


the offset of the part string into the parent string

public int get offset ( ) { return offset ; }


gets the action index to use for calls to { @ link recognizer # action }

public int get action index ( ) { return action index ; }


returns the remaining bytes in the pdb byte reader as a byte array

public byte [ ] parse bytes remaining ( ) { int remaining = limit - index ; byte [ ] selected bytes = arrays copy of range ( bytes , index , index + remaining ) ; index + = remaining ; return selected bytes ; }


returns all the metadata entries named ' name ' , in the order they were received , parsed as t , or null if there are none the iterator is not guaranteed to be " live " it may or may not be accurate if metadata is mutated

public < t > iterable < t > get all ( final key < t > key ) { for ( int i = 0 ; i < size ; i + + ) { if ( bytes equal ( key ascii name ( ) , name ( i ) ) ) { return new iterable at < > ( key , i ) ; } } return null ; }


judge should assign id value to model ' s id field the principle is that if id name is not null , id type is not null and id is greater than 0 , then should assign id value to it

private boolean should give model id value ( string id name , class < ? > id type , long id ) { return id name ! = null & & id type ! = null & & id > 0 ; }


sets custom { @ linkplain executor executor } for tasks of loading and displaying images < br > < br > < b > note : < b > if you set custom executor then following configuration options will not be considered for this executor : { @ link # thread pool size ( int ) } { @ link # thread priority ( int ) } { @ link # tasks processing order ( queue processing type ) }

public builder task executor ( executor executor ) { if ( thread pool size ! = default thread pool size | | thread priority ! = default thread priority | | tasks processing type ! = default task processing type ) { l w ( warning overlap executor ) ; } this task executor = executor ; return this ; }


stores a key - value pair in the multimap

public boolean put ( @ nullable decl k key , @ nullable decl v value ) { return super put ( key , value ) ; }


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


called from the drop tgt adapter when the drag operation is going over a drop site ; indicate when the drop is ok by providing appropriate feedback

public void drag under feedback ( boolean ok , drop target drag event e ) { synchronized ( root ) { draw feedback = true ; cancel editing ( ) ; if ( ok ) { point p = e get location ( ) ; tree path path = get path for location ( p x , p y ) ; if ( path = = null ) { return ; } destination node = ( program node ) path get last path component ( ) ; relative mouse pos = compare pointer location ( p , destination node ) ; int action = e get drop action ( ) ; drag source adapter set feedback cursor ( null ) ; cursor c = drag source adapter get drop ok cursor ( action ) ; if ( relative mouse pos ! = 0 ) { draw feedback = false ; c = drag source adapter get cursor ( action , relative mouse pos ) ; } else { dnd cell renderer set selection for drag ( plaf selection color ) ; dnd cell renderer set non selection for drag ( non selection drag color ) ; } drag source adapter set feedback cursor ( c ) ; } else { destination node = null ; dnd cell renderer set selection for drag ( color red ) ; dnd cell renderer set non selection for drag ( color red ) ; } point p = e get location ( ) ; dnd cell renderer set row for feedback ( get row for location ( p x , p y ) ) ; repaint ( ) ; } }


trying to rename a file onto itself should succeed ( it ' s a no - op )

public void test rename file to self ( ) throws throwable { if ( ! rename supported ( ) ) return ; path filepath = path ( " test / file " ) ; create file ( filepath ) ; / / hdfs expects rename src , src - > true rename ( filepath , filepath , true , true , true ) ; / / verify the file is still there assert is file ( filepath ) ; }


simple acl tests on a directory : set a default acl , remove default acls

private void test dir acls ( ) throws exception { if ( is local f s ( ) ) { return ; } final string def user 1 = " default : user : glarch : r - x " ; file system proxy fs = file system get ( get proxied f s conf ( ) ) ; file system httpfs = get http f s file system ( ) ; path dir = get proxied f s test dir ( ) ; / * acl status on a directory * / acl status proxy acl stat = proxy fs get acl status ( dir ) ; acl status httpfs acl stat = httpfs get acl status ( dir ) ; assert same acls ( httpfs acl stat , proxy acl stat ) ; assert same acls ( httpfs , proxy fs , dir ) ; / * set a default acl on the directory * / httpfs set acl ( dir , ( acl entry parse acl spec ( def user 1 , true ) ) ) ; proxy acl stat = proxy fs get acl status ( dir ) ; httpfs acl stat = httpfs get acl status ( dir ) ; assert same acls ( httpfs acl stat , proxy acl stat ) ; assert same acls ( httpfs , proxy fs , dir ) ; / * remove the default acl * / httpfs remove default acl ( dir ) ; proxy acl stat = proxy fs get acl status ( dir ) ; httpfs acl stat = httpfs get acl status ( dir ) ; assert same acls ( httpfs acl stat , proxy acl stat ) ; assert same acls ( httpfs , proxy fs , dir ) ; }


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

map < string , integer > get inventory ( ) ;


delete storeorder { order id } : 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

default response entity < void > delete order ( @ api param ( value = " id of the order that needs to be deleted " , required = true ) @ path variable ( " order id " ) string order id ) { return get delegate ( ) delete order ( order id ) ; }


notify all matching listeners registered with this application of an event if the specified { @ code event } is not an { @ link application event } , it is wrapped in a { @ link payload application event } such an event publication step is effectively a hand - off to the multicaster and does not imply synchronousasynchronous execution or even immediate execution at all event listeners are encouraged to be as efficient as possible , individually using asynchronous execution for longer - running and potentially blocking operations


test { @ link array writable } to array ( ) method

public void test array writable to array ( ) { text [ ] elements = { new text ( " zero " ) , new text ( " one " ) , new text ( " two " ) } ; text array writable array writable = new text array writable ( ) ; array writable set ( elements ) ; object array = array writable to array ( ) ; assert true ( " test array writable test array writable to array error ! ! ! " , array instanceof text [ ] ) ; text [ ] dest elements = ( text [ ] ) array ; for ( int i = 0 ; i < elements length ; i + + ) { assert equals ( dest elements [ i ] , elements [ i ] ) ; } }


get the url to advertise to other workers and clients this uses the default connector from the embedded jetty server , unless overrides for advertised hostname andor port are provided via configs { @ link # initialize server ( ) } must be invoked successfully before calling this method

public uri advertised url ( ) { uri builder builder = uri builder from uri ( jetty server get u r i ( ) ) ; string advertised security protocol = determine advertised protocol ( ) ; server connector server connector = find connector ( advertised security protocol ) ; builder scheme ( advertised security protocol ) ; string advertised hostname = config get string ( worker config rest advertised host name config ) ; if ( advertised hostname ! = null & & ! advertised hostname is empty ( ) ) builder host ( advertised hostname ) ; else if ( server connector ! = null & & server connector get host ( ) ! = null & & server connector get host ( ) length ( ) > 0 ) builder host ( server connector get host ( ) ) ; integer advertised port = config get int ( worker config rest advertised port config ) ; if ( advertised port ! = null ) builder port ( advertised port ) ; else if ( server connector ! = null & & server connector get port ( ) > 0 ) builder port ( server connector get port ( ) ) ; log info ( " advertised uri : { } " , builder build ( ) ) ; return builder build ( ) ; }


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

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


adds the given directories to the include directories ( they are passed with { @ code " - i " } to the compiler ) ; these are also passed to dependent rules

public cc compilation helper add include dirs ( iterable < path fragment > include dirs ) { iterables add all ( this include dirs , include dirs ) ; return this ; }


compresses the data using the provided hadoop { @ link compression codec } and { @ link configuration }

public compress writer factory < in > with hadoop compression ( string codec name , configuration hadoop config ) throws i o exception { this codec extension = get hadoop codec extension ( codec name , hadoop config ) ; this hadoop codec name = codec name ; for ( map entry < string , string > entry : hadoop config ) { hadoop config map put ( entry get key ( ) , entry get value ( ) ) ; } return this ; }


returns the corresponding primitive type of { @ code type } if it is a wrapper type ; otherwise returns { @ code type } itself idempotent unwrap ( integer class ) = = int class unwrap ( int class ) = = int class unwrap ( string class ) = = string class

public static < t > class < t > unwrap ( class < t > type ) { check not null ( type ) ; / / cast is safe : long class and long class are both of type class < long > @ suppress warnings ( " unchecked " ) class < t > unwrapped = ( class < t > ) wrapper to primitive type get ( type ) ; return ( unwrapped = = null ) ? type : unwrapped ; }


note : it ' s not enough for first and second to be empty , with trimming , they must also contain the same options classes

boolean are same ( ) { return first is empty ( ) & & second is empty ( ) & & extra second fragments is empty ( ) & & extra first fragments is empty ( ) & & differing options is empty ( ) & & starlark first is empty ( ) & & starlark second is empty ( ) & & extra starlark options first is empty ( ) & & extra starlark options second is empty ( ) ; }


creates list of users with given input array

public void create users with list input ( list < user > body , api client auth info auth info , handler < async result < void > > result handler ) { delegate create users with list input ( body , auth info , result handler ) ; }


verify that an empty { @ code list state } yields { @ code null }

public void test list state default value ( ) throws exception { checkpointable keyed state backend < integer > backend = create keyed backend ( int serializer instance ) ; list state descriptor < string > kv id = new list state descriptor < > ( " id " , string class ) ; list state < string > state = backend get partitioned state ( void namespace instance , void namespace serializer instance , kv id ) ; backend set current key ( 1 ) ; assert null ( state get ( ) ) ; state update ( arrays as list ( " ciao " , " bello " ) ) ; assert that ( state get ( ) , contains in any order ( " ciao " , " bello " ) ) ; state clear ( ) ; assert null ( state get ( ) ) ; backend dispose ( ) ; }


returns true if the provided string passes through the filter , or false if it should be removed

public boolean passes filter ( string flag ) { if ( all passes ) { return true ; } else { return ! no copts pattern matcher ( flag ) matches ( ) ; } }


add a listener to react to changes in the filter selection

public void add item listener ( item listener l ) { listener list add ( item listener class , l ) ; }


invoked when the current { @ link channel } has read a message from the peer

void channel read ( channel handler context ctx , object msg ) throws exception ;


displays a dialog containing the checkout information for a version controlled domain file the dialog is only displayed if the repository is connected and a single version controlled domain file is in the list from the domain file provider

private void view checkouts ( list < domain file > domain files ) { if ( ! check repository connected ( ) ) { return ; } if ( domain files size ( ) ! = 1 ) { return ; } try { domain file domain file = domain files get ( 0 ) ; user user = repository ! = null ? repository get user ( ) : null ; item checkout status [ ] checkouts = domain file get checkouts ( ) ; if ( checkouts length = = 0 ) { msg show info ( get class ( ) , tool get tool frame ( ) , " no checkouts exist " , " no checkouts exist for " + domain file get name ( ) ) ; } else { checkouts dialog dialog = new checkouts dialog ( tool , user , domain file , checkouts ) ; tool show dialog ( dialog ) ; } } catch ( i o exception e ) { client util handle exception ( repository , e , " fetch check out status " , tool get tool frame ( ) ) ; } }


see { @ link kafka producer # send offsets to transaction ( map , string ) }

void send offsets to transaction ( map < topic partition , offset and metadata > offsets , string consumer group id ) throws producer fenced exception ;


update gauges in zoo keeper metrics api gauges are callbacks served by internal components and the value is not held by prometheus structures

private void sample gauges ( ) { root context gauges values ( ) for each ( prometheus gauge wrapper : : sample ) ; }


given the class , list up its { @ link property type } s from its public fieldsgetters

private map < string , property type > build property types ( class < ? > clazz ) { map < string , property type > r = new hash map < > ( ) ; for ( field f : clazz get fields ( ) ) r put ( f get name ( ) , new property type ( f ) ) ; for ( method m : clazz get methods ( ) ) if ( m get name ( ) starts with ( " get " ) ) r put ( introspector decapitalize ( m get name ( ) substring ( 3 ) ) , new property type ( m ) ) ; return r ; }


if using android ' s embedded s q lite , this enables localized ordering of strings ( see { @ link # order asc ( property ) } and { @ link # order desc ( property ) } ) this uses " collate localized " , which is unavailable in s q l cipher ( in that case , the ordering is unchanged )

public query builder < t > prefer localized string order ( ) { / / s q l cipher 3 5 0 + does not understand " collate localized " if ( dao get database ( ) get raw database ( ) instanceof s q lite database ) { string order collation = " collate localized " ; } return this ; }


searches this database for functions that match a domain path substring

public list < function record > find functions by domain path substring ( string domain path ) { try { list < function record > list = functions table get function records by domain path substring ( domain path ) ; return list ; } catch ( i o exception e ) { msg error ( this , " serious problem searching for fid functions by domain path " , e ) ; } return null ; }


returns password entered by user or null if dialog was cancelled

char [ ] get password ( ) { return ( password = = null ? null : ( char [ ] ) password clone ( ) ) ; }