failover from service 1 to service 2 if the failover fails then try to failback

public void failover ( h a service target from svc , h a service target to svc , boolean force fence , boolean force active ) throws failover failed exception { preconditions check argument ( from svc get fencer ( ) ! = null , " failover requires a fencer " ) ; pre failover checks ( from svc , to svc , force active ) ; / / try to make from svc standby boolean try fence = true ; if ( try graceful fence ( from svc ) ) { try fence = force fence ; } / / fence from svc if it ' s required or forced by the user if ( try fence ) { if ( ! from svc get fencer ( ) fence ( from svc , to svc ) ) { throw new failover failed exception ( " unable to fence " + from svc + " fencing failed " ) ; } } / / try to make to svc active boolean failed = false ; throwable cause = null ; try { h a service protocol helper transition to active ( to svc get proxy ( conf , rpc timeout to new active ) , create req info ( ) ) ; } catch ( service failed exception sfe ) { log error ( " unable to make { } active ( { } ) failing back " , to svc , sfe get message ( ) ) ; failed = true ; cause = sfe ; } catch ( i o exception ioe ) { log error ( " unable to make { } active ( unable to connect ) failing back " , to svc , ioe ) ; failed = true ; cause = ioe ; } / / we failed to make to svc active if ( failed ) { string msg = " unable to failover to " + to svc ; / / only try to failback if we didn ' t fence from svc if ( ! try fence ) { try { / / unconditionally fence to svc in case it is still trying to / / become active , eg we timed out waiting for its response / / unconditionally force from svc to become active since it / / was previously active when we initiated failover failover ( to svc , from svc , true , true ) ; } catch ( failover failed exception ffe ) { msg + = " failback to " + from svc + " failed ( " + ffe get message ( ) + " ) " ; log error ( msg ) ; } } throw new failover failed exception ( msg , cause ) ; } }


go to the given address ; update the last address so that iterator will be adjusted for next and previous

private void go to ( address p 1 address ) { p 1 current address = p 1 address ; location changed ( p 1 current address ) ; }


check if an address that is a possible reference falls within a defined function , pointing at a symbol

boolean check offcut func ref ( program program , address addr ) { instruction instr = program get listing ( ) get instruction containing ( addr ) ; / / no instruction , not offcut if ( instr = = null ) { return false ; } / / in the middle of an instruction , offcut if ( ! instr get min address ( ) equals ( addr ) ) { return true ; } / / in the middle of a function body , offcut function func = program get function manager ( ) get function containing ( addr ) ; if ( func ! = null ) { if ( ! func get entry point ( ) equals ( addr ) ) { return true ; } } return false ; }


check if access should be allowed user i d is not checked if null this method doesn ' t check if token password is correct it should be used only when token password has already been verified ( e g , in the rpc layer ) some places need to check the access using storage types and for other places the storage types is not relevant

public void check access ( block token identifier id , string user id , extended block block , block token identifier access mode mode , storage type [ ] storage types ) throws invalid token { check access ( id , user id , block , mode ) ; if ( array utils is not empty ( storage types ) ) { check access ( id get storage types ( ) , storage types , " storage types " ) ; } }


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


performs the opening handshake when call this method you must not retain the { @ link http request } which is passed in

public final channel future handshake ( final channel channel , http request req , final http headers response headers , final channel promise promise ) { if ( req instanceof full http request ) { return handshake ( channel , ( full http request ) req , response headers , promise ) ; } if ( logger is debug enabled ( ) ) { logger debug ( " { } web socket version { } server handshake " , channel , version ( ) ) ; } channel pipeline p = channel pipeline ( ) ; channel handler context ctx = p context ( http request decoder class ) ; if ( ctx = = null ) { / / this means the user use an http server codec ctx = p context ( http server codec class ) ; if ( ctx = = null ) { promise set failure ( new illegal state exception ( " no http decoder and no http server codec in the pipeline " ) ) ; return promise ; } } / / add aggregator and ensure we feed the http request so it is aggregated a limit o 8192 should be more then / / enough for the websockets handshake payload / / / / todo : make handshake work without http object aggregator at all string aggregator name = " http aggregator " ; p add after ( ctx name ( ) , aggregator name , new http object aggregator ( 8192 ) ) ; p add after ( aggregator name , " handshaker " , new simple channel inbound handler < full http request > ( ) { @ override protected void channel read 0 ( channel handler context ctx , full http request msg ) throws exception { / / remove ourself and do the actual handshake ctx pipeline ( ) remove ( this ) ; handshake ( channel , msg , response headers , promise ) ; } @ override public void exception caught ( channel handler context ctx , throwable cause ) throws exception { / / remove ourself and fail the handshake promise ctx pipeline ( ) remove ( this ) ; promise try failure ( cause ) ; ctx fire exception caught ( cause ) ; } @ override public void channel inactive ( channel handler context ctx ) throws exception { / / fail promise if channel was closed if ( ! promise is done ( ) ) { promise try failure ( new closed channel exception ( ) ) ; } ctx fire channel inactive ( ) ; } } ) ; try { ctx fire channel read ( reference count util retain ( req ) ) ; } catch ( throwable cause ) { promise set failure ( cause ) ; } return promise ; }


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


public boolean merge ( ) throws cancelled exception { return merge ( task monitor adapter dummy monitor ) ; }


sets the { @ code package name } and returns a reference to this builder so that the methods can be chained together

public builder with package name ( string package name ) { this package name = package name ; return this ; }


sets the < code > attribute number < code > property

public xml item attribute number ( big decimal attribute number ) { this attribute number = attribute number ; return this ; }


this method is only used by { @ link # split ( int ) } when splitting a large batch to smaller ones

private boolean try append for split ( long timestamp , byte buffer key , byte buffer value , header [ ] headers , thunk thunk ) { if ( ! records builder has room for ( timestamp , key , value , headers ) ) { return false ; } else { / / no need to get the crc this records builder append ( timestamp , key , value , headers ) ; this max record size = math max ( this max record size , abstract records estimate size in bytes upper bound ( magic ( ) , records builder compression type ( ) , key , value , headers ) ) ; future record metadata future = new future record metadata ( this produce future , this record count , timestamp , thunk future checksum or null ( ) , key = = null ? - 1 : key remaining ( ) , value = = null ? - 1 : value remaining ( ) , time system ) ; / / chain the future to the original thunk thunk future chain ( future ) ; this thunks add ( thunk ) ; this record count + + ; return true ; } }


tests verifies the jmx attributes of local and remote peer bean - change participant to observer role

public void test j m x bean after role change ( ) throws exception { qu = new quorum util ( 1 ) ; / / create 3 servers qu disable j m x test = true ; qu start all ( ) ; zk arr = create handles ( qu ) ; zk admin arr = create admin handles ( qu ) ; / / changing a server ' s role / port is done by " adding " it with the same / / id but different role / port list < string > joining servers = new array list < string > ( ) ; / / assert remote peer bean 1 of replicated server 2 int changing index = 1 ; int replica 2 = 2 ; quorum peer peer 2 = qu get peer ( replica 2 ) peer ; quorum server changing q s 2 = peer 2 get view ( ) get ( long value of ( changing index ) ) ; string remote peer bean 2 = m bean registry domain + " : name 0 = replicated server id " + replica 2 + " , name 1 = replica " + changing index ; assert remote peer m x bean attributes ( changing q s 2 , remote peer bean 2 ) ; / / assert remote peer bean 1 of replicated server 3 int replica 3 = 3 ; quorum peer peer 3 = qu get peer ( replica 3 ) peer ; quorum server changing q s 3 = peer 3 get view ( ) get ( long value of ( changing index ) ) ; string remote peer bean 3 = m bean registry domain + " : name 0 = replicated server id " + replica 3 + " , name 1 = replica " + changing index ; assert remote peer m x bean attributes ( changing q s 3 , remote peer bean 3 ) ; string new role = " observer " ; zoo keeper zk = zk arr [ changing index ] ; zoo keeper admin zk admin = zk admin arr [ changing index ] ; / / exactly as it is now , except for role change joining servers add ( " server " + changing index + " = 127 0 0 1 : " + qu get peer ( changing index ) peer get quorum address ( ) get all ports ( ) get ( 0 ) + " : " + qu get peer ( changing index ) peer get election address ( ) get all ports ( ) get ( 0 ) + " : " + new role + " ; 127 0 0 1 : " + qu get peer ( changing index ) peer get client port ( ) ) ; reconfig ( zk admin , joining servers , null , null , - 1 ) ; test normal operation ( zk arr [ changing index ] , zk ) ; assert true ( qu get peer ( changing index ) peer observer ! = null & & qu get peer ( changing index ) peer follower = = null & & qu get peer ( changing index ) peer leader = = null ) ; assert true ( qu get peer ( changing index ) peer get peer state ( ) = = server state observing ) ; quorum peer qp = qu get peer ( changing index ) peer ; string local peer bean name = m bean registry domain + " : name 0 = replicated server id " + changing index + " , name 1 = replica " + changing index ; / / local peer bean 1 of replicated server 1 assert local peer m x bean attributes ( qp , local peer bean name , true ) ; / / assert remote peer bean 1 of replicated server 2 changing q s 2 = peer 2 get view ( ) get ( long value of ( changing index ) ) ; assert remote peer m x bean attributes ( changing q s 2 , remote peer bean 2 ) ; / / assert remote peer bean 1 of replicated server 3 changing q s 3 = peer 3 get view ( ) get ( long value of ( changing index ) ) ; assert remote peer m x bean attributes ( changing q s 3 , remote peer bean 3 ) ; }


serialize the sparse vector to string the format of the returned is described at { @ link # parse sparse ( string ) }

public static string to string ( sparse vector sparse vector ) { string builder sbd = new string builder ( ) ; if ( sparse vector n > 0 ) { sbd append ( header delimiter ) ; sbd append ( sparse vector n ) ; sbd append ( header delimiter ) ; } if ( null ! = sparse vector indices ) { for ( int i = 0 ; i < sparse vector indices length ; i + + ) { sbd append ( sparse vector indices [ i ] ) ; sbd append ( index value delimiter ) ; sbd append ( sparse vector values [ i ] ) ; if ( i < sparse vector indices length - 1 ) { sbd append ( element delimiter ) ; } } } return sbd to string ( ) ; }


returns the number of parameters of the given internal method descriptor

public static int internal method parameter count ( string internal method descriptor ) { int counter = 0 ; int index = 1 ; while ( true ) { char c = internal method descriptor char at ( index + + ) ; switch ( c ) { case class constants type array : { / / just ignore all array characters break ; } case class constants type class start : { counter + + ; / / skip the class name index = internal method descriptor index of ( class constants type class end , index ) + 1 ; break ; } default : { counter + + ; break ; } case class constants method arguments close : { return counter ; } } } }


adds a move instruction to the end of this basic block , just before the last instruction if the result of the final instruction is the source in question , then the move is placed at the beginning of the primary successor block this is for unversioned registers

public void add move to end ( register spec result , register spec source ) { if ( result get reg ( ) = = source get reg ( ) ) { / / sometimes we end up with no - op moves ignore them here return ; } / * * the last insn has to be a normal ssa insn : a phi can ' t branch * or return or cause an exception , etc * / normal ssa insn last insn ; last insn = ( normal ssa insn ) insns get ( insns size ( ) - 1 ) ; if ( last insn get result ( ) ! = null | | last insn get sources ( ) size ( ) > 0 ) { / * * the final insn in this block has a source or result * register , and the moves we may need to place and * schedule may interfere we need to insert this * instruction at the beginning of the primary successor * block instead we know this is safe , because when we * edge - split earlier , we ensured that each successor has * only us as a predecessor * / for ( int i = successors next set bit ( 0 ) ; i > = 0 ; i = successors next set bit ( i + 1 ) ) { ssa basic block succ ; succ = parent get blocks ( ) get ( i ) ; succ add move to beginning ( result , source ) ; } } else { / * * we can safely add a move to the end of the block just * before the last instruction , because the final insn does * not assign to anything * / register spec list sources = register spec list make ( source ) ; normal ssa insn to add = new normal ssa insn ( new plain insn ( rops op move ( result get type ( ) ) , source position no info , result , sources ) , this ) ; insns add ( insns size ( ) - 1 , to add ) ; moves from phis at end + + ; } }


tries to perform a " full " garbage collection cycle ( including processing of weak references and invocation of finalize methods ) and waits for it to complete ensures that at least one weak reference has been cleared and one { @ code finalize } method has been run before this method returns this method may be useful when testing the garbage collection mechanism itself , or inhibiting a spontaneous gc initiation in subsequent code in contrast , a plain call to { @ link java lang system # gc ( ) } does not ensure finalization processing and may run concurrently , for example , if the jvm flag { @ code - xx : + explicit g c invokes concurrent } is used whenever possible , it is preferable to test directly for some observable change resulting from gc , as with { @ link # await clear } because there are no guarantees for the order of gc finalization processing , there may still be some unfinished work for the gc to do after this method returns this method does not create any memory pressure as would be required to cause soft references to be processed

public static void await full gc ( ) { final count down latch finalizer ran = new count down latch ( 1 ) ; weak reference < object > ref = new weak reference < object > ( new object ( ) { @ override protected void finalize ( ) { finalizer ran count down ( ) ; } } ) ; await ( finalizer ran ) ; await clear ( ref ) ; / / hope to catch some stragglers queued up behind our finalizable object system run finalization ( ) ; }


select the content - type header ' s value from the given array : if json exists in the given array , use it ; otherwise use the first one of the array

public string select header content type ( string [ ] content types ) { if ( content types length = = 0 | | content types [ 0 ] equals ( " * / * " ) ) { return " application / json " ; } for ( string content type : content types ) { if ( is json mime ( content type ) ) { return content type ; } } return content types [ 0 ] ; }


public cancellable get ssl certificates async ( request options options , action listener < get ssl certificates response > listener ) { return rest high level client perform request async and parse entity ( get ssl certificates request instance , get ssl certificates request : : get request , options , get ssl certificates response : : from x content , listener , empty set ( ) ) ; }


parse the string representation of a refresh policy , usually from a request parameter

public static refresh policy parse ( string value ) { for ( refresh policy policy : values ( ) ) { if ( policy get value ( ) equals ( value ) ) { return policy ; } } if ( " " equals ( value ) ) { / / empty string is immediate because that makes " post / test / test / 1 ? refresh " perform / / a refresh which reads well and is what folks are used to return immediate ; } throw new illegal argument exception ( " unknown value for refresh : [ " + value + " ] " ) ; }


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


converts { @ code value } to a json document and writes it to { @ code out } unlike gson ' s similar { @ link gson # to json ( json element , appendable ) to json } method , this write is strict create a { @ link json writer # set lenient ( boolean ) lenient } { @ code json writer } and call { @ link # write ( com google gson stream json writer , object ) } for lenient writing

public final void to json ( writer out , t value ) throws i o exception { json writer writer = new json writer ( out ) ; write ( writer , value ) ; }


create the test filesystem with or without multipart purging if the test fs s 3a name property is not set , this will trigger a j unit failure

public static s 3 a file system create test file system ( configuration conf , boolean purge ) throws i o exception { string fsname = conf get trimmed ( test fs s3a name , " " ) ; boolean live test = ! string utils is empty ( fsname ) ; uri test u r i = null ; if ( live test ) { test u r i = uri create ( fsname ) ; live test = test u r i get scheme ( ) equals ( constants fs s3a ) ; } / / this doesn ' t work with our j unit 3 style test cases , so instead we ' ll / / make this whole class not run by default assume assume true ( " no test filesystem in " + test fs s3a name , live test ) ; / / patch in s 3 guard options maybe enable s 3 guard ( conf ) ; s 3 a file system fs 1 = new s 3 a file system ( ) ; / / enable purging in tests if ( purge ) { / / purge with but a delay so that parallel multipart tests don ' t / / suddenly start timing out enable multipart purge ( conf , purge delay seconds ) ; } fs 1 initialize ( test u r i , conf ) ; return fs 1 ; }


set per - file charsets to use for parsing properties files only applies to classic properties files , not to xml files

public void set file encodings ( properties file encodings ) { this file encodings = file encodings ; }


returns true if this segment has relocations

public boolean has relocation ( ) { return ( flagword & flag reloc info ) ! = 0 ; }


swallow - result - > background - thread hand - off - > multiplex - > encoded cache - > disk cache - > ( webp transcode ) - > local file fetch

private synchronized producer < void > get local file fetch to encoded memory prefetch sequence ( ) { if ( fresco systrace is tracing ( ) ) { fresco systrace begin section ( " producer sequence factory # get local file fetch to encoded memory prefetch sequence " ) ; } if ( m local file fetch to encoded memory prefetch sequence = = null ) { if ( fresco systrace is tracing ( ) ) { fresco systrace begin section ( " producer sequence factory # get local file fetch to encoded memory prefetch sequence : init " ) ; } m local file fetch to encoded memory prefetch sequence = m producer factory new swallow result producer ( get background local file fetch to encode memory sequence ( ) ) ; if ( fresco systrace is tracing ( ) ) { fresco systrace end section ( ) ; } } if ( fresco systrace is tracing ( ) ) { fresco systrace end section ( ) ; } return m local file fetch to encoded memory prefetch sequence ; }


override with any special handling of response codes

protected api response find method response ( api responses responses ) { string code = null ; for ( string response code : responses key set ( ) ) { if ( response code starts with ( " 2 " ) | | response code equals ( " default " ) ) { if ( code = = null | | code compare to ( response code ) > 0 ) { code = response code ; } } } if ( code = = null ) { return null ; } return responses get ( code ) ; }


observable < model api response > upload file with required file ( @ retrofit 2 http path ( " pet id " ) long pet id , @ retrofit 2 http part multipart body part required file , @ retrofit 2 http part ( " additional metadata " ) string additional metadata ) ;


the path at which this entry ' s visibility was defined ( eg public xml ) < code > optional aapt pb source source = 2 ; < code >


typo , switch to use { @ link # get dispatcher ( ) }

public string get dispather ( ) { return get dispatcher ( ) ; }


public static void ensure service access is allowed ( final string service , final registered service registered service ) { if ( registered service = = null ) { logger warn ( " unauthorized service access service [ { } ] is not found in service registry " , service ) ; throw new unauthorized service exception ( unauthorized service exception code unauthz service , " service is not found in service registry " ) ; } if ( ! registered service get access strategy ( ) is service access allowed ( ) ) { val msg = string format ( " unauthorized service access service [ % s ] is not enabled in service registry " , service ) ; logger warn ( msg ) ; throw new unauthorized service exception ( unauthorized service exception code unauthz service , msg ) ; } if ( ! ensure service is not expired ( registered service ) ) { val msg = string format ( " expired service access is denied service [ % s ] has been expired " , service ) ; logger warn ( msg ) ; throw new unauthorized service exception ( unauthorized service exception code expired service , msg ) ; } }


get the actual instance of ` complex quadrilateral ` if the actual instanct is not ` complex quadrilateral ` , the class cast exception will be thrown

public complex quadrilateral get complex quadrilateral ( ) throws class cast exception { return ( complex quadrilateral ) super get actual instance ( ) ; }


dispatches { @ link # on drm keys removed ( int , media period id ) }

public void drm keys removed ( ) { for ( listener and handler listener and handler : listener and handlers ) { drm session event listener listener = listener and handler listener ; post or run ( listener and handler handler , ( ) - > listener on drm keys removed ( window index , media period id ) ) ; } }


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

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


start writing to the log segment with the given txid transitions from between log segments state to in log segment state

private void start log segment ( final long segment tx id , int layout version ) throws i o exception { assert thread holds lock ( this ) ; log info ( " starting log segment at " + segment tx id ) ; preconditions check argument ( segment tx id > 0 , " bad txid : % s " , segment tx id ) ; preconditions check state ( state = = state between log segments , " bad state : % s " , state ) ; preconditions check state ( segment tx id > cur segment tx id , " cannot start writing to log segment " + segment tx id + " when previous log segment started at " + cur segment tx id ) ; preconditions check argument ( segment tx id = = txid + 1 , " cannot start log segment at txid % s when next expected " + " txid is % s " , segment tx id , txid + 1 ) ; num transactions = 0 ; total time transactions = 0 ; num transactions batched in sync set ( 0l ) ; / / todo no need to link this back to storage anymore ! / / see hdfs - 2174 storage attempt restore removed storage ( ) ; try { edit log stream = journal set start log segment ( segment tx id , layout version ) ; } catch ( i o exception ex ) { final string msg = " unable to start log segment " + segment tx id + " : too few journals successfully started " ; log error ( msg , ex ) ; synchronized ( journal set lock ) { i o utils cleanup with logger ( log , journal set ) ; } terminate ( 1 , msg ) ; } cur segment tx id = segment tx id ; state = state in segment ; }


gather a collection of files at least as large as min size

public long get input files ( long min size , collection < file status > files ) throws i o exception { update lock read lock ( ) lock ( ) ; try { return root select files ( min size , files ) ; } finally { update lock read lock ( ) unlock ( ) ; } }


returns all the nodes in the topologically sorted order that is , if there ' s an edge a → b , b always come earlier than a

public list < n > get sorted ( ) { return topological order ; }


formats bytes using sql standard format for binary string literal

public static string binary literal ( byte [ ] value ) { return " x ' " + base 1 6 ( ) encode ( value ) + " ' " ; }


the test creates 2 electors which try to become active using a real zookeeper server it verifies that 1 becomes active and 1 becomes standby upon becoming active the leader quits election and the test verifies that the standby now becomes active

public void test active standby transition ( ) throws exception { log info ( " starting test with parent dir : " + parent dir ) ; assert false ( electors [ 0 ] parent z node exists ( ) ) ; electors [ 0 ] ensure parent z node ( ) ; assert true ( electors [ 0 ] parent z node exists ( ) ) ; / / first elector joins election , becomes active electors [ 0 ] join election ( app datas [ 0 ] ) ; active standby elector test util wait for active lock data ( null , zk server , parent dir , app datas [ 0 ] ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) become active ( ) ; check fatals and reset ( ) ; / / second elector joins election , becomes standby electors [ 1 ] join election ( app datas [ 1 ] ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) become standby ( ) ; check fatals and reset ( ) ; / / first elector quits , second one should become active electors [ 0 ] quit election ( true ) ; active standby elector test util wait for active lock data ( null , zk server , parent dir , app datas [ 1 ] ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) become active ( ) ; check fatals and reset ( ) ; / / first one rejoins , becomes standby , second one stays active electors [ 0 ] join election ( app datas [ 0 ] ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) become standby ( ) ; check fatals and reset ( ) ; / / second one expires , first one becomes active electors [ 1 ] prevent session reestablishment for tests ( ) ; try { zk server close session ( electors [ 1 ] get z k session id for tests ( ) ) ; active standby elector test util wait for active lock data ( null , zk server , parent dir , app datas [ 0 ] ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) enter neutral mode ( ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) fence old active ( additional matchers ary eq ( app datas [ 1 ] ) ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) become active ( ) ; } finally { electors [ 1 ] allow session reestablishment for tests ( ) ; } / / second one eventually reconnects and becomes standby mockito verify ( cbs [ 1 ] , mockito timeout ( 5000 ) ) become standby ( ) ; check fatals and reset ( ) ; / / first one expires , second one should become active electors [ 0 ] prevent session reestablishment for tests ( ) ; try { zk server close session ( electors [ 0 ] get z k session id for tests ( ) ) ; active standby elector test util wait for active lock data ( null , zk server , parent dir , app datas [ 1 ] ) ; mockito verify ( cbs [ 0 ] , mockito timeout ( 1000 ) ) enter neutral mode ( ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) fence old active ( additional matchers ary eq ( app datas [ 0 ] ) ) ; mockito verify ( cbs [ 1 ] , mockito timeout ( 1000 ) ) become active ( ) ; } finally { electors [ 0 ] allow session reestablishment for tests ( ) ; } check fatals and reset ( ) ; }


test that verifies headers can be up to 64k long the test adds a 63k header leaving 1k for other headers this is because the header buffer setting is for all headers , names and values included

public void test long header ( ) throws exception { url url = new url ( base url , servlet path longheader ) ; https u r l connection conn = ( https u r l connection ) url open connection ( ) ; conn set s s l socket factory ( client ssl factory create s s l socket factory ( ) ) ; test long header ( conn ) ; }


check if a record matches the primary keys or the partial record

public boolean matches ( t other ) { if ( this partial = = null ) { return false ; } return this partial like ( other ) ; }


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


generate the config option key for the configuration key of external resource in the deploying system

public static string get system config key config option for resource ( string resource name , string suffix ) { return key with resource name and suffix ( resource name , suffix ) ; }


asynchronously deletes license from the cluster

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


returns the unique identifier of this jenkins that has been historically used to identify this jenkins to the outside world this form of identifier is weak in that it can be impersonated by others see https : wiki jenkins - ci orgdisplay j e n k i n s instance + identity for more modern form of instance id that can be challenged and verified

public string get legacy instance id ( ) { return util get digest of ( get secret key ( ) ) ; }


public ssl context builder protocols ( iterable < string > protocols ) { return protocols ( to array ( protocols , empty strings ) ) ; }


public glyph layout add text ( char sequence str , float x , float y , int start , int end , float target width , int halign , boolean wrap , string truncate ) { glyph layout layout = pools obtain ( glyph layout class ) ; pooled layouts add ( layout ) ; layout set text ( font , str , start , end , color , target width , halign , wrap , truncate ) ; add text ( layout , x , y ) ; return layout ; }


deprecated use ` fill get gradient colors ( ) `

public int get start color ( ) { return get gradient colors ( ) [ 0 ] ; }


applies logic of this class to another { @ link ms symbol applier } instead of to the program

abstract void apply to ( ms symbol applier apply to applier ) throws pdb exception , cancelled exception ;


sets the starting vertical position of this field

public void set start y ( int start y ) { this start y = start y ; }


specify the order to use for resource handling relative to other { @ code handler mapping } s configured in the spring configuration the default value used is { @ code integer max value - 1 }

public resource handler registry set order ( int order ) { this order = order ; return this ; }


equivalent to { @ link # get all ( object ) } but no intermediate list is generated

public iterator < v > value iterator ( k name ) { return new value iterator ( name ) ; }


gets the status code for parsing this zip entry

public status get code ( ) { return code ; }


adds { @ code equality group } with objects that are supposed to be equal to each other and not equal to any other equality groups added to this tester

public equals tester add equality group ( object equality group ) { check not null ( equality group ) ; equality groups add ( immutable list copy of ( equality group ) ) ; return this ; }


exit a parse tree produced by { @ link sql base parser # function expression }

void exit function expression ( sql base parser function expression context ctx ) ;


public string insn arg string ( dalv insn insn ) { register spec list regs = insn get registers ( ) ; return regs get ( 0 ) reg string ( ) + " , " + regs get ( 1 ) reg string ( ) ; }


shutdown tolerable number of datanode before reading verify the decoding works correctly

public void test read with d n failure ( ) throws exception { try { / / setup a new cluster with no dead datanode setup ( ) ; read striped file with decoding helper test read with d n failure ( cluster , dfs , file length , dn failure num ) ; } catch ( i o exception ioe ) { string file type = file length < ( block size * num data units ) ? " small file " : " large file " ; log error ( " failed to read file with dn failure : " + " file type = " + file type + " , dn failure num = " + dn failure num ) ; } finally { / / tear down the cluster tear down ( ) ; } }


the collection of { @ link calendar } objects found in the query

public list < calendar > calendars ( ) { return results ; }


returns the { @ link h a proxy proxied protocol } represented by the specified byte

public static h a proxy proxied protocol value of ( byte tpaf byte ) { switch ( tpaf byte ) { case tpaf tcp4 byte : return tcp4 ; case tpaf tcp6 byte : return tcp6 ; case tpaf unknown byte : return unknown ; case tpaf udp4 byte : return udp4 ; case tpaf udp6 byte : return udp6 ; case tpaf unix stream byte : return unix stream ; case tpaf unix dgram byte : return unix dgram ; default : throw new illegal argument exception ( " unknown transport protocol + address family : " + ( tpaf byte & 0x f f ) ) ; } }


removes the given fid file from the application note : this does not delete the file , it only removes it from the applications list of knows fid files

public void remove user file ( fid file fid file ) { load fid files ( ) ; fid files remove ( fid file ) ; save to preferences ( ) ; notify listeners ( ) ; }


this test adds randomized fields on all json objects and checks that we can parse it to ensure the parsing is lenient for forward compatibility we need to exclude json objects with the " highlight " and " fields " field name since these objects allow arbitrary keys ( the field names that are queries ) also we want to exclude to add anything under " source " since it is not parsed , and avoid complexity by excluding everything under " inner hits " they are also keyed by arbitrary names and contain search hits , which are already tested elsewhere we also exclude the root level , as all unknown fields on a root level are interpreted as meta - fields and will be kept

public void test from x content lenient parsing ( ) throws i o exception { x content type x content type = random from ( x content type values ( ) ) ; search hit search hit = create test item ( x content type , true , true ) ; bytes reference original bytes = to x content ( search hit , x content type , true ) ; predicate < string > paths to exclude = path - > path ends with ( " highlight " ) | | path contains ( " fields " ) | | path contains ( " source " ) | | path contains ( " inner hits " ) | | path is empty ( ) ; bytes reference with random fields = insert random fields ( x content type , original bytes , paths to exclude , random ( ) ) ; search hit parsed ; try ( x content parser parser = create parser ( x content type x content ( ) , with random fields ) ) { parser next token ( ) ; / / jump to first start object parsed = search hit from x content ( parser ) ; assert equals ( x content parser token end object , parser current token ( ) ) ; assert null ( parser next token ( ) ) ; } assert to x content equivalent ( original bytes , to x content ( parsed , x content type , true ) , x content type ) ; }


called when the user has indicated they she would like to dismiss the view

void on dismiss ( view view , object token ) ;


called if a { @ code rst stream } is received but we have some data for that stream

protected void on rst stream read ( http 2 stream stream , full http message msg ) { remove message ( stream , true ) ; }


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

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


ensures that { @ code expression } is { @ code true } , throwing a { @ code verify exception } with a custom message otherwise see { @ link # verify ( boolean , string , object ) } for details

public static void verify ( boolean expression , @ nullable decl string error message template , int p 1 , int p 2 ) { if ( ! expression ) { throw new verify exception ( lenient format ( error message template , p 1 , p 2 ) ) ; } }


called when a resource is successfully loaded

void on resource ready ( resource < ? > resource , data source data source , boolean is loaded from alternate cache key ) ;


order by job id ( needs to be followed by { @ link # asc ( ) } or { @ link # desc ( ) } )

dead letter job query order by job id ( ) ;


randomize the { @ link fetch source context } request parameters

private static void randomize fetch source context params ( consumer < fetch source context > consumer , map < string , string > expected params ) { if ( random boolean ( ) ) { if ( random boolean ( ) ) { boolean fetch source = random boolean ( ) ; consumer accept ( new fetch source context ( fetch source ) ) ; if ( fetch source = = false ) { expected params put ( " source " , " false " ) ; } } else { int num includes = random int between ( 0 , 5 ) ; string [ ] includes = new string [ num includes ] ; string includes param = random fields ( includes ) ; if ( num includes > 0 ) { expected params put ( " source includes " , includes param ) ; } int num excludes = random int between ( 0 , 5 ) ; string [ ] excludes = new string [ num excludes ] ; string excludes param = random fields ( excludes ) ; if ( num excludes > 0 ) { expected params put ( " source excludes " , excludes param ) ; } consumer accept ( new fetch source context ( true , includes , excludes ) ) ; } } }


assert that no in - memory state for any running snapshot - create or - delete operation exists in this instance

public boolean assert all listeners resolved ( ) { final discovery node local node = cluster service local node ( ) ; assert ending snapshots is empty ( ) : " found leaked ending snapshots " + ending snapshots + " on [ " + local node + " ] " ; assert snapshot completion listeners is empty ( ) : " found leaked snapshot completion listeners " + snapshot completion listeners + " on [ " + local node + " ] " ; assert currently finalizing is empty ( ) : " found leaked finalizations " + currently finalizing + " on [ " + local node + " ] " ; assert snapshot deletion listeners is empty ( ) : " found leaked snapshot delete listeners " + snapshot deletion listeners + " on [ " + local node + " ] " ; assert repository operations is empty ( ) : " found leaked snapshots to finalize " + repository operations + " on [ " + local node + " ] " ; return true ; }


create a { @ code sql xml value } instance for the given xml data , as supported by the underlying jdbc driver

sql xml value new sql xml value ( xml character stream provider provider ) ;


true if the item is starving for an executor for too long

public boolean is stuck ( ) { return false ; }


creates list of users with given input array

public void create users with list input ( list < user > body ) throws api exception , processing exception ;


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

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


obtain state whether user decide to use selected media in original

public static boolean obtain original state ( intent data ) { return data get boolean extra ( matisse activity extra result original enable , false ) ; }


method to properly set action enablement based upon appropriate business logic

private void enable actions ( ) { boolean at least one user fid db = fid file manager get user added files ( ) size ( ) > 0 ; create raw file action set enabled ( at least one user fid db ) ; }


if true , then memory contents should be readwritten

public boolean is memory contents ( ) { return memory contents ; }


gives the passed in parameter an initialized value if the parameter is basic data type or the corresponding object data type , return the default data or return null

private object get init param value ( class < ? > model class , class < ? > param type ) { string param type name = param type get name ( ) ; if ( " boolean " equals ( param type name ) | | " java lang boolean " equals ( param type name ) ) { return false ; } if ( " float " equals ( param type name ) | | " java lang float " equals ( param type name ) ) { return 0f ; } if ( " double " equals ( param type name ) | | " java lang double " equals ( param type name ) ) { return 0 0 ; } if ( " int " equals ( param type name ) | | " java lang integer " equals ( param type name ) ) { return 0 ; } if ( " long " equals ( param type name ) | | " java lang long " equals ( param type name ) ) { return 0l ; } if ( " short " equals ( param type name ) | | " java lang short " equals ( param type name ) ) { return 0 ; } if ( " char " equals ( param type name ) | | " java lang character " equals ( param type name ) ) { return ' ' ; } if ( " [ b " equals ( param type name ) | | " [ ljava lang byte ; " equals ( param type name ) ) { return new byte [ 0 ] ; } if ( " java lang string " equals ( param type name ) ) { return " " ; } if ( model class = = param type ) { return null ; } return create instance from class ( param type ) ; }


returns dependency links derived from spans in an interval contained by ( end ts - lookback ) or empty if none are found implementations may bucket aggregated data , for example daily when this is the case , end ts may be floored to align with that bucket , for example midnight if daily lookback applies to the original end ts , even when bucketed using the daily example , if end ts was 1 1pm and lookback was 25 hours , the implementation would query against 2 buckets some implementations parse spans from storage and call { @ link dependency linker } to aggregate links the reason is certain graph logic , such as skipping up the tree is difficult to implement as a storage query spans are grouped by the right - most 16 characters of the trace id this ensures call counts are not incremented twice due to one hop downgrading from 128 to 64 - bit trace i ds

call < list < dependency link > > get dependencies ( long end ts , long lookback ) ;


default string get limit ( parameters holder parameters holder , array list < list < object > > param appender list ) { return null ; }


releases an instance of the given value the instance must have been obtained from { @ link # get ( object ) } otherwise will throw illegal argument exception caller must not release a reference more than once it ' s advised that you clear the reference to the instance with the null returned by this method

public v release ( k key , v value ) { check not null ( key , " key " ) ; check not null ( value , " value " ) ; return release internal ( key , value ) ; }


public string get catalog ( ) { return catalog ; }


public void delete pet test ( ) { long pet id = null ; string api key = null ; api delete pet ( pet id , api key ) ; / / todo : test validations }


build a { @ link prepared statement creator } based on the given sql and named parameters note : used for the { @ code update } variant with generated key handling , and also delegated from { @ link # get prepared statement creator ( string , sql parameter source ) }

protected prepared statement creator get prepared statement creator ( string sql , sql parameter source param source , @ nullable consumer < prepared statement creator factory > customizer ) { parsed sql parsed sql = get parsed sql ( sql ) ; prepared statement creator factory pscf = get prepared statement creator factory ( parsed sql , param source ) ; if ( customizer ! = null ) { customizer accept ( pscf ) ; } object [ ] params = named parameter utils build value array ( parsed sql , param source , null ) ; return pscf new prepared statement creator ( params ) ; }


public e add or replace ( e entry ) { return add ( entry , true ) ; }


returns the { @ link com google gson stream json token # boolean boolean } value of the next token , consuming it

public boolean next boolean ( ) throws i o exception { int p = peeked ; if ( p = = peeked none ) { p = do peek ( ) ; } if ( p = = peeked true ) { peeked = peeked none ; path indices [ stack size - 1 ] + + ; return true ; } else if ( p = = peeked false ) { peeked = peeked none ; path indices [ stack size - 1 ] + + ; return false ; } throw new illegal state exception ( " expected a boolean but was " + peek ( ) + location string ( ) ) ; }


returns an immutable map of the extension names and their values

public map < string , string > map ( ) { return extensions map ; }


returns a vertex [ ] containing the sources a vertex is a source if it has no incoming edges

public vertex [ ] get sources ( ) { return this vertices ( ) get sources ( ) ; }


test inline additional properties < b > 200 < b > - successful operation

public void test inline additional properties ( map < string , string > param ) throws i o exception { test inline additional properties for http response ( param ) ; }


static authentication handler disabled ( ) { return new authentication handler ( ) { @ override public authentication handler execution result authenticate ( final credential credential ) throws prevented exception { throw new prevented exception ( " authentication handler is disabled " ) ; } @ override public boolean supports ( final credential credential ) { return false ; } @ override public boolean supports ( final class < ? extends credential > clazz ) { return false ; } } ; }


get number of part uploads under given path

public static int count uploads at ( s 3 a file system fs , path path ) throws i o exception { string key = fs path to key ( path ) ; multipart utils upload iterator uploads = fs list uploads ( key ) ; int count = 0 ; while ( uploads has next ( ) ) { multipart upload upload = uploads next ( ) ; count + + ; } return count ; }


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


this method returns { @ link application attempt history data } for specified { @ link application id }

application attempt history data get application attempt ( application attempt id app attempt id ) throws i o exception ;


build a new wizard { @ link character } without spell or abilities and verify if it has the expected attributes

public void test build poor wizard ( ) { final var character = character step builder new builder ( ) name ( " merlin " ) wizard class ( " alchemist " ) no spell ( ) build ( ) ; assert equals ( " merlin " , character get name ( ) ) ; assert equals ( " alchemist " , character get wizard class ( ) ) ; assert null ( character get spell ( ) ) ; assert null ( character get abilities ( ) ) ; assert not null ( character to string ( ) ) ; }


set the encoding to use for requests this encoding will be passed into a { @ link javax servlet http http servlet request # set character encoding } call whether this encoding will override existing request encodings ( and whether it will be applied as default response encoding as well ) depends on the { @ link # set force encoding " force encoding " } flag

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


get an input block stream handle which will facilitate access to a remote input block stream the handle will facilitate use of a remote streaming interface this method should only be used if the associated { @ link buffer file adapter # is remote ( ) } is true

public block stream handle < input block stream > get input block stream handle ( ) throws i o exception ;


declare the expected cost on a guarded auth fs

protected operation cost validator expected probe when authoritative ( operation cost cost ) { return expect ( is authoritative ( ) , cost ) ; }


returns an { @ link optional } containing the first element in { @ code iterator } that satisfies the given predicate , if such an element exists if no such element is found , an empty { @ link optional } will be returned from this method and the iterator will be left exhausted : its { @ code has next ( ) } method will return { @ code false } < b > warning : < b > avoid using a { @ code predicate } that matches { @ code null } if { @ code null } is matched in { @ code iterator } , a null pointer exception will be thrown

public static < t > optional < t > try find ( iterator < t > iterator , predicate < ? super t > predicate ) { check not null ( iterator ) ; check not null ( predicate ) ; while ( iterator has next ( ) ) { t t = iterator next ( ) ; if ( predicate apply ( t ) ) { return optional of ( t ) ; } } return optional absent ( ) ; }


restricts the execution to the given set of operating systems

public static void restrict to ( final string reason , final operating system operating systems ) throws assumption violated exception { final enum set < operating system > allowed = enum set copy of ( arrays as list ( operating systems ) ) ; assume assume true ( reason , allowed contains ( operating system get current operating system ( ) ) ) ; }


returns an { @ link escaper } that does no escaping , passing all character data through unchanged

public static escaper null escaper ( ) { return null escaper ; }


upgrades the generation stamp for the filesystem by reserving a sufficient range for all existing blocks should be invoked only during the first upgrade to sequential block i ds

public long upgrade legacy generation stamp ( ) { preconditions check state ( generation stamp get current value ( ) = = generation stamp last reserved stamp ) ; generation stamp skip to ( legacy generation stamp get current value ( ) + hdfs server constants reserved legacy generation stamps ) ; legacy generation stamp limit = generation stamp get current value ( ) ; return generation stamp get current value ( ) ; }


returns the name of this service { @ link abstract execution thread service } may include the name in debugging output subclasses may override this method

protected string service name ( ) { return get class ( ) get simple name ( ) ; }


creates a new { @ link inbound http 2 to http adapter } with the specified properties

protected abstract t build ( http 2 connection connection , int max content length , boolean validate http headers , boolean propagate settings ) throws exception ;


whether module map generation and interpretation is enabled

public boolean module maps enabled ( ) { return module maps enabled ; }


public server service definition add service ( bindable service bindable service ) { return add service ( bindable service bind service ( ) ) ; }


public big decimal get number ( ) { return number ; }


appends realm name to user to form principal name

protected string principal name ( final string user ) { return user + " @ " + simple kdc ldap server get realm ( ) ; }


get the authority score good authorities link to good hubs

public double value get authority score ( ) { return authority score ; }


returns whether a spawn claims to support being executed with the persistent worker strategy according to its execution info tags

public static boolean supports workers ( spawn spawn ) { return " 1 " equals ( spawn get execution info ( ) get ( execution requirements supports workers ) ) ; }


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

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


if this exception was thrown by a multi - request then the ( partial ) results and error codes can be retrieved using this getter

public list < op result > get results ( ) { return results ! = null ? new array list < op result > ( results ) : null ; }


creates a mockito mock object it returns a generic typed { @ link resource } to prevent unchecked warnings

public static < t > resource < t > mock resource ( ) { return mock ( resource class ) ; }


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


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

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


public void next critical path phase ( spawn executed event change phase phase ) { critical path component stats = output artifact to component get ( phase get action ( ) get primary output ( ) ) ; if ( stats ! = null ) { stats change phase ( ) ; } }


public static long divide ( long p , long q , rounding mode mode ) { return long math divide ( p , q , mode ) ; }


sets cartesian product doesn ' t allow sets that contain null , but we want null to mean " don ' t call the associated cache builder method " - that is , get the default cache builder behavior this method wraps the elements in the input sets ( which may contain null ) as optionals , calls sets cartesian product with those , then transforms the result to unwrap the optionals

private iterable < list < object > > build cartesian product ( set < ? > sets ) { list < set < optional < ? > > > optional sets = lists new array list with expected size ( sets length ) ; for ( set < ? > set : sets ) { set < optional < ? > > optional set = sets new linked hash set ( iterables transform ( set , nullable to optional ) ) ; optional sets add ( optional set ) ; } set < list < optional < ? > > > cartesian product = sets cartesian product ( optional sets ) ; return iterables transform ( cartesian product , new function < list < optional < ? > > , list < object > > ( ) { @ override public list < object > apply ( list < optional < ? > > objs ) { return lists transform ( objs , optional to nullable ) ; } } ) ; }


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

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


returns the absolute uri of the class - path entry value as specified in < a href = " http : docs oracle comjavase 8docstechnotesguidesjarjar html # main attributes " > jar file specification even though the specification only talks about relative urls , absolute urls are actually supported too ( for example , in maven surefire plugin )

static url get class path entry ( file jar file , string path ) throws malformed u r l exception { return new url ( jar file to u r i ( ) to u r l ( ) , path ) ; }


dispatches { @ link # on upstream discarded ( int , media period id , media load data ) }

public void upstream discarded ( media load data media load data ) { media period id media period id = assertions check not null ( this media period id ) ; for ( listener and handler listener and handler : listener and handlers ) { media source event listener listener = listener and handler listener ; post or run ( listener and handler handler , ( ) - > listener on upstream discarded ( window index , media period id , media load data ) ) ; } }


consumes the { @ link authentication token } provided by the caller in the case of a { @ code null } token , { @ link # handle null token ( ) } is called in the case of a { @ code non - null } token , the realms are iterated over in the order defined in the configuration while possibly also taking into consideration the last realm that authenticated this principal when consulting multiple realms , the first realm that returns a non - null { @ link user } is the authenticating realm and iteration is stopped this user is then passed to { @ link # consume user ( user , map ) } if no exception was caught while trying to authenticate the token

private void consume token ( authentication token token ) { if ( token = = null ) { handle null token ( ) ; } else { authentication token = token ; final list < realm > realms list = get realm list ( authentication token principal ( ) ) ; logger trace ( " checking token of type [ { } ] against [ { } ] realm ( s ) " , token get class ( ) get name ( ) , realms list size ( ) ) ; final long start invalidation = num invalidation get ( ) ; final map < realm , tuple < string , exception > > messages = new linked hash map < > ( ) ; final bi consumer < realm , action listener < user > > realm authenticating consumer = ( realm , user listener ) - > { if ( realm supports ( authentication token ) ) { logger trace ( " trying to authenticate [ { } ] using realm [ { } ] with token [ { } ] " , token principal ( ) , realm , token get class ( ) get name ( ) ) ; realm authenticate ( authentication token , action listener wrap ( ( result ) - > { assert result ! = null : " realm " + realm + " produced a null authentication result " ; logger debug ( " authentication of [ { } ] using realm [ { } ] with token [ { } ] was [ { } ] " , token principal ( ) , realm , token get class ( ) get simple name ( ) , result ) ; if ( result get status ( ) = = authentication result status success ) { / / user was authenticated , populate the authenticated by information authenticated by = new realm ref ( realm name ( ) , realm type ( ) , node name ) ; authentication result = result ; if ( last successful auth cache ! = null & & start invalidation = = num invalidation get ( ) ) { last successful auth cache put ( authentication token principal ( ) , realm ) ; } user listener on response ( result get user ( ) ) ; } else { / / the user was not authenticated , call this so we can audit the correct event request realm authentication failed ( authentication token , realm name ( ) ) ; if ( result get status ( ) = = authentication result status terminate ) { if ( result get exception ( ) ! = null ) { logger info ( new parameterized message ( " authentication of [ { } ] was terminated by realm [ { } ] - { } " , authentication token principal ( ) , realm name ( ) , result get message ( ) ) , result get exception ( ) ) ; } else { logger info ( " authentication of [ { } ] was terminated by realm [ { } ] - { } " , authentication token principal ( ) , realm name ( ) , result get message ( ) ) ; } user listener on failure ( result get exception ( ) ) ; } else { if ( result get message ( ) ! = null ) { messages put ( realm , new tuple < > ( result get message ( ) , result get exception ( ) ) ) ; } user listener on response ( null ) ; } } } , ( ex ) - > { logger warn ( new parameterized message ( " an error occurred while attempting to authenticate [ { } ] against realm [ { } ] " , authentication token principal ( ) , realm name ( ) ) , ex ) ; user listener on failure ( ex ) ; } ) ) ; } else { user listener on response ( null ) ; } } ; final iterating action listener < user , realm > authenticating listener = new iterating action listener < > ( context preserving action listener wrap preserving context ( action listener wrap ( ( user ) - > consume user ( user , messages ) , ( e ) - > { if ( e ! = null ) { listener on failure ( request exception processing request ( e , token ) ) ; } else { listener on failure ( request authentication failed ( token ) ) ; } } ) , thread context ) , realm authenticating consumer , realms list , thread context ) ; try { authenticating listener run ( ) ; } catch ( exception e ) { logger debug ( new parameterized message ( " authentication of [ { } ] with token [ { } ] failed " , token principal ( ) , token get class ( ) get name ( ) ) , e ) ; listener on failure ( request exception processing request ( e , token ) ) ; } } }


accessor method for blaze version info singleton if set build info was not called , returns an empty blaze version info instance , which should not be persisted

public static synchronized blaze version info instance ( ) { if ( instance = = null ) { return new blaze version info ( immutable map < string , string > of ( ) ) ; } return instance ; }


the revision for all exported dubbo services from the specified { @ link service instance }

public static string get exported services revision ( service instance service instance ) { map < string , string > metadata = service instance get metadata ( ) ; return metadata get ( exported services revision property name ) ; }


{ @ inherit doc } the state of the ticket is affected by this operation and the ticket will be considered used the state update subsequently may impact the ticket expiration policy in that , depending on the policy configuration , the ticket may be considered expired

public synchronized service ticket grant service ticket ( final string id , final service service , final expiration policy expiration policy , final boolean credential provided , final boolean only track most recent session ) { val service ticket = new service ticket impl ( id , this , service , credential provided , expiration policy ) ; track service session ( service ticket get id ( ) , service , only track most recent session ) ; return service ticket ; }


public t use transport security ( ) { throw new unsupported operation exception ( ) ; }


test { @ link r m audit logger } with ip set

public void test r m audit logger with i p ( ) throws exception { configuration conf = new configuration ( ) ; rpc set protocol engine ( conf , test rpc service class , protobuf rpc engine 2 class ) ; / / create server side implementation my test r p c server server impl = new my test r p c server ( ) ; blocking service service = test rpc service protos test protobuf rpc proto new reflective blocking service ( server impl ) ; / / start the ipc server server server = new rpc builder ( conf ) set protocol ( test rpc service class ) set instance ( service ) set bind address ( " 0 0 0 0 " ) set port ( 0 ) set num handlers ( 5 ) set verbose ( true ) build ( ) ; server start ( ) ; inet socket address addr = net utils get connect address ( server ) ; / / make a client connection and test the audit log test rpc service proxy = rpc get proxy ( test rpc service class , test protocol version i d , addr , conf ) ; / / start the testcase test protos empty request proto ping request = test protos empty request proto new builder ( ) build ( ) ; proxy ping ( null , ping request ) ; server stop ( ) ; rpc stop proxy ( proxy ) ; }


to watermark from the consumer side always increase schema : ( key , timestamp , source instance id ) producer parallelism = 2 ; kafka partition # = 3 ; consumer parallelism = 3

private void test watermark incremental ( int num elements per producer ) throws exception { time characteristic time characteristic = event time ; string topic = topic ( " test watermark incremental " , time characteristic ) ; final int number of partitions = 3 ; final int producer parallelism = 2 ; create test topic ( topic , number of partitions , 1 ) ; final stream execution environment env = create environment ( producer parallelism , time characteristic ) ; keyed stream < tuple 3 < integer , long , integer > , tuple > keyed stream = create kafka shuffle ( env , topic , num elements per producer , producer parallelism , time characteristic , number of partitions , true ) ; keyed stream process ( new watermark validator ( ) ) set parallelism ( number of partitions ) map ( new element count no more than validator ( num elements per producer * producer parallelism ) ) set parallelism ( 1 ) map ( new element count no less than validator ( num elements per producer * producer parallelism ) ) set parallelism ( 1 ) ; try execute ( env , topic ) ; delete test topic ( topic ) ; }


prior to fixing spr - 10546 this might have succeeded depending on the ordering the classes were picked up if they are picked up in the same order as { @ link # enclosing config first parent defines bean ( ) } then it would fail this test is mostly for illustration purposes , but doesn ' t hurt to continue using it we purposely use the { @ link a enclosing config } to make it alphabetically prior to the { @ link a enclosing config child config } which encourages this to occur with the classpath scanning implementation being used by the author of this test

public void enclosing config first parent defines bean with scanning ( ) { annotation config application context ctx = new annotation config application context ( ) ; context = ctx ; ctx scan ( a enclosing config class get package ( ) get name ( ) ) ; ctx refresh ( ) ; assert that ( context get bean ( " my bean " , string class ) ) is equal to ( " my bean " ) ; }


void error ( location location , string message , throwable error ) ;


return the description for the given resource ; if the description is empty , return the class name of the resource plus its identity hash code

private static string get name for resource ( resource resource ) { string name = resource get description ( ) ; if ( ! string utils has text ( name ) ) { name = resource get class ( ) get simple name ( ) + " @ " + system identity hash code ( resource ) ; } return name ; }


tests maximum opportunistic container allocation per am heartbeat when limit is set to higher value

public void test max allocations per a m heartbeat with high limit ( ) throws exception { allocator set max allocations per a m heartbeat ( 100 ) ; final int num containers = 20 ; list < resource request > reqs = new array list < > ( ) ; for ( int i = 0 ; i < num containers ; i + + ) { reqs add ( create resource request ( i + 1 , " h 1 " , 1 ) ) ; } application attempt id app att id = application attempt id new instance ( application id new instance ( 0l , 1 ) , 1 ) ; allocator set node queue load monitor ( create node queue load monitor ( 3 , 2 , 500 ) ) ; list < container > containers = allocator allocate containers ( empty blacklist request , reqs , app att id , opp cntxt , 1l , " user " ) ; / / all containers should be allocated in single heartbeat assert equals ( num containers , containers size ( ) ) ; }


public void test outer enum ( ) { / / todo : test outer enum }


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


same behavior as { @ link type inference util # run type inference ( type inference , call context ) }

type inference util result run type inference ( unresolved call expression unresolved call , list < resolved expression > resolved args ) ;


generate the response for the inbound dns query

byte [ ] generate reply ( message query , socket s ) throws i o exception { header header ; boolean badversion ; int max length ; int flags = 0 ; o p t record query o p t = query get o p t ( ) ; max length = get max length ( s , query o p t ) ; header = query get header ( ) ; if ( header get flag ( flags qr ) ) { log debug ( " returning null " ) ; return null ; } if ( header get rcode ( ) ! = rcode noerror ) { return error message ( query , rcode formerr ) ; } if ( header get opcode ( ) ! = opcode query ) { return error message ( query , rcode notimp ) ; } record query record = query get question ( ) ; if ( query o p t ! = null & & ( query o p t get flags ( ) & extended flags do ) ! = 0 ) { flags = flag dnssecok ; } message response = new message ( query get header ( ) get i d ( ) ) ; response get header ( ) set flag ( flags qr ) ; if ( query get header ( ) get flag ( flags rd ) ) { response get header ( ) set flag ( flags rd ) ; response get header ( ) set flag ( flags ra ) ; } response add record ( query record , section question ) ; name name = query record get name ( ) ; int type = query record get type ( ) ; int dclass = query record get d class ( ) ; t s i g record query t s i g = query get t s i g ( ) ; if ( type = = type axfr & & s ! = null ) { return do a x f r ( name , query , null , query t s i g , s ) ; } if ( ! type is r r ( type ) & & type ! = type any ) { return error message ( query , rcode notimp ) ; } log debug ( " calling add answer " ) ; byte rcode = add answer ( response , name , type , dclass , 0 , flags ) ; if ( rcode ! = rcode noerror ) { rcode = remote lookup ( response , name , type , 0 ) ; response get header ( ) set rcode ( rcode ) ; } add additional ( response , flags ) ; if ( query o p t ! = null ) { int optflags = ( flags = = flag dnssecok ) ? extended flags do : 0 ; o p t record opt = new o p t record ( ( short ) 4096 , rcode > > > 16 , ( byte ) 0 , optflags ) ; response add record ( opt , section additional ) ; } return response to wire ( max length ) ; }


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


returns the milli second part of the datetime

private static int get millis ( string date str ) { int length = date str length ( ) ; if ( length = = 19 ) { / / " 1999 - 12 - 31 12 : 34 : 56 " , no milli second left return 0 ; } else if ( length = = 21 ) { / / " 1999 - 12 - 31 12 : 34 : 56 7 " , return 7 return integer parse int ( date str substring ( 20 ) ) * 100 ; } else if ( length = = 22 ) { / / " 1999 - 12 - 31 12 : 34 : 56 78 " , return 78 return integer parse int ( date str substring ( 20 ) ) * 10 ; } else if ( length > = 23 & & length < = 26 ) { / / " 1999 - 12 - 31 12 : 34 : 56 123 " ~ " 1999 - 12 - 31 12 : 34 : 56 123456 " return integer parse int ( date str substring ( 20 , 23 ) ) ; } else { return 0 ; } }


used ( by block graph transfer object ref ) to reset the internal object and address

protected void set ( object r , address addr ) { ref = r ; address = addr ; }


{ @ inherit doc } < b > note : < b > this method ignores how often any element might appear in { @ code c } , and only cares whether or not an element appears at all if you wish to remove one occurrence in this multiset for every occurrence in { @ code c } , see { @ link multisets # remove occurrences ( multiset , multiset ) } this method refines { @ link collection # remove all } to further specify that it < b > may not < b > throw an exception in response to any of { @ code elements } being null or of the wrong type

boolean remove all ( collection < ? > c ) ;


applies the given { @ link process function } on the input stream , thereby creating a transformed output stream the function will be called for every element in the input streams and can produce zero or more output elements contrary to the { @ link data stream # flat map ( flat map function ) } function , this function can also query the time and set timers when reacting to the firing of set timers the function can directly emit elements andor register yet more timers

public < r > single output stream operator < r > process ( process function < t , r > process function ) { type information < r > out type = type extractor get unary operator return type ( process function , process function class , 0 , 1 , type extractor no index , get type ( ) , utils get call location name ( ) , true ) ; return process ( process function , out type ) ; }


protected void reset failures ( ) { if ( inconsistent client ! = null ) { set throttling ( 0 , 0 ) ; } }


override this if you haven ' t set a static value in the constructor or with set value return null to resort to the default value

public t get value ( lottie frame info < t > frame info ) { return value ; }


send a shard failed request to the master node to update the cluster state with the failure of a shard on another node this means that the shard should be failed because a write made it into the primary but was not replicated to this shard copy if the shard does not exist anymore but still has an entry in the in - sync set , remove its allocation id from the in - sync set

public void remote shard failed ( final shard id shard id , string allocation id , long primary term , boolean mark as stale , final string message , @ nullable final exception failure , action listener < void > listener ) { assert primary term > 0l : " primary term should be strictly positive " ; remote failed shards deduplicator execute once ( new failed shard entry ( shard id , allocation id , primary term , message , failure , mark as stale ) , listener , ( req , req listener ) - > send shard action ( shard failed action name , cluster service state ( ) , req , req listener ) ) ; }


specifies the time attribute on which rows are ordered for streaming tables , reference a rowtime or proctime time attribute here to specify the time mode for batch tables , refer to a timestamp or long attribute

public over window partitioned ordered order by ( string order by ) { return this order by ( expression parser parse expression ( order by ) ) ; }


public void set crumb salt ( string salt ) { if ( util fix empty and trim ( salt ) = = null ) { crumb salt = " hudson crumb " ; } else { crumb salt = salt ; } }


delete snapshot from shard level metadata

private shard snapshot meta delete result delete from shard snapshot meta ( set < snapshot id > surviving snapshots , index id index id , int snapshot shard id , collection < snapshot id > snapshot ids , blob container shard container , set < string > blobs , blob store index shard snapshots snapshots , long index generation ) { / / build a list of snapshots that should be preserved list < snapshot files > new snapshots list = new array list < > ( ) ; final set < string > surviving snapshot names = surviving snapshots stream ( ) map ( snapshot id : : get name ) collect ( collectors to set ( ) ) ; for ( snapshot files point : snapshots ) { if ( surviving snapshot names contains ( point snapshot ( ) ) ) { new snapshots list add ( point ) ; } } string written generation = null ; try { if ( new snapshots list is empty ( ) ) { return new shard snapshot meta delete result ( index id , snapshot shard id , shard generations deleted shard gen , blobs ) ; } else { final blob store index shard snapshots updated snapshots = new blob store index shard snapshots ( new snapshots list ) ; if ( index generation < 0l ) { written generation = u u i ds random base 6 4 u u i d ( ) ; index shard snapshots format write ( updated snapshots , shard container , written generation , compress , big arrays ) ; } else { written generation = string value of ( index generation ) ; write shard index blob atomic ( shard container , index generation , updated snapshots ) ; } final set < string > surviving snapshot u u i ds = surviving snapshots stream ( ) map ( snapshot id : : get u u i d ) collect ( collectors to set ( ) ) ; return new shard snapshot meta delete result ( index id , snapshot shard id , written generation , unused blobs ( blobs , surviving snapshot u u i ds , updated snapshots ) ) ; } } catch ( i o exception e ) { throw new repository exception ( metadata name ( ) , " failed to finalize snapshot deletion " + snapshot ids + " with shard index [ " + index shard snapshots format blob name ( written generation ) + " ] " , e ) ; } }


stores a collection of values with the same key , replacing any existing values for that key because a { @ code sorted set multimap } has unique sorted values for a given key , this method returns a { @ link sorted set } , instead of the { @ link java util collection } specified in the { @ link multimap } interface any duplicates in { @ code values } will be stored in the multimap once

sorted set < v > replace values ( k key , iterable < ? extends v > values ) ;


set the length of the body in bytes , as specified by the { @ code content - length } header

body builder content length ( long content length ) ;


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


adds { @ code element } to the { @ code immutable set } if the { @ code immutable set } already contains { @ code element } , then { @ code add } has no effect ( only the previously added element is retained )

public builder < e > add ( e element ) { check not null ( element ) ; if ( hash table ! = null & & choose table size ( size ) < = hash table length ) { add deduping ( element ) ; return this ; } else { hash table = null ; super add ( element ) ; return this ; } }


generates a random object { " first field " : " foo " , " marked field " : { random } , " last field " : " bar } returns the number of tokens in the marked field

private static int generate random object for marking ( x content builder builder ) throws i o exception { builder start object ( ) field ( " first field " , " foo " ) field ( " marked field " ) ; int number of tokens = generate random object ( builder , 0 ) ; builder field ( " last field " , " bar " ) end object ( ) ; return number of tokens ; }


convert each { @ code http range } into a { @ code resource region } , selecting the appropriate segment of the given { @ code resource } using http range information

public static list < resource region > to resource regions ( list < http range > ranges , resource resource ) { if ( collection utils is empty ( ranges ) ) { return collections empty list ( ) ; } list < resource region > regions = new array list < > ( ranges size ( ) ) ; for ( http range range : ranges ) { regions add ( range to resource region ( resource ) ) ; } if ( ranges size ( ) > 1 ) { long length = get length for ( resource ) ; long total = 0 ; for ( resource region region : regions ) { total + = region get count ( ) ; } if ( total > = length ) { throw new illegal argument exception ( " the sum of all ranges ( " + total + " ) should be less than the resource length ( " + length + " ) " ) ; } } return regions ; }


returns whether the decoder may throw an { @ link illegal state exception } from { @ link media codec # dequeue output buffer ( media codec buffer info , long ) } or { @ link media codec # release output buffer ( int , boolean ) } after receiving an input buffer with { @ link media codec # buffer flag end of stream } set see [ internal : b 1 7 9 3 3 8 3 8 ]

private static boolean codec needs eos output exception workaround ( string name ) { return util sdk int = = 21 & & " omx google aac decoder " equals ( name ) ; }


send browser app traffic , browser app single version traffic , browser app page traffic and browser app page perf scope to the receiver

public void build ( ) { / / traffic source receiver receive ( source builder to browser app traffic ( ) ) ; source receiver receive ( source builder to browser app single version traffic ( ) ) ; source receiver receive ( source builder to browser app page traffic ( ) ) ; / / performance ( currently only page level performance data is analyzed ) source receiver receive ( source builder to browser app page perf ( ) ) ; }


inserts the specified element at the specified position in the array shifts the element currently at that position ( if any ) and any subsequent elements to the right ( adds one to their indices ) this method returns a new array with the same elements of the input array plus the given element on the specified position the component type of the returned array is always the same as that of the input array if the input array is < code > null < code > , a new one element array is returned whose component type is the same as the element array utils add ( null , 0 , null ) = [ null ] array utils add ( null , 0 , " a " ) = [ " a " ] array utils add ( [ " a " ] , 1 , null ) = [ " a " , null ] array utils add ( [ " a " ] , 1 , " b " ) = [ " a " , " b " ] array utils add ( [ " a " , " b " ] , 3 , " c " ) = [ " a " , " b " , " c " ]

public static < t > t [ ] add ( t [ ] array , int index , t element ) { class clss ; if ( array ! = null ) { clss = array get class ( ) get component type ( ) ; } else if ( element ! = null ) { clss = element get class ( ) ; } else { return ( t [ ] ) new object [ ] { null } ; } return ( t [ ] ) real add ( array , index , element , clss ) ; }


returns the { @ link status } of a cancelled context or { @ code null } if the context is not cancelled

public static status status from cancelled ( context context ) { preconditions check not null ( context , " context must not be null " ) ; if ( ! context is cancelled ( ) ) { return null ; } throwable cancellation cause = context cancellation cause ( ) ; if ( cancellation cause = = null ) { return status cancelled with description ( " io grpc context was cancelled without error " ) ; } if ( cancellation cause instanceof timeout exception ) { return status deadline exceeded with description ( cancellation cause get message ( ) ) with cause ( cancellation cause ) ; } status status = status from throwable ( cancellation cause ) ; if ( status code unknown equals ( status get code ( ) ) & & status get cause ( ) = = cancellation cause ) { / / if from throwable could not determine a status , then / / just return cancelled return status cancelled with description ( " context cancelled " ) with cause ( cancellation cause ) ; } return status with cause ( cancellation cause ) ; }


returns true if the edges in this graph are directed directed edges connect a { @ link endpoint pair # source ( ) source node } to a { @ link endpoint pair # target ( ) target node } , while undirected edges connect a pair of nodes to each other


move primary symbol to last element in array

private void make primary last item ( symbol [ ] symbols ) { for ( int i = 0 ; i < symbols length - 1 ; + + i ) { if ( symbols [ i ] is primary ( ) ) { symbol primary = symbols [ i ] ; system arraycopy ( symbols , i + 1 , symbols , i , symbols length - i - 1 ) ; symbols [ symbols length - 1 ] = primary ; break ; } } }


async observable and thread isolation user provided thread [ rx net thread ] executes observable and then [ rx computation ] observes the on next calls note : request context will not exist on that thread an async observable running on its own thread will not have access to the request context unless the user manages the context

public void test rejection with fallback request context with thread isolated asynchronous observable ( ) { request context test results results = test request context on rejection with fallback ( execution isolation strategy thread , schedulers new thread ( ) ) ; assert false ( results is context initialized get ( ) ) ; / / it won ' t have request context as it ' s on a user provided thread / scheduler assert true ( results origin thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / the user provided thread / scheduler assert true ( results is context initialized observe on get ( ) ) ; / / we capture and set the context once the user provided observable emits assert true ( results observe on thread get ( ) get name ( ) starts with ( " rx new thread " ) ) ; / / thread isolated , but rejected , so this is false assert false ( results command is executed in thread ( ) ) ; }


get the remote server ' s principal the value will be obtained from the config and cross - checked against the server ' s advertised principal

string get server principal ( sasl auth auth type ) throws i o exception { kerberos info krb info = security util get kerberos info ( protocol , conf ) ; log debug ( " get kerberos info proto : " + protocol + " info : " + krb info ) ; if ( krb info = = null ) { / / protocol has no support for kerberos return null ; } string server key = krb info server principal ( ) ; if ( server key = = null ) { throw new illegal argument exception ( " can ' t obtain server kerberos config key from protocol = " + protocol get canonical name ( ) ) ; } / / construct server advertised principal for comparision string server principal = new kerberos principal ( auth type get protocol ( ) + " / " + auth type get server id ( ) , kerberos principal krb nt srv hst ) get name ( ) ; / / use the pattern if defined string server key pattern = conf get ( server key + " pattern " ) ; if ( server key pattern ! = null & & ! server key pattern is empty ( ) ) { pattern pattern = glob pattern compile ( server key pattern ) ; if ( ! pattern matcher ( server principal ) matches ( ) ) { throw new illegal argument exception ( string format ( " server has invalid kerberos principal : % s , " + " doesn ' t match the pattern : % s " , server principal , server key pattern ) ) ; } } else { / / check that the server advertised principal matches our conf string conf principal = security util get server principal ( conf get ( server key ) , server addr get address ( ) ) ; if ( log is debug enabled ( ) ) { log debug ( " getting server key : " + server key + " conf value : " + conf get ( server key ) + " principal : " + conf principal ) ; } if ( conf principal = = null | | conf principal is empty ( ) ) { throw new illegal argument exception ( " failed to specify server ' s kerberos principal name " ) ; } kerberos name name = new kerberos name ( conf principal ) ; if ( name get host name ( ) = = null ) { throw new illegal argument exception ( " kerberos principal name does not have the expected hostname part : " + conf principal ) ; } if ( ! server principal equals ( conf principal ) ) { throw new illegal argument exception ( string format ( " server has invalid kerberos principal : % s , expecting : % s " , server principal , conf principal ) ) ; } } return server principal ; }


get the function that this stack belongs to

public function get function ( ) { return null ; }


verify a view fs wrapped over multiple federated name nodes will dispatch the acl operations to the correct name node

public void test acl on mount entry ( ) throws exception { / / set a c ls on the first namespace and verify they are correct list < acl entry > acl spec = lists new array list ( acl entry ( access , user , read write ) , acl entry ( access , user , " foo " , read ) , acl entry ( access , group , read ) , acl entry ( access , other , none ) ) ; fs view set acl ( mount on nn 1 , acl spec ) ; acl entry [ ] expected = new acl entry [ ] { acl entry ( access , user , " foo " , read ) , acl entry ( access , group , read ) } ; assert array equals ( expected , acl entry array ( fs view get acl status ( mount on nn 1 ) ) ) ; / / double - check by getting acl status using file system / / instead of view fs assert array equals ( expected , acl entry array ( f hdfs get acl status ( target test root ) ) ) ; / / modify the acl entries on the first namespace acl spec = lists new array list ( acl entry ( default , user , " foo " , read ) ) ; fs view modify acl entries ( mount on nn 1 , acl spec ) ; expected = new acl entry [ ] { acl entry ( access , user , " foo " , read ) , acl entry ( access , group , read ) , acl entry ( default , user , read write ) , acl entry ( default , user , " foo " , read ) , acl entry ( default , group , read ) , acl entry ( default , mask , read ) , acl entry ( default , other , none ) } ; assert array equals ( expected , acl entry array ( fs view get acl status ( mount on nn 1 ) ) ) ; fs view remove default acl ( mount on nn 1 ) ; expected = new acl entry [ ] { acl entry ( access , user , " foo " , read ) , acl entry ( access , group , read ) } ; assert array equals ( expected , acl entry array ( fs view get acl status ( mount on nn 1 ) ) ) ; assert array equals ( expected , acl entry array ( f hdfs get acl status ( target test root ) ) ) ; / / paranoid check : verify the other namespace does not / / have a c ls set on the same path assert equals ( 0 , fs view get acl status ( mount on nn 2 ) get entries ( ) size ( ) ) ; assert equals ( 0 , f hdfs 2 get acl status ( target test root 2 ) get entries ( ) size ( ) ) ; / / remove the acl entries on the first namespace fs view remove acl ( mount on nn 1 ) ; assert equals ( 0 , fs view get acl status ( mount on nn 1 ) get entries ( ) size ( ) ) ; assert equals ( 0 , f hdfs get acl status ( target test root ) get entries ( ) size ( ) ) ; / / now set a c ls on the second namespace acl spec = lists new array list ( acl entry ( access , user , " bar " , read ) ) ; fs view modify acl entries ( mount on nn 2 , acl spec ) ; expected = new acl entry [ ] { acl entry ( access , user , " bar " , read ) , acl entry ( access , group , read execute ) } ; assert array equals ( expected , acl entry array ( fs view get acl status ( mount on nn 2 ) ) ) ; assert array equals ( expected , acl entry array ( f hdfs 2 get acl status ( target test root 2 ) ) ) ; / / remove the acl entries on the second namespace fs view remove acl entries ( mount on nn 2 , lists new array list ( acl entry ( access , user , " bar " , read ) ) ) ; expected = new acl entry [ ] { acl entry ( access , group , read execute ) } ; assert array equals ( expected , acl entry array ( f hdfs 2 get acl status ( target test root 2 ) ) ) ; fs view remove acl ( mount on nn 2 ) ; assert equals ( 0 , fs view get acl status ( mount on nn 2 ) get entries ( ) size ( ) ) ; assert equals ( 0 , f hdfs 2 get acl status ( target test root 2 ) get entries ( ) size ( ) ) ; }


get class desc boolean [ ] class = > " [ z " object class = > " ljavalang object ; "

public static string get desc ( class < ? > c ) { string builder ret = new string builder ( ) ; while ( c is array ( ) ) { ret append ( ' [ ' ) ; c = c get component type ( ) ; } if ( c is primitive ( ) ) { string t = c get name ( ) ; if ( " void " equals ( t ) ) { ret append ( jvm void ) ; } else if ( " boolean " equals ( t ) ) { ret append ( jvm boolean ) ; } else if ( " byte " equals ( t ) ) { ret append ( jvm byte ) ; } else if ( " char " equals ( t ) ) { ret append ( jvm char ) ; } else if ( " double " equals ( t ) ) { ret append ( jvm double ) ; } else if ( " float " equals ( t ) ) { ret append ( jvm float ) ; } else if ( " int " equals ( t ) ) { ret append ( jvm int ) ; } else if ( " long " equals ( t ) ) { ret append ( jvm long ) ; } else if ( " short " equals ( t ) ) { ret append ( jvm short ) ; } } else { ret append ( ' l ' ) ; ret append ( c get name ( ) replace ( ' ' , ' / ' ) ) ; ret append ( ' ; ' ) ; } return ret to string ( ) ; }


returns the bin directory for this build configuration todo ( kchodorow ) : this ( and the other get directory functions ) won ' t work with external repositories without changes to how artifact factory resolves derived roots this is not an issue right now because it only effects blaze ' s include scanning ( internal ) and bazel ' s repositories ( external ) but will need to be fixed

public artifact root get bin directory ( repository name repository name ) { return output directories get bin directory ( repository name ) ; }


see original { @ link stubber # do answer ( answer ) }

b d d stubber will answer ( answer < ? > answer ) ;


get the r m node in the rm from the node identifier

private r m node get r m node ( final string node id ) { if ( node id = = null | | node id is empty ( ) ) { throw new not found exception ( " node id , " + node id + " , is empty or null " ) ; } node id nid = node id from string ( node id ) ; r m context rm context = this rm get r m context ( ) ; r m node ni = rm context get r m nodes ( ) get ( nid ) ; if ( ni = = null ) { ni = rm context get inactive r m nodes ( ) get ( nid ) ; if ( ni = = null ) { throw new not found exception ( " node id , " + node id + " , is not found " ) ; } } return ni ; }


trace provided { @ link throwable } to the given resource entry

public static void trace entry ( throwable e , entry entry ) { if ( ! should trace ( e ) ) { return ; } trace entry internal ( e , entry ) ; }


returns a list of batch result objects there will be one entry in the list for each successful sub - executor executed before the failing executor

public list < batch result > get successful batch results ( ) { return successful batch results ; }


gets the alignment for this model ' s data type

protected int get alignment ( ) { data type dt = get data type ( ) ; if ( dt ! = null ) { return dt get alignment ( ) ; } return 4 ; / / default to 4 byte aligned }


creates a radio button with the given attributes

private j radio button create search r b ( abstract action action , string name , string tooltip ) { g radio button button = new g radio button ( action ) ; button set text ( name ) ; button set tool tip text ( tooltip ) ; button set alignment x ( component left alignment ) ; return button ; }


static factory method to create a new { @ code bean property row mapper }

public static < t > bean property row mapper < t > new instance ( class < t > mapped class , @ nullable conversion service conversion service ) { bean property row mapper < t > row mapper = new instance ( mapped class ) ; row mapper set conversion service ( conversion service ) ; return row mapper ; }


generalizes the values of this variables object with the values of the given variables object

public boolean generalize ( variables other , boolean clear conflicting other variables ) { if ( this size ! = other size ) { throw new illegal argument exception ( " variable frames have different sizes [ " + this size + " ] and [ " + other size + " ] " ) ; } boolean changed = false ; for ( int index = 0 ; index < size ; index + + ) { value this value = this values [ index ] ; value other value = other values [ index ] ; / / occasionally , two values of different types might be present / / in the same variable in a variable frame ( corresponding to / / two local variables that share the same index ) , at some point / / outside of their scopes don ' t generalize the variable then , / / but let it clear instead if ( this value ! = null & & other value ! = null & & this value computational type ( ) = = other value computational type ( ) ) { value new value = this value generalize ( other value ) ; changed = changed | | ! this value equals ( new value ) ; this values [ index ] = new value ; } else { changed = changed | | this value ! = null ; this values [ index ] = null ; if ( clear conflicting other variables ) { other values [ index ] = null ; } } } return changed ; }


acquires the index commit that should be included in a snapshot

public final index commit ref acquire index commit for snapshot ( ) throws engine exception { return engine config get snapshot commit supplier ( ) acquire index commit for snapshot ( this ) ; }


args : : = kafka prop file name command disable auto terminate command : = " run " | " process "

public static void main ( final string [ ] args ) throws i o exception { if ( args length < 2 ) { system err println ( " streams smoke test are expecting two parameters : prop file , command ; but only see " + args length + " parameter " ) ; exit exit ( 1 ) ; } final string prop file name = args [ 0 ] ; final string command = args [ 1 ] ; final boolean disable auto terminate = args length > 2 ; final properties streams properties = utils load props ( prop file name ) ; final string kafka = streams properties get property ( streams config bootstrap servers config ) ; final string processing guarantee = streams properties get property ( streams config processing guarantee config ) ; if ( kafka = = null ) { system err println ( " no bootstrap kafka servers specified in " + streams config bootstrap servers config ) ; exit exit ( 1 ) ; } if ( " process " equals ( command ) ) { if ( ! streams config at least once equals ( processing guarantee ) & & ! streams config exactly once equals ( processing guarantee ) ) { system err println ( " processing guarantee must be either " + streams config at least once + " or " + streams config exactly once ) ; exit exit ( 1 ) ; } } system out println ( " streams test instance started ( streams smoke test ) " ) ; system out println ( " command = " + command ) ; system out println ( " props = " + streams properties ) ; system out println ( " disable auto terminate = " + disable auto terminate ) ; switch ( command ) { case " run " : / / this starts the driver ( data generation and result verification ) final int num keys = 10 ; final int max records per key = 500 ; if ( disable auto terminate ) { generate perpetually ( kafka , num keys , max records per key ) ; } else { / / slow down data production to span 30 seconds so that system tests have time to / / do their bounces , etc final map < string , set < integer > > all data = generate ( kafka , num keys , max records per key , duration of seconds ( 30 ) ) ; smoke test driver verify ( kafka , all data , max records per key ) ; } break ; case " process " : / / this starts the stream processing app new smoke test client ( uuid random u u i d ( ) to string ( ) ) start ( streams properties ) ; break ; default : system out println ( " unknown command : " + command ) ; } }


return the producer id of the record batches created by this builder

public long producer id ( ) { return this producer id ; }


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


returns the internal names of the implemented interfaces ( see { @ link type # get internal name ( ) } )


public object get target bean ( ) { return target bean ; }


observable < order > place order ( @ retrofit 2 http body order body ) ;


removes the record of exactly one path does not leave a tombstone ( see { @ link metadata store # delete ( path , bulk operation state ) } it is currently intended for testing only , and a need to use it as part of normal file system usage is not anticipated

void forget metadata ( path path ) throws i o exception ;


public static data base transaction store manager get instance ( ) { if ( instance = = null ) { synchronized ( data base transaction store manager class ) { if ( instance = = null ) { instance = new data base transaction store manager ( ) ; } } } return instance ; }


the radius of the underlying shape this can refer to different things depending on the shape implementation

public float get radius ( ) { return m radius ; }


note : if the parameter inputted is empty then will return the empty list

public list < instance > generate instances by ips ( string service name , string raw product name , string cluster name , string [ ] ip array ) { if ( string utils is empty ( service name ) | | string utils is empty ( cluster name ) | | ip array = = null | | ip array length = = 0 ) { return collections empty list ( ) ; } list < instance > instance list = new array list < > ( ip array length ) ; for ( string ip : ip array ) { string [ ] ip and port = generate ip and port ( ip ) ; instance instance = new instance ( ) ; instance set ip ( ip and port [ 0 ] ) ; instance set port ( integer parse int ( ip and port [ 1 ] ) ) ; instance set cluster name ( cluster name ) ; instance set service name ( service name ) ; instance set tenant ( constants default namespace id ) ; instance set app ( raw product name ) ; instance set ephemeral ( false ) ; instance list add ( instance ) ; } return instance list ; }


returns the dwo files that should be included in this target ' s dwp packaging ( if this target is linked ) or passed through to a dependant ' s dwp packaging ( e g if this is a cc library depended on by a statically linked cc binary ) assumes the corresponding link consumes o files ( vs pic o files )

public nested set < artifact > get transitive dwo files ( ) { return transitive dwo files ; }