emits pcode to push a value of computational category 1 onto the stack

public void emit push cat 1 value ( string value name ) { varnode [ ] in = new varnode [ 2 ] ; in [ 0 ] = sp varnode ; in [ 1 ] = get constant ( 4 , sp varnode get size ( ) ) ; pcode op op = new pcode op ( op address , seqnum + + , pcode op int sub , in , sp varnode ) ; op list add ( op ) ; in = new varnode [ 3 ] ; in [ 0 ] = def space id ; in [ 1 ] = sp varnode ; in [ 2 ] = find register ( value name ) ; op = new pcode op ( op address , seqnum + + , pcode op store , in ) ; op list add ( op ) ; }


public static void shut down ( ) { s drawee controller builder supplier = null ; simple drawee view shut down ( ) ; image pipeline factory shut down ( ) ; }


set the service names that the dubbo interface subscribed

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


returns an artifact for a tool at the given root - relative path under the given root , creating it if not found this method only works for normalized , relative paths the root must be below the exec root parent , and the exec path of the resulting artifact is computed as { @ code root get relative ( root relative path ) relative to ( root exec root ) }

public artifact derived artifact get derived artifact ( path fragment root relative path , artifact root root , artifact owner owner ) { return get derived artifact ( root relative path , root , owner , / * content based path = * / false ) ; }


return a { @ link resolvable type } for the specified { @ link method } return type

public static resolvable type for method return type ( method method ) { assert not null ( method , " method must not be null " ) ; return for method parameter ( new method parameter ( method , - 1 ) ) ; }


the difference between this method and { @ link # decompress to intermediate buffer ( buffer ) } is that this method copies the decompressed data to the input { @ link buffer } starting from offset 0 the caller must guarantee that the input { @ link buffer } is writable and there ' s enough space left

public buffer decompress to original buffer ( buffer buffer ) { int decompressed len = decompress ( buffer ) ; / / copy the decompressed data back int memory segment offset = buffer get memory segment offset ( ) ; memory segment segment = buffer get memory segment ( ) ; segment put ( memory segment offset , internal buffer array ( ) , 0 , decompressed len ) ; return new read only sliced network buffer ( buffer as byte buf ( ) , 0 , decompressed len , memory segment offset , false ) ; }


static path qualify ( final o b s file system owner , final path path ) { return path make qualified ( owner get uri ( ) , owner get working directory ( ) ) ; }


returns a hash code for the elements of the given array

public static int hash code ( int [ ] array , int size ) { int hash code = 0 ; for ( int index = 0 ; index < size ; index + + ) { hash code ^ = array [ index ] ; } return hash code ; }


initialize a collection of file system layouts that will be used as the test matrix

private collection < test matrix entry > create test matrix ( ) { collection < test matrix entry > matrix = new array list < test matrix entry > ( ) ; / / single empty unprotected dir matrix add ( test matrix entry get ( ) add unprotected dir ( " / 1 " , true ) ) ; / / single empty protected dir matrix add ( test matrix entry get ( ) add protected dir ( " / 1 " , true ) ) ; / / nested unprotected dirs matrix add ( test matrix entry get ( ) add unprotected dir ( " / 1 " , true ) add unprotected dir ( " / 1 / 2 " , true ) add unprotected dir ( " / 1 / 2 / 3 " , true ) add unprotected dir ( " / 1 / 2 / 3 / 4 " , true ) ) ; / / non - empty protected dir matrix add ( test matrix entry get ( ) add protected dir ( " / 1 " , false ) add unprotected dir ( " / 1 / 2 " , true ) ) ; / / protected empty child of unprotected parent matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 " , true ) add unprotected dir ( " / 1 / 2 " , true ) ) ; / / protected empty child of protected parent / / we should not be able to delete the parent matrix add ( test matrix entry get ( ) add protected dir ( " / 1 " , false ) add protected dir ( " / 1 / 2 " , true ) ) ; / / one of each , non - nested matrix add ( test matrix entry get ( ) add protected dir ( " / 1 " , true ) add unprotected dir ( " / a " , true ) ) ; / / protected non - empty child of unprotected parent / / neither should be deletable matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 " , false ) add unprotected dir ( " / 1 / 2 / 3 " , true ) add unprotected dir ( " / 1 " , false ) ) ; / / protected non - empty child has unprotected siblings matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 2 " , false ) add unprotected dir ( " / 1 / 2 2 / 3 " , true ) add unprotected dir ( " / 1 / 2 1 " , true ) add unprotected dir ( " / 1 / 2 3 " , true ) add unprotected dir ( " / 1 " , false ) ) ; / / deeply nested protected child matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 / 3 / 4 / 5 " , false ) add unprotected dir ( " / 1 / 2 / 3 / 4 / 5 / 6 " , true ) add unprotected dir ( " / 1 " , false ) add unprotected dir ( " / 1 / 2 " , false ) add unprotected dir ( " / 1 / 2 / 3 " , false ) add unprotected dir ( " / 1 / 2 / 3 / 4 " , false ) ) ; / / disjoint trees matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 " , false ) add protected dir ( " / a / b " , false ) add unprotected dir ( " / 1 / 2 / 3 " , true ) add unprotected dir ( " / a / b / c " , true ) ) ; / / the following tests exercise special cases in the path prefix / / checks and handling of trailing separators / / a disjoint non - empty protected dir has the same string prefix as the / / directory we are trying to delete matrix add ( test matrix entry get ( ) add protected dir ( " / a 1 " , false ) add unprotected dir ( " / a 1 / a 2 " , true ) add unprotected dir ( " / a " , true ) ) ; / / the directory we are trying to delete has a non - empty protected / / child and we try to delete it with a trailing separator matrix add ( test matrix entry get ( ) add protected dir ( " / a / b " , false ) add unprotected dir ( " / a / b / c " , true ) add unprotected dir ( " / a / " , false ) ) ; / / the directory we are trying to delete has an empty protected / / child and we try to delete it with a trailing separator matrix add ( test matrix entry get ( ) add protected dir ( " / a / b " , true ) add unprotected dir ( " / a / " , true ) ) ; return matrix ; }


get user { username } : get user by user name

default response entity < user > get user by name ( @ api param ( value = " the name that needs to be fetched use user 1 for testing " , required = true ) @ path variable ( " username " ) string username ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " first name \ " : \ " first name \ " , \ " last name \ " : \ " last name \ " , \ " password \ " : \ " password \ " , \ " user status \ " : 6 , \ " phone \ " : \ " phone \ " , \ " id \ " : 0 , \ " email \ " : \ " email \ " , \ " username \ " : \ " username \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < user > < id > 123456789 < / id > < username > aeiou < / username > < first name > aeiou < / first name > < last name > aeiou < / last name > < email > aeiou < / email > < password > aeiou < / password > < phone > aeiou < / phone > < user status > 123 < / user status > < / user > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


handle the given exception that arose during listener execution the default implementation logs the exception at warn level , not propagating it to the jms provider & mdash ; assuming that all handling of acknowledgement andor transactions is done by this listener container this can be overridden in subclasses

protected void handle listener exception ( throwable ex ) { if ( ex instanceof message rejected while stopping exception ) { / / internal exception - has been handled before return ; } if ( ex instanceof j m s exception ) { invoke exception listener ( ( j m s exception ) ex ) ; } if ( is active ( ) ) { / / regular case : failed while active / / invoke error handler if available invoke error handler ( ex ) ; } else { / / rare case : listener thread failed after container shutdown / / log at debug level , to avoid spamming the shutdown log logger debug ( " listener exception after container shutdown " , ex ) ; } }


executes a high - level handshake using the given connection and returns the discovery node of the node the connection was established with the handshake will fail if the cluster name on the target node doesn ' t match the local cluster name the action listener will be called on the calling thread or the generic thread pool

public void handshake ( final transport connection connection , final time value handshake timeout , predicate < cluster name > cluster name predicate , final action listener < handshake response > listener ) { final discovery node node = connection get node ( ) ; send request ( connection , handshake action name , handshake request instance , transport request options timeout ( handshake timeout ) , new action listener response handler < > ( new action listener < > ( ) { @ override public void on response ( handshake response response ) { if ( cluster name predicate test ( response cluster name ) = = false ) { listener on failure ( new illegal state exception ( " handshake with [ " + node + " ] failed : remote cluster name [ " + response cluster name value ( ) + " ] does not match " + cluster name predicate ) ) ; } else if ( response version is compatible ( local node get version ( ) ) = = false ) { listener on failure ( new illegal state exception ( " handshake with [ " + node + " ] failed : remote node version [ " + response version + " ] is incompatible with local node version [ " + local node get version ( ) + " ] " ) ) ; } else { listener on response ( response ) ; } } @ override public void on failure ( exception e ) { listener on failure ( e ) ; } } , handshake response : : new , thread pool names generic ) ) ; }


removes and returns the value associated with { @ code key } if { @ code key } is not in the map , this method has no effect and returns zero

public long remove ( k key ) { atomic long atomic = map get ( key ) ; if ( atomic = = null ) { return 0l ; } while ( true ) { long old value = atomic get ( ) ; if ( old value = = 0l | | atomic compare and set ( old value , 0l ) ) { / / only remove after setting to zero , to avoid concurrent updates map remove ( key , atomic ) ; / / succeed even if the remove fails , since the value was already adjusted return old value ; } } }


protected string human name ( ) { return " field " ; }


returns whether the use of the memory cache is enabled

public boolean is memory cache enabled ( ) { return m memory cache enabled ; }


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


post fake : fake endpoint for testing various parameters 가짜 엔드 포인트 fake endpoint for testing various parameters 가짜 엔드 포인트

response entity < void > test endpoint parameters ( @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " number " , required = true ) big decimal number , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " double " , required = true ) double double , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " pattern without delimiter " , required = true ) string pattern without delimiter , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " byte " , required = true ) byte [ ] byte , @ api param ( value = " none " ) @ valid @ request part ( value = " integer " , required = false ) integer integer , @ api param ( value = " none " ) @ valid @ request part ( value = " int 3 2 " , required = false ) integer int 3 2 , @ api param ( value = " none " ) @ valid @ request part ( value = " int 6 4 " , required = false ) long int 6 4 , @ api param ( value = " none " ) @ valid @ request part ( value = " float " , required = false ) float float , @ api param ( value = " none " ) @ valid @ request part ( value = " string " , required = false ) string string , @ api param ( value = " none " ) @ valid @ request part ( value = " binary " , required = false ) multipart file binary , @ api param ( value = " none " ) @ valid @ request part ( value = " date " , required = false ) local date date , @ api param ( value = " none " ) @ valid @ request part ( value = " date time " , required = false ) offset date time date time , @ api param ( value = " none " ) @ valid @ request part ( value = " password " , required = false ) string password , @ api param ( value = " none " ) @ valid @ request part ( value = " callback " , required = false ) string param callback ) ;


public static void remove changed listener ( final clipboard manager on primary clip changed listener listener ) { clipboard manager cm = ( clipboard manager ) utils get app ( ) get system service ( context clipboard service ) ; / / noinspection constant conditions cm remove primary clip changed listener ( listener ) ; }


returns { @ link spawn metrics } for the provided execution kind this will never return { @ code null } , but the { @ link spawn metrics } can be empty

public spawn metrics get metrics ( spawn metrics exec kind kind ) { @ nullable spawn metrics metrics = metrics map get ( kind ) ; if ( metrics = = null ) { return empty metrics instance get ( kind ) ; } return metrics ; }


sets or clears the specified bit of the general purpose bit flags

public void set flag ( flag flag , boolean set ) { short mask = ( short ) ( 1 < < flag get bit ( ) ) ; if ( set ) { flags | = mask ; } else { flags = ( short ) ( flags & ~ mask ) ; } }


a sensible definition of { @ link # last key } in terms of { @ code last entry } if you override { @ code last entry } , you may wish to override { @ code last key } to forward to this implementation

protected k standard last key ( ) { entry < k , v > entry = last entry ( ) ; if ( entry = = null ) { throw new no such element exception ( ) ; } else { return entry get key ( ) ; } }


returns the symbol object with the given name in the specified library

public symbol get symbol ( string symbol name , imported library library ) { map < string , symbol > map = library symbols map get ( library ) ; return map get ( symbol name ) ; }


an opaque identifier for the mcp node < code > string id = 1 ; < code >

public java lang string get id ( ) { java lang object ref = id ; if ( ref instanceof java lang string ) { return ( java lang string ) ref ; } else { com google protobuf byte string bs = ( com google protobuf byte string ) ref ; java lang string s = bs to string utf 8 ( ) ; id = s ; return s ; } }


like { @ link net utils # connect ( socket , socket address , int ) } but also takes a local address and port to bind the socket to

public static void connect ( socket socket , socket address endpoint , socket address local addr , int timeout ) throws i o exception { if ( socket = = null | | endpoint = = null | | timeout < 0 ) { throw new illegal argument exception ( " illegal argument for connect ( ) " ) ; } socket channel ch = socket get channel ( ) ; if ( local addr ! = null ) { class local class = local addr get class ( ) ; class remote class = endpoint get class ( ) ; preconditions check argument ( local class equals ( remote class ) , " local address % s must be of same family as remote address % s " , local addr , endpoint ) ; socket bind ( local addr ) ; } try { if ( ch = = null ) { / / let the default implementation handle it socket connect ( endpoint , timeout ) ; } else { socket i o with timeout connect ( ch , endpoint , timeout ) ; } } catch ( socket timeout exception ste ) { throw new connect timeout exception ( ste get message ( ) ) ; } catch ( unresolved address exception uae ) { throw new unknown host exception ( uae get message ( ) ) ; } / / there is a very rare case allowed by the tcp specification , such that / / if we are trying to connect to an endpoint on the local machine , / / and we end up choosing an ephemeral port equal to the destination port , / / we will actually end up getting connected to ourself ( ie any data we / / send just comes right back ) this is only possible if the target / / daemon is down , so we ' ll treat it like connection refused if ( socket get local port ( ) = = socket get port ( ) & & socket get local address ( ) equals ( socket get inet address ( ) ) ) { log info ( " detected a loopback tcp socket , disconnecting it " ) ; socket close ( ) ; throw new connect exception ( " localhost targeted connection resulted in a loopback " + " no daemon is listening on the target port " ) ; } }


logs the response to a request that was logged by { @ link # maybe trace request ( rest request , exception ) }

void trace response ( rest response rest response , http channel http channel , string content length , string opaque header , long request id , boolean success ) { logger trace ( new parameterized message ( " [ { } ] [ { } ] [ { } ] [ { } ] [ { } ] sent response to [ { } ] success [ { } ] " , request id , opaque header , rest response status ( ) , rest response content type ( ) , content length , http channel , success ) ) ; }


public void can be committed async test ( global session global session ) { assertions assert false ( global session can be committed async ( ) ) ; }


add to the answer a localized node request , and keeps track of statistics on a per - allocation - id and per - subcluster bases

private void add localized node r r ( sub cluster id target id , resource request rr ) { preconditions check argument ( ! resource request is any location ( rr get resource name ( ) ) ) ; if ( rr get num containers ( ) > 0 ) { if ( ! count containers per r m contains key ( rr get allocation request id ( ) ) ) { count containers per r m put ( rr get allocation request id ( ) , new hash map < > ( ) ) ; } if ( ! count containers per r m get ( rr get allocation request id ( ) ) contains key ( target id ) ) { count containers per r m get ( rr get allocation request id ( ) ) put ( target id , new atomic long ( 0 ) ) ; } count containers per r m get ( rr get allocation request id ( ) ) get ( target id ) add and get ( rr get num containers ( ) ) ; if ( ! tot num localized containers contains key ( rr get allocation request id ( ) ) ) { tot num localized containers put ( rr get allocation request id ( ) , new atomic long ( 0 ) ) ; } tot num localized containers get ( rr get allocation request id ( ) ) add and get ( rr get num containers ( ) ) ; } internal add to answer ( target id , rr , false ) ; }


public float get low ( ) { return m shadow low ; }


debug method for dumping information from this { @ link pdb debug info } - based instance


returns a new async stub with the given channel for the provided method configurations

public static < t extends abstract stub < t > > t new stub ( stub factory < t > factory , channel channel ) { return new stub ( factory , channel , call options default ) ; }


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


copy as much as possible to dst from src unlike { @ link byte buffer # put ( byte buffer ) } , this stops early if there is no room left in dst

private static void copy ( byte buffer dst , byte buffer src ) { if ( dst has remaining ( ) & & src has remaining ( ) ) { / / avoid an allocation if possible if ( dst remaining ( ) > = src remaining ( ) ) { dst put ( src ) ; } else { int count = math min ( dst remaining ( ) , src remaining ( ) ) ; byte buffer slice = src slice ( ) ; ( ( buffer ) slice ) limit ( count ) ; dst put ( slice ) ; ( ( buffer ) src ) position ( src position ( ) + count ) ; } } }


set the password that this factory should use to access the remote service default is none the password will be sent by hessian via http basic authentication

public void set password ( string password ) { this proxy factory set password ( password ) ; }


returns all { @ link node } s in the system , excluding { @ link jenkins } instance itself which represents the master

public list < node > get nodes ( ) { return nodes get nodes ( ) ; }


creates the file in < code > path < code > location will also create all subdirectories , if they do not exist

public static path create file ( path path ) throws i o exception { files create directories ( path get parent ( ) ) ; if ( files exists ( path ) ) { return path ; } files create file ( path ) ; return path ; }


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public model factory basic model with attribute on visibility changed ( on model visibility changed listener < model factory basic model with attribute , object > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


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

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


variant of { @ link # set allowed origin patterns } for adding one origin at a time

public void add allowed origin pattern ( string origin pattern ) { if ( this allowed origin patterns = = null ) { this allowed origin patterns = new array list < > ( 4 ) ; } this allowed origin patterns add ( new origin pattern ( origin pattern ) ) ; if ( this allowed origins = = default permit all ) { this allowed origins = null ; } }


retrieve the flag for the given property key

public static boolean get flag ( string key ) { return boolean parse boolean ( get property ( key ) ) ; }


public void set destination volume ( disk balancer volume destination volume ) { this destination volume = destination volume ; }


< code > replace labels < code > replaces all symbols and aliases in the specified address set from the second program

public void replace labels ( address set origin address set , boolean replace function , task monitor monitor ) throws cancelled exception { merge labels ( origin address set , program merge filter replace , true , replace function , monitor ) ; }


test that a jelly is escaped when the escape - by - default = ' true ' directive is set in it

public void test jelly escaping default ( ) throws exception { test jelly ( null ) ; }


gets the number of tasks holding { @ link class loader } references for the given job

int get number of reference holders ( job i d job id ) { synchronized ( lock object ) { library cache entry entry = cache entries get ( job id ) ; return entry = = null ? 0 : entry get reference count ( ) ; } }


gets the registry for aggregators for the iteration

public aggregator registry get aggregators ( ) { return this aggregators ; }


gets the purpose for the { @ code cc compilation context }

public string get purpose ( ) { / / proto support creates multiple { @ code cc compilation context } s for a single rule , / / potentially / / multiple archives per build configuration this covers that worst case return " objc cpp semantics build arch " + build configuration get mnemonic ( ) + " with suffix " + intermediate artifacts archive file name suffix ( ) ; }


the list of sends that completed on the last { @ link # poll ( long ) poll ( ) } call

list < network send > completed sends ( ) ;


public long count by user id ( final string user id ) { val view = create query ( " count by user id " ) key ( user id ) ; val rows = db query view ( view ) get rows ( ) ; if ( rows is empty ( ) ) { return 0 ; } return rows get ( 0 ) get value as int ( ) ; }


simplfies this local property provided that the specified inputs are constants

default optional < local property < e > > with constants ( set < e > constants ) { set < e > set = new linked hash set < > ( get columns ( ) ) ; set remove all ( constants ) ; if ( set is empty ( ) ) { return optional empty ( ) ; } return optional of ( constrain ( set ) ) ; }


asserts that all 5 different ways to convert an object to a string of { @ code expression } ( { @ code str } , { @ code repr } , { @ code ' % s ' } , { @ code ' % r ' } , { @ code ' { } ' format } return the correct { @ code representation } not applicable for objects that have different { @ code str } and { @ code repr } representations

private void assert string representation in build file ( string expression , string representation ) throws exception { assert that ( starlark loading eval in build file ( string format ( " str ( % s ) " , expression ) ) ) is equal to ( representation ) ; assert that ( starlark loading eval in build file ( string format ( " repr ( % s ) " , expression ) ) ) is equal to ( representation ) ; assert that ( starlark loading eval in build file ( string format ( " ' % % s ' % % ( % s , ) " , expression ) ) ) is equal to ( representation ) ; assert that ( starlark loading eval in build file ( string format ( " ' % % r ' % % ( % s , ) " , expression ) ) ) is equal to ( representation ) ; assert that ( starlark loading eval in build file ( string format ( " ' { } ' format ( % s ) " , expression ) ) ) is equal to ( representation ) ; }


enumerate all available parameter names if possible this is an optional operation , primarily for use with { @ link org springframework jdbc core simple simple jdbc insert } and { @ link org springframework jdbc core simple simple jdbc call }

default string [ ] get parameter names ( ) { return null ; }


get the page size to use with a specific address space the page containers ( memory bank ) assume page size is always power of 2 any address space is assigned at least 8 - bits of addressable locations , so at the very least , the size is divisible by 256 starting with this minimum , this method finds the power of 2 that is closest to the preferred page size ( page size ) but that still divides the size of the space

private int get valid page size ( address space space ) { int ps = 256 ; / / minimum page size supported long space size = space get max address ( ) get offset ( ) + 1 ; / / number of bytes in the space ( 0 if 2 ^ 64 bytes ) if ( ( space size & 0xff ) ! = 0 ) { msg warn ( this , " emulator using page size of 256 bytes for " + space get name ( ) + " which is not a multiple of 256 " ) ; return ps ; } space size > > > = 8 ; / / divide required size by 256 ( evenly ) while ( ps < page size ) { / / if current page size is smaller than preferred page size if ( ( space size & 1 ) ! = 0 ) { break ; / / a bigger page size does not divide the space size evenly , so use current size } ps < < = 1 ; / / bump up current page size to next power of 2 space size > > > = 1 ; / / divide ( evenly ) by 2 } return ps ; }


receives an object sent by { @ link # write object ( object ) }

public < t > t read object ( ) throws i o exception , class not found exception { object input stream ois = new object input stream ex ( in , get class ( ) get class loader ( ) , class filter default ) ; return ( t ) ois read object ( ) ; }


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


public synchronized void update job status ( job status status ) { this current status = status ; }


interrupt process , pipeline will be destroy when this method called

void on interrupt ( throwable exception ) ;


public outer enum get outer enum ( ) { return outer enum ; }


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


change the current theme to the specified one , storing the new theme name through the configured { @ link theme resolver }

public void change theme ( @ nullable theme theme ) { theme resolver theme resolver = request context utils get theme resolver ( this request ) ; if ( theme resolver = = null ) { throw new illegal state exception ( " cannot change theme if no theme resolver configured " ) ; } theme resolver set theme name ( this request , this response , ( theme ! = null ? theme get name ( ) : null ) ) ; this theme = theme ; }


relinquish locks held during computation for a short while and reacquire them this will give other threads a chance to acquire the contended locks and run

public boolean yield ( ) { / / are we set up to do this ? if ( limit per run < = 0 | | dir = = null | | fsn = = null ) { return false ; } / / have we reached the limit ? long current count = counts get file count ( ) + counts get symlink count ( ) + counts get directory count ( ) + counts get snapshotable directory count ( ) ; if ( current count < = next count limit ) { return false ; } / / update the next limit next count limit = current count + limit per run ; boolean had dir read lock = dir has read lock ( ) ; boolean had dir write lock = dir has write lock ( ) ; boolean had fsn read lock = fsn has read lock ( ) ; boolean had fsn write lock = fsn has write lock ( ) ; / / sanity check if ( ! had dir read lock | | ! had fsn read lock | | had dir write lock | | had fsn write lock | | dir get read hold count ( ) ! = 1 | | fsn get read hold count ( ) ! = 1 ) { / / cannot relinquish return false ; } / / unlock dir read unlock ( ) ; fsn read unlock ( " content summary " ) ; try { thread sleep ( sleep milli sec , sleep nano sec ) ; } catch ( interrupted exception ie ) { } finally { / / reacquire fsn read lock ( ) ; dir read lock ( ) ; } yield count + + ; return true ; }


get the disabled administrative monitors

public set < string > get disabled administrative monitors ( ) { synchronized ( this disabled administrative monitors ) { return new hash set < > ( disabled administrative monitors ) ; } }


returns an array containing each value of { @ code collection } , converted to a { @ code short } value in the manner of { @ link number # short value } elements are copied from the argument collection as if by { @ code collection to array ( ) } calling this method is as thread - safe as calling that method

public static short [ ] to array ( collection < ? extends number > collection ) { if ( collection instanceof short array as list ) { return ( ( short array as list ) collection ) to short array ( ) ; } object [ ] boxed array = collection to array ( ) ; int len = boxed array length ; short [ ] array = new short [ len ] ; for ( int i = 0 ; i < len ; i + + ) { / / check not null for gwt ( do not optimize ) array [ i ] = ( ( number ) check not null ( boxed array [ i ] ) ) short value ( ) ; } return array ; }


determine the transaction attribute for the given method or class this implementation delegates to configured { @ link transaction annotation parser transaction annotation parsers } for parsing known annotations into spring ' s metadata attribute class returns { @ code null } if it ' s not transactional can be overridden to support custom annotations that carry transaction metadata

protected transaction attribute determine transaction attribute ( annotated element element ) { for ( transaction annotation parser parser : this annotation parsers ) { transaction attribute attr = parser parse transaction annotation ( element ) ; if ( attr ! = null ) { return attr ; } } return null ; }


get the last zxid that was logged in the transaction logs

public long get last logged zxid ( ) { file [ ] files = get log files ( log dir list files ( ) , 0 ) ; long max log = files length > 0 ? util get zxid from name ( files [ files length - 1 ] get name ( ) , log file prefix ) : - 1 ; / / if a log file is more recent we must scan it to find / / the highest zxid long zxid = max log ; try ( file txn log txn = new file txn log ( log dir ) ; txn iterator itr = txn read ( max log ) ) { while ( true ) { if ( ! itr next ( ) ) { break ; } txn header hdr = itr get header ( ) ; zxid = hdr get zxid ( ) ; } } catch ( i o exception e ) { log warn ( " unexpected exception " , e ) ; } return zxid ; }


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public model with super attributes on visibility changed ( on model visibility changed listener < model with super attributes , object > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


shorthand for { @ link query builder # build count ( ) build count ( ) } { @ link count query # count ( ) count ( ) } ; see { @ link count query # count ( ) } for details to execute a query more than once , you should build the query and keep the { @ link count query } object for efficiency reasons

public long count ( ) { return build count ( ) count ( ) ; }


cast an i binder object into an com taobao atlas dexmerge i dex merge callback interface , generating a proxy if needed

public static i dex merge callback as interface ( android os i binder obj ) { if ( ( obj = = null ) ) { return null ; } android os i interface iin = obj query local interface ( descriptor ) ; if ( ( ( iin ! = null ) & & ( iin instanceof i dex merge callback ) ) ) { return ( ( i dex merge callback ) iin ) ; } return new proxy ( obj ) ; }


returns the name of the current constraint for this or filter condition

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


returns all nodes in this network adjacent to { @ code node } which can be reached by traversing { @ code node } ' s outgoing edges in the direction ( if any ) of the edge in an undirected network , this is equivalent to { @ link # adjacent nodes ( object ) } this is not the same as " all nodes reachable from { @ code node } by following outgoing edges " for that functionality , see { @ link graphs # reachable nodes ( graph , object ) }


appends the string representation of the specified { @ code char sequence } if the { @ code char sequence } is { @ code null } , then the string { @ code " null " } is appended

public string builder append ( char sequence csq ) { if ( csq = = null ) { append null ( ) ; } else if ( csq instanceof string builder ) { string builder builder = ( string builder ) csq ; append 0 ( builder chars , 0 , builder length ) ; } else { append 0 ( csq to string ( ) ) ; } return this ; }


the base file system implementation generally has no knowledge of the capabilities of actual implementations unless it has a way to explicitly determine the capabilities , this method returns false { @ inherit doc }

public boolean has path capability ( final path path , final string capability ) throws i o exception { switch ( validate path capability args ( make qualified ( path ) , capability ) ) { case common path capabilities fs symlinks : / / delegate to the existing supports symlinks ( ) call return supports symlinks ( ) & & are symlinks enabled ( ) ; default : / / the feature is not implemented return false ; } }


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


set the { @ link string } representation of the bytes immediately before a function

public void set pre bytes ( string pre bytes ) { this pre bytes = pre bytes ; }


called by the { @ link transport } implementation when an incoming request arrives but before any parsing of it has happened ( with the exception of the request id and action )

public void on request received ( long request id , string action ) { if ( handle incoming requests get ( ) = = false ) { throw new illegal state exception ( " transport not ready yet to handle incoming requests " ) ; } if ( tracer log is trace enabled ( ) & & should trace action ( action ) ) { tracer log trace ( " [ { } ] [ { } ] received request " , request id , action ) ; } message listener on request received ( request id , action ) ; }


returns the dash path effect that is set for axis line

public dash path effect get axis line dash path effect ( ) { return m axis line dash path effect ; }


returns a " closure - cleaned " version of the given function cleans only if closure cleaning is not disabled in the { @ link org apache flink api common execution config }

public < f > f clean ( f f ) { if ( get config ( ) is closure cleaner enabled ( ) ) { closure cleaner clean ( f , get config ( ) get closure cleaner level ( ) , true ) ; } closure cleaner ensure serializable ( f ) ; return f ; }


equivalent to { @ link sql parser # create ( reader , sql parser config ) } the only difference is we do not wrap the { @ link flink sql parser impl } with { @ link sql parser } it is so that we can access specific parsing methods not accessible through the { @ code sql parser }

private sql abstract parser impl create flink parser ( string expr ) { source string reader reader = new source string reader ( expr ) ; sql abstract parser impl parser = config parser factory ( ) get parser ( reader ) ; parser set tab size ( 1 ) ; parser set quoted casing ( config quoted casing ( ) ) ; parser set unquoted casing ( config unquoted casing ( ) ) ; parser set identifier max length ( config identifier max length ( ) ) ; parser set conformance ( config conformance ( ) ) ; switch ( config quoting ( ) ) { case double quote : parser switch to ( sql abstract parser impl lexical state dqid ) ; break ; case back tick : parser switch to ( sql abstract parser impl lexical state btid ) ; break ; case bracket : parser switch to ( sql abstract parser impl lexical state default ) ; break ; } return parser ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


transitions the node from the evaluating to the done state and simultaneously sets it to the given value and error state it then returns the set of reverse dependencies that need to be signaled this is an atomic operation to avoid a race where two threads work on two nodes , where one node depends on another ( b depends on a ) when a finishes , it signals < b > exactly < b > the set of reverse dependencies that are registered at the time of the { @ code set value } call if b comes in before a , it is signaled ( and re - scheduled ) by a , otherwise it needs to do that itself { @ code version } indicates the graph version at which this node is being written if the entry determines that the new value is equal to the previous value , the entry will keep its current version callers can query that version to see if the node considers its value to have changed

set < sky key > set value ( sky value value , version version ) throws interrupted exception ;


short - circuit ? : no threadsemaphore : thread thread pool full ? : no thread pool queue full ? : no timeout : no execution result : synchronous hystrix bad request exception

public void test execution hook thread bad request exception ( ) { assert hooks on failure ( new func 0 < test hystrix command < integer > > ( ) { @ override public test hystrix command < integer > call ( ) { return get command ( execution isolation strategy thread , abstract test hystrix command execution result bad request ) ; } } , new action 1 < test hystrix command < integer > > ( ) { @ override public void call ( test hystrix command < integer > command ) { testable execution hook hook = command get builder ( ) execution hook ; assert true ( hook command emissions match ( 0 , 1 , 0 ) ) ; assert true ( hook execution events match ( 0 , 1 , 0 ) ) ; assert true ( hook fallback events match ( 0 , 0 , 0 ) ) ; assert equals ( hystrix bad request exception class , hook get command exception ( ) get class ( ) ) ; assert equals ( hystrix bad request exception class , hook get execution exception ( ) get class ( ) ) ; assert equals ( " on start - on thread start - ! on run start - on execution start - on execution error - ! on run error - on thread complete - on error - " , hook execution sequence to string ( ) ) ; } } ) ; }


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


delete the global transaction it will operate two parts : 1 delete the global session map 2 remove the xid from the global status list if the operate failed , the succeed operates will rollback

private boolean delete global transaction d o ( global transaction d o global transaction d o ) { string global key = build global key by transaction id ( global transaction d o get transaction id ( ) ) ; try ( jedis jedis = jedis pooled factory get jedis instance ( ) ) { map < string , string > global transaction do map = jedis hget all ( global key ) ; string xid = global transaction do map get ( redis key global xid ) ; if ( string utils is empty ( xid ) ) { logger warn ( " global transaction is not exist , xid = { } maybe has been deleted by another tc server " , global transaction d o get xid ( ) ) ; return true ; } pipeline pipelined = jedis pipelined ( ) ; pipelined lrem ( build global status ( global transaction d o get status ( ) ) , 0 , global transaction d o get xid ( ) ) ; pipelined del ( global key ) ; pipelined sync ( ) ; return true ; } catch ( exception ex ) { throw new redis exception ( ex ) ; } }


public void test has only read only ( ) { / / todo : test has only read only }


void on search complete ( search result result ) ;


return whether input matches regex of chinese character

public static boolean is zh ( final char sequence input ) { return is match ( regex constants regex zh , input ) ; }


get the component to be placed over the field

public component get component ( ) { return component ; }


public void 1 2 3number test ( ) { / / todo : test 1 2 3number }


sets an external < code > delegation token secret manager < code > instance to manage creation and verification of delegation tokens this is useful for use cases where secrets must be shared across multiple services

public void set external delegation token secret manager ( abstract delegation token secret manager secret manager ) { this secret manager stop threads ( ) ; this secret manager = secret manager ; managed secret manager = false ; }


short - circuit ? : no threadsemaphore : semaphore semaphore permit reached ? : no execution result : synchronous hystrix bad request exception

public void test execution hook semaphore bad request exception ( ) { assert hooks on failure ( new func 0 < c > ( ) { @ override public c call ( ) { return get command ( execution isolation strategy semaphore , execution result bad request , fallback result success ) ; } } , new action 1 < c > ( ) { @ override public void call ( c command ) { testable execution hook hook = command get builder ( ) execution hook ; assert true ( hook command emissions match ( 0 , 1 , 0 ) ) ; assert true ( hook execution events match ( 0 , 1 , 0 ) ) ; assert true ( hook fallback events match ( 0 , 0 , 0 ) ) ; assert equals ( hystrix bad request exception class , hook get command exception ( ) get class ( ) ) ; assert equals ( hystrix bad request exception class , hook get execution exception ( ) get class ( ) ) ; assert equals ( " on start - ! on run start - on execution start - on execution error - ! on run error - on error - " , hook execution sequence to string ( ) ) ; } } ) ; }


parse json data to set of { @ link api definition } since the predicate items of { @ link api definition } is set of interface , here we parse predicate items to { @ link api path predicate item } temporarily

private set < api definition > parse json ( string data ) { set < api definition > api definitions = new hash set < > ( ) ; j s o n array array = json parse array ( data ) ; for ( object obj : array ) { j s o n object o = ( j s o n object ) obj ; api definition api definition = new api definition ( ( o get string ( " api name " ) ) ) ; set < api predicate item > predicate items = new hash set < > ( ) ; j s o n array item array = o get j s o n array ( " predicate items " ) ; if ( item array ! = null ) { predicate items add all ( item array to java list ( api path predicate item class ) ) ; } api definition set predicate items ( predicate items ) ; api definitions add ( api definition ) ; } return api definitions ; }


get the key to use for the bucket for documents not matching any filter

public string other bucket key ( ) { return other bucket key ; }


vibrate must hold { @ code < uses - permission android : name = " android permission vibrate " > }

public static void vibrate ( final long milliseconds ) { vibrator vibrator = get vibrator ( ) ; if ( vibrator = = null ) return ; vibrator vibrate ( milliseconds ) ; }


public void remove ( register reg ) { register tree tree = get register tree ( reg ) ; if ( tree = = null ) { return ; } if ( tree get parent ( ) = = null ) { return ; } tree get parent ( ) children remove ( tree ) ; }


construct a new { @ link java util set } that is the intersection of the given sets

public static < t > set < t > intersection ( set < ? extends t > set 1 , set < ? extends t > set 2 ) { set < t > result = helpers < t > copy to set ( set 1 ) ; result retain all ( set 2 ) ; return result ; }


public void set base resource ( resource base resource ) { handler set base resource ( base resource ) ; }


adds the given linkstamps note that linkstamps are usually not compiled at the library level , but only in the dependent binary rules

public cc linking helper add linkstamps ( iterable < ? extends transitive info collection > linkstamps ) { for ( transitive info collection linkstamp : linkstamps ) { this linkstamps add transitive ( linkstamp get provider ( file provider class ) get files to build ( ) ) ; } return this ; }


gets the appropriate reference data type if program is 64 bit , then a 32 - bit image base offset data type will be returned otherwise , a default pointer to the referred to data type will be returned

public static data type get reference data type ( program program , data type referred to data type ) { data type manager dtm = program get data type manager ( ) ; return is 6 4 bit ( program ) ? new image base offset 3 2 data type ( dtm ) : new pointer data type ( referred to data type ) ; }


creates a replaying connectable observable with a time bound buffer

public static < t > connectable observable < t > create ( observable source < t > source , long max age , time unit unit , scheduler scheduler , boolean eager truncate ) { return create ( source , max age , unit , scheduler , integer max value , eager truncate ) ; }


validate offsets for all assigned partitions for which a leader change has been detected

public void validate offsets if needed ( ) { runtime exception exception = cached offset for leader exception get and set ( null ) ; if ( exception ! = null ) throw exception ; / / validate each partition against the current leader and epoch / / if we see a new metadata version , check all partitions validate positions on metadata change ( ) ; / / collect positions needing validation , with backoff map < topic partition , fetch position > partitions to validate = subscriptions partitions needing validation ( time milliseconds ( ) ) stream ( ) filter ( tp - > subscriptions position ( tp ) ! = null ) collect ( collectors to map ( function identity ( ) , subscriptions : : position ) ) ; validate offsets async ( partitions to validate ) ; }


instantiate the web application context for this servlet , either a default { @ link org springframework web context support xml web application context } or a { @ link # set context class custom context class } , if set this implementation expects custom contexts to implement the { @ link org springframework web context configurable web application context } interface can be overridden in subclasses do not forget to register this servlet instance as application listener on the created context ( for triggering its { @ link # on refresh callback } , and to call { @ link org springframework context configurable application context # refresh ( ) } before returning the context instance

protected web application context create web application context ( @ nullable application context parent ) { class < ? > context class = get context class ( ) ; if ( ! configurable web application context class is assignable from ( context class ) ) { throw new application context exception ( " fatal initialization error in servlet with name ' " + get servlet name ( ) + " ' : custom web application context class [ " + context class get name ( ) + " ] is not of type configurable web application context " ) ; } configurable web application context wac = ( configurable web application context ) bean utils instantiate class ( context class ) ; wac set environment ( get environment ( ) ) ; wac set parent ( parent ) ; string config location = get context config location ( ) ; if ( config location ! = null ) { wac set config location ( config location ) ; } configure and refresh web application context ( wac ) ; return wac ; }


waits until { @ link one shot latch # trigger ( ) } is called once { @ code trigger ( ) } has been called this call will always return immediately

public void await ( ) throws interrupted exception { synchronized ( lock ) { while ( ! triggered ) { thread thread = thread current thread ( ) ; try { waiters set add ( thread ) ; lock wait ( ) ; } finally { waiters set remove ( thread ) ; } } } }


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


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


specifies the expected number of nodes in the graph

public value graph builder < n , v > expected node count ( int expected node count ) { this expected node count = optional of ( check non negative ( expected node count ) ) ; return this ; }


returns a { @ link request options } object with { @ link # skip memory cache ( boolean ) } set

public static request options skip memory cache of ( boolean skip memory cache ) { if ( skip memory cache ) { if ( skip memory cache true options = = null ) { skip memory cache true options = new request options ( ) skip memory cache ( true ) auto clone ( ) ; } return skip memory cache true options ; } else { if ( skip memory cache false options = = null ) { skip memory cache false options = new request options ( ) skip memory cache ( false ) auto clone ( ) ; } return skip memory cache false options ; } }


public vh get ad view holder ( view view ) { return null ; }


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

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


wait until balanced : each datanode gives utilization within balance allowed variance of average

static void wait for balancer ( long total used space , long total capacity , client protocol client , mini d f s cluster cluster , balancer parameters p , int expected excluded nodes ) throws i o exception , timeout exception { long timeout = timeout ; long failtime = ( timeout < = 0l ) ? long max value : time monotonic now ( ) + timeout ; if ( ! p get included nodes ( ) is empty ( ) ) { total capacity = p get included nodes ( ) size ( ) * capacity ; } if ( ! p get excluded nodes ( ) is empty ( ) ) { total capacity - = p get excluded nodes ( ) size ( ) * capacity ; } final double avg utilization = ( ( double ) total used space ) / total capacity ; boolean balanced ; do { datanode info [ ] datanode report = client get datanode report ( datanode report type all ) ; assert equals ( datanode report length , cluster get data nodes ( ) size ( ) ) ; balanced = true ; int actual excluded node count = 0 ; for ( datanode info datanode : datanode report ) { double node utilization = ( ( double ) datanode get dfs used ( ) ) / datanode get capacity ( ) ; if ( dispatcher util is excluded ( p get excluded nodes ( ) , datanode ) ) { assert true ( node utilization = = 0 ) ; actual excluded node count + + ; continue ; } if ( ! dispatcher util is included ( p get included nodes ( ) , datanode ) ) { assert true ( node utilization = = 0 ) ; actual excluded node count + + ; continue ; } if ( math abs ( avg utilization - node utilization ) > balance allowed variance ) { balanced = false ; if ( time monotonic now ( ) > failtime ) { throw new timeout exception ( " rebalancing expected avg utilization to become " + avg utilization + " , but on datanode " + datanode + " it remains at " + node utilization + " after more than " + timeout + " msec " ) ; } try { thread sleep ( 100 ) ; } catch ( interrupted exception ignored ) { } break ; } } assert equals ( expected excluded nodes , actual excluded node count ) ; } while ( ! balanced ) ; }


test sps for low redundant file blocks 1 create cluster with 10 datanode 1 create one striped file with default ec policy 2 set policy and call satisfy storage policy for file 3 stop name node and datanodes 4 start name node with 5 datanode and wait for block movement 5 start remaining 5 datanode 6 all replica should be moved in proper storage based on policy

public void test s p s when file has low redundancy blocks ( ) throws exception { / / start 9 datanodes int num of datanodes = 9 ; int storages per datanode = 2 ; long capacity = 20 * default stripe block size ; long [ ] [ ] capacities = new long [ num of datanodes ] [ storages per datanode ] ; for ( int i = 0 ; i < num of datanodes ; i + + ) { for ( int j = 0 ; j < storages per datanode ; j + + ) { capacities [ i ] [ j ] = capacity ; } } conf set ( d f s config keys dfs storage policy satisfier recheck timeout millis key , " 3000 " ) ; conf set ( d f s config keys dfs storage policy satisfier self retry timeout millis key , " 5000 " ) ; final mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( num of datanodes ) storages per datanode ( storages per datanode ) storage types ( new storage type [ ] [ ] { { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } , { storage type disk , storage type archive } } ) storage capacities ( capacities ) build ( ) ; try { cluster wait active ( ) ; start s p s ( ) ; distributed file system fs = cluster get file system ( ) ; fs enable erasure coding policy ( striped file test util get default e c policy ( ) get name ( ) ) ; path bar dir = new path ( " / bar " ) ; fs mkdirs ( bar dir ) ; / / set an ec policy on " / bar " directory fs set erasure coding policy ( bar dir , striped file test util get default e c policy ( ) get name ( ) ) ; / / write file to bar dir final path foo file = new path ( " / bar / foo " ) ; long file len = cell size * data blocks ; d f s test util create file ( cluster get file system ( ) , foo file , file len , ( short ) 3 , 0 ) ; / / move file to archive fs set storage policy ( bar dir , " cold " ) ; / / stop data nodes and restart namenode list < data node properties > list = new array list < > ( num of datanodes ) ; for ( int i = 0 ; i < num of datanodes ; i + + ) { list add ( cluster stop data node ( 0 ) ) ; } cluster restart name nodes ( ) ; / / restart half datanodes for ( int i = 0 ; i < 5 ; i + + ) { cluster restart data node ( list get ( i ) , false ) ; } cluster wait active ( ) ; fs satisfy storage policy ( foo file ) ; d f s test util wait expected storage type ( foo file to string ( ) , storage type archive , 5 , 30000 , cluster get file system ( ) ) ; / / start remaining datanodes for ( int i = num of datanodes - 1 ; i > = 5 ; i - - ) { cluster restart data node ( list get ( i ) , false ) ; } cluster wait active ( ) ; / / verify storage types and locations wait expected storage type ( cluster , foo file to string ( ) , file len , storage type archive , 9 , 9 , 60000 ) ; } finally { cluster shutdown ( ) ; sps stop gracefully ( ) ; } }


specifies the types for the csv fields this method parses the csv data to a 11 - tuple which has fields of the specified types this method is overloaded for each possible length of the tuples to support type safe creation of data sets through csv parsing

public < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > data source < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > types ( class < t0 > type 0 , class < t1 > type 1 , class < t2 > type 2 , class < t3 > type 3 , class < t4 > type 4 , class < t5 > type 5 , class < t6 > type 6 , class < t7 > type 7 , class < t8 > type 8 , class < t9 > type 9 , class < t10 > type 1 0 ) { tuple type info < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > types = tuple type info get basic and basic value tuple type info ( type 0 , type 1 , type 2 , type 3 , type 4 , type 5 , type 6 , type 7 , type 8 , type 9 , type 1 0 ) ; csv input format < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > input format = new tuple csv input format < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > ( path , types , this included mask ) ; configure input format ( input format ) ; return new data source < tuple 1 1 < t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 > > ( execution context , input format , types , utils get call location name ( ) ) ; }


convert an array of method into an array of hash codes

private static int [ ] get fingerprints ( method [ ] methods ) { if ( methods = = null ) { return null ; } int [ ] hash codes = new int [ methods length ] ; for ( int i = 0 ; i < methods length ; i + + ) { hash codes [ i ] = get fingerprint ( methods [ i ] ) ; } return hash codes ; }


set the error reporters for this connector

public void reporters ( collection < error reporter > reporters ) { objects require non null ( reporters ) ; this reporters = reporters ; }


general project utility that brings up a file chooser for the user to specify a directory and filename that are used for the project location and name

project locator choose project ( ghidra file chooser file chooser , string mode , string preference name ) { boolean create = ( mode equals ( " create " ) ) ? true : false ; file chooser set title ( mode + " a ghidra project " ) ; file chooser set approve button text ( mode + " project " ) ; file chooser set approve button tool tip text ( mode + " a ghidra project " ) ; file chooser set selected file ( null ) ; boolean valid input = false ; while ( ! valid input ) { file file = file chooser get selected file ( ) ; if ( file ! = null ) { string path = file get absolute file ( ) get parent ( ) ; string filename = file get name ( ) ; / / strip off extension since the local root folder takes care of it if ( filename ends with ( project extension ) ) { filename = filename substring ( 0 , filename last index of ( project extension ) - 1 ) ; } / / if user enters the name of the project manually and leaves off / / the extension , try to open or create using the extension else if ( ! create & & filename last index of ( " " ) > path last index of ( file separator ) ) { / / treat opening a file without the ghidra extension as an error msg show error ( get class ( ) , tool get tool frame ( ) , " invalid project file " , " cannot open ' " + file get name ( ) + " ' as a ghidra project " ) ; continue ; } if ( ! naming utilities is valid project name ( filename ) ) { msg show error ( get class ( ) , tool get tool frame ( ) , " invalid project name " , filename + " is not a valid project name " ) ; continue ; } preferences set property ( preference name , path ) ; try { preferences store ( ) ; } catch ( exception e ) { msg debug ( this , " unexpected exception storing preferences to " + preferences get filename ( ) , e ) ; } return new project locator ( path , filename ) ; } return null ; } return null ; }


check the correctness of the diff reports

private void verify diff report ( path dir , string from , string to , diff report entry entries ) throws i o exception { d f s test util verify snapshot diff report ( fs , dir , from , to , entries ) ; }


public address get address ( ) { return addr ; }


resolve the default response destination into a jms { @ link destination } , using this accessor ' s { @ link destination resolver } in case of a destination name

protected destination resolve default response destination ( session session ) throws j m s exception { if ( this default response destination instanceof destination ) { return ( destination ) this default response destination ; } if ( this default response destination instanceof destination name holder ) { destination name holder name holder = ( destination name holder ) this default response destination ; return get destination resolver ( ) resolve destination name ( session , name holder name , name holder is topic ) ; } return null ; }


convenience method that returns a resource as inputstream from the classpath using given classloader

public static input stream get resource as stream ( class loader cl , string resource name ) throws i o exception { if ( cl = = null ) { throw new i o exception ( " can not read resource file ' " + resource name + " ' because given class loader is null " ) ; } input stream is = cl get resource as stream ( resource name ) ; if ( is = = null ) { throw new i o exception ( " can not read resource file ' " + resource name + " ' " ) ; } return is ; }


mixin interface and delegates all class must be public

public static mixin mixin ( class < ? > [ ] ics , class < ? > [ ] dcs , class loader cl ) { assert interface array ( ics ) ; long id = mixin class counter get and increment ( ) ; string pkg = null ; class generator ccp = null , ccm = null ; try { ccp = class generator new instance ( cl ) ; / / impl constructor string builder code = new string builder ( ) ; for ( int i = 0 ; i < dcs length ; i + + ) { if ( ! modifier is public ( dcs [ i ] get modifiers ( ) ) ) { string npkg = dcs [ i ] get package ( ) get name ( ) ; if ( pkg = = null ) { pkg = npkg ; } else { if ( ! pkg equals ( npkg ) ) { throw new illegal argument exception ( " non - public interfaces class from different packages " ) ; } } } ccp add field ( " private " + dcs [ i ] get name ( ) + " d " + i + " ; " ) ; code append ( " d " ) append ( i ) append ( " = ( " ) append ( dcs [ i ] get name ( ) ) append ( " ) $ 1 [ " ) append ( i ) append ( " ] ; \ n " ) ; if ( mixin aware class is assignable from ( dcs [ i ] ) ) { code append ( " d " ) append ( i ) append ( " set mixin instance ( this ) ; \ n " ) ; } } ccp add constructor ( modifier public , new class < ? > [ ] { object [ ] class } , code to string ( ) ) ; / / impl methods set < string > worked = new hash set < string > ( ) ; for ( int i = 0 ; i < ics length ; i + + ) { if ( ! modifier is public ( ics [ i ] get modifiers ( ) ) ) { string npkg = ics [ i ] get package ( ) get name ( ) ; if ( pkg = = null ) { pkg = npkg ; } else { if ( ! pkg equals ( npkg ) ) { throw new illegal argument exception ( " non - public delegate class from different packages " ) ; } } } ccp add interface ( ics [ i ] ) ; for ( method method : ics [ i ] get methods ( ) ) { if ( " java lang object " equals ( method get declaring class ( ) get name ( ) ) ) { continue ; } string desc = reflect utils get desc ( method ) ; if ( worked contains ( desc ) ) { continue ; } worked add ( desc ) ; int ix = find method ( dcs , desc ) ; if ( ix < 0 ) { throw new runtime exception ( " missing method [ " + desc + " ] implement " ) ; } class < ? > rt = method get return type ( ) ; string mn = method get name ( ) ; if ( void type equals ( rt ) ) { ccp add method ( mn , method get modifiers ( ) , rt , method get parameter types ( ) , method get exception types ( ) , " d " + ix + " " + mn + " ( $ $ ) ; " ) ; } else { ccp add method ( mn , method get modifiers ( ) , rt , method get parameter types ( ) , method get exception types ( ) , " return ( $ r ) d " + ix + " " + mn + " ( $ $ ) ; " ) ; } } } if ( pkg = = null ) { pkg = package name ; } / / create mixin instance class string micn = pkg + " mixin " + id ; ccp set class name ( micn ) ; ccp to class ( ) ; / / create mixin class string fcn = mixin class get name ( ) + id ; ccm = class generator new instance ( cl ) ; ccm set class name ( fcn ) ; ccm add default constructor ( ) ; ccm set super class ( mixin class get name ( ) ) ; ccm add method ( " public object new instance ( object [ ] delegates ) { return new " + micn + " ( $ 1 ) ; } " ) ; class < ? > mixin = ccm to class ( ) ; return ( mixin ) mixin new instance ( ) ; } catch ( runtime exception e ) { throw e ; } catch ( exception e ) { throw new runtime exception ( e get message ( ) , e ) ; } finally { / / release class generator if ( ccp ! = null ) { ccp release ( ) ; } if ( ccm ! = null ) { ccm release ( ) ; } } }


returns a value that is a percentage of the specified actor ' s width the context actor is ignored

static public value percent width ( final float percent , final actor actor ) { if ( actor = = null ) throw new illegal argument exception ( " actor cannot be null " ) ; return new value ( ) { public float get ( @ null actor context ) { return actor get width ( ) * percent ; } } ; }


saves the current state of the chart to the gallery as a jpeg image the filename and compression can be set 0 = = maximum compression , 100 = low compression ( high quality ) note : needs permission write external storage

public boolean save to gallery ( string file name , int quality ) { return save to gallery ( file name , " " , " m p android chart - library save " , bitmap compress format png , quality ) ; }


public static boolean delete all in dir ( final string dir path ) { return delete all in dir ( get file by path ( dir path ) ) ; }


returns the task object that should be used to keep track of the processing of the request

default task create task ( long id , string type , string action , task id parent task id , map < string , string > headers ) { return new task ( id , type , action , get description ( ) , parent task id , headers ) ; }


public void 1 2 3number test ( ) { / / todo : test 1 2 3number }


public void abort ( ) { if ( ! closed get ( ) ) { log debug ( " aborting " ) ; wrapped stream abort ( ) ; } }


public byte [ ] compressed ( ) { return this bytes ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


private void inline subroutines ( ) { if ( configuration verbose ) { system out println ( " inlining subroutines " ) ; } / / perform the actual inlining new subroutine inliner ( configuration ) execute ( program class pool ) ; }


saves all the assets required by all the controllers inside this effect

public void save ( asset manager asset manager , resource data data ) { for ( particle controller controller : controllers ) { controller save ( asset manager , data ) ; } }


lists recursive files of this directory with pattern matching the default implementation calls { @ link # list ( ) } recursively inside { @ link # run } and applies filtering to the result implementations may wish to override this more efficiently

public @ non null collection < string > list ( @ non null string includes , @ check for null string excludes , boolean use default excludes ) throws i o exception { return list ( includes , excludes , use default excludes , false ) ; }


override equals check to use primary key ( s ) for comparison

public boolean equals ( object obj ) { if ( ! ( obj instanceof base record ) ) { return false ; } base record base object = ( base record ) obj ; map < string , string > keyset 1 = this get primary keys ( ) ; map < string , string > keyset 2 = base object get primary keys ( ) ; return keyset 1 equals ( keyset 2 ) ; }


check for an authentication error on a given node and raise the exception if there is one

public void maybe throw auth failure ( node node ) { lock lock ( ) ; try { authentication exception exception = client authentication exception ( node ) ; if ( exception ! = null ) throw exception ; } finally { lock unlock ( ) ; } }


set the class loader to use for bean classes default is { @ code null } , which suggests to not load bean classes eagerly but rather to just register bean definitions with class names , with the corresponding classes to be resolved later ( or never )

public void set bean class loader ( @ nullable class loader bean class loader ) { this bean class loader = bean class loader ; }


returns the workspace directory , which is also the working dir of the server

public path get workspace ( ) { return workspace ; }


waits for this future to be completed without interruption this method catches an { @ link interrupted exception } and discards it silently

future < v > await uninterruptibly ( ) ;


read one record from the output topic and return its key and value as pair

public key value < k , v > read key value ( ) { final test record < k , v > record = read record ( ) ; return new key value < > ( record key ( ) , record value ( ) ) ; }


adds a mutation to set the { @ link content metadata # key content length } value , or to remove any existing value if { @ link c # length unset } is passed

public static content metadata mutations set content length ( content metadata mutations mutations , long length ) { return mutations set ( content metadata key content length , length ) ; }


loads the regex for a property and compiles it to a pattern ( this is cached upstream , plus we are doing it only once per property and batch )

protected set < pattern > get pattern ( property id value pid ) { if ( patterns contains key ( pid ) ) { return patterns get ( pid ) ; } else { list < statement > statement list = fetcher get constraints by type ( pid , format constraint qid ) ; set < pattern > patterns = new hash set < > ( ) ; for ( statement statement : statement list ) { format constraint constraint = new format constraint ( statement ) ; string regex = constraint regular expression format ; pattern pattern = null ; if ( regex ! = null ) { pattern = pattern compile ( regex ) ; } patterns add ( pattern ) ; } patterns put ( pid , patterns ) ; return patterns ; } }


public void write ( byte [ ] b , int off , int len ) throws i o exception { sum update ( b , off , len ) ; out write ( b , off , len ) ; }


private static void set value ( postcard postcard , integer type def , string key , string value ) { if ( text utils is empty ( key ) | | text utils is empty ( value ) ) { return ; } try { if ( null ! = type def ) { if ( type def = = type kind boolean ordinal ( ) ) { postcard with boolean ( key , boolean parse boolean ( value ) ) ; } else if ( type def = = type kind byte ordinal ( ) ) { postcard with byte ( key , byte parse byte ( value ) ) ; } else if ( type def = = type kind short ordinal ( ) ) { postcard with short ( key , short parse short ( value ) ) ; } else if ( type def = = type kind int ordinal ( ) ) { postcard with int ( key , integer parse int ( value ) ) ; } else if ( type def = = type kind long ordinal ( ) ) { postcard with long ( key , long parse long ( value ) ) ; } else if ( type def = = type kind float ordinal ( ) ) { postcard with float ( key , float parse float ( value ) ) ; } else if ( type def = = type kind double ordinal ( ) ) { postcard with double ( key , double parse double ( value ) ) ; } else if ( type def = = type kind string ordinal ( ) ) { postcard with string ( key , value ) ; } else if ( type def = = type kind parcelable ordinal ( ) ) { / / todo : how to description parcelable value with string ? } else if ( type def = = type kind object ordinal ( ) ) { postcard with string ( key , value ) ; } else { / / compatible compiler sdk 1 0 3 , in that version , the string type = 18 postcard with string ( key , value ) ; } } else { postcard with string ( key , value ) ; } } catch ( throwable ex ) { logger warning ( consts tag , " logistics center set value failed ! " + ex get message ( ) ) ; } }


tests that after renaming a directory , the original directory and its contents are indeed missing and the corresponding new paths are visible

public void test consistent list after rename ( ) throws exception { path d 1f = path ( " d 1 / f " ) ; path d 1f 2 = path ( " d 1 / f - " + default delay key substring ) ; path [ ] mkdirs = { d 1f , d 1f 2 } ; path d 1 = path ( " d 1 " ) ; path [ ] srcdirs = { d 1 } ; path d 2 = path ( " d 2 " ) ; path [ ] dstdirs = { d 2 } ; path d 2f 2 = path ( " d 2 / f - " + default delay key substring ) ; path [ ] yesdirs = { d 2 , path ( " d 2 / f " ) , d 2f 2 } ; path [ ] nodirs = { d 1 , d 1f , d 1f 2 } ; try { do test rename sequence ( mkdirs , srcdirs , dstdirs , yesdirs , nodirs ) ; } finally { clear inconsistency ( get file system ( ) ) ; delete paths quietly ( d 1 , d 2 , d 1f , d 1f 2 , d 2f 2 ) ; } }


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


gets the contract that has been set as the next workset

public operator < wt > get next workset ( ) { return this next workset ; }


set the options back to their default values

public void restore defaults ( ) { apply code scope block comments = default apply code scope block comments ; apply instruction labels = default apply instruction labels ; restrictions = default restrictions ; remap addresses using existing public symbols = default remap addresses using existing symbols ; allow demote primary mangled symbols = default allow demote primary mangled symbols ; apply function variables = default apply function variables ; class layout = default class layout ; }


start a timer to periodically write name node metrics to the log file this behavior can be disabled by configuration

protected void start metrics logger ( configuration conf ) { long metrics logger period sec = conf get int ( dfs namenode metrics logger period seconds key , dfs namenode metrics logger period seconds default ) ; if ( metrics logger period sec < = 0 ) { return ; } metrics logger task make metrics logger async ( metrics log ) ; / / schedule the periodic logging metrics logger timer = new scheduled thread pool executor ( 1 ) ; metrics logger timer set execute existing delayed tasks after shutdown policy ( false ) ; metrics logger timer schedule with fixed delay ( new metrics logger task ( metrics log , " name node " , ( short ) 128 ) , metrics logger period sec , metrics logger period sec , time unit seconds ) ; }


transcodes webp image given by input stream into png

public void transcode webp to png ( input stream input stream , output stream output stream ) throws i o exception { static webp native loader ensure ( ) ; native transcode webp to png ( preconditions check not null ( input stream ) , preconditions check not null ( output stream ) ) ; }


public e get ( int index ) { e match = null ; if ( first ! = null ) { node < e > c = first ; while ( c n ! = null & & c index < index ) { c = c n ; } if ( c index = = index ) { match = c value ; } } return match ; }


public string to human ( ) { return annotations to human ( ) ; }


query using a prepared statement , reading the result set with a result set extractor

< t > t query ( string sql , @ nullable prepared statement setter pss , result set extractor < t > rse ) throws data access exception ;


long and ( long mask ) { return d 0 & mask ; }


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


inserts the specified element into the queue represented by this deque ( in other words , at the tail of this deque ) if it is possible to do so immediately without violating capacity restrictions , returning < tt > true < tt > upon success and < tt > false < tt > if no space is currently available when using a capacity - restricted deque , this method is generally preferable to the { @ link # add } method , which can fail to insert an element only by throwing an exception < p > this method is equivalent to { @ link # offer last }


verify that more than 3 network error retries result fatal error

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


partitioning < code > a = { a 1 , a n } < code > is considered as a refined partitioning over partitioning < code > b = { b 1 , b m } < code > if : n > = m for every partition < code > b i < code > in partitioning < code > b < code > , the rows it contains is the same as union of a set of partitions < code > a { i 1 } , a { i 2 } , a { i k } < code > in partitioning < code > a < code > , i e < code > b i = a { i 1 } + a { i 2 } + + a { i k } < code > connector can transparently convert partitioning < code > a < code > to partitioning < code > b < code > associated with the provided table layout handle for example , consider two partitioning over < code > order < code > table : partitioning < code > a < code > has 256 partitions by < code > orderkey % 256 < code > partitioning < code > b < code > has 128 partitions by < code > orderkey % 128 < code > partitioning < code > a < code > is a refined partitioning over < code > b < code > if connector supports transparently convert < code > a < code > to < code > b < code > refined - over relation is reflexive this spi is unstable and subject to change in the future

default boolean is refined partitioning over ( connector session session , connector partitioning handle left , connector partitioning handle right ) { return left equals ( right ) ; }


ensures malformed spans don ' t hang the collector

@ test void skips malformed data ( ) throws exception { rabbit m q collector builder builder = builder ( " decoder exception " ) ; byte [ ] malformed 1 = " [ \ " = ' " get bytes ( utf 8 ) ; / / screwed up json byte [ ] malformed 2 = " malformed " get bytes ( utf 8 ) ; produce spans ( thrift encode list ( spans ) , builder queue ) ; produce spans ( new byte [ 0 ] , builder queue ) ; produce spans ( malformed 1 , builder queue ) ; produce spans ( malformed 2 , builder queue ) ; produce spans ( thrift encode list ( spans ) , builder queue ) ; try ( rabbit m q collector collector = builder build ( ) ) { collector start ( ) ; assert that ( received spans take ( ) ) contains exactly elements of ( spans ) ; / / the only way we could read this , is if the malformed spans were skipped assert that ( received spans take ( ) ) contains exactly elements of ( spans ) ; } assert that ( rabbitmq metrics messages ( ) ) is equal to ( 5 ) ; assert that ( rabbitmq metrics messages dropped ( ) ) is equal to ( 2 ) ; / / only malformed , not empty assert that ( rabbitmq metrics bytes ( ) ) is equal to ( thrift encode list ( spans ) length * 2 + malformed 1 length + malformed 2 length ) ; assert that ( rabbitmq metrics spans ( ) ) is equal to ( spans size ( ) * 2 ) ; assert that ( rabbitmq metrics spans dropped ( ) ) is zero ( ) ; }


returns the effective startup options since in this command line the command options include invocation policy ' s and rcs ' contents expanded fully , the list of startup options should prevent reapplication of these contents the options parser does not understand the effect of these flags , since the relationship between these startup options and the command options is not held within the options parser , so instead , we add a small hack remove any explicit mentions of these flags , and explicitly add the options that prevent blaze from looking for the default rc files

private command line section get canonical startup options ( ) { list < option > unfiltered options = get active startup options ( ) get option list ( ) get option list ( ) ; / / create the fake ones to prevent reapplication of the original rc file contents options parser fake options = options parser builder ( ) options classes ( blaze server startup options class ) build ( ) ; try { fake options parse ( " - - ignore all rc files " ) ; } catch ( options parsing exception e ) { / / unless someone changes the definition of these flags , this is impossible throw new illegal state exception ( e ) ; } / / remove any instances of the applied , and add the new blocking ones return command line section new builder ( ) set section label ( " startup options " ) set option list ( option list new builder ( ) add all option ( unfiltered options stream ( ) filter ( option - > { string option name = option get option name ( ) ; return ! option name equals ( " ignore all rc files " ) & & ! option name equals ( " blazerc " ) & & ! option name equals ( " master blazerc " ) & & ! option name equals ( " bazelrc " ) & & ! option name equals ( " master bazelrc " ) & & ! option name equals ( " invocation policy " ) ; } ) collect ( collectors to list ( ) ) ) add all option ( get option list from parsed option descriptions ( fake options as complete list of parsed options ( ) ) ) ) build ( ) ; }


enables or disables compression for the jar file entries

public void set compression ( boolean compression ) { storage method = compression ? jar entry deflated : jar entry stored ; }


check if worker auto shutdown feature is enabled

public boolean get auto shutdown workers ( ) { return boolean parse boolean ( configs map get ( auto shutdown workers ) ) ; }


public final int get index ( ) { if ( index < 0 ) { throw new runtime exception ( " index not yet set " ) ; } return index ; }


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

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


returns an address range iterator over all occupied ranges in the map

public address range iterator get address ranges ( ) { return new range iterator ( ) ; }


loads and inializes the server configuration

protected void init config ( ) throws server exception { verify dir ( config dir ) ; file file = new file ( config dir ) ; configuration default conf ; string default config = name + " - default xml " ; class loader class loader = thread current thread ( ) get context class loader ( ) ; input stream input stream = class loader get resource as stream ( default config ) ; if ( input stream = = null ) { log warn ( " default configuration file not available in classpath [ { } ] " , default config ) ; default conf = new configuration ( false ) ; } else { try { default conf = new configuration ( false ) ; configuration utils load ( default conf , input stream ) ; } catch ( exception ex ) { throw new server exception ( server exception error s03 , default config , ex get message ( ) , ex ) ; } } if ( config = = null ) { configuration site conf ; file site file = new file ( file , name + " - site xml " ) ; if ( ! site file exists ( ) ) { log warn ( " site configuration file [ { } ] not found in config directory " , site file ) ; site conf = new configuration ( false ) ; } else { if ( ! site file is file ( ) ) { throw new server exception ( server exception error s05 , site file get absolute path ( ) ) ; } try { log debug ( " loading site configuration from [ { } ] " , site file ) ; input stream = files new input stream ( site file to path ( ) ) ; site conf = new configuration ( false ) ; configuration utils load ( site conf , input stream ) ; } catch ( i o exception ex ) { throw new server exception ( server exception error s06 , site file , ex get message ( ) , ex ) ; } } config = new configuration ( false ) ; configuration utils copy ( site conf , config ) ; } configuration utils inject defaults ( default conf , config ) ; config redactor redactor = new config redactor ( config ) ; for ( string name : system get properties ( ) string property names ( ) ) { string value = system get property ( name ) ; if ( name starts with ( get prefix ( ) + " " ) ) { config set ( name , value ) ; string redacted = redactor redact ( name , value ) ; log info ( " system property sets { } : { } " , name , redacted ) ; } } log debug ( " loaded configuration : " ) ; log debug ( " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " ) ; for ( map entry < string , string > entry : config ) { string name = entry get key ( ) ; string value = config get ( entry get key ( ) ) ; string redacted = redactor redact ( name , value ) ; log debug ( " { } : { } " , entry get key ( ) , redacted ) ; } log debug ( " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " ) ; }


private static directory listing get reserved listing ( f s directory fsd ) { return new directory listing ( fsd get reserved statuses ( ) , 0 ) ; }


writes the opening ' { @ code label } ' tag and forces a block tag so that body content is written correctly

protected int write tag content ( tag writer tag writer ) throws jsp exception { tag writer start tag ( label tag ) ; tag writer write attribute ( for attribute , resolve for ( ) ) ; write default attributes ( tag writer ) ; tag writer force block ( ) ; this tag writer = tag writer ; return eval body include ; }


outbound flow control where the initial window size is reduced before a stream is started

public void outbound flow control small window size ( ) throws exception { init transport ( ) ; int initial outbound window size = 100 ; set initial window size ( initial outbound window size ) ; mock stream listener listener = new mock stream listener ( ) ; ok http client stream stream = client transport new stream ( method , new metadata ( ) , call options default ) ; stream start ( listener ) ; int message length = 75 ; / / the first message should be sent out input stream input = new byte array input stream ( new byte [ message length ] ) ; stream write message ( input ) ; stream flush ( ) ; verify ( frame writer , timeout ( time out ms ) ) data ( eq ( false ) , eq ( 3 ) , any ( buffer class ) , eq ( message length + header length ) ) ; / / the second message should be partially sent out input = new byte array input stream ( new byte [ message length ] ) ; stream write message ( input ) ; stream flush ( ) ; int partially sent size = initial outbound window size - message length - header length ; verify ( frame writer , timeout ( time out ms ) ) data ( eq ( false ) , eq ( 3 ) , any ( buffer class ) , eq ( partially sent size ) ) ; / / get more credit so the rest of the data should be sent out frame handler ( ) window update ( 3 , initial outbound window size ) ; verify ( frame writer , timeout ( time out ms ) ) data ( eq ( false ) , eq ( 3 ) , any ( buffer class ) , eq ( message length + header length - partially sent size ) ) ; stream cancel ( status cancelled ) ; listener wait until stream closed ( ) ; shutdown and verify ( ) ; }


set whether to detect handler functions in ancestor application contexts default is " false " : only handler functions in the current application context will be detected , i e only in the context that this handler mapping itself is defined in ( typically the current dispatcher servlet ' s context ) switch this flag on to detect handler beans in ancestor contexts ( typically the spring root web application context ) as well

public void set detect handler functions in ancestor contexts ( boolean detect handler functions in ancestor contexts ) { this detect handler functions in ancestor contexts = detect handler functions in ancestor contexts ; }


registers this object as an active listener so that it can start getting callbacks invoked

public void register ( ) { all ( ) add ( this ) ; }


protected result value printer get printer ( ) { return this printer ; }


escapes a reserved word as defined in the ` reserved words ` array handle escaping those terms here this logic is only called if a variable matches the reserved words

public string escape reserved word ( string name ) { if ( this reserved words mappings ( ) contains key ( name ) ) { return this reserved words mappings ( ) get ( name ) ; } return name + " " ; / / add an underscore suffix to the name - a prefix implies unused }


clears out the source and targets lists and reloads them to ensure that they reflect the current state of the data model any currently - selected list items will be restored after the lists are reloaded

public void reload ( ) { reload source list ( ) ; function selected source = ( function ) source functions c b model get selected item ( ) ; reload target list ( selected source ) ; load functions ( selected source , ( function ) target functions c b model get selected item ( ) ) ; update tab text ( ) ; / / fire a notification to update the ui state ; without this the / / actions would not be properly enabled / disabled tool context changed ( provider ) ; tool set status info ( " function comparisons updated " ) ; }


retrieves the underlying error when { @ link # type } is { @ link # type out of memory }

public out of memory error get out of memory error ( ) { assertions check state ( type = = type out of memory ) ; return ( out of memory error ) assertions check not null ( cause ) ; }


fail the owning task with the given throwable

void fail externally ( throwable cause ) ;


returns the default port if the file system defines one { @ link file system # get default port ( ) } returns 0 to indicate the default port is undefined however , the logic that consumes this value expects to receive - 1 to indicate the port is undefined , which agrees with the contract of { @ link uri # get port ( ) }

private static int get default port if defined ( file system the fs impl ) { int default port = the fs impl get default port ( ) ; return default port ! = 0 ? default port : delegate to fs default port ; }


checks if name resolution was successful for the given address if ip address and host name are the same , then it means name resolution has failed as a special case , local addresses are also considered acceptable this is particularly important on windows , where 127 0 0 1 does not resolve to " localhost "

private static boolean is name resolved ( inet address address ) { string hostname = address get host name ( ) ; string ip = address get host address ( ) ; return ! hostname equals ( ip ) | | net utils is local address ( address ) ; }


sets the filter which should be applied to the image which was ( or will be ) set by set image ( )

public void set filter ( final g p u image filter filter ) { this filter = filter ; renderer set filter ( this filter ) ; request render ( ) ; }


do some basic verification on the input received - - being defensive

private boolean verify sanity ( long compressed length , long decompressed length , int for reduce , set < task attempt i d > remaining , task attempt i d map id ) { if ( compressed length < 0 | | decompressed length < 0 ) { wrong length errs increment ( 1 ) ; log warn ( get name ( ) + " invalid lengths in map output header : id : " + map id + " len : " + compressed length + " , decomp len : " + decompressed length ) ; return false ; } if ( for reduce ! = reduce ) { wrong reduce errs increment ( 1 ) ; log warn ( get name ( ) + " data for the wrong reduce map : " + map id + " len : " + compressed length + " decomp len : " + decompressed length + " for reduce " + for reduce ) ; return false ; } / / sanity check if ( ! remaining contains ( map id ) ) { wrong map errs increment ( 1 ) ; log warn ( " invalid map - output ! received output for " + map id ) ; return false ; } return true ; }


returns { @ code true } if the { @ link throwable } was caused by an timeout or transport error these methods can be used on the { @ link future # cause ( ) } that is returned by the various methods exposed by this { @ link dns name resolver }

public static boolean is transport or timeout error ( throwable cause ) { return cause ! = null & & cause get cause ( ) instanceof dns name resolver exception ; }


public void set stream type ( @ c stream type int stream type ) { if ( this stream type = = stream type ) { return ; } this stream type = stream type ; update volume and notify if changed ( ) ; listener on stream type changed ( stream type ) ; }


gets signature signing configuration the resolved used is { @ link saml id p metadata credential resolver } that allows the entire criteria set to be passed to the role descriptor resolver this behavior allows the passing of { @ link saml id p saml registered service criterion } so signing configuration , etc can be fetched for a specific service as an override , if on is in fact defined for the service

protected signature signing configuration get signature signing configuration ( final saml registered service service ) throws exception { val config = configure signature signing security configuration ( service ) ; val saml idp = cas properties get authn ( ) get saml idp ( ) ; val private key = get signing private key ( service ) ; val md credential resolver = new saml id p metadata credential resolver ( ) ; val role descriptor resolver = saml id p utils get role descriptor resolver ( cas saml id p metadata resolver , saml idp get metadata ( ) is require valid metadata ( ) ) ; md credential resolver set role descriptor resolver ( role descriptor resolver ) ; md credential resolver set key info credential resolver ( default security configuration bootstrap build basic inline key info credential resolver ( ) ) ; md credential resolver initialize ( ) ; val criteria set = new criteria set ( ) ; criteria set add ( new signature signing configuration criterion ( config ) ) ; criteria set add ( new usage criterion ( usage type signing ) ) ; criteria set add ( new entity id criterion ( saml idp get entity id ( ) ) ) ; criteria set add ( new entity role criterion ( i d p s s o descriptor default element name ) ) ; criteria set add ( new saml id p saml registered service criterion ( service ) ) ; val credentials = sets < credential > new linked hash set ( md credential resolver resolve ( criteria set ) ) ; val creds = new array list < credential > ( 2 ) ; credentials stream ( ) map ( c - > get resolved signing credential ( c , private key , service ) ) filter ( objects : : non null ) filter ( c - > does credential fingerprint match ( c , service ) ) for each ( creds : : add ) ; if ( creds is empty ( ) ) { logger error ( " unable to locate any signing credentials for service [ { } ] " , service get name ( ) ) ; throw new illegal argument exception ( " unable to locate signing credentials " ) ; } config set signing credentials ( creds ) ; logger trace ( " signature signing credentials configured with [ { } ] credentials " , creds size ( ) ) ; return config ; }