converts the { @ link job result } to a { @ link job execution result }

public job execution result to job execution result ( class loader class loader ) throws job execution exception , i o exception , class not found exception { if ( application status = = application status succeeded ) { return new job execution result ( job id , net runtime , accumulator helper deserialize accumulators ( accumulator results , class loader ) ) ; } else { final throwable cause ; if ( serialized throwable = = null ) { cause = null ; } else { cause = serialized throwable deserialize error ( class loader ) ; } final job execution exception exception ; if ( application status = = application status failed ) { exception = new job execution exception ( job id , " job execution failed " , cause ) ; } else if ( application status = = application status canceled ) { exception = new job cancellation exception ( job id , " job was cancelled " , cause ) ; } else { exception = new job execution exception ( job id , " job completed with illegal application status : " + application status + ' ' , cause ) ; } throw exception ; } }


schedule final request processing ; if a worker thread pool is not being used , processing is done directly by this thread

private void send to next processor ( request request ) { num requests processing increment and get ( ) ; commit work request work request = new commit work request ( request ) ; worker pool schedule ( work request , request session id ) ; }


advances the internally mocked wall - clock time this might trigger a { @ link punctuation type # wall clock time wall - clock } type { @ link processor context # schedule ( duration , punctuation type , punctuator ) punctuations }

public void advance wall clock time ( final long advance ms ) { advance wall clock time ( duration of millis ( advance ms ) ) ; }


return the object that is the subject of this change record

public object get object ( ) { return affected obj ; }


retrieve the given column as string from the given result set might simply invoke { @ code result set get string } or work with { @ code sqlxml } or database - specific classes depending on the database and driver

string get xml as string ( result set rs , string column name ) throws s q l exception ;


use system apis to update all existing resources < br > 1 update application info split source dirs and loaded apk m split res dirs < br > 2 replace all keys of resources manager m resource impls to new resources key < br > 3 use resources manager append lib asset for main asset path ( app info public source dir , " $ { package name } vastub " ) to update all existing resources < br > see android webkit web view delegate add web view asset path ( context )

private static resources create resources for n ( context context , string package name , file apk ) throws exception { long start time = system current time millis ( ) ; string new asset path = apk get absolute path ( ) ; application info info = context get application info ( ) ; string base res dir = info public source dir ; info split source dirs = append ( info split source dirs , new asset path ) ; loaded apk loaded apk = reflector with ( context ) field ( " m package info " ) get ( ) ; reflector r loaded apk = reflector with ( loaded apk ) field ( " m split res dirs " ) ; string [ ] split res dirs = r loaded apk get ( ) ; r loaded apk set ( append ( split res dirs , new asset path ) ) ; final android app resources manager resources manager = android app resources manager get instance ( ) ; array map < resources key , weak reference < resources impl > > original map = reflector with ( resources manager ) field ( " m resource impls " ) get ( ) ; synchronized ( resources manager ) { hash map < resources key , weak reference < resources impl > > resolved map = new hash map < > ( ) ; if ( build version sdk int > = 28 | | ( build version sdk int = = 27 & & build version preview sdk int ! = 0 ) ) { / / p preview resources manager compat for p resolve resources impl map ( original map , resolved map , context , loaded apk ) ; } else { resources manager compat for n resolve resources impl map ( original map , resolved map , base res dir , new asset path ) ; } original map clear ( ) ; original map put all ( resolved map ) ; } android app resources manager get instance ( ) append lib asset for main asset path ( base res dir , package name + " vastub " ) ; resources new resources = context get resources ( ) ; / / lastly , sync all loaded plugin to new resources for ( loaded plugin plugin : plugin manager get instance ( context ) get all loaded plugins ( ) ) { plugin update resources ( new resources ) ; } log d ( tag , " create resources for n cost time : + " + ( system current time millis ( ) - start time ) + " ms " ) ; return new resources ; }


returns the comma separated intercepter class names from the configuration

private list < string > get interceptor class names ( configuration conf ) { string configured interceptor class names = conf get ( yarn configuration router clientrm interceptor class pipeline , yarn configuration default router clientrm interceptor class ) ; list < string > interceptor class names = new array list < string > ( ) ; collection < string > temp list = string utils get string collection ( configured interceptor class names ) ; for ( string item : temp list ) { interceptor class names add ( item trim ( ) ) ; } return interceptor class names ; }


public string data read string data ( ) { ensure four bytes aligned ( table of contents string datas , false ) ; return super read string data ( ) ; }


public project file manager get project file manager ( ) { return ( project file manager ) g project get project ( ) get project data ( ) ; }


gets the operator for which this optimizer sink node was created

public generic data sink base < ? > get operator ( ) { return ( generic data sink base < ? > ) super get operator ( ) ; }


public static boolean parse general string ( string str , boolean default value ) { return boolean utils to boolean default if null ( boolean utils to boolean object ( str ) , default value ) ; }


return true if a specific connection establishment is currently underway

public boolean is connecting ( string id ) { node connection state state = node state get ( id ) ; return state ! = null & & state state = = connection state connecting ; }


public static void patch ( string path , route route , response transformer transformer ) { get instance ( ) patch ( path , route , transformer ) ; }


@ test public void ipv 6 host has square braces ( ) throws exception { / / use a proxy to fake i pv 6 connectivity , even if localhost doesn ' t have i pv 6 server use https ( handshake certificates ssl socket factory ( ) , true ) ; server set protocols ( collections singleton list ( protocol http 1 1 ) ) ; server enqueue ( new mock response ( ) set socket policy ( socket policy upgrade to ssl at end ) clear headers ( ) ) ; server enqueue ( new mock response ( ) set body ( " response body " ) ) ; client = client new builder ( ) ssl socket factory ( handshake certificates ssl socket factory ( ) , handshake certificates trust manager ( ) ) hostname verifier ( new recording hostname verifier ( ) ) proxy ( server to proxy address ( ) ) build ( ) ; request request = new request builder ( ) url ( " https : / / [ : : 1 ] / " ) build ( ) ; response response = client new call ( request ) execute ( ) ; assert that ( response body ( ) string ( ) ) is equal to ( " response body " ) ; recorded request connect = server take request ( ) ; assert that ( connect get request line ( ) ) is equal to ( " connect [ : : 1 ] : 443 http / 1 1 " ) ; assert that ( connect get header ( " host " ) ) is equal to ( " [ : : 1 ] : 443 " ) ; recorded request get = server take request ( ) ; assert that ( get get request line ( ) ) is equal to ( " get / http / 1 1 " ) ; assert that ( get get header ( " host " ) ) is equal to ( " [ : : 1 ] " ) ; }


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

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


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


is the decider default on for policies matching the roles ( ) of this decider service ?

default boolean default on ( ) { return true ; }


get the container associated with the event

public container get container ( ) { return container ; }


public int get account no ( ) { return account no ; }


static void init kerberos e n v ( string principal , string keytab , boolean debug enabled ) { try { configuration conf = new configuration ( ) ; conf set ( " hadoop security authentication " , " kerberos " ) ; if ( debug enabled ) { system set property ( " sun security krb 5 debug " , " true " ) ; } user group information set configuration ( conf ) ; user group information login user from keytab ( principal , keytab ) ; log info ( " connecting to kudu with kerberos authentication " ) ; log info ( " current user : " + user group information get current user ( ) ) ; log info ( " login user : " + user group information get login user ( ) ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } }


insert new object before object pointed to by iterator , other iterators remain valid

public iterator < t > insert before ( iterator < t > itr , t o ) { / / insert before iterator linked node cur = ( ( linked iterator ) itr ) cur node ; linked node new node = new linked node ( cur previous node , cur , o ) ; cur previous node next node = new node ; cur previous node = new node ; return new linked iterator ( new node ) ; }


boolean is expired ( reference entry < k , v > entry , long now ) { check not null ( entry ) ; if ( expires after access ( ) & & ( now - entry get access time ( ) > = expire after access nanos ) ) { return true ; } if ( expires after write ( ) & & ( now - entry get write time ( ) > = expire after write nanos ) ) { return true ; } return false ; }


link to another { @ link batch operator } link the < code > next < code > batch operator using this batch operator as its input for example : { @ code batch operator a = ; batch operator b = ; batch operator c = a link ( b ) } the batch operator < code > c < code > in the above code is the same instance as < code > b < code > which takes < code > a < code > as its input note that batch operator < code > b < code > will be changed to link from batch operator < code > a < code >

public < b extends batch operator < ? > > b link ( b next ) { next link from ( this ) ; return next ; }


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


we induce a failure in the last mapper in batch execution mode the part of the pipeline before the rescale should not be re - executed only the part after that will restart we check that by suffixing the attempt number to records and asserting the correct number

public void batch failover with rescale barrier ( ) throws exception { final stream execution environment env = get execution environment ( ) ; data stream source < string > source = env from elements ( " foo " , " bar " ) ; env set parallelism ( 1 ) ; single output stream operator < string > mapped = source map ( new suffix attempt id ( " a " ) ) map ( new suffix attempt id ( " b " ) ) rescale ( ) map ( new suffix attempt id ( " c " ) ) set parallelism ( 2 ) map ( new once failing mapper ( " d " ) ) set parallelism ( 2 ) ; try ( closeable iterator < string > result = mapped execute and collect ( ) ) { / / only the operators after the rescale " barrier " are restarted and will have the / / " attempt 1 " suffix assert that ( iterator to list ( result ) , contains in any order ( " foo - a 0 - b 0 - c 1 - d 1 " , " bar - a 0 - b 0 - c 1 - d 1 " ) ) ; } }


post is supported but does not actually change any state so we do not add csrf protection to it this ensures existing extensions will not have to be updated to add a csrf token to their requests ( 2019 - 11 - 10 )

public void do post ( http servlet request request , http servlet response response ) throws servlet exception , i o exception { string modname = request get parameter ( " module " ) ; if ( modname = = null ) { modname = " core " ; } string [ ] langs = request get parameter values ( " lang " ) ; if ( langs = = null | | " " equals ( langs [ 0 ] ) ) { preference store ps = project manager singleton get preference store ( ) ; if ( ps ! = null ) { langs = new string [ ] { ( string ) ps get ( " user lang " ) } ; } } / / default language is english if ( langs length = = 0 | | langs [ langs length - 1 ] ! = " en " ) { langs = arrays copy of ( langs , langs length + 1 ) ; langs [ langs length - 1 ] = " en " ; } object node translations = null ; string best lang = null ; for ( int i = langs length - 1 ; i > = 0 ; i - - ) { if ( langs [ i ] = = null ) continue ; object node json = load language ( this servlet , modname , langs [ i ] ) ; if ( json ! = null ) { best lang = langs [ i ] ; if ( translations = = null ) { translations = json ; } else { translations = merge languages ( json , translations ) ; } } } if ( translations ! = null ) { try { object node node = parsing utilities mapper create object node ( ) ; node set ( " dictionary " , translations ) ; node set ( " lang " , new text node ( best lang ) ) ; respond j s o n ( response , node ) ; } catch ( i o exception e ) { logger error ( " error writing language labels to response stream " ) ; } } else { logger error ( " failed to load any language files " ) ; } }


format url template using given variables

public string url ( map < string , string > variables ) { string url = this url ; / / go through variables and replace placeholders for ( map entry < string , server variable > variable : this variables entry set ( ) ) { string name = variable get key ( ) ; server variable server variable = variable get value ( ) ; string value = server variable default value ; if ( variables ! = null & & variables contains key ( name ) ) { value = variables get ( name ) ; if ( server variable enum values size ( ) > 0 & & ! server variable enum values contains ( value ) ) { throw new runtime exception ( " the variable " + name + " in the server url has invalid value " + value + " " ) ; } } url = url replace all ( " \ \ { " + name + " \ \ } " , value ) ; } return url ; }


returns the width of the scrolled viewport

public float get scroll width ( ) { return widget area width ; }


creates an date for sql date type from the millis since epoch

public static zoned date time as date only ( long millis ) { return zoned date time of instant ( instant of epoch milli ( millis ) , utc ) to local date ( ) at start of day ( utc ) ; }


create a jms message for the specified payload and conversion hint the conversion hint is an extra object passed to the { @ link message converter } , e g the associated { @ code method parameter } ( may be { @ code null } }

protected javax jms message create message for payload ( object payload , session session , @ nullable object conversion hint ) throws j m s exception { return this payload converter to message ( payload , session ) ; }


public map < string , metric > get metrics ( ) { return collections empty map ( ) ; }


returns a comparator that compares two { @ code float } arrays < a href = " http : en wikipedia orgwiki lexicographical order " > lexicographically that is , it compares , using { @ link # compare ( float , float ) } ) , the first pair of values that follow any common prefix , or when one array is a prefix of the other , treats the shorter array as the lesser for example , { @ code [ ] < [ 1 0f ] < [ 1 0f , 2 0f ] < [ 2 0f ] } the returned comparator is inconsistent with { @ link object # equals ( object ) } ( since arrays support only identity equality ) , but it is consistent with { @ link arrays # equals ( float [ ] , float [ ] ) }

public static comparator < float [ ] > lexicographical comparator ( ) { return lexicographical comparator instance ; }


use ism register value to establish isa mode when branchingcalling if ism = 0 , check for odd destination address which may occur when jumpingreturning indirectly to thumb mode it is assumed that language will properly handle context changes during the flow of execution , we need only fix the current program counter

public void post execute callback ( emulate emulate , address last execute address , pcode op [ ] last execute pcode , int last pcode index , address current address ) throws lowlevel error { if ( last pcode index < 0 ) { / / ignore fall - through condition return ; } int last op = last execute pcode [ last pcode index ] get opcode ( ) ; if ( last op ! = pcode op branch & & last op ! = pcode op cbranch & & last op ! = pcode op branchind & & last op ! = pcode op call & & last op ! = pcode op callind & & last op ! = pcode op return ) { / / only concerned with branch , call or return ops return ; } long tb value = emu get memory state ( ) get value ( ism reg ) ; if ( tb value = = 1 ) { / / thumb mode emu set context register value ( isa mode1 ) ; / / change context to be consistent with ism value if ( ( current address get offset ( ) & 0x 1 ) = = 1 ) { emulate set execute address ( current address previous ( ) ) ; } } else { if ( ( current address get offset ( ) & 0x 1 ) = = 1 ) { throw new lowlevel error ( " flow to odd address occurred without setting ism register ( 16 - bit mode ) " ) ; } / / mips mode emu set context register value ( isa mode0 ) ; / / change context to be consistent with ism value } }


default response entity < void > update pet ( @ api param ( value = " pet object that needs to be added to the store " , required = true ) @ valid @ request body pet body ) { return new response entity < > ( http status not implemented ) ; }


the docker client config for the service

public string get docker client config ( ) { return docker client config ; }


helper method to set username for the first http basic authentication

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


asserts that if the contents of { @ code changed path string } changes , then the file value corresponding to { @ code path string } will change returns the paths of all files seen

private set < rooted path > get files seen and assert value changes if contents of file changes ( string changed path string , boolean changes , string path string ) throws exception { return assert changes if changes ( changed path string , true , changes , path string ) ; }


find a view in the hierarchy for which the given predicate is true

public immutable list < view > find child ( predicate < view > predicate ) { return find child ( m view , predicate , predicates < view group > always true ( ) ) ; }


binds the texture to the given texture unit sets the currently active texture unit via { @ link gl20 # gl active texture ( int ) }

public void bind ( int unit ) { gdx gl gl active texture ( gl20 gl texture0 + unit ) ; gdx gl gl bind texture ( gl target , gl handle ) ; }


sets new values to all fields of the tuple


access to request body matchers using a < a href = " https : github comjayway json path " > json path expression to inspect a specific subset of the body the json path expression can be a parameterized string using formatting specifiers as defined in { @ link string # format ( string , object ) }

public static json path request matchers json path ( string expression , object args ) { return new json path request matchers ( expression , args ) ; }


public connection get connection ( string username , string password ) throws s q l exception { throw new s q l feature not supported exception ( ) ; }


delete directory and everything underneath it

private static void deldir ( file system fs , string topdir ) throws i o exception { fs delete ( new path ( topdir ) , true ) ; }


the version of the response data ( used for debugging ) < code > string system version info = 1 ; < code >

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


test the property ' prefix ns wrapped array '

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


json schema defines one of as a validation property which can be applied to any schema open a p i specification is a variant of json schema for which one of is defined as : " inline or referenced schema must be of a schema object and not a standard json schema " where the only examples of one of in open a p i specification are used to define eitheror type structures rather than validations because of this ambiguity in the spec about what is non - standard about one of support , we ' ll warn as a recommendation that properties on the schema defining one of relationships may not be intentional in the open a p i specification

private static validation rule result check one of with properties ( schema wrapper schema wrapper ) { schema schema = schema wrapper get schema ( ) ; validation rule result result = validation rule pass empty ( ) ; if ( schema instanceof composed schema ) { final composed schema composed = ( composed schema ) schema ; / / check for loosely defined one of extension requirements / / this is a recommendation because the 3 0 x spec is not clear enough on usage of one of / / see https : / / json - schema org / draft / 2019 - 09 / json - schema - core html # rfc section 9 2 1 3 and the oas section on ' composition and inheritance ' if ( composed get one of ( ) ! = null & & composed get one of ( ) size ( ) > 0 ) { if ( composed get properties ( ) ! = null & & composed get properties ( ) size ( ) > = 1 & & composed get properties ( ) get ( " discriminator " ) = = null ) { / / not necessarily " invalid " here , but we trigger the recommendation which requires the method to return false result = validation rule fail empty ( ) ; } } } return result ; }


select the best media type for the current request through a content negotiation algorithm

protected media type select media type ( server web exchange exchange , supplier < list < media type > > producible types supplier ) { media type content type = exchange get response ( ) get headers ( ) get content type ( ) ; if ( content type ! = null & & content type is concrete ( ) ) { if ( logger is debug enabled ( ) ) { logger debug ( exchange get log prefix ( ) + " found ' content - type : " + content type + " ' in response " ) ; } return content type ; } list < media type > acceptable types = get acceptable types ( exchange ) ; list < media type > producible types = get producible types ( exchange , producible types supplier ) ; set < media type > compatible media types = new linked hash set < > ( ) ; for ( media type acceptable : acceptable types ) { for ( media type producible : producible types ) { if ( acceptable is compatible with ( producible ) ) { compatible media types add ( select more specific media type ( acceptable , producible ) ) ; } } } list < media type > result = new array list < > ( compatible media types ) ; media type sort by specificity and quality ( result ) ; media type selected = null ; for ( media type media type : result ) { if ( media type is concrete ( ) ) { selected = media type ; break ; } else if ( media type is present in ( all application media types ) ) { selected = media type application octet stream ; break ; } } if ( selected ! = null ) { selected = selected remove quality value ( ) ; if ( logger is debug enabled ( ) ) { logger debug ( exchange get log prefix ( ) + " using ' " + selected + " ' given " + acceptable types + " and supported " + producible types ) ; } } else if ( logger is debug enabled ( ) ) { logger debug ( exchange get log prefix ( ) + " no match for " + acceptable types + " , supported : " + producible types ) ; } return selected ; }


return true if the provided query contains a mandatory clauses ( must ) that doesn ' t track the maximum scores per block

static boolean has inf max score ( query query ) { max score query visitor visitor = new max score query visitor ( ) ; query visit ( visitor ) ; return visitor has inf max score ; }


remove the request attribute { @ link # path attribute } that holds a { @ link # parse and cache previously } parsed and cached { @ code request path }

public static void clear parsed request path ( servlet request request ) { request remove attribute ( path attribute ) ; } / / methods to select either parsed request path or resolved string lookup path


protected @ nullable gesture detector get gesture detector ( ) { return m gesture detector ; }


get the storage reports for all blockpools that were not specified by the balancer blockpool parameters if none were specified then the parameter was not set and do not return any reports

private static map < integer , datanode storage report [ ] > get storage reports ( suite s ) throws i o exception { map < integer , datanode storage report [ ] > reports = new hash map < integer , datanode storage report [ ] > ( ) ; if ( s parameters get block pools ( ) size ( ) = = 0 ) { / / the blockpools parameter was not set , so we don ' t need to track any / / blockpools return collections empty map ( ) ; } for ( int i = 0 ; i < s clients length ; i + + ) { if ( s parameters get block pools ( ) contains ( s cluster get namesystem ( i ) get block pool id ( ) ) ) { / / we want to ensure that blockpools not specified by the balancer / / parameters were left alone therefore , if the pool was specified , / / skip it note : this code assumes the clients in the suite are ordered / / the same way that they are indexed via cluster # get namesystem ( index ) continue ; } else { log info ( " tracking usage of blockpool id : " + s cluster get namesystem ( i ) get block pool id ( ) ) ; reports put ( i , s clients [ i ] get datanode storage report ( datanode report type live ) ) ; } } log info ( " tracking " + reports size ( ) + " blockpool ( s ) for pre / post balancer usage " ) ; return reports ; }


returns an { @ code input stream } that decodes base - encoded input from the specified { @ code reader } the returned stream throws a { @ link decoding exception } upon decoding - specific errors

public abstract input stream decoding stream ( reader reader ) ;


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


checks for the { @ link reader context } if it exists and compares the { @ link authentication } object from the scroll context with the current authentication context

public void validate reader context ( reader context reader context , transport request request ) { if ( license state is security enabled ( ) ) { if ( reader context scroll context ( ) ! = null ) { final authentication original auth = reader context get from context ( authentication field authentication key ) ; final authentication current = security context get authentication ( ) ; final thread context thread context = security context get thread context ( ) ; final string action = thread context get transient ( originating action key ) ; ensure authenticated user is same ( original auth , current , audit trail service , reader context id ( ) , action , request , audit util extract request id ( thread context ) , thread context get transient ( authorization info key ) ) ; / / piggyback on context validation to assert the dls / fls permissions on the thread context of the scroll search handler if ( null = = security context get thread context ( ) get transient ( authorization service field indices permissions key ) ) { / / fill in the dls and fls permissions for the scroll search action from the scroll context indices access control scroll indices access control = reader context get from context ( authorization service field indices permissions key ) ; assert scroll indices access control ! = null : " scroll does not contain index access control " ; security context get thread context ( ) put transient ( authorization service field indices permissions key , scroll indices access control ) ; } } } }


the value of the string index item must be a valid index into the constant pool table the constant pool entry at that index must be a constant utf 8 info structure representing the sequence of unicode code points to which the string object is to be initialized

public int get string index ( ) { return string index & 0xffff ; }


sets whether the translation gesture is enabled or not

public void set translation enabled ( boolean enabled ) { m is translation enabled = enabled ; }


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


install multi dex before install tinker so we don ' t need to put the tinker lib classes in the main dex

public void on base context attached ( context base ) { super on base context attached ( base ) ; / / you must install multi dex whatever tinker is installed ! multi dex install ( base ) ; sample application context application = get application ( ) ; sample application context context = get application ( ) ; tinker manager set tinker application like ( this ) ; tinker manager init fast crash protect ( ) ; / / should set before tinker is installed tinker manager set upgrade retry enable ( true ) ; / / optional set log iml , or you can use default debug log tinker installer set log iml ( new my log imp ( ) ) ; / / install tinker after load multi dex / / or you can put com tencent tinker * * to main dex tinker manager install tinker ( this ) ; tinker tinker = tinker with ( get application ( ) ) ; }


create a loop this automatically adjusts connectivity

public void create loop ( float [ ] vertices , int offset , int length ) { final int vertex count = length / 2 ; vec 2 [ ] v = new vec 2 [ vertex count ] ; for ( int i = offset , vi = 0 ; vi < vertex count ; i + = 2 , vi + + ) { v [ vi ] = new vec 2 ( vertices [ i ] , vertices [ i + 1 ] ) ; } shape create loop ( v , vertex count ) ; is looped = true ; }


adds the specified icon as an overlay to the base icon , possibly scaled according to the specified width and height , in the specified quadrant corner

public multi icon builder add icon ( icon icon , int w , int h , quadrant quandrant ) { image icon scaled = resource manager get scaled icon ( icon , w , h ) ; int x = ( multi icon get icon width ( ) - scaled get icon width ( ) ) * quandrant x ; int y = ( multi icon get icon height ( ) - scaled get icon height ( ) ) * quandrant y ; translate icon tx icon = new translate icon ( scaled , x , y ) ; multi icon add icon ( tx icon ) ; return this ; }


returns true if there is an edge that directly connects { @ code endpoints } ( in the order , if any , specified by { @ code endpoints } ) this is equivalent to { @ code edges ( ) contains ( endpoints ) } unlike the other { @ code endpoint pair } - accepting methods , this method does not throw if the endpoints are unordered and the graph is directed ; it simply returns { @ code false } this is for consistency with the behavior of { @ link collection # contains ( object ) } ( which does not generally throw if the object cannot be present in the collection ) , and the desire to have this method ' s behavior be compatible with { @ code edges ( ) contains ( endpoints ) }

boolean has edge connecting ( endpoint pair < n > endpoints ) ; / / / / graph identity / /


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


returns true if field arg is set ( has been assigned a value ) and false otherwise

public boolean is set arg ( ) { return isset bit vector get ( arg isset id ) ; }


public static rest result < string > http post ( string url , list < string > headers , map < string , string > param values , string encoding ) { try { header header = header new instance ( ) ; if ( collection utils is not empty ( headers ) ) { header add all ( headers ) ; } header add param ( http header consts accept charset , encoding ) ; auth header util add identity to header ( header ) ; http client config http client config = http client config builder ( ) set con time out millis ( 5000 ) set read time out millis ( 5000 ) set connection request timeout ( 5000 ) set max redirects ( 5 ) build ( ) ; return apache sync nacos rest template post form ( url , http client config , header , param values , string class ) ; } catch ( throwable e ) { return rest result < string > builder ( ) with code ( 500 ) with msg ( e to string ( ) ) build ( ) ; } }


this test unit makes sure that if part of the config xml file is deleted it will still load everything else inside the folder the test unit expects an i o exception is thrown , and the one failed job fails to load

public void xml file fails to load ( ) throws exception { mock folder folder = r create folder ( " folder " ) ; assert not null ( folder ) ; abstract project project = folder create project ( free style project class , " job 1 " ) ; abstract project project 2 = folder create project ( free style project class , " job 2 " ) ; abstract project project 3 = folder create project ( free style project class , " job 3 " ) ; file config file = project get config file ( ) get file ( ) ; list < string > lines = file utils read lines ( config file ) sub list ( 0 , 5 ) ; config file delete ( ) ; / / remove half of the config xml file to make " invalid " or fail to load file utils write byte array to file ( config file , lines to string ( ) get bytes ( ) ) ; for ( int i = lines size ( ) / 2 ; i < lines size ( ) ; i + + ) { file utils write string to file ( config file , lines get ( i ) , true ) ; } / / reload jenkins r jenkins reload ( ) ; / / folder assert not null ( " folder failed to load " , r jenkins get item by full name ( " folder " ) ) ; assert null ( " job should have failed to load " , r jenkins get item by full name ( " folder / job 1 " ) ) ; assert not null ( " other job in folder should have loaded " , r jenkins get item by full name ( " folder / job 2 " ) ) ; assert not null ( " other job in folder should have loaded " , r jenkins get item by full name ( " folder / job 3 " ) ) ; }


public parsed document parse document ( source to parse source ) throws mapper parsing exception { return mapping lookup parse document ( source ) ; }


tests appending after soft - limit expires

public void test append 2 after soft limit ( ) throws exception { configuration conf = new hdfs configuration ( ) ; conf set int ( d f s config keys dfs replication key , 1 ) ; / / set small soft - limit for lease final long soft limit = 1l ; final long hard limit = 9999999l ; file builder base dir = new file ( generic test utils get randomized temp path ( ) ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf , builder base dir ) num data nodes ( 1 ) build ( ) ; cluster set lease period ( soft limit , hard limit ) ; cluster wait active ( ) ; distributed file system fs = cluster get file system ( ) ; distributed file system fs 2 = new distributed file system ( ) ; fs 2 initialize ( fs get uri ( ) , conf ) ; final path test path = new path ( " / test append after soft limit " ) ; final byte [ ] file contents = append test util init buffer ( 32 ) ; / / create a new file without closing f s data output stream out = fs create ( test path ) ; out write ( file contents ) ; / / wait for > soft - limit thread sleep ( 250 ) ; try { f s data output stream append stream 2 = fs 2 append ( test path , enum set of ( create flag append , create flag new block ) , 4096 , null ) ; append stream 2 write ( file contents ) ; append stream 2 close ( ) ; assert equals ( file contents length , fs get file status ( test path ) get len ( ) ) ; / / make sure we now have 1 block since the first writer was revoked located blocks blks = fs get client ( ) get located blocks ( test path to string ( ) , 0l ) ; assert equals ( 1 , blks get located blocks ( ) size ( ) ) ; for ( located block blk : blks get located blocks ( ) ) { assert equals ( file contents length , blk get block size ( ) ) ; } } finally { fs close ( ) ; fs 2 close ( ) ; cluster shutdown ( ) ; } }


add a record to the accumulator , return the append result the append result will contain the future metadata , and flag for whether the appended batch is full or a new batch is created

public record append result append ( topic partition tp , long timestamp , byte [ ] key , byte [ ] value , header [ ] headers , callback callback , long max time to block , boolean abort on new batch , long now ms ) throws interrupted exception { / / we keep track of the number of appending thread to make sure we do not miss batches in / / abort incomplete batches ( ) appends in progress increment and get ( ) ; byte buffer buffer = null ; if ( headers = = null ) headers = record empty headers ; try { / / check if we have an in - progress batch deque < producer batch > dq = get or create deque ( tp ) ; synchronized ( dq ) { if ( closed ) throw new kafka exception ( " producer closed while send in progress " ) ; record append result append result = try append ( timestamp , key , value , headers , callback , dq , now ms ) ; if ( append result ! = null ) return append result ; } / / we don ' t have an in - progress record batch try to allocate a new batch if ( abort on new batch ) { / / return a result that will cause another call to append return new record append result ( null , false , false , true ) ; } byte max usable magic = api versions max usable produce magic ( ) ; int size = math max ( this batch size , abstract records estimate size in bytes upper bound ( max usable magic , compression , key , value , headers ) ) ; log trace ( " allocating a new { } byte message buffer for topic { } partition { } with remaining timeout { } ms " , size , tp topic ( ) , tp partition ( ) , max time to block ) ; buffer = free allocate ( size , max time to block ) ; / / update the current time in case the buffer allocation blocked above now ms = time milliseconds ( ) ; synchronized ( dq ) { / / need to check if producer is closed again after grabbing the dequeue lock if ( closed ) throw new kafka exception ( " producer closed while send in progress " ) ; record append result append result = try append ( timestamp , key , value , headers , callback , dq , now ms ) ; if ( append result ! = null ) { / / somebody else found us a batch , return the one we waited for ! hopefully this doesn ' t happen often return append result ; } memory records builder records builder = records builder ( buffer , max usable magic ) ; producer batch batch = new producer batch ( tp , records builder , now ms ) ; future record metadata future = objects require non null ( batch try append ( timestamp , key , value , headers , callback , now ms ) ) ; dq add last ( batch ) ; incomplete add ( batch ) ; / / don ' t deallocate this buffer in the finally block as it ' s being used in the record batch buffer = null ; return new record append result ( future , dq size ( ) > 1 | | batch is full ( ) , true , false ) ; } } finally { if ( buffer ! = null ) free deallocate ( buffer ) ; appends in progress decrement and get ( ) ; } }


public static string research megaphone ( ) { return get string ( research megaphone 1 , " " ) ; }


heuristic for comparing two architectures if architectures are found to be in the same " architecture family " ( e g i 3 8 6 , i 6 8 6 , x 8 6 and ia 3 2 are considered related ) , they will match

public boolean is ( architecture compare with ) { return this equals ( compare with ) ; }


public list < big decimal > get array number ( ) { return array number ; }


temporary storage forecast is allowed to use for persisting models

public string get tmp storage ( ) { return tmp storage ; }


sets the { @ link rule link expander } for the provided { @ link rule documentation attributes } this method is used to set the { @ link rule link expander } for common attributes , such as those defined in { @ link predefined attributes } , so that rule references in the docs for those attributes can be expanded

protected static map < string , rule documentation attribute > expand common attributes ( map < string , rule documentation attribute > attributes , rule link expander expander ) { for ( rule documentation attribute attribute : attributes values ( ) ) { attribute set rule link expander ( expander ) ; } return attributes ; }


activates the process definition with the given key ( = id in the bpmn 2 0 xml file )

void activate process definition by key ( string process definition key , boolean activate process instances , date activation date ) ;


calls { @ link # init servlet context ( javax servlet servlet context ) } if the given application context is a { @ link web application context }

protected void init application context ( application context context ) { super init application context ( context ) ; if ( this servlet context = = null & & context instanceof web application context ) { this servlet context = ( ( web application context ) context ) get servlet context ( ) ; if ( this servlet context ! = null ) { init servlet context ( this servlet context ) ; } } }


returns the results from default dfs ( fallback ) if you want the results from specific clusters , please invoke them on child fs instance directly

public remote iterator < zone reencryption status > list reencryption status ( ) throws i o exception { if ( this vfs = = null ) { return super list reencryption status ( ) ; } check default d f s ( default d f s , " list reencryption status " ) ; return default d f s list reencryption status ( ) ; }


dispatches { @ link # on load started ( int , media period id , load event info , media load data ) }

public void load started ( load event info load event info , int data type ) { load started ( load event info , data type , / * track type = * / c track type unknown , / * track format = * / null , / * track selection reason = * / c selection reason unknown , / * track selection data = * / null , / * media start time us = * / c time unset , / * media end time us = * / c time unset ) ; }


protected void detect handler methods ( final object handler ) { class < ? > handler type = ( handler instanceof string ? obtain application context ( ) get type ( ( string ) handler ) : handler get class ( ) ) ; if ( handler type ! = null ) { final class < ? > user type = class utils get user class ( handler type ) ; map < method , t > methods = method introspector select methods ( user type , ( method introspector metadata lookup < t > ) method - > get mapping for method ( method , user type ) ) ; if ( logger is trace enabled ( ) ) { logger trace ( format mappings ( user type , methods ) ) ; } methods for each ( ( method , mapping ) - > { method invocable method = aop utils select invocable method ( method , user type ) ; register handler method ( handler , invocable method , mapping ) ; } ) ; } }


returns a copy of the build configuration options for this configuration

public build options clone options ( ) { build options clone = build options clone ( ) ; return clone ; }


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


enable caching for the materialized { @ link state store }

public materialized < k , v , s > with caching enabled ( ) { caching enabled = true ; return this ; }


atomically sets the element at position { @ code i } to the given updated value if the current value is < a href = " # bit equals " > bitwise equal to the expected value may < a href = " http : download oracle comjavase 7docsapijavautilconcurrentatomicpackage - summary html # spurious " > fail spuriously and does not provide ordering guarantees , so is only rarely an appropriate alternative to { @ code compare and set }

public final boolean weak compare and set ( int i , double expect , double update ) { return longs weak compare and set ( i , double to raw long bits ( expect ) , double to raw long bits ( update ) ) ; }


verify that the given list of streams contains exactly the range of transactions specified , inclusive

public static void verify edits ( list < edit log input stream > streams , int first txn id , int last txn id ) throws i o exception { iterator < edit log input stream > iter = streams iterator ( ) ; assert true ( iter has next ( ) ) ; edit log input stream stream = iter next ( ) ; for ( int expected = first txn id ; expected < = last txn id ; expected + + ) { f s edit log op op = stream read op ( ) ; while ( op = = null ) { assert true ( " expected to find txid " + expected + " , " + " but no more streams available to read from " , iter has next ( ) ) ; stream = iter next ( ) ; op = stream read op ( ) ; } assert equals ( f s edit log op codes op mkdir , op op code ) ; assert equals ( expected , op get transaction id ( ) ) ; } assert null ( stream read op ( ) ) ; assert false ( " expected no more txns after " + last txn id + " but more streams are available " , iter has next ( ) ) ; }


converts the given number of the current units into megabytes

public long to megabytes ( long l ) { return megabytes convert ( l , this ) ; }


returns { @ code true } if and only if the specified address has been resolved

boolean is resolved ( socket address address ) ;


boolean is idle ( ) { return is idle ; }


receive a message synchronously from the specified destination , but only wait up to a specified time for delivery this method should be used carefully , since it will block the thread until the message becomes available or until the timeout value is exceeded

message receive ( destination destination ) throws jms exception ;


public offset date time get ship date ( ) { return ship date ; }


if nn restarted then lazy persist files should not deleted

public void test file should not discarded if n n restarted ( ) throws i o exception , interrupted exception , timeout exception { get cluster builder ( ) set ram disk replica capacity ( 2 ) build ( ) ; final string method name = generic test utils get method name ( ) ; path path 1 = new path ( " / " + method name + " 01 dat " ) ; make test file ( path 1 , block size , true ) ; ensure file replicas on storage type ( path 1 , ram disk ) ; shutdown data nodes ( ) ; cluster restart name nodes ( ) ; / / wait for the redundancy monitor to mark the file as corrupt wait for corrupt block ( 1l ) ; / / ensure path 1 exist wait for file ( path 1 , true ) ; }


create a new instance of the committer statistics

public committer statistics new committer statistics ( ) { return new committer statistics impl ( ) ; }


public void clear ( ) { / / todo : we should only clear policies loaded from nn metadata / / this is a placeholder for hdfs - 7337 }


returns if this model is sortable ( true )

public boolean is sortable ( int column index ) { return true ; }


reset { @ code my s q l binary statement registry }

public static void reset ( ) { field statement id assigner field = my s q l binary statement registry class get declared field ( " statement id assigner " ) ; statement id assigner field set accessible ( true ) ; ( ( map ) statement id assigner field get ( my s q l binary statement registry get instance ( ) ) ) clear ( ) ; field binary statements field = my s q l binary statement registry class get declared field ( " binary statements " ) ; binary statements field set accessible ( true ) ; ( ( map ) binary statements field get ( my s q l binary statement registry get instance ( ) ) ) clear ( ) ; field sequence field = my s q l binary statement registry class get declared field ( " sequence " ) ; sequence field set accessible ( true ) ; ( ( atomic integer ) sequence field get ( my s q l binary statement registry get instance ( ) ) ) set ( 0 ) ; }


decode the body to a { @ link flux } with elements of the given type for an error response ( status code of 4xx or 5xx ) , the { @ code mono } emits a { @ link web client exception } use { @ link # on status ( predicate , function ) } to customize error response handling

< t > flux < t > body to flux ( class < t > element class ) ;


returns true if this node represents a module

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


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


create an update description which has a string value created by a supplied factory method that will be run on a background thread

public static update description mentioning ( @ non null collection < uuid > mentioned , @ non null string factory string factory , @ drawable res int icon resource ) { return new update description ( uuid util filter known ( mentioned ) , string factory , null , icon resource , 0 , 0 ) ; }


called when either the target aspect ratio or the view aspect ratio is updated

void on aspect ratio updated ( float target aspect ratio , float natural aspect ratio , boolean aspect ratio mismatch ) ;


return a list of blocks & amp ; their locations on { @ code datanode } whose total size is { @ code size }

public blocks with locations get blocks ( datanode i d datanode , long size , long minimum block size , long time interval ) throws i o exception { check operation ( operation category read ) ; read lock ( ) ; try { check operation ( operation category read ) ; return get block manager ( ) get blocks with locations ( datanode , size , minimum block size , time interval ) ; } finally { read unlock ( " get blocks " ) ; } }


the children of this element < code > repeated aapt pb xml node child = 5 ; < code >

public int get child count ( ) { return instance get child count ( ) ; }


special handling of the value to authorize for a put mapping request dynamic put mapping requests use a concrete index , but we allow permissions to be defined on aliases so if the request ' s concrete index is not in the list of authorized indices , then we need to look to see if this can be authorized against an alias

static string get put mapping index or alias ( put mapping request request , list < string > authorized indices list , metadata metadata ) { final string concrete index name = request get concrete index ( ) get name ( ) ; / / validate that the concrete index exists , otherwise there is no remapping that we could do final index abstraction index abstraction = metadata get indices lookup ( ) get ( concrete index name ) ; final string resolved alias or index ; if ( index abstraction = = null ) { resolved alias or index = concrete index name ; } else if ( index abstraction get type ( ) ! = index abstraction type concrete index ) { throw new illegal state exception ( " concrete index [ " + concrete index name + " ] is a [ " + index abstraction get type ( ) get display name ( ) + " ] , but a concrete index is expected " ) ; } else if ( authorized indices list contains ( concrete index name ) ) { / / user is authorized to put mappings for this index resolved alias or index = concrete index name ; } else { / / the user is not authorized to put mappings for this index , but could have been / / authorized for a write using an alias that triggered a dynamic mapping update immutable open map < string , list < alias metadata > > found aliases = metadata find all aliases ( new string [ ] { concrete index name } ) ; list < alias metadata > alias metadata = found aliases get ( concrete index name ) ; if ( alias metadata ! = null ) { optional < string > found alias = alias metadata stream ( ) map ( alias metadata : : alias ) filter ( authorized indices list : : contains ) filter ( alias name - > { index abstraction alias = metadata get indices lookup ( ) get ( alias name ) ; list < index metadata > index metadata = alias get indices ( ) ; if ( index metadata size ( ) = = 1 ) { return true ; } else { assert alias get type ( ) = = index abstraction type alias ; index metadata idx meta = alias get write index ( ) ; return idx meta ! = null & & idx meta get index ( ) get name ( ) equals ( concrete index name ) ; } } ) find first ( ) ; resolved alias or index = found alias or else ( concrete index name ) ; } else { resolved alias or index = concrete index name ; } } return resolved alias or index ; }


greet server if provided , the first element of { @ code args } is the name to use in the greeting and the second is the client identifier to set in jwt

public static void main ( string [ ] args ) throws exception { string host = " localhost " ; int port = 50051 ; string user = " world " ; string client id = " default - client " ; if ( args length > 0 ) { host = args [ 0 ] ; / / use the arg as the server host if provided } if ( args length > 1 ) { port = integer parse int ( args [ 1 ] ) ; / / use the second argument as the server port if provided } if ( args length > 2 ) { user = args [ 2 ] ; / / use the the third argument as the name to greet if provided } if ( args length > 3 ) { client id = args [ 3 ] ; / / use the fourth argument as the client identifier if provided } call credentials credentials = new jwt credential ( client id ) ; auth client client = new auth client ( credentials , host , port ) ; try { client greet ( user ) ; } finally { client shutdown ( ) ; } }


add the file read latency to { @ link mutable quantiles } metrics

public void add read file latency ( long read latency ) { if ( file read quantiles ! = null ) { for ( mutable quantiles q : file read quantiles ) { q add ( read latency ) ; } } }


return a model and view object with the specified view name the content of the { @ link request context utils # get input flash map " input " flash map } is also added to the model

protected model and view handle request internal ( http servlet request request , http servlet response response ) throws exception { string view name = get view name ( ) ; if ( get status code ( ) ! = null ) { if ( get status code ( ) is 3xx redirection ( ) ) { request set attribute ( view response status attribute , get status code ( ) ) ; } else { response set status ( get status code ( ) value ( ) ) ; if ( get status code ( ) equals ( http status no content ) & & view name = = null ) { return null ; } } } if ( is status only ( ) ) { return null ; } model and view model and view = new model and view ( ) ; model and view add all objects ( request context utils get input flash map ( request ) ) ; if ( view name ! = null ) { model and view set view name ( view name ) ; } else { model and view set view ( get view ( ) ) ; } return model and view ; }


nameservice for a p is that cannot be resolved to a specific one

private void init default name service ( configuration conf ) { this default n s enable = conf get boolean ( dfs router default nameservice enable , dfs router default nameservice enable default ) ; if ( ! this default n s enable ) { log warn ( " default name service is disabled " ) ; return ; } this default name service = conf get ( dfs router default nameservice , " " ) ; if ( this default name service equals ( " " ) ) { this default n s enable = false ; log warn ( " default name service is not set " ) ; } else { log info ( " default name service : { } , enabled to read or write " , this default name service ) ; } }


return whether it is today the pattern is { @ code yyyy - mm - dd hh : mm : ss }

public static boolean is today ( final string time ) { return is today ( string 2 millis ( time , get default format ( ) ) ) ; }


concatenates the given array of byte arrays

public static byte [ ] concat ( byte [ ] byte arrays ) { int len = 0 ; for ( byte [ ] byte array : byte arrays ) { len + = byte array length ; } byte [ ] result = new byte [ len ] ; len = 0 ; for ( byte [ ] byte array : byte arrays ) { system arraycopy ( byte array , 0 , result , len , byte array length ) ; len + = byte array length ; } return result ; }


add the lock hold time for a recent operation to the metrics

private void add metric ( string operation name , long value , boolean is write ) { if ( metrics enabled ) { string op metric = get metric name ( operation name , is write ) ; detailed hold time metrics add ( op metric , value ) ; string overall metric = get metric name ( overall metric name , is write ) ; detailed hold time metrics add ( overall metric , value ) ; } update processing details ( is write ? timing lockexclusive : timing lockshared , value ) ; }


simulate the { @ link d f s config keys # dfs datanode data dir key } of a populated dfs filesystem this method populates for each parent directory , < code > parentdir name < code > with the content of block pool storage directory that comes from a singleton datanode master ( that contains version and block files ) if the destination directory does not exist , it will be created if the directory already exists , it will first be deleted

public static file [ ] create block pool storage dirs ( string [ ] parents , string dir name , string bpid ) throws exception { file [ ] ret val = new file [ parents length ] ; path bp cur dir = new path ( mini d f s cluster get b p dir ( datanode storage , bpid , storage storage dir current ) ) ; for ( int i = 0 ; i < parents length ; i + + ) { file new dir = new file ( parents [ i ] + " / current / " + bpid , dir name ) ; create empty dirs ( new string [ ] { new dir to string ( ) } ) ; local file system local f s = file system get local ( new hdfs configuration ( ) ) ; local f s copy to local file ( bp cur dir , new path ( new dir to string ( ) ) , false ) ; ret val [ i ] = new dir ; } return ret val ; }


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

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


public static void main ( final string [ ] args ) { environment information log environment info ( log , " command line client " , args ) ; / / 1 find the configuration directory final string configuration directory = get configuration directory from env ( ) ; / / 2 load the global configuration final configuration configuration = global configuration load configuration ( configuration directory ) ; / / 3 load the custom command lines final list < custom command line > custom command lines = load custom command lines ( configuration , configuration directory ) ; try { final cli frontend cli = new cli frontend ( configuration , custom command lines ) ; security utils install ( new security configuration ( cli configuration ) ) ; int ret code = security utils get installed context ( ) run secured ( ( ) - > cli parse and run ( args ) ) ; system exit ( ret code ) ; } catch ( throwable t ) { final throwable stripped throwable = exception utils strip exception ( t , undeclared throwable exception class ) ; log error ( " fatal error while running command line interface " , stripped throwable ) ; stripped throwable print stack trace ( ) ; system exit ( 31 ) ; } }


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


returns fields for which the mappings should be either predefined or copied from source index to destination index

map < string , object > get result mappings ( string results field name , field capabilities response field capabilities response ) ;


type of resource collection that is being requested , e g istionetworkingv 1alpha 3 virtual service k 8s & lt ; api version & gt ; & lt ; kind & gt ; < code > string collection = 2 ; < code >

public builder set collection ( java lang string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } collection = value ; on changed ( ) ; return this ; }


create a shell command executor object using the user ' s name

protected shell command executor create group executor ( string user name ) { return new shell command executor ( get groups for user command ( user name ) , null , null , timeout ) ; }


sets the db access related fields in the job conf

public static void configure d b ( job conf job , string driver class , string db url ) { configure d b ( job , driver class , db url , null , null ) ; }


when this response was created as a timestamp in milliseconds since epoch

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


the doc lookup for the lucene segment this script was created for

public map < string , script doc values < ? > > get doc ( ) { return leaf lookup doc ( ) ; }


attempts to read the required bytes into next frame

private boolean read required bytes ( ) { int total bytes read = 0 ; int deflated bytes read = 0 ; try { if ( next frame = = null ) { next frame = new composite readable buffer ( ) ; } / / read until the buffer contains all the required bytes int missing bytes ; while ( ( missing bytes = required length - next frame readable bytes ( ) ) > 0 ) { if ( full stream decompressor ! = null ) { try { if ( inflated buffer = = null | | inflated index = = inflated buffer length ) { inflated buffer = new byte [ math min ( missing bytes , max buffer size ) ] ; inflated index = 0 ; } int bytes to read = math min ( missing bytes , inflated buffer length - inflated index ) ; int n = full stream decompressor inflate bytes ( inflated buffer , inflated index , bytes to read ) ; total bytes read + = full stream decompressor get and reset bytes consumed ( ) ; deflated bytes read + = full stream decompressor get and reset deflated bytes consumed ( ) ; if ( n = = 0 ) { / / no more inflated data is available return false ; } next frame add buffer ( readable buffers wrap ( inflated buffer , inflated index , n ) ) ; inflated index + = n ; } catch ( i o exception e ) { throw new runtime exception ( e ) ; } catch ( data format exception e ) { throw new runtime exception ( e ) ; } } else { if ( unprocessed readable bytes ( ) = = 0 ) { / / no more data is available return false ; } int to read = math min ( missing bytes , unprocessed readable bytes ( ) ) ; total bytes read + = to read ; next frame add buffer ( unprocessed read bytes ( to read ) ) ; } } return true ; } finally { if ( total bytes read > 0 ) { listener bytes read ( total bytes read ) ; if ( state = = state body ) { if ( full stream decompressor ! = null ) { / / with compressed streams , total bytes read can include gzip header and trailer metadata stats trace ctx inbound wire size ( deflated bytes read ) ; inbound body wire size + = deflated bytes read ; } else { stats trace ctx inbound wire size ( total bytes read ) ; inbound body wire size + = total bytes read ; } } } } }


creates an action to allow users to manually add new extensions

private void create add action ( extension table panel panel ) { icon add icon = resource manager load image ( " images / plus png " ) ; docking action add action = new docking action ( " extension tools " , " add extension " ) { @ override public void action performed ( action context context ) { / / don ' t let the user attempt to install anything if they don ' t have write / / permissions on the installation dir resource file install dir = application get application layout ( ) get extension installation dirs ( ) get ( 0 ) ; if ( ! install dir exists ( ) & & ! install dir mkdir ( ) ) { msg show error ( this , null , " directory error " , " cannot install / uninstall extensions : failed to create extension installation directory \ n " + " see the \ " ghidra extension notes \ " section of the ghidra installation guide for more information " ) ; } if ( ! install dir can write ( ) ) { msg show error ( this , null , " permissions error " , " cannot install / uninstall extensions : invalid write permissions on installation directory \ n " + " see the \ " ghidra extension notes \ " section of the ghidra installation guide for more information " ) ; return ; } ghidra file chooser chooser = new ghidra file chooser ( get component ( ) ) ; chooser set file selection mode ( ghidra file chooser mode files and directories ) ; chooser set title ( " select extension " ) ; chooser add file filter ( new extension file filter ( ) ) ; list < file > files = chooser get selected files ( ) ; for ( file file : files ) { try { if ( ! extension utils is extension ( new resource file ( file ) ) ) { msg show error ( this , null , " installation error " , " selected file : [ " + file get name ( ) + " ] is not a valid ghidra extension " ) ; continue ; } } catch ( extension exception e 1 ) { msg show error ( this , null , " installation error " , " error determining if [ " + file get name ( ) + " ] is a valid ghidra extension " , e 1 ) ; continue ; } if ( ! has correct version ( file ) ) { msg show error ( this , null , " installation error " , " extension version for [ " + file get name ( ) + " ] is incompatible with ghidra " ) ; continue ; } try { if ( extension utils install ( new resource file ( file ) ) ) { panel refresh table ( ) ; require restart = true ; } } catch ( exception e ) { msg error ( null , " problem installing extension [ " + file get name ( ) + " ] " , e ) ; } } } } ; string group = " extension tools " ; add action set menu bar data ( new menu data ( new string [ ] { " add extension " } , add icon , group ) ) ; add action set tool bar data ( new tool bar data ( add icon , group ) ) ; add action set help location ( new help location ( generic help topics front end , " extension tools " ) ) ; add action set description ( system utilities is in development mode ( ) ? " add extension ( disabled in development mode ) " : " add extension " ) ; add action set enabled ( ! system utilities is in development mode ( ) & & ! application in single jar mode ( ) ) ; add action ( add action ) ; }


executed when a shard returns a fetch result

protected void on fetch result ( int shard index ) { }


test changing name and source on existing symbol in only latest

public void test change symbol name source only in latest ( ) throws exception { / / 01002721 : primary global " xxx " mtf initialize ( " notepad merge listing test " , new program modifier listener ( ) { / * ( non - javadoc ) * @ see ghidra framework data program modifier listener # modify latest ( ghidra program database program d b ) * / @ override public void modify latest ( program d b program ) { int tx id = program start transaction ( " modify my program " ) ; boolean commit = false ; try { symbol symbol = get unique symbol ( program , " xxx " ) ; assert equals ( source type user defined , symbol get source ( ) ) ; symbol set name ( " new name " , source type analysis ) ; commit = true ; } catch ( exception e ) { assert fail ( e get message ( ) ) ; } finally { program end transaction ( tx id , commit ) ; } } / * ( non - javadoc ) * @ see ghidra framework data program modifier listener # modify private ( ghidra program database program d b ) * / @ override public void modify private ( program d b program ) { / / no changes for my program } } ) ; execute merge ( ask user ) ; wait for merge completion ( ) ; symbol s ; s = get unique symbol ( result program , " xxx " ) ; assert null ( s ) ; s = get unique symbol ( result program , " new name " ) ; check symbol ( s , " new name " , true ) ; assert equals ( source type analysis , s get source ( ) ) ; }


the amazon resource name ( arn ) of the role to assume

public string get role arn ( ) { return this role arn ; }


compare all the fields and embedded anomaly records ( if any )

public boolean equals ( object other ) { if ( this = = other ) { return true ; } if ( other instanceof overall bucket = = false ) { return false ; } overall bucket that = ( overall bucket ) other ; return objects equals ( this timestamp , that timestamp ) & & this bucket span = = that bucket span & & this overall score = = that overall score & & objects equals ( this jobs , that jobs ) & & this is interim = = that is interim ; }


public static void verify increment pub content ( string content ) { if ( content = = null | | content length ( ) = = 0 ) { throw new illegal argument exception ( " / " ) ; } for ( int i = 0 ; i < content length ( ) ; i + + ) { char c = content char at ( i ) ; if ( c = = ' \ r ' | | c = = ' \ n ' ) { throw new illegal argument exception ( " / " ) ; } if ( c = = constants word separator char at ( 0 ) ) { throw new illegal argument exception ( " / ( char ) 2 " ) ; } } }


parses the given settings and creates the appropriate { @ link distribution }

private static distribution parse distribution ( settings settings ) { string raw distribution = settings get ( " distribution " ) ; distribution distribution = distributions get ( raw distribution ) ; if ( distribution = = null ) { throw new illegal argument exception ( " unsupported distribution [ " + raw distribution + " ] " ) ; } return distribution ; }


get { @ link content summary } rooted at the specified directory

content summary get content summary ( string src ) throws i o exception { check open ( ) ; try ( trace scope ignored = new path trace scope ( " get content summary " , src ) ) { return namenode get content summary ( src ) ; } catch ( remote exception re ) { throw re unwrap remote exception ( access control exception class , file not found exception class , unresolved path exception class ) ; } }


protected void handle saml 2 profile sso post request ( final http servlet response response , final http servlet request request ) throws exception { val decoder = get saml profile handler configuration context ( ) get saml message decoders ( ) get instance ( http method post ) ; handle sso post profile request ( response , request , decoder ) ; }


tests that track selector will select audio tracks with lower num channel when other factors are the same , and tracks exceed renderer ' s capabilities

public void select tracks exceeding capabilities select lower num channel ( ) throws exception { format builder format builder = audio format build upon ( ) ; format higher channel format = format builder set channel count ( 6 ) build ( ) ; format lower channel format = format builder set channel count ( 2 ) build ( ) ; track group array track groups = wrap formats ( higher channel format , lower channel format ) ; track selector result result = track selector select tracks ( new renderer capabilities [ ] { all audio format exceeded renderer capabilities } , track groups , period id , timeline ) ; assert fixed selection ( result selections get ( 0 ) , track groups , lower channel format ) ; }


returns true if field success is set ( has been assigned a value ) and false otherwise

public boolean is set success ( ) { return this success ! = null ; }


move started shards that can not be allocated to a node anymore for each shard to be moved this function executes a move operation to the minimal eligible node with respect to the weight function if a shard is moved the shard will be set to { @ link shard routing state # relocating } and a shadow instance of this shard is created with an incremented version in the state { @ link shard routing state # initializing }

public void move shards ( ) { / / iterate over the started shards interleaving between nodes , and check if they can remain in the presence of throttling / / shard movements , the goal of this iteration order is to achieve a fairer movement of shards from the nodes that are / / offloading the shards for ( iterator < shard routing > it = allocation routing nodes ( ) node interleaved shard iterator ( ) ; it has next ( ) ; ) { shard routing shard routing = it next ( ) ; final move decision move decision = decide move ( shard routing ) ; if ( move decision is decision taken ( ) & & move decision force move ( ) ) { final model node source node = nodes get ( shard routing current node id ( ) ) ; final model node target node = nodes get ( move decision get target node ( ) get id ( ) ) ; source node remove shard ( shard routing ) ; tuple < shard routing , shard routing > relocating shards = routing nodes relocate shard ( shard routing , target node get node id ( ) , allocation cluster info ( ) get shard size ( shard routing , shard routing unavailable expected shard size ) , allocation changes ( ) ) ; target node add shard ( relocating shards v 2 ( ) ) ; if ( logger is trace enabled ( ) ) { logger trace ( " moved shard [ { } ] to node [ { } ] " , shard routing , target node get routing node ( ) ) ; } } else if ( move decision is decision taken ( ) & & move decision can remain ( ) = = false ) { logger trace ( " [ { } ] [ { } ] can ' t move " , shard routing index ( ) , shard routing id ( ) ) ; } } }


check the passing conditions represent to affect all lines or not < br > do not pass anything to the conditions parameter means affect all lines

protected boolean is affect all lines ( object conditions ) { return conditions ! = null & & conditions length = = 0 ; }


removes a subscriber who no longer wishes to receive provider activation events

public void remove provider listener ( component provider activation listener listener ) { listeners remove ( listener ) ; }


< code > optional int 6 4 num = 4 ; < code >

public builder set num ( long value ) { bit field 0 | = 0x 0 0 0 0 0 0 0 8 ; num = value ; on changed ( ) ; return this ; }


tests saslplain authentication failure over plaintext with old version of client that does not support sasl authenticate headers and new version of server

public void old sasl plain plaintext client without sasl authenticate header failure ( ) throws exception { verify sasl authenticate header interop with failure ( true , false , security protocol sasl plaintext , " plain " ) ; }


standard initialisation for { @ link fair scheduler } rules , shared by all rules each rule that extends this abstract and overrides this method must call < code > super initialize ( ) < code > to run this basic initialisation

public boolean initialize ( resource scheduler scheduler ) throws i o exception { if ( ! ( scheduler instanceof fair scheduler ) ) { throw new i o exception ( get name ( ) + " rule can only be configured for the fair scheduler " ) ; } if ( get parent rule ( ) ! = null & & get parent rule ( ) get name ( ) equals ( get name ( ) ) ) { throw new i o exception ( " parent rule may not be the same type as the " + " child rule : " + get name ( ) ) ; } fair scheduler fs = ( fair scheduler ) scheduler ; queue manager = fs get queue manager ( ) ; return true ; }


{ @ inherit doc } the implementation for { @ link token tag token } returns the token tag formatted with { @ code < } and { @ code > } delimiters

public string get text ( ) { if ( label ! = null ) { return " < " + label + " : " + token name + " > " ; } return " < " + token name + " > " ; }


returns the addresses that are in program 2 , but not in program 1 the returned address set is derived using program 2

public address set get addresses only in two ( ) { return new address set ( only in two ) ; }


delegates to the wrapped mbean server , but if a mbean is already registered with the specified name , the existing instance is returned

public object instance register m bean ( object object , object name name ) throws m bean registration exception , not compliant m bean exception { while ( true ) { try { / / try to register the mbean return mbean server register m bean ( object , name ) ; } catch ( instance already exists exception ignored ) { } try { / / a mbean is already installed , try to return the already registered instance object instance object instance = mbean server get object instance ( name ) ; log debug ( " % s already bound to % s " , name , object instance ) ; return object instance ; } catch ( instance not found exception ignored ) { / / the mbean was removed before we could get the reference / / start the whole process over again } } }


this method creates a mapping from each index source lookup variable ( directly applied to the index ) to the corresponding probe key input

private set multimap < variable reference expression , integer > map index source lookup variable to probe key input ( index join node node , map < variable reference expression , integer > probe key layout ) { set < variable reference expression > index join variables = node get criteria ( ) stream ( ) map ( index join node equi join clause : : get index ) collect ( to immutable set ( ) ) ; / / trace the index join variables to the index source lookup variables / / map : index join variable = > index source lookup variable map < variable reference expression , variable reference expression > index key trace = index join optimizer index key tracer trace ( node get index source ( ) , index join variables ) ; / / map the index join variables to the probe key input multimap < variable reference expression , integer > index to probe key input = hash multimap create ( ) ; for ( index join node equi join clause clause : node get criteria ( ) ) { index to probe key input put ( clause get index ( ) , probe key layout get ( clause get probe ( ) ) ) ; } / / create the mapping from index source look up variable to probe key input immutable set multimap builder < variable reference expression , integer > builder = immutable set multimap builder ( ) ; for ( map entry < variable reference expression , variable reference expression > entry : index key trace entry set ( ) ) { variable reference expression index join variable = entry get key ( ) ; variable reference expression index lookup variable = entry get value ( ) ; builder put all ( index join variable , index to probe key input get ( index lookup variable ) ) ; } return builder build ( ) ; }


test the property ' prefix wrapped array '

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


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


public attribute statement new attribute statement ( final map < string , object > attributes , final saml 2 0 attribute builder builder , final saml registered service saml registered service ) { val attr statement = saml utils new saml object ( attribute statement class ) ; val resp = saml id p properties get response ( ) ; val name formats = new hash map < > ( resp configure attribute name formats ( ) ) ; name formats put all ( saml registered service get attribute name formats ( ) ) ; val global friendly names = saml id p properties get attribute friendly names ( ) ; val friendly names = new hash map < > ( collection utils convert directed list to map ( global friendly names ) ) ; attribute definition store get attribute definitions ( ) stream ( ) filter ( defn - > defn instanceof saml id p attribute definition ) map ( saml id p attribute definition class : : cast ) filter ( defn - > string utils is not blank ( defn get friendly name ( ) ) ) for each ( defn - > friendly names put ( defn get key ( ) , defn get friendly name ( ) ) ) ; friendly names put all ( saml registered service get attribute friendly names ( ) ) ; for ( val e : attributes entry set ( ) ) { if ( e get value ( ) instanceof collection < ? > & & ( ( collection < ? > ) e get value ( ) ) is empty ( ) ) { logger info ( " skipping attribute [ { } ] because it does not have any values " , e get key ( ) ) ; continue ; } val friendly name = friendly names get or default ( e get key ( ) , null ) ; val name = attribute definition store locate attribute definition ( e get key ( ) ) map ( attribute definition : : get name ) filter ( string utils : : is not blank ) or else get ( e : : get key ) ; logger trace ( " creating saml attribute [ { } ] with value [ { } ] , friendly name [ { } ] " , name , e get value ( ) , friendly name ) ; val attribute = new attribute ( friendly name , name , e get value ( ) , name formats , resp get default attribute name format ( ) , saml registered service get attribute value types ( ) ) ; logger trace ( " created saml attribute [ { } ] with nameid - format [ { } ] " , attribute get name ( ) , attribute get name format ( ) ) ; builder build ( attr statement , attribute ) ; } return attr statement ; }


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

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


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

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


tests if any view in the hierarchy under the root , for which the path is visible , is displaying the requested drawable by the given resource id for this assertion to work , robolectric must be immediately available and be able to load the drawable corresponding to this resource id

public view tree assert has visible drawable ( final int resource id ) { has visible drawable ( runtime environment application get resources ( ) get drawable ( resource id ) ) ; return this ; }


returns a list of lists containing the ids of the nodes in the transformation graph that correspond to the provided transformations each transformation may have multiple nodes parent transformations will be translated if they are not already translated

private list < collection < integer > > get parent input ids ( @ nullable final collection < transformation < ? > > parent transformations ) { final list < collection < integer > > all input ids = new array list < > ( ) ; if ( parent transformations = = null ) { return all input ids ; } for ( transformation < ? > transformation : parent transformations ) { all input ids add ( transform ( transformation ) ) ; } return all input ids ; }


public void update n clob ( string column label , reader reader , long length ) throws s q l exception { }


get the value of the < code > name < code > property as an < code > int < code > if no such property exists , the provided default value is returned , or if the specified value is not a valid < code > int < code > , then an error is thrown

public int get int ( string name , int default value ) { string value string = get trimmed ( name ) ; if ( value string = = null ) return default value ; string hex string = get hex digits ( value string ) ; if ( hex string ! = null ) { return integer parse int ( hex string , 16 ) ; } return integer parse int ( value string ) ; }


gets the current value of the given counter

public static long get long counter value ( native azure file system fs , string counter name ) { return get long counter ( counter name , get metrics ( fs get instrumentation ( ) ) ) ; }


public static void register discriminator ( class < ? > model class , string discriminator property name , map < string , class < ? > > mappings ) { class discriminator mapping m = new class discriminator mapping ( model class , discriminator property name , mappings ) ; model discriminators put ( model class , m ) ; }


set the jndi template to use for jndi lookups

public void set jndi template ( object jndi template ) { this jndi environment = jndi template ; }


does the database use upper case for identifiers ?

protected boolean is stores upper case identifiers ( ) { return this stores upper case identifiers ; }


controls the choice of algorithm used to select interesting terms the default value is true which means terms are selected based on significance ( see the { @ link significant terms } aggregation ) rather than popularity ( using the { @ link terms aggregator } )

public void use significance ( boolean value ) { this use significance = value ; }


sets the < code > array array number < code > property

public void set array array number ( list < list < big decimal > > array array number ) { this array array number = array array number ; }


this older version of this method is kept around for compatibility because downstream frameworks like spark and tez have been using it downstream frameworks are expected to move off of it

public static void add to environment ( map < string , string > environment , string variable , string value ) { add to environment ( environment , variable , value , file path separator ) ; }


add include directories to be added with " - isystem " it can be either relative to the exec root ( see { @ link com google devtools build lib analysis blaze directories # get exec root ( string ) } ) or absolute before it is stored , the include directory is normalized

public builder add system include dirs ( iterable < path fragment > system include dirs ) { this system include dirs add all ( system include dirs ) ; return this ; }


private void op copy block ( data input stream in ) throws i o exception { op copy block proto proto = op copy block proto parse from ( vint prefixed ( in ) ) ; trace scope trace scope = continue trace span ( proto get header ( ) , proto get class ( ) get simple name ( ) ) ; try { copy block ( p b helper client convert ( proto get header ( ) get block ( ) ) , p b helper client convert ( proto get header ( ) get token ( ) ) ) ; } finally { if ( trace scope ! = null ) trace scope close ( ) ; } }


default void on shut down ( ) { get executor service ( ) shutdown now ( ) ; }


tests that disabling client authentication as a listener override has the desired effect

public void test listener config override ( args args ) throws exception { string node = " 0 " ; listener name client listener name = new listener name ( " client " ) ; args ssl server configs put ( broker security configs ssl client auth config , " required " ) ; args ssl server configs put ( client listener name config prefix ( ) + broker security configs ssl client auth config , " none " ) ; / / ` client ` listener is not configured at this point , so client auth should be required server = create echo server ( args , security protocol ssl ) ; inet socket address addr = new inet socket address ( " localhost " , server port ( ) ) ; / / connect with client auth should work fine create selector ( args ssl client configs ) ; selector connect ( node , addr , buffer size , buffer size ) ; network test utils check client connection ( selector , node , 100 , 10 ) ; selector close ( ) ; / / remove client auth , so connection should fail cert stores keystore props for each ( args ssl client configs : : remove ) ; create selector ( args ssl client configs ) ; selector connect ( node , addr , buffer size , buffer size ) ; network test utils wait for channel close ( selector , node , channel state state authentication failed ) ; selector close ( ) ; server close ( ) ; / / listener - specific config should be used and client auth should be disabled server = create echo server ( args , client listener name , security protocol ssl ) ; addr = new inet socket address ( " localhost " , server port ( ) ) ; / / connect without client auth should work fine now create selector ( args ssl client configs ) ; selector connect ( node , addr , buffer size , buffer size ) ; network test utils check client connection ( selector , node , 100 , 10 ) ; }


public void test get store mode ( ) { assertions assert equals ( " file " , parameter parser get store mode ( ) ) ; }


set the offset variable string ( e g { @ code " # { offset } " } )

public t offset ( string variable ) { sql ( ) offset = variable ; sql ( ) limiting rows strategy = s q l statement limiting rows strategy offset limit ; return get self ( ) ; }


converts the given thread pool executor into an executor service that exits when the application is complete it does so by using daemon threads and adding a shutdown hook to wait for their completion this is mainly for fixed thread pools see { @ link executors # new fixed thread pool ( int ) }

public static executor service get exiting executor service ( thread pool executor executor , duration termination timeout ) { return get exiting executor service ( executor , to nanos saturated ( termination timeout ) , time unit nanoseconds ) ; }


setup a fresh mini d f s and a mini k m s the reset kms parameter controls whether the mini k m s will start fresh or reuse the existing data

private void setup ( configuration conf , boolean reset kms ) throws exception { setup ( conf , reset kms , true ) ; }


public date get entry date ( ) { return date ; }


public static int get screen width ( ) { window manager wm = ( window manager ) utils get app ( ) get system service ( context window service ) ; if ( wm = = null ) return - 1 ; point point = new point ( ) ; if ( build version sdk int > = build version codes jelly bean mr1 ) { wm get default display ( ) get real size ( point ) ; } else { wm get default display ( ) get size ( point ) ; } return point x ; }


delete user { username } : delete user this can only be done by the logged in user

response entity < void > delete user ( @ api param ( value = " the name that needs to be deleted " , required = true ) @ path variable ( " username " ) string username ) ;


returns true if there is at least one tool listening to this tool ' s plugin events

public boolean has tool listeners ( ) { return event mgr has tool listeners ( ) ; }


gets the right side function ' s entry point address

private address get right function address ( ) { if ( functions [ right ] ! = null ) { return functions [ right ] get entry point ( ) ; } return null ; }


do client side sasl authentication with server via the given ipc streams

public auth method sasl connect ( ipc streams ipc streams ) throws i o exception { / / redefined if / when a sasl negotiation starts , can be queried if the / / negotiation fails auth method = auth method simple ; send sasl message ( ipc streams out , negotiate request ) ; / / loop until sasl is complete or a rpc error occurs boolean done = false ; do { byte buffer bb = ipc streams read response ( ) ; rpc writable buffer sasl packet = rpc writable buffer wrap ( bb ) ; rpc response header proto header = sasl packet get value ( rpc response header proto get default instance ( ) ) ; switch ( header get status ( ) ) { case error : / / might get a rpc error during case fatal : throw new remote exception ( header get exception class name ( ) , header get error msg ( ) ) ; default : break ; } if ( header get call id ( ) ! = auth protocol sasl call id ) { throw new sasl exception ( " non - sasl response during negotiation " ) ; } rpc sasl proto sasl message = sasl packet get value ( rpc sasl proto get default instance ( ) ) ; if ( sasl packet remaining ( ) > 0 ) { throw new sasl exception ( " received malformed response length " ) ; } / / handle sasl negotiation process rpc sasl proto builder response = null ; switch ( sasl message get state ( ) ) { case negotiate : { / / create a compatible sasl client , throws if no supported auths sasl auth sasl auth type = select sasl client ( sasl message get auths list ( ) ) ; / / define auth being attempted , caller can query if connect fails auth method = auth method value of ( sasl auth type get method ( ) ) ; byte [ ] response token = null ; if ( auth method = = auth method simple ) { / / switching to simple done = true ; / / not going to wait for success ack } else { byte [ ] challenge token = null ; if ( sasl auth type has challenge ( ) ) { / / server provided the first challenge challenge token = sasl auth type get challenge ( ) to byte array ( ) ; sasl auth type = sasl auth new builder ( sasl auth type ) clear challenge ( ) build ( ) ; } else if ( sasl client has initial response ( ) ) { challenge token = new byte [ 0 ] ; } response token = ( challenge token ! = null ) ? sasl client evaluate challenge ( challenge token ) : new byte [ 0 ] ; } response = create sasl reply ( sasl state initiate , response token ) ; response add auths ( sasl auth type ) ; break ; } case challenge : { if ( sasl client = = null ) { / / should probably instantiate a client to allow a server to / / demand a specific negotiation throw new sasl exception ( " server sent unsolicited challenge " ) ; } byte [ ] response token = sasl evaluate token ( sasl message , false ) ; response = create sasl reply ( sasl state response , response token ) ; break ; } case success : { / / simple server sends immediate success to a sasl client for / / switch to simple if ( sasl client = = null ) { auth method = auth method simple ; } else { sasl evaluate token ( sasl message , true ) ; } done = true ; break ; } default : { throw new sasl exception ( " rpc client doesn ' t support sasl " + sasl message get state ( ) ) ; } } if ( response ! = null ) { send sasl message ( ipc streams out , response build ( ) ) ; } } while ( ! done ) ; return auth method ; }


configure with the provided { @ link serde serde < k > } for the key

public stream joined < k , v1 , v2 > with key serde ( final serde < k > key serde ) { return new stream joined < > ( key serde , value serde , other value serde , this store supplier , other store supplier , name , store name , logging enabled , topic config ) ; }


constructs a cluster info service which may be mocked for tests

protected cluster info service new cluster info service ( settings settings , cluster service cluster service , thread pool thread pool , node client client ) { final internal cluster info service service = new internal cluster info service ( settings , cluster service , thread pool , client ) ; if ( discovery node is master node ( settings ) ) { / / listen for state changes ( this node starts / stops being the elected master , or new nodes are added ) cluster service add listener ( service ) ; } return service ; }


adds a download defined by the given request

public void add download ( download request request ) { add download ( request , stop reason none ) ; }


when the request resources is the first in a stream , the initial resource versions must be populated otherwise , initial resource versions must be omitted the keys are the resources names of the mcp resources known to the mcp client the values in the map are the associated resource level version info < code > map & lt ; string , string & gt ; initial resource versions = 3 ; < code >

public java lang string get initial resource versions or default ( java lang string key , java lang string default value ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } java util map < java lang string , java lang string > map = internal get initial resource versions ( ) get map ( ) ; return map contains key ( key ) ? map get ( key ) : default value ; }


public list < command > get commands ( ) { return new array list < > ( commands ) ; }


public generic drawee hierarchy builder set progress bar image ( int resource id ) { m progress bar image = m resources get drawable ( resource id ) ; return this ; }


get the container to which this client is bound

public string get container ( ) { return container ; }


should script context cache statistics be returned

public nodes stats request builder set script cache ( boolean script cache ) { add or remove metric ( script cache , nodes stats request metric script cache ) ; return this ; }


parses a top level query including the query element that wraps it

private static query builder parse top level query builder ( string field name , x content parser parser ) { try { query builder query builder = null ; x content parser token first = parser next token ( ) ; if ( first = = null ) { return null ; } else if ( first ! = x content parser token start object ) { throw new parsing exception ( parser get token location ( ) , " expected [ " + x content parser token start object + " ] but found [ " + first + " ] " , parser get token location ( ) ) ; } for ( x content parser token token = parser next token ( ) ; token ! = x content parser token end object ; token = parser next token ( ) ) { if ( token = = x content parser token field name ) { string current name = parser current name ( ) ; if ( field name equals ( current name ) ) { query builder = parse inner query builder ( parser ) ; } else { throw new parsing exception ( parser get token location ( ) , " request does not support [ " + parser current name ( ) + " ] " ) ; } } } return query builder ; } catch ( parsing exception e ) { throw e ; } catch ( exception e ) { throw new parsing exception ( parser = = null ? null : parser get token location ( ) , " failed to parse " , e ) ; } }


see { @ link mutable configuration # remove cache entry listener configuration }

public void remove cache entry listener configuration ( cache entry listener configuration < k , v > cache entry listener configuration ) { delegate remove cache entry listener configuration ( cache entry listener configuration ) ; }


public void get transform ( matrix transform ) { if ( m transform callback ! = null ) { m transform callback get transform ( transform ) ; } else { transform reset ( ) ; } }


utility to create a { @ link thread pool executor }

public static thread pool executor get thread pool executor ( int core pool size , int max pool size , long keep alive time secs , string thread name prefix , boolean run rejected exec ) { return get thread pool executor ( core pool size , max pool size , keep alive time secs , new synchronous queue < > ( ) , thread name prefix , run rejected exec ) ; }


void on scroll response ( long last batch start time n s , int last batch size , scrollable hit source async response async response ) { scrollable hit source response response = async response response ( ) ; logger debug ( " [ { } ] : got scroll response with [ { } ] hits " , task get id ( ) , response get hits ( ) size ( ) ) ; if ( task is cancelled ( ) ) { logger debug ( " [ { } ] : finishing early because the task was cancelled " , task get id ( ) ) ; finish him ( null ) ; return ; } if ( / / if any of the shards failed that should abort the request ( response get failures ( ) size ( ) > 0 ) / / timeouts aren ' t shard failures but we still need to pass them back to the user | | response is timed out ( ) ) { refresh and finish ( empty list ( ) , response get failures ( ) , response is timed out ( ) ) ; return ; } long total = response get total hits ( ) ; if ( main request get max docs ( ) > 0 ) { total = min ( total , main request get max docs ( ) ) ; } worker set total ( total ) ; abstract runnable prepare bulk request runnable = new abstract runnable ( ) { @ override protected void do run ( ) throws exception { / * * it is important that the batch start time be calculated from here , scroll response to scroll response that way the time * waiting on the scroll doesn ' t count against this batch in the throttle * / prepare bulk request ( system nano time ( ) , async response ) ; } @ override public void on failure ( exception e ) { finish him ( e ) ; } } ; prepare bulk request runnable = ( abstract runnable ) thread pool get thread context ( ) preserve context ( prepare bulk request runnable ) ; worker delay prepare bulk request ( thread pool , last batch start time n s , last batch size , prepare bulk request runnable ) ; }


creates a { @ link local stream environment } the local execution environment will run the program in a multi - threaded fashion in the same jvm as the environment was created in the default parallelism of the local environment is the number of hardware contexts ( cpu cores threads ) , unless it was specified differently by { @ link # set parallelism ( int ) }

public static local stream environment create local environment ( ) { return create local environment ( default local parallelism ) ; }


public long get corrupt e c block groups ( ) { return corrupt replicas get corrupt e c block groups ( ) ; }