public byte [ ] raw value ( final v value ) { try { return value serde serializer ( ) serialize ( topic , value ) ; } catch ( final class cast exception e ) { final string value class ; final class < ? extends serializer > serializer class ; if ( value serializer ( ) instanceof value and timestamp serializer ) { serializer class = ( ( value and timestamp serializer ) value serializer ( ) ) value serializer get class ( ) ; value class = value = = null ? " unknown because value is null " : ( ( value and timestamp ) value ) value ( ) get class ( ) get name ( ) ; } else { serializer class = value serializer ( ) get class ( ) ; value class = value = = null ? " unknown because value is null " : value get class ( ) get name ( ) ; } throw new streams exception ( string format ( " a serializer ( % s ) is not compatible to the actual value type " + " ( value type : % s ) change the default serdes in stream config or " + " provide correct serdes via method parameters " , serializer class get name ( ) , value class ) , e ) ; } }


probes the supplied { @ code start bytes } byte [ ] array to determine if this filesystem implementation can handle the file

public boolean probe start bytes ( fsrl container f s r l , byte [ ] start bytes ) ;


returns the object corresponding to the provided path if present , null otherwise

public < t > t evaluate ( string path , stash stash ) throws i o exception { string [ ] parts = parse path ( path ) ; object object = this object ; for ( string part : parts ) { object = evaluate ( part , object , stash ) ; if ( object = = null ) { return null ; } } return ( t ) object ; }


this returns selenium remote control logs associated with the session id

public synchronized string get log ( session id session id ) throws i o exception { / / todo ( chandra ) : provide option to clear logs after get log ( ) string logs = formatted records ( session id ) ; logs = " \ n < rc logs rc session id = " + session id + " > \ n " + logs + " \ n < / rc logs > \ n " ; return logs ; }


copies a value from a specified path into the cache , computing the cache key itself

public synchronized string put ( path source path , key type key type , string canonical id ) throws i o exception , interrupted exception { string cache key = get checksum ( key type , source path ) ; put ( cache key , source path , key type , canonical id ) ; return cache key ; }


void on search complete ( search result result ) ;


deserialize the body of the { @ link abstract symbol information } according to the gsi versions prior to 7 00 specification

private void deserialize gsi pre 7 0 hash table ( pdb byte reader reader , task monitor monitor ) throws pdb exception , cancelled exception { int num buckets bytes = 4 * ( num hash records + 1 ) ; if ( reader num remaining ( ) < num buckets bytes ) { throw new pdb exception ( " not enough data for gsi " ) ; } int num records bytes = ( reader num remaining ( ) - num buckets bytes ) ; pdb byte reader hash records reader = reader get sub pdb byte reader ( num records bytes ) ; pdb byte reader buckets reader = reader get sub pdb byte reader ( num buckets bytes ) ; if ( reader has more ( ) ) { throw new pdb exception ( " unexpected extra information at and of gsi stream " ) ; } hash bucket offsets = new array list < > ( ) ; while ( buckets reader has more ( ) ) { monitor check canceled ( ) ; hash bucket offsets add ( buckets reader parse int ( ) ) ; } / / note : each offset value is into an array of structures that are 12 bytes in length , but / / whose on - disk size is 8 bytes these are the structures in the hash records reader so / / take the offset and multiple by 2 / 3 to get the byte offset into the reader for the / / actual record still need to deal with the collision logic after that deserialize hash records ( hash records reader , monitor ) ; }


if the file doesn ' t exists locally , retrieve the file from the blob - service

public future < path > create tmp file ( string name , distributed cache entry entry , job i d job i d , execution attempt i d execution id ) throws exception { synchronized ( lock ) { map < string , future < path > > job entries = entries compute if absent ( job i d , k - > new hash map < > ( ) ) ; / / register reference holder final set < execution attempt i d > ref holders = job ref holders compute if absent ( job i d , id - > new hash set < > ( ) ) ; ref holders add ( execution id ) ; future < path > file entry = job entries get ( name ) ; if ( file entry ! = null ) { / / file is already in the cache return a future that / / immediately returns the file return file entry ; } else { / / need to copy the file / / create the target path file temp dir to use = new file ( storage directories [ next directory + + ] , job i d to string ( ) ) ; if ( next directory > = storage directories length ) { next directory = 0 ; } / / kick off the copying callable < path > cp ; if ( entry blob key ! = null ) { cp = new copy from blob process ( entry , job i d , blob service , new path ( temp dir to use get absolute path ( ) ) ) ; } else { cp = new copy from d f s process ( entry , new path ( temp dir to use get absolute path ( ) ) ) ; } future task < path > copy task = new future task < > ( cp ) ; executor service submit ( copy task ) ; / / store our entry job entries put ( name , copy task ) ; return copy task ; } } }


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

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


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


helper method to create an intercepted object for finer control over the generated instance , use a new instance of < code > enhancer < code > instead of this static method

public static object create ( class superclass , class [ ] interfaces , callback filter filter , callback [ ] callbacks ) { enhancer e = new enhancer ( ) ; e set superclass ( superclass ) ; e set interfaces ( interfaces ) ; e set callback filter ( filter ) ; e set callbacks ( callbacks ) ; return e create ( ) ; }


public static binary row data get 2 4 bytes binary row ( ) { / / header ( 8 bytes ) + 2 * string in fixed - length part ( 8 bytes each ) binary row data row = new binary row data ( 2 ) ; binary row writer writer = new binary row writer ( row ) ; writer write string ( 0 , string data from string ( random string utils random numeric ( 2 ) ) ) ; writer write string ( 1 , string data from string ( random string utils random numeric ( 2 ) ) ) ; writer complete ( ) ; return row ; }


report a required record to the data store the data store uses this to createmaintain storage for the record

public class < r > get record class ( ) { return this record class ; }


emulating retrying create root dir not to raise node exist exception

private void test retrying create root dir ( ) throws exception { create ( znode working path ) ; }


match a list item with the search query , case insensitive

public static boolean matches ( string query , string name ) { if ( name = = null | | name is empty ( ) ) { return false ; } return name to lower case ( ) contains ( query ) ; }


public void small snake test ( ) { / / todo : test small snake }


creates a placement constraint that has to be satisfied within a time window

public static timed placement constraint timed clock constraint ( abstract constraint constraint , long delay , time unit time unit ) { return new timed placement constraint ( constraint , time unit to millis ( delay ) , timed placement constraint delay unit milliseconds ) ; }


initializes paint objects and sets desired attributes

private void init ( context context , attribute set attrs , int def style ) { / / initialize paint objects paint = new paint ( ) ; paint set anti alias ( true ) ; paint border = new paint ( ) ; paint border set anti alias ( true ) ; paint border set style ( paint style stroke ) ; paint selector border = new paint ( ) ; paint selector border set anti alias ( true ) ; / / enable software rendering on honey comb and up ( needed for shadow ) if ( build version sdk int > = build version codes honeycomb ) set layer type ( layer type software , null ) ; / / load the styled attributes and set their properties typed array attributes = context obtain styled attributes ( attrs , r styleable circular image view , def style , 0 ) ; / / check for extra features being enabled has border = attributes get boolean ( r styleable circular image view civ border , false ) ; has selector = attributes get boolean ( r styleable circular image view civ selector , false ) ; shadow enabled = attributes get boolean ( r styleable circular image view civ shadow , shadow enabled ) ; / / set border properties , if enabled if ( has border ) { int default border size = ( int ) ( 2 * context get resources ( ) get display metrics ( ) density + 0 5f ) ; set border width ( attributes get dimension pixel offset ( r styleable circular image view civ border width , default border size ) ) ; set border color ( attributes get color ( r styleable circular image view civ border color , color white ) ) ; } / / set selector properties , if enabled if ( has selector ) { int default selector size = ( int ) ( 2 * context get resources ( ) get display metrics ( ) density + 0 5f ) ; set selector color ( attributes get color ( r styleable circular image view civ selector color , color transparent ) ) ; set selector stroke width ( attributes get dimension pixel offset ( r styleable circular image view civ selector stroke width , default selector size ) ) ; set selector stroke color ( attributes get color ( r styleable circular image view civ selector stroke color , color blue ) ) ; } / / set shadow properties , if enabled if ( shadow enabled ) { shadow radius = attributes get float ( r styleable circular image view civ shadow radius , shadow radius ) ; shadow dx = attributes get float ( r styleable circular image view civ shadow dx , shadow dx ) ; shadow dy = attributes get float ( r styleable circular image view civ shadow dy , shadow dy ) ; shadow color = attributes get color ( r styleable circular image view civ shadow color , shadow color ) ; set shadow enabled ( true ) ; } / / we no longer need our attributes typed array , give it back to cache attributes recycle ( ) ; }


accepts an xds client and starts a watch

public void start ( xds client xds client ) { check state ( this xds client = = null , " start ( ) called more than once " ) ; check not null ( xds client , " xds client " ) ; this xds client = xds client ; this listener watcher = new xds client listener watcher ( ) { @ override public void on listener changed ( xds client listener update update ) { cur listener = update get listener ( ) ; report success ( ) ; } @ override public void on resource does not exist ( string resource name ) { logger log ( level warning , " resource { 0 } is unavailable " , resource name ) ; cur listener = null ; report error ( status not found with description ( resource name ) ) ; } @ override public void on error ( status error ) { logger log ( level warning , " listener watcher in xds client wrapper for server sds : { 0 } " , error ) ; report error ( error ) ; } } ; xds client watch listener data ( port , listener watcher ) ; }


sets a node labels provider to the node manager

void set node labels provider ( node labels provider provider ) ;


public string type name ( ) { return " byte " ; }


returns the values from each provided array combined into a single array for example , { @ code concat ( new short [ ] { a , b } , new short [ ] { } , new short [ ] { c } } returns the array { @ code { a , b , c } }

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


handle incoming web socket messages from clients

public void handle message from client ( web socket session session , web socket message < ? > web socket message , message channel output channel ) { list < message < byte [ ] > > messages ; try { byte buffer byte buffer ; if ( web socket message instanceof text message ) { byte buffer = byte buffer wrap ( ( ( text message ) web socket message ) as bytes ( ) ) ; } else if ( web socket message instanceof binary message ) { byte buffer = ( ( binary message ) web socket message ) get payload ( ) ; } else { return ; } buffering stomp decoder decoder = this decoders get ( session get id ( ) ) ; if ( decoder = = null ) { if ( ! session is open ( ) ) { logger trace ( " dropped inbound web socket message due to closed session " ) ; return ; } throw new illegal state exception ( " no decoder for session id ' " + session get id ( ) + " ' " ) ; } messages = decoder decode ( byte buffer ) ; if ( messages is empty ( ) ) { if ( logger is trace enabled ( ) ) { logger trace ( " incomplete stomp frame content received in session " + session + " , buffer size = " + decoder get buffer size ( ) + " , buffer size limit = " + decoder get buffer size limit ( ) + " " ) ; } return ; } } catch ( throwable ex ) { if ( logger is error enabled ( ) ) { logger error ( " failed to parse " + web socket message + " in session " + session get id ( ) + " sending stomp error to client " , ex ) ; } handle error ( session , ex , null ) ; return ; } for ( message < byte [ ] > message : messages ) { stomp header accessor header accessor = message header accessor get accessor ( message , stomp header accessor class ) ; assert state ( header accessor ! = null , " no stomp header accessor " ) ; stomp command command = header accessor get command ( ) ; boolean is connect = stomp command connect equals ( command ) | | stomp command stomp equals ( command ) ; boolean sent = false ; try { header accessor set session id ( session get id ( ) ) ; header accessor set session attributes ( session get attributes ( ) ) ; header accessor set user ( get user ( session ) ) ; if ( is connect ) { header accessor set user change callback ( user - > { if ( user ! = null & & user ! = session get principal ( ) ) { this stomp authentications put ( session get id ( ) , user ) ; } } ) ; } header accessor set header ( simp message header accessor heart beat header , header accessor get heartbeat ( ) ) ; if ( ! detect immutable message interceptor ( output channel ) ) { header accessor set immutable ( ) ; } if ( logger is trace enabled ( ) ) { logger trace ( " from client : " + header accessor get short log message ( message get payload ( ) ) ) ; } if ( is connect ) { this stats increment connect count ( ) ; } else if ( stomp command disconnect equals ( command ) ) { this stats increment disconnect count ( ) ; } try { simp attributes context holder set attributes from message ( message ) ; sent = output channel send ( message ) ; if ( sent ) { if ( this event publisher ! = null ) { principal user = get user ( session ) ; if ( is connect ) { publish event ( this event publisher , new session connect event ( this , message , user ) ) ; } else if ( stomp command subscribe equals ( command ) ) { publish event ( this event publisher , new session subscribe event ( this , message , user ) ) ; } else if ( stomp command unsubscribe equals ( command ) ) { publish event ( this event publisher , new session unsubscribe event ( this , message , user ) ) ; } } } } finally { simp attributes context holder reset attributes ( ) ; } } catch ( throwable ex ) { if ( logger is debug enabled ( ) ) { logger debug ( " failed to send message to message channel in session " + session get id ( ) , ex ) ; } else if ( logger is error enabled ( ) ) { / / skip unsent connect messages ( likely auth issues ) if ( ! is connect | | sent ) { logger error ( " failed to send message to message channel in session " + session get id ( ) + " : " + ex get message ( ) ) ; } } handle error ( session , ex , message ) ; } } }


called when the audio sink ' s position has increased for the first time since it was last paused or flushed

default void on position advancing ( long playout start system time ms ) { }


parses the given string as bytes the supported expressions are listed under { @ link memory size }

public static long parse bytes ( string text ) throws illegal argument exception { check not null ( text , " text " ) ; final string trimmed = text trim ( ) ; check argument ( ! trimmed is empty ( ) , " argument is an empty - or whitespace - only string " ) ; final int len = trimmed length ( ) ; int pos = 0 ; char current ; while ( pos < len & & ( current = trimmed char at ( pos ) ) > = ' 0 ' & & current < = ' 9 ' ) { pos + + ; } final string number = trimmed substring ( 0 , pos ) ; final string unit = trimmed substring ( pos ) trim ( ) to lower case ( locale us ) ; if ( number is empty ( ) ) { throw new number format exception ( " text does not start with a number " ) ; } final long value ; try { value = long parse long ( number ) ; / / this throws a number format exception on overflow } catch ( number format exception e ) { throw new illegal argument exception ( " the value ' " + number + " ' cannot be re represented as 6 4bit number ( numeric overflow ) " ) ; } final long multiplier = parse unit ( unit ) map ( memory unit : : get multiplier ) or else ( 1l ) ; final long result = value * multiplier ; / / check for overflow if ( result / multiplier ! = value ) { throw new illegal argument exception ( " the value ' " + text + " ' cannot be re represented as 6 4bit number of bytes ( numeric overflow ) " ) ; } return result ; }


static method with a type parameter number

public static int static number test ( number number ) { return number int value ( ) ; }


required : a list of server specifications < code > repeated istio networking v 1alpha 3 server servers = 1 ; < code >

public builder set servers ( int index , com alibaba nacos istio model server builder builder for value ) { if ( servers builder = = null ) { ensure servers is mutable ( ) ; servers set ( index , builder for value build ( ) ) ; on changed ( ) ; } else { servers builder set message ( index , builder for value build ( ) ) ; } return this ; }


return whether proxies created by this configuration should be prevented from being cast to { @ link advised }

public boolean is opaque ( ) { return this opaque ; }


public static boolean finish to activity ( @ non null final activity activity , final boolean is include self ) { return finish to activity ( activity , is include self , false ) ; }


custom collections with nested result map

void test select list with nested result map ( ) throws exception { string xml config = " org / apache / ibatis / submitted / custom collection handling / mapper config xml " ; sql session factory sql session factory = get sql session factory xml config ( xml config ) ; try ( sql session sql session = sql session factory open session ( ) ) { list < person > list = sql session select list ( " org apache ibatis submitted custom collection handling person mapper find with result map " ) ; assert equals ( 2 , list size ( ) ) ; assert equals ( 2 , list get ( 0 ) get contacts ( ) size ( ) ) ; assert equals ( 1 , list get ( 1 ) get contacts ( ) size ( ) ) ; assert equals ( " 3 wall street " , list get ( 0 ) get contacts ( ) get ( 1 ) get address ( ) ) ; } }


parse a list of arguments to to extract the { @ link expression } elements the input deque will be modified to remove the used elements

private expression parse expression ( deque < string > args ) throws i o exception { deque < expression > primaries = new linked list < expression > ( ) ; deque < expression > operators = new linked list < expression > ( ) ; expression prev expr = get expression ( and class ) ; while ( ! args is empty ( ) ) { string arg = args pop ( ) ; if ( " ( " equals ( arg ) ) { expression expr = parse expression ( args ) ; primaries add ( expr ) ; prev expr = new base expression ( ) { @ override public result apply ( path data item , int depth ) throws i o exception { return result pass ; } } ; / / stub the previous expression to be a non - op } else if ( " ) " equals ( arg ) ) { break ; } else if ( is expression ( arg ) ) { expression expr = get expression ( arg ) ; expr add arguments ( args ) ; if ( expr is operator ( ) ) { while ( ! operators is empty ( ) ) { if ( operators peek ( ) get precedence ( ) > = expr get precedence ( ) ) { expression op = operators pop ( ) ; op add children ( primaries ) ; primaries push ( op ) ; } else { break ; } } operators push ( expr ) ; } else { if ( ! prev expr is operator ( ) ) { expression and = get expression ( and class ) ; while ( ! operators is empty ( ) ) { if ( operators peek ( ) get precedence ( ) > = and get precedence ( ) ) { expression op = operators pop ( ) ; op add children ( primaries ) ; primaries push ( op ) ; } else { break ; } } operators push ( and ) ; } primaries push ( expr ) ; } prev expr = expr ; } else { throw new i o exception ( " unexpected argument : " + arg ) ; } } while ( ! operators is empty ( ) ) { expression operator = operators pop ( ) ; operator add children ( primaries ) ; primaries push ( operator ) ; } return primaries is empty ( ) ? get expression ( print class ) : primaries pop ( ) ; }


returns an array of names of all tables ( tables and views , both temporary and permanent ) registered in the namespace of the current catalog and database

public set < string > list tables ( ) { return list tables ( get current catalog ( ) , get current database ( ) ) ; }


testing the behavior in https : github comgoogleguavaissues 1 9 0 0 - this behavior may want to be changed ?

public void test map splitter extra value delimiter ( ) { try { comma splitter with key value separator ( " = " ) split ( " a = 1 , c = 2 = " ) ; fail ( ) ; } catch ( illegal argument exception expected ) { } }


returns { @ code true } if { @ code obj } is another { @ code range set } that contains the same ranges according to { @ link range # equals ( object ) }

boolean equals ( @ nullable decl object obj ) ;


set the converter that will convert incoming jms messages to listener method arguments , and objects returned from listener methods back to jms messages the default converter is a { @ link simple message converter } , which is able to handle { @ link javax jms bytes message bytes messages } , { @ link javax jms text message text messages } and { @ link javax jms object message object messages }

public void set message converter ( @ nullable message converter message converter ) { this message converter = message converter ; }


returns the creation date of this pef container the stamp follows the mac time - measurement scheme that is , the number of seconds measured from jan 1 , 1904

public int get date time stamp ( ) { return date time stamp ; }


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


the logic here is very similar to that of opening an input stream , because on windows java cannot create a regular file when asked to open a named pipe that doesn ' t exist

private output stream open named pipe output stream windows ( path file , duration timeout ) throws i o exception { long timeout millis remaining = timeout to millis ( ) ; / / can ' t use file is file ( ) on windows , but luckily there ' s an even simpler check ( that ' s not possible on * nix ) if ( ! file to string ( ) starts with ( win pipe prefix ) ) { throw new i o exception ( file + " is not a named pipe " ) ; } security manager sm = system get security manager ( ) ; if ( sm ! = null ) { sm check permission ( new special permission ( ) ) ; } / / try to open the file periodically until the timeout expires , then , if / / it ' s still not available throw the exception from file output stream while ( true ) { try { privileged output pipe opener privileged output pipe opener = new privileged output pipe opener ( file ) ; return access controller do privileged ( privileged output pipe opener ) ; } catch ( runtime exception e ) { if ( timeout millis remaining < = 0 ) { propagate privileged exception ( e ) ; } long this sleep = math min ( timeout millis remaining , pause time ms ) ; timeout millis remaining - = this sleep ; try { thread sleep ( this sleep ) ; } catch ( interrupted exception ie ) { thread current thread ( ) interrupt ( ) ; propagate privileged exception ( e ) ; } } } }


parses and returns the settings for connection limiting , for the file system with the given file system scheme

public static connection limiting settings from config ( configuration config , string fs scheme ) { check not null ( fs scheme , " fs scheme " ) ; check not null ( config , " config " ) ; final config option < integer > total limit option = core options file system connection limit ( fs scheme ) ; final config option < integer > limit in option = core options file system connection limit in ( fs scheme ) ; final config option < integer > limit out option = core options file system connection limit out ( fs scheme ) ; final int total limit = config get integer ( total limit option ) ; final int limit in = config get integer ( limit in option ) ; final int limit out = config get integer ( limit out option ) ; check limit ( total limit , total limit option ) ; check limit ( limit in , limit in option ) ; check limit ( limit out , limit out option ) ; / / create the settings only , if at least one limit is configured if ( total limit < = 0 & & limit in < = 0 & & limit out < = 0 ) { / / no limit configured return null ; } else { final config option < long > open timeout option = core options file system connection limit timeout ( fs scheme ) ; final config option < long > inactivity timeout option = core options file system connection limit stream inactivity timeout ( fs scheme ) ; final long open timeout = config get long ( open timeout option ) ; final long inactivity timeout = config get long ( inactivity timeout option ) ; check timeout ( open timeout , open timeout option ) ; check timeout ( inactivity timeout , inactivity timeout option ) ; return new connection limiting settings ( total limit = = - 1 ? 0 : total limit , limit in = = - 1 ? 0 : limit in , limit out = = - 1 ? 0 : limit out , open timeout , inactivity timeout ) ; } }


find a java beans { @ code property descriptor } for the given method , with the method either being the read method or the write method for that bean property

public static property descriptor find property for method ( method method ) throws beans exception { return find property for method ( method , method get declaring class ( ) ) ; }


sets a custom registry for the application metrics

public void set metric registry ( metric registry metric registry ) { this metric registry = metric registry ; }


parse the first " forwarded : for = " or " x - forwarded - for " header value to an { @ code inet socket address } representing the address of the client

public static inet socket address parse forwarded for ( http request request , @ nullable inet socket address remote address ) { int port = ( remote address ! = null ? remote address get port ( ) : " https " equals ( request get u r i ( ) get scheme ( ) ) ? 443 : 80 ) ; string forwarded header = request get headers ( ) get first ( " forwarded " ) ; if ( string utils has text ( forwarded header ) ) { string forwarded to use = string utils tokenize to string array ( forwarded header , " , " ) [ 0 ] ; matcher matcher = forwarded for pattern matcher ( forwarded to use ) ; if ( matcher find ( ) ) { string value = matcher group ( 1 ) trim ( ) ; string host = value ; int port separator idx = value last index of ( ' : ' ) ; if ( port separator idx > value last index of ( ' ] ' ) ) { host = value substring ( 0 , port separator idx ) ; port = integer parse int ( value substring ( port separator idx + 1 ) ) ; } return new inet socket address ( host , port ) ; } } string for header = request get headers ( ) get first ( " x - forwarded - for " ) ; if ( string utils has text ( for header ) ) { string host = string utils tokenize to string array ( for header , " , " ) [ 0 ] ; return new inet socket address ( host , port ) ; } return null ; }


parse the expected and actual strings as json and assert the two are " not similar " - i e they contain different attribute - value pairs regardless of formatting can compare in two modes , depending on { @ code strict } parameter value : { @ code true } : strict checking not extensible , and strict array ordering { @ code false } : lenient checking extensible , and non - strict array ordering

public void assert json not equal ( string expected , string actual , boolean strict ) throws exception { j s o n assert assert not equals ( expected , actual , strict ) ; }


private static void process command ( repository manager repository mgr , string cmd ) throws i o exception { user manager user mgr = repository mgr get user manager ( ) ; string [ ] args = split command ( cmd ) ; if ( add user command equals ( args [ 0 ] ) ) { / / add user string sid = args [ 1 ] ; char [ ] pwd hash = null ; if ( args length = = 4 & & args [ 2 ] content equals ( password option ) ) { pwd hash = args [ 3 ] to char array ( ) ; } try { user mgr add user ( sid , pwd hash ) ; log info ( " user ' " + sid + " ' added " ) ; } catch ( duplicate name exception e ) { log error ( " add user failed : user ' " + sid + " ' already exists " ) ; } } else if ( remove user command equals ( args [ 0 ] ) ) { / / remove user string sid = args [ 1 ] ; user mgr remove user ( sid ) ; log info ( " user ' " + sid + " ' removed " ) ; } else if ( reset user command equals ( args [ 0 ] ) ) { / / reset user string sid = args [ 1 ] ; char [ ] pwd hash = null ; if ( args length = = 4 & & args [ 2 ] content equals ( password option ) ) { pwd hash = args [ 3 ] to char array ( ) ; } if ( ! user mgr reset password ( sid , pwd hash ) ) { log info ( " failed to reset password for user ' " + sid + " ' " ) ; } else if ( pwd hash ! = null ) { log info ( " user ' " + sid + " ' password reset to specified password " ) ; } else { log info ( " user ' " + sid + " ' password reset to default password " ) ; } } else if ( set user dn command equals ( args [ 0 ] ) ) { / / set / add user with dn for pki string sid = args [ 1 ] ; x 5 0 0 principal x 5 0 0 user = new x 5 0 0 principal ( args [ 2 ] ) ; if ( user mgr is valid user ( sid ) ) { user mgr set distinguished name ( sid , x 5 0 0 user ) ; log info ( " user ' " + sid + " ' dn set ( " + x 5 0 0 user get name ( ) + " ) " ) ; } else { try { user mgr add user ( sid , x 5 0 0 user ) ; log info ( " user ' " + sid + " ' added with dn ( " + x 5 0 0 user get name ( ) + " ) and default password " ) ; } catch ( duplicate name exception e ) { / / should never occur } } } else if ( set admin command equals ( args [ 0 ] ) ) { / / set / add repository admin string sid = args [ 1 ] ; string rep name = args [ 2 ] ; if ( ! user mgr is valid user ( sid ) ) { try { user mgr add user ( sid ) ; log info ( " user ' " + sid + " ' added " ) ; } catch ( duplicate name exception e ) { return ; / / should never occur } } repository rep = repository mgr get repository ( rep name ) ; if ( rep = = null ) { log error ( " failed to add ' " + sid + " ' as admin , repository ' " + rep name + " ' not found " ) ; } else { rep add admin ( sid ) ; } } }


return a { @ link string } representation of the provided values that is typically used for scripts or for the ` map ` execution mode of terms aggs note : this is very slow !

public static sorted binary doc values to string ( final sorted numeric doc values values ) { return to string ( new to string values ( ) { @ override public boolean advance exact ( int doc ) throws i o exception { return values advance exact ( doc ) ; } @ override public void get ( list < char sequence > list ) throws i o exception { for ( int i = 0 , count = values doc value count ( ) ; i < count ; + + i ) { list add ( long to string ( values next value ( ) ) ) ; } } } ) ; }


dumps the fields of the object using the { @ code dumper }


returns the java call methods declared for a python object some python " methods " in the new - style python objects are actually classes in and of themselves , re - implementing call methods to tell us how to call them this returns an array of those methods ( for code completion help )

public static object [ ] get call methods ( py object obj ) { list < method > call method list = new array list < > ( ) ; method [ ] declared methods = obj get class ( ) get declared methods ( ) ; for ( method declared method : declared methods ) { if ( declared method get name ( ) equals ( " call " ) ) { call method list add ( declared method ) ; } } return call method list to array ( ) ; }


indicates whether or not the jetty alpn jar is installed in the boot classloader

static synchronized boolean is jetty alpn configured ( ) { try { class for name ( " org eclipse jetty alpn alpn " , true , null ) ; return true ; } catch ( class not found exception e ) { jetty alpn unavailability cause = e ; return false ; } }


returns the portion of this { @ code host address } instance that should represent the hostname or i pv 4 i pv 6 literal a successful parse does not imply any degree of sanity in this field for additional validation , see the { @ link com google common net host specifier } class

public string get host text ( ) { return host ; }


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


record that the tuple contains an element at the position provided

void set written ( int i ) { written set ( i ) ; }


checks if the specified url is pointing to the local file system and if it does , resolves the specified url against the list of configured repository roots if the specified url doesn ' t match any of the roots , returns null

public url resolve repo u r l ( url url ) { try { if ( " file " equals ignore case ( url get protocol ( ) ) ) { if ( url get host ( ) = = null | | " " equals ( url get host ( ) ) ) { / / only local file urls are supported path path = path utils get ( repo files , url to u r i ( ) ) ; if ( path = = null ) { / / couldn ' t resolve against known repo locations return null ; } / / normalize url return path to uri ( ) to u r l ( ) ; } return null ; } else if ( " jar " equals ( url get protocol ( ) ) ) { string file = url get file ( ) ; int pos = file index of ( " ! / " ) ; if ( pos < 0 ) { return null ; } string jar tail = file substring ( pos ) ; string file path = file substring ( 0 , pos ) ; url internal url = new url ( file path ) ; url normalized url = resolve repo u r l ( internal url ) ; if ( normalized url = = null ) { return null ; } return new url ( " jar " , " " , normalized url to external form ( ) + jar tail ) ; } else { / / it ' s not file or jar url and it didn ' t match the white list - reject return null ; } } catch ( malformed u r l exception ex ) { / / cannot make sense of this file url return null ; } catch ( u r i syntax exception ex ) { return null ; } }


public static elf symbol create section symbol 3 2 ( elf header header , long section address , short section header index , string name , int symbol index , elf symbol table symbol table ) { return new elf symbol ( header , name , 0 , section address , 0 , stt section , ( byte ) 0 , section header index , symbol index , symbol table ) ; }


adds an { @ link analytics listener } to receive analytics events

public void add analytics listener ( analytics listener listener ) { / / don ' t verify application thread we allow calls to this method from any thread assertions check not null ( listener ) ; analytics collector add listener ( listener ) ; }


the entries defined for this type < code > repeated aapt pb entry entry = 3 ; < code >

public builder remove entry ( int index ) { copy on write ( ) ; instance remove entry ( index ) ; return this ; }


generates a payload of desired type and size reads compressable buffer or uncompressable buffer as a circular buffer

private byte string generate payload ( byte string data buffer , int offset , int size ) { byte string payload = byte string empty ; / / this offset would never pass the array boundary int begin = offset ; int end = 0 ; int bytes left = size ; while ( bytes left > 0 ) { end = math min ( begin + bytes left , data buffer size ( ) ) ; / / byte string substring returns the substring from begin , inclusive , to end , exclusive payload = payload concat ( data buffer substring ( begin , end ) ) ; bytes left - = ( end - begin ) ; begin = end % data buffer size ( ) ; } return payload ; }


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


public void set background ( color color ) { root panel set background ( color ) ; }


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

public void load completed ( load event info load event info , media load data media load data ) { for ( listener and handler listener and handler : listener and handlers ) { media source event listener listener = listener and handler listener ; post or run ( listener and handler handler , ( ) - > listener on load completed ( window index , media period id , load event info , media load data ) ) ; } }


create a { @ link mock http servlet request builder } for a request with the given http method

public static mock http servlet request builder request ( http method http method , uri uri ) { return new mock http servlet request builder ( http method , uri ) ; }


protected void prepare consentable attributes ( final map < string , list < object > > attributes , final request context context ) { val builders = new array list < > ( application context get beans of type ( consentable attribute builder class , false , true ) values ( ) ) ; annotation aware order comparator sort if necessary ( builders ) ; val consentable attributes = new array list < cas consentable attribute > ( ) ; attributes for each ( ( key , value ) - > { var attr = cas consentable attribute builder ( ) name ( key ) values ( value ) build ( ) ; for ( val builder : builders ) { logger trace ( " preparing to build consentable attribute [ { } ] via [ { } ] " , attr , builder get name ( ) ) ; attr = builder build ( attr ) ; logger trace ( " finalized consentable attribute [ { } ] " , attr ) ; } consentable attributes add ( attr ) ; } ) ; context get flow scope ( ) put ( " attributes " , consentable attributes ) ; }


sets the stop reason of the download with the given id in a terminal state ( { @ link download # state completed } , { @ link download # state failed } ) does nothing if a download with the given id does not exist , or if it ' s not in a terminal state this method may be slow and shouldn ' t normally be called on the main thread

void set stop reason ( string id , int stop reason ) throws i o exception ;


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


< code > required string message = 1 ; < code >

public com google protobuf byte string get message bytes ( ) { object ref = message ; if ( ref instanceof string ) { com google protobuf byte string b = com google protobuf byte string copy from utf 8 ( ( string ) ref ) ; message = b ; return b ; } else { return ( com google protobuf byte string ) ref ; } }


see { @ link media session compat callback # on remove queue item ( media description compat description ) }

void on remove queue item ( player player , media description compat description ) ;


test that if validation is strict , invalid points throw an error

public void test build invalid points ( ) throws i o exception { query shard context shard context mock = create mock shard context ( ) ; { geo distance sort builder sort builder = new geo distance sort builder ( " field name " , - 180 0 , 0 0 ) ; sort builder validation ( geo validation method strict ) ; elasticsearch parse exception ex = expect throws ( elasticsearch parse exception class , ( ) - > sort builder build ( shard context mock ) ) ; assert equals ( " illegal latitude value [ - 180 0 ] for [ geo distance sort ] for field [ field name ] " , ex get message ( ) ) ; } { geo distance sort builder sort builder = new geo distance sort builder ( " field name " , 0 0 , - 360 0 ) ; sort builder validation ( geo validation method strict ) ; elasticsearch parse exception ex = expect throws ( elasticsearch parse exception class , ( ) - > sort builder build ( shard context mock ) ) ; assert equals ( " illegal longitude value [ - 360 0 ] for [ geo distance sort ] for field [ field name ] " , ex get message ( ) ) ; } }


public synchronized repository get repository ( string current user , string name ) throws user access exception { if ( ! is anonymous user ( current user ) ) { validate user ( current user ) ; } repository rep = repository map get ( name ) ; if ( rep ! = null ) { rep validate read privilege ( current user ) ; } return rep ; }


attempt to locate an existing { @ code m bean server } called if { @ code locate existing server if possible } is set to { @ code true } the default implementation attempts to find an { @ code m bean server } using a standard lookup subclasses may override to add additional location logic

protected m bean server locate m bean server ( @ nullable string agent id ) throws m bean server not found exception { return jmx utils locate m bean server ( agent id ) ; }


cancels the on - going request that is associated with the current instance of { @ link cancellable }

public synchronized void cancel ( ) { this http request abort ( ) ; }


public void inc error count ( ) { this error count + + ; }


as ninja files describe the action graph , we must establish the dependency between ninja files and the ninja graph configured target for the sky frame we are doing it by computing all related file value sky values

private static void establish dependency on ninja files ( environment env , artifact main file , immutable list < artifact > ninja srcs ) throws interrupted exception { array list < sky key > dep keys = lists new array list ( ) ; dep keys add ( get artifact rooted path ( main file ) ) ; for ( artifact artifact : ninja srcs ) { dep keys add ( get artifact rooted path ( artifact ) ) ; } env get values ( dep keys ) ; }


set the color that indicates gaps in memory

void set separator color ( color c ) { separator color = c ; }


utility to validate a create mode and a ttl

public static void validate t t l ( create mode mode , long ttl ) { if ( mode is t t l ( ) ) { ttl to ephemeral owner ( ttl ) ; } else if ( ttl > = 0 ) { throw new illegal argument exception ( " ttl not valid for mode : " + mode ) ; } }


adds a keyvalue pair to the hashtable if the key is already in the table , the old value is replaced with the new value if the hashtable is already full , the hashtable will attempt to approximately double in size ( it will use a prime number ) , and all the current entries will be rehashed

public void put ( short key , object value ) { int index = indexer put ( key ) ; / / make sure there is room if ( index > = capacity ) { grow ( ) ; } values [ index ] = value ; }


returns the ca certificate and private key that will be used to sign certificates these may be specified by the user or automatically generated

c a info get c a info ( terminal terminal , option set options , environment env ) throws exception { if ( options has ( ca pkcs 1 2 path spec ) ) { return load pkcs 1 2 c a ( terminal , options , env ) ; } else if ( options has ( ca cert path spec ) ) { return load pem c a ( terminal , options , env ) ; } else { terminal println ( " note : generating certificates without providing a ca certificate is deprecated " ) ; terminal println ( " a ca certificate will become mandatory in the next major release " ) ; terminal println ( " " ) ; return generate c a ( terminal , options ) ; } }


get sort finish time for the task , if sort finish time was not set due to sort and reduce phase finishing in same heartebat interval , it is set to finish time , when finish time is set

public long get sort finish time ( ) { return 0 ; }


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

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


sets the bitmap height as a fraction of the viewport size

public builder set bitmap height ( float bitmap height ) { this bitmap height = bitmap height ; return this ; }


called once the { @ link channel inbound handler # channel active ( channel handler context ) } event hit the end of the { @ link channel pipeline }

protected void on unhandled inbound channel active ( ) { }


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

public boolean is stuck ( ) { return false ; }


marks this future as a failure and notifies all listeners

boolean try failure ( throwable cause ) ;


loops continuously , pulling references off the queue and cleaning them up

public void run ( ) { while ( true ) { try { if ( ! clean up ( queue remove ( ) ) ) { break ; } } catch ( interrupted exception e ) { / / ignore } } }


get the lower joint limit , usually in meters

public float get lower limit ( ) { return m lower translation ; }


test handling when the number of volume failures tolerated is the same as the number of volumes

public void test failed locations above threshold ( ) throws exception { final list < storage location > locations = make mock locations ( healthy , failed , failed ) ; / / 1 healthy , 2 failed final configuration conf = new hdfs configuration ( ) ; conf set int ( dfs datanode failed volumes tolerated key , 1 ) ; thrown expect ( i o exception class ) ; thrown expect message ( " too many failed volumes - current valid volumes : 1 , " + " volumes configured : 3 , volumes failed : 2 , volume failures " + " tolerated : 1 " ) ; storage location checker checker = new storage location checker ( conf , new fake timer ( ) ) ; checker check ( conf , locations ) ; }


when read only processing is enabled , any changes made by script or analyzers are discarded when the headless analyzer exits when used with import mode , the imported program file will not be saved to the project or repository

public void enable read only processing ( boolean enabled ) { this read only = enabled ; }


draws a pixel at the given location with the given color

public void draw pixel ( int x , int y , int color ) { pixmap set pixel ( x , y , color ) ; }


public rounding params set border color ( @ color int int color ) { m border color = color ; return this ; }


reports whether the call stack has less than two frames zero frames means an idle thread one frame means the function for the top - level statements of a file is active more than that means a function call is in progress every use of this function is a hack to work around the lack of proper local vs global identifier resolution at top level

boolean toplevel ( ) { return callstack size ( ) < 2 ; }


reset this resource holder - transactional state as well as reference count

public void reset ( ) { clear ( ) ; this reference count = 0 ; }


receive first notification of a logical and predicate the first subsequent notification will contain the left - hand side of the and - predicate ; followed by { @ link # and ( ) } , followed by the right - hand side , followed by { @ link # end and ( ) }


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

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


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

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


parses a trun atom ( defined in 14496 - 12 )

private static int parse trun ( track bundle track bundle , int index , @ flags int flags , parsable byte array trun , int track run start ) throws parser exception { trun set position ( atom header size ) ; int full atom = trun read int ( ) ; int atom flags = atom parse full atom flags ( full atom ) ; track track = track bundle moov sample table track ; track fragment fragment = track bundle fragment ; default sample values default sample values = cast non null ( fragment header ) ; fragment trun length [ index ] = trun read unsigned int to int ( ) ; fragment trun data position [ index ] = fragment data position ; if ( ( atom flags & 0x 0 1 / * data offset present * / ) ! = 0 ) { fragment trun data position [ index ] + = trun read int ( ) ; } boolean first sample flags present = ( atom flags & 0x 0 4 / * first sample flags present * / ) ! = 0 ; int first sample flags = default sample values flags ; if ( first sample flags present ) { first sample flags = trun read int ( ) ; } boolean sample durations present = ( atom flags & 0x 1 0 0 / * sample duration present * / ) ! = 0 ; boolean sample sizes present = ( atom flags & 0x 2 0 0 / * sample size present * / ) ! = 0 ; boolean sample flags present = ( atom flags & 0x 4 0 0 / * sample flags present * / ) ! = 0 ; boolean sample composition time offsets present = ( atom flags & 0x 8 0 0 / * sample composition time offsets present * / ) ! = 0 ; / / offset to the entire video timeline in the presence of b - frames this is usually used to / / ensure that the first frame ' s presentation timestamp is zero long edts offset us = 0 ; / / currently we only support a single edit that moves the entire media timeline ( indicated by / / duration = = 0 ) other uses of edit lists are uncommon and unsupported if ( track edit list durations ! = null & & track edit list durations length = = 1 & & track edit list durations [ 0 ] = = 0 ) { edts offset us = util scale large timestamp ( cast non null ( track edit list media times ) [ 0 ] , c micros per second , track timescale ) ; } int [ ] sample size table = fragment sample size table ; int [ ] sample composition time offset us table = fragment sample composition time offset us table ; long [ ] sample decoding time us table = fragment sample decoding time us table ; boolean [ ] sample is sync frame table = fragment sample is sync frame table ; boolean workaround every video frame is sync frame = track type = = c track type video & & ( flags & flag workaround every video frame is sync frame ) ! = 0 ; int track run end = track run start + fragment trun length [ index ] ; long timescale = track timescale ; long cumulative time = fragment next fragment decode time ; for ( int i = track run start ; i < track run end ; i + + ) { / / use trun values if present , otherwise tfhd , otherwise trex int sample duration = check non negative ( sample durations present ? trun read int ( ) : default sample values duration ) ; int sample size = check non negative ( sample sizes present ? trun read int ( ) : default sample values size ) ; int sample flags = sample flags present ? trun read int ( ) : ( i = = 0 & & first sample flags present ) ? first sample flags : default sample values flags ; if ( sample composition time offsets present ) { / / the bmff spec ( iso 14496 - 12 ) states that sample offsets should be unsigned integers in / / version 0 trun boxes , however a significant number of streams violate the spec and use / / signed integers instead it ' s safe to always decode sample offsets as signed integers / / here , because unsigned integers will still be parsed correctly ( unless their top bit is / / set , which is never true in practice because sample offsets are always small ) int sample offset = trun read int ( ) ; sample composition time offset us table [ i ] = ( int ) ( ( sample offset * c micros per second ) / timescale ) ; } else { sample composition time offset us table [ i ] = 0 ; } sample decoding time us table [ i ] = util scale large timestamp ( cumulative time , c micros per second , timescale ) - edts offset us ; if ( ! fragment next fragment decode time includes moov ) { sample decoding time us table [ i ] + = track bundle moov sample table duration us ; } sample size table [ i ] = sample size ; sample is sync frame table [ i ] = ( ( sample flags > > 16 ) & 0x 1 ) = = 0 & & ( ! workaround every video frame is sync frame | | i = = 0 ) ; cumulative time + = sample duration ; } fragment next fragment decode time = cumulative time ; return track run end ; }


override to add additional { @ link network service custom name resolver } s this can be handy if you want to provide your own network interface name like mycard and implement by yourself the logic to get an actual ip addresshostname based on this name for example : you could call a third party service ( an api ) to resolve mycard then you could define in elasticsearch yml settings like : { @ code network host : mycard }

default network service custom name resolver get custom name resolver ( settings settings ) { return null ; }


test that the fix flag is accepted by the fsck note that we don ' t have an assert at the end of this test because there maybe some errors found during the check and the returned value will be error and not success so if we assert on success , then the test could ( likely ) to be flaky if the fix flag parameter is not accepted here an exception will be thrown so the test will break

public void test c l i fsck d db fix and internal succeed ( ) throws exception { describe ( " this test serves the purpose to run fsck with the correct " + " parameters , so there will be no exception thrown " ) ; final int result = run ( s 3 guard tool fsck name , " - " + fsck fix flag , " - " + fsck ddb ms consistency flag , " s 3a : / / " + get file system ( ) get bucket ( ) ) ; log info ( " the return value of the run : { } " , result ) ; }


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


get blocks to invalidate by limit as blocks that can be sent in one message is limited

private int get blocks to invalidate by limit ( light weight hash set < block > block set , list < block > to invalidate , long adder stats adder , int limit ) { assert block set ! = null ; int remaining limit = limit ; list < block > polled blocks = block set poll n ( limit ) ; remaining limit - = polled blocks size ( ) ; to invalidate add all ( polled blocks ) ; stats adder add ( polled blocks size ( ) * - 1 ) ; return remaining limit ; }


returns a type adapter for { @ code type } , or null if this factory doesn ' t support { @ code type }

< t > type adapter < t > create ( gson gson , type token < t > type ) ;


return a { @ code request predicate } that matches if request ' s http method is { @ code head } and the given { @ code pattern } matches against the request path

public static request predicate head ( string pattern ) { return method ( http method head ) and ( path ( pattern ) ) ; }


returns the total time spent joining the playback in foreground , in milliseconds this does include invalid join times where the playback never reached { @ link # playback state playing } or { @ link # playback state paused } , or joining was interrupted by a seek , stop , or error state

public long get total join time ms ( ) { return get playback state duration ms ( playback state joining foreground ) ; }


since the built action will need a predicate that handles any action type , this method creates a predicate that adapts a user supplied predicate for a more specific action context to a general predicate that can accept any action context

private predicate < action context > adapt predicate ( predicate < c > predicate ) { if ( action context class = = action context class ) { / / don ' t wrap the predicate if it doesn ' t need it return ( predicate < action context > ) predicate ; } / / convert a sub - classed action context predicate to a plain action context predicate predicate < action context > predicate adapter = ( ac ) - > { return action context class is instance ( ac ) & & predicate test ( ( c ) ac ) ; } ; return predicate adapter ; }


creates a bitmap of the specified width and height

public closeable reference < bitmap > create bitmap internal ( int width , int height , bitmap config bitmap config ) { bitmap bitmap = bitmap create bitmap ( width , height , bitmap config ) ; return closeable reference of ( bitmap , simple bitmap releaser get instance ( ) ) ; }


called for each { @ link tool installation # translate for ( node , task listener ) } invocations ( which normally means it ' s invoked for each { @ link node specific # for node ( node , task listener ) } ) to translate the tool location into the node specific location if this implementation is capable of determining the location , return the path in the absolute file name ( this method doesn ' t return { @ link file } so that it can handle path names of a different os otherwise return null to let other { @ link tool location translator } s a chance to do translations on their own

public abstract string get tool home ( node node , tool installation installation , task listener log ) throws i o exception , interrupted exception ;


disconnect the session by sending a disconnect frame


sets the usernames of the users that should be evicted from the caches when not set , all users will be evicted

public clear realm cache request usernames ( string usernames ) { this usernames = usernames ; return this ; }


gets an array with all the scalar values at a code unit and operand index there can be multiple sub - operands and therefore multiple scalars for an operand

private scalar [ ] get scalars ( code unit code unit , int op index ) { scalar cu scalar = code unit get scalar ( op index ) ; if ( cu scalar ! = null ) { return new scalar [ ] { cu scalar } ; } array list < scalar > list = new array list < > ( ) ; if ( code unit instanceof instruction ) { object [ ] objs = ( ( instruction ) code unit ) get op objects ( op index ) ; for ( int index = 0 ; index < objs length ; index + + ) { if ( index > = 0 & & index < objs length & & objs [ index ] instanceof scalar ) { scalar scalar = ( scalar ) objs [ index ] ; if ( ! list contains ( scalar ) ) { list add ( scalar ) ; } } } } return list to array ( new scalar [ list size ( ) ] ) ; }


to test special tags to test special tags and operation id starting with number

public void call 1 2 3test special tags test ( ) throws api exception { client body = null ; client response = api call 1 2 3test special tags ( body ) ; / / todo : test validations }


public static string pi 2string ( final double pi , final long terms ) { final long value = ( long ) ( pi * ( 1l < < double precision ) ) ; final int acc bit = accuracy ( terms , false ) ; final int acc hex = acc bit / 4 ; final int shift = double precision - acc bit ; return string format ( " % 0 " + acc hex + " x % 0 " + ( 13 - acc hex ) + " x ( % d hex digits ) " , value > > shift , value & ( ( 1 < < shift ) - 1 ) , acc hex ) ; }


caches { @ code bitmap } for { @ code key } the bitmap is moved to the head of the queue

public final boolean put ( string key , bitmap value ) { if ( key = = null | | value = = null ) { throw new null pointer exception ( " key = = null | | value = = null " ) ; } synchronized ( this ) { size + = size of ( key , value ) ; bitmap previous = map put ( key , value ) ; if ( previous ! = null ) { size - = size of ( key , previous ) ; } } trim to size ( max size ) ; return true ; }


test the property ' sc a e t h flow points '

public void sc a e t h flow points test ( ) { / / todo : test sc a e t h flow points }


public void my string test ( ) { / / todo : test my string }


processes each model ' s property not mapped to any type and adds related vendor extensions most of time it ' s related to referenced properties eg \ model \ user

public void process unknown type property ( codegen model model , codegen property property , string description , ktorm schema ktorm schema ) { map < string , object > column definition = new hash map < string , object > ( ) ; string base name = property get base name ( ) ; string col name = to column name ( base name ) ; string data type = property get data type ( ) ; string data format = property get data format ( ) ; string actual type = to column type ( data type , data format ) ; ktorm schema put ( " column definition " , column definition ) ; column definition put ( " col name " , col name ) ; column definition put ( " col type " , actual type ) ; column definition put ( " col kotlin type " , data type ) ; process type args ( data type , data format , null , null , column definition ) ; process null and default ( model , property , description , column definition ) ; }


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

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


public void set router id ( string id ) { this router id = id ; if ( this state store ! = null ) { this state store set identifier ( this router id ) ; } if ( this namenode resolver ! = null ) { this namenode resolver set router id ( this router id ) ; } }


this test makes sure that only a hybridhash on the static path is transformed to the cached variant

public void test right side countercheck ( ) { try { plan plan = get test plan right static ( optimizer hint local strategy hash build first ) ; optimized plan o plan = compile no stats ( plan ) ; optimizer plan node resolver resolver = get optimizer plan node resolver ( o plan ) ; dual input plan node inner join = resolver get node ( " dummy joiner " ) ; / / verify correct join strategy assert equals ( driver strategy hybridhash build first , inner join get driver strategy ( ) ) ; assert equals ( temp mode none , inner join get input 1 ( ) get temp mode ( ) ) ; assert equals ( temp mode cached , inner join get input 2 ( ) get temp mode ( ) ) ; new job graph generator ( ) compile job graph ( o plan ) ; } catch ( exception e ) { system err println ( e get message ( ) ) ; e print stack trace ( ) ; fail ( " test errored : " + e get message ( ) ) ; } }


public configuration get options ( ) { return options ; }


obtain ( read - only ) collection of active applications

public collection < fi ca scheduler app > get applications ( ) { return collections unmodifiable collection ( ordering policy get schedulable entities ( ) ) ; }


public void incr client backoff ( ) { rpc client backoff incr ( ) ; }


create a new { @ code date time formatter } using this factory if no specific pattern or style has been defined , the supplied { @ code fallback formatter } will be used

public date time formatter create date time formatter ( date time formatter fallback formatter ) { date time formatter date time formatter = null ; if ( string utils has length ( this pattern ) ) { date time formatter = date time format for pattern ( this pattern ) ; } else if ( this iso ! = null & & this iso ! = iso none ) { switch ( this iso ) { case date : date time formatter = i s o date time format date ( ) ; break ; case time : date time formatter = i s o date time format time ( ) ; break ; case date time : date time formatter = i s o date time format date time ( ) ; break ; default : throw new illegal state exception ( " unsupported iso format : " + this iso ) ; } } else if ( string utils has length ( this style ) ) { date time formatter = date time format for style ( this style ) ; } if ( date time formatter ! = null & & this time zone ! = null ) { date time formatter = date time formatter with zone ( date time zone for time zone ( this time zone ) ) ; } return ( date time formatter ! = null ? date time formatter : fallback formatter ) ; }


build a lazily formatted message from the given format string and varargs

public static log message format ( string format , object args ) { return new format message x ( format , args ) ; }


test that a method is found by is overridden even when it is inherited from an intermediate class

public void is overridden test ( ) { assert true ( util is overridden ( base class , derived class , " method " ) ) ; assert true ( util is overridden ( base class , intermediate class , " method " ) ) ; assert false ( util is overridden ( base class , base class , " method " ) ) ; assert true ( util is overridden ( base class , intermediate class , " set x " , object class ) ) ; assert true ( util is overridden ( base class , intermediate class , " get x " ) ) ; }


maps array of 2d points from image - relative to view - absolute coordinates this does not take into account the zoomable transformation points are represented by float array of [ x 0 , y 0 , x 1 , y 1 , ]

private void map relative to absolute ( float [ ] dest points , float [ ] src points , int num points ) { for ( int i = 0 ; i < num points ; i + + ) { dest points [ i * 2 + 0 ] = src points [ i * 2 + 0 ] * m image bounds width ( ) + m image bounds left ; dest points [ i * 2 + 1 ] = src points [ i * 2 + 1 ] * m image bounds height ( ) + m image bounds top ; } }


initialize with supported configuration this method is invoked when the ( uri , configuration ) } method is invoked

void initialize ( configuration configuration , string account name ) throws i o exception ;


public static map < string , ? > load properties ( resource resource ) throws i o exception { return new origin tracked properties loader ( resource ) load ( ) ; }


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


note the change will be taken as best effort , meaning that all already scheduled traffics will not be changed , but only applied to new traffics so the expected usage of this method is to be used not too often , accordingly to the traffic shaping configuration

public void set max write delay ( long max write delay ) { if ( max write delay < = 0 ) { throw new illegal argument exception ( " max write delay must be positive " ) ; } this max write delay = max write delay ; }


public static class loader get class loader ( class < ? > clazz ) { class loader cl = null ; try { cl = thread current thread ( ) get context class loader ( ) ; } catch ( throwable ex ) { / / cannot access thread context class loader - falling back to system class loader } if ( cl = = null ) { / / no thread context class loader - > use class loader of this class cl = clazz get class loader ( ) ; if ( cl = = null ) { / / get class loader ( ) returning null indicates the bootstrap class loader try { cl = class loader get system class loader ( ) ; } catch ( throwable ex ) { / / cannot access system class loader - oh well , maybe the caller can live with null } } } return cl ; }


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


checks the class mentioned in the given type ( if any ) , printing notes if necessary

private void check type ( string type ) { if ( type ! = null ) { check class name ( class util internal class name from type ( type ) ) ; } }


convert an array of file status to an array of path

public static path [ ] stat 2 paths ( file status [ ] stats ) { if ( stats = = null ) return null ; path [ ] ret = new path [ stats length ] ; for ( int i = 0 ; i < stats length ; + + i ) { ret [ i ] = stats [ i ] get path ( ) ; } return ret ; }


paint a representation of the value into a given area of screen real estate note that the property editor is responsible for doing its own clipping so that it fits into the given rectangle if the property editor doesn ' t honor paint requests ( see is paintable ) this method should be a silent noop

public void paint value ( graphics gfx , rectangle box ) { if ( color ! = null ) { gfx set color ( color ) ; } else { gfx set color ( color black ) ; } gfx fill rect ( box x , box y , box width , box height ) ; }


disables the automatic setting of content - type header made from a guess based on extension

public void disable mime type guessing ( ) { mime type disable guessing ( ) ; }


compares two string ignoring extra whitespaces we can remove double whitespaces and any whitespaces between special chars ( - + , : etc )

public static boolean compare aliases ( string str 1 , string str 2 ) { return remove extra spaces ( str 1 ) equals ( remove extra spaces ( str 2 ) ) ; }


verifies a single file is properly uploaded

private static void test copy single file from local ( file system target file system , path target dir , string local resource directory , temporary folder temporary folder ) throws i o exception , interrupted exception , u r i syntax exception { final file src dir = temporary folder new folder ( ) ; final string local file = " local jar " ; final string local file content = " local jar content " ; final hash map < string / * ( relative ) path * / , / * contents * / string > src files = new hash map < > ( 4 ) ; src files put ( local file , local file content ) ; generate files in directory ( src dir , src files ) ; try { final list < path > remote paths = new array list < > ( ) ; final application id application id = application id new instance ( 0 , 0 ) ; final yarn application file uploader uploader = yarn application file uploader from ( target file system , target dir , collections empty list ( ) , application id , d f s config keys dfs replication default ) ; final list < string > classpath = uploader register multiple local resources ( collections singleton list ( new path ( src dir get absolute path ( ) , local file ) ) , local resource directory , local resource type file ) ; assert that ( classpath , contains in any order ( new path ( local resource directory , local file ) to string ( ) ) ) ; final map < string , local resource > local resources = uploader get registered local resources ( ) ; final path work dir = converter utils get path from yarn u r l ( local resources get ( new path ( local resource directory , local file ) to string ( ) ) get resource ( ) ) get parent ( ) ; verify directory recursive ( target file system , work dir , src files ) ; } finally { target file system delete ( target dir , true ) ; } }


create a file if it doesn ' t exist , otherwise delete old file before creating

public static boolean create file by delete old file ( final string file path ) { return create file by delete old file ( get file by path ( file path ) ) ; }


test serialization of outer boolean types

public boolean fake outer boolean serialize ( boolean body ) throws api exception { api response < boolean > local var response = fake outer boolean serialize with http info ( body ) ; return local var response get data ( ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void enter multi match query ( sql base parser multi match query context ctx ) { }


applies an aggregation that that gives the minimum value of the pojo data stream at the given field expression for every window a field expression is either the name of a public field or a getter method with parentheses of the { @ link data stream } s underlying type a dot can be used to drill down into objects , as in { @ code " field 1 get inner field 2 ( ) " }

public single output stream operator < t > min ( string field ) { return aggregate ( new comparable aggregator < > ( field , input get type ( ) , aggregation function aggregation type min , false , input get execution config ( ) ) ) ; }


set the additional ( undeclared ) property with the specified name and value if the property does not already exist , create it otherwise replace it

public additional properties string put additional property ( string key , string value ) { if ( this additional properties = = null ) { this additional properties = new hash map < string , string > ( ) ; } this additional properties put ( key , value ) ; return this ; }


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

t visit nonconditional ( painless parser nonconditional context ctx ) ;


return varnode of given size and starting address , which is also an input

public varnode find input varnode ( int sz , address addr ) { return vbank find input ( sz , addr ) ; }


gets request interceptor based on authentication name

public request interceptor get authorization ( string auth name ) { return api authorizations get ( auth name ) ; }


fail the owning task with the given throwable

void fail externally ( throwable cause ) ;


a filtering function is one whose outputs are a subset of a single input argument returns the function as a filtering function if it is one and { @ code null } otherwise

default filtering query function as filtering function ( ) { return null ; }


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


< code > optional bytes msg = 7 ; < code >


constructs a fully - initialized instance ( this method exists so as to avoid calling a large amount of code in the constructor )

public static dominators make ( ssa method meth , dom front dom info [ ] dom infos , boolean postdom ) { dominators result = new dominators ( meth , dom infos , postdom ) ; result run ( ) ; return result ; }


create a new { @ code k table } by transforming the value of each record in this { @ code k table } into a new value ( with possibly a new type ) in the new { @ code k table } , with the { @ link serde key serde } , { @ link serde value serde } , and the underlying { @ link key value store materialized state storage } configured in the { @ link materialized } instance for each { @ code k table } update the provided { @ link value mapper } is applied to the value of the updated record and computes a new value for it , resulting in an updated record for the result { @ code k table } thus , an input record { @ code < k , v > } can be transformed into an output record { @ code < k : v ' > } this is a stateless record - by - record operation the example below counts the number of token of the value string { @ code k table < string , string > input table = builder table ( " topic " ) ; k table < string , integer > output table = input table map value ( new value mapper < string , integer > { integer apply ( string value ) { return value split ( " " ) length ; } } ) ; } to query the local { @ link key value store } representing output table above it must be obtained via { @ link kafka streams # store ( store query parameters ) kafka streams # store ( ) } : for non - local keys , a custom rpc mechanism must be implemented using { @ link kafka streams # all metadata ( ) } to query the value of the key on a parallel running instance of your kafka streams application the store name to query with is specified by { @ link materialized # as ( string ) } or { @ link materialized # as ( key value bytes store supplier ) } this operation preserves data co - location with respect to the key thus , no internal data redistribution is required if a key based operator ( like a join ) is applied to the result { @ code k table } note that { @ code map values } for a changelog stream works differently than { @ link k stream # map values ( value mapper ) record stream filters } , because { @ link key value records } with { @ code null } values ( so - called tombstone records ) have delete semantics thus , for tombstones the provided value - mapper is not evaluated but the tombstone record is forwarded directly to delete the corresponding record in the result { @ code k table }

< vr > k table < k , vr > map values ( final value mapper < ? super v , ? extends vr > mapper , final materialized < k , vr , key value store < bytes , byte [ ] > > materialized ) ;


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


extract an error trailers from the causal chain of a { @ link throwable }

public static metadata trailers from throwable ( throwable t ) { throwable cause = check not null ( t , " t " ) ; while ( cause ! = null ) { if ( cause instanceof status exception ) { return ( ( status exception ) cause ) get trailers ( ) ; } else if ( cause instanceof status runtime exception ) { return ( ( status runtime exception ) cause ) get trailers ( ) ; } cause = cause get cause ( ) ; } return null ; }


variant of { @ link # register ( object ) } that also allows the caller to apply the properties from { @ link default codec config } to the given codec if you want to apply all the properties , prefer using { @ link # register with default config ( object ) } the consumer is called every time { @ link # get readers ( ) } or { @ link # get writers ( ) } are used to obtain the list of configured readers or writers

void register with default config ( object codec , consumer < default codec config > config consumer ) ;


adds a route to the given handler function that handles all http { @ code head } requests that match the given pattern

builder head ( string pattern , handler function < server response > handler function ) ;


create an edit log input stream from a { @ link byte string } , i e an in - memory collection of bytes

public static edit log input stream from byte string ( byte string bytes , long start tx id , long end tx id , boolean in progress ) { return new edit log file input stream ( new byte string log ( bytes , string format ( " byte string edit log [ % d , % d ] " , start tx id , end tx id ) ) , start tx id , end tx id , in progress ) ; }


cancel any existing requests for the specified target { @ link image view }

public void cancel request ( @ non null image view view ) { / / check main ( ) is called from cancel existing request ( ) check not null ( view , " view = = null " ) ; cancel existing request ( view ) ; }


returns an estimate of the position up to which data is buffered

public long get buffered position us ( ) { if ( loading finished ) { return c time end of source ; } else if ( is pending reset ( ) ) { return pending reset position us ; } else { long buffered position us = last seek position us ; base media chunk last media chunk = get last media chunk ( ) ; base media chunk last completed media chunk = last media chunk is load completed ( ) ? last media chunk : media chunks size ( ) > 1 ? media chunks get ( media chunks size ( ) - 2 ) : null ; if ( last completed media chunk ! = null ) { buffered position us = max ( buffered position us , last completed media chunk end time us ) ; } return max ( buffered position us , primary sample queue get largest queued timestamp us ( ) ) ; } }


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

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


set the isolation level by the name of the corresponding constant in transaction definition , e g " isolation default "

public final void set isolation level name ( string constant name ) throws illegal argument exception { if ( ! constant name starts with ( prefix isolation ) ) { throw new illegal argument exception ( " only isolation constants allowed " ) ; } set isolation level ( constants as number ( constant name ) int value ( ) ) ; }


returns the section header which fully contains the specified file offset range

public elf section header get section header containing file range ( long file offset , long file range length ) { long max offset = file offset + file range length - 1 ; for ( elf section header section : section headers ) { if ( section get type ( ) = = elf section header constants shn undef ) { continue ; } long size = section get size ( ) ; if ( size = = 0 ) { continue ; } long start = section get offset ( ) ; long end = start + size - 1 ; if ( file offset > = start & & max offset < = end ) { return section ; } } return null ; }


int write ( final byte buf buffer , int offset , int length ) { int index = buffer for each byte ( offset , length , write processor ) ; return index = = - 1 ? length : index - offset ; }


assert request query parameter values with the given hamcrest matcher ( s )

public static request matcher query param ( string name , matcher < ? super string > matchers ) { return request - > { multi value map < string , string > params = get query params ( request ) ; assert value count ( " query param " , name , params , matchers length ) ; for ( int i = 0 ; i < matchers length ; i + + ) { assert that ( " query param " , params get ( name ) get ( i ) , matchers [ i ] ) ; } } ; }


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


tree path get tree path ( ) { return path ; }


public string to string ( ) { return src + " : " + owner + " : " + group + " : " + permission ; }


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

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


renaming a filedir then delete the ancestor dir of the rename target should be reported as deleted

public void test diff report with rename and delete ( ) throws exception { final path root = new path ( " / " ) ; final path dir 1 = new path ( root , " dir 1 " ) ; final path dir 2 = new path ( root , " dir 2 " ) ; final path foo = new path ( dir 1 , " foo " ) ; final path file in foo = new path ( foo , " file " ) ; final path bar = new path ( dir 2 , " bar " ) ; final path file in bar = new path ( bar , " file " ) ; d f s test util create file ( hdfs , file in foo , blocksize , replication , seed ) ; d f s test util create file ( hdfs , file in bar , blocksize , replication , seed ) ; snapshot test helper create snapshot ( hdfs , root , " s 0 " ) ; hdfs rename ( file in foo , file in bar , rename overwrite ) ; snapshot test helper create snapshot ( hdfs , root , " s 1 " ) ; verify diff report ( root , " s 0 " , " s 1 " , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( " dir 1 / foo " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( " dir 2 / bar " ) ) , new diff report entry ( diff type delete , d f s util string 2 bytes ( " dir 2 / bar / file " ) ) , new diff report entry ( diff type rename , d f s util string 2 bytes ( " dir 1 / foo / file " ) , d f s util string 2 bytes ( " dir 2 / bar / file " ) ) ) ; / / delete bar hdfs delete ( bar , true ) ; snapshot test helper create snapshot ( hdfs , root , " s 2 " ) ; verify diff report ( root , " s 0 " , " s 2 " , new diff report entry ( diff type modify , d f s util string 2 bytes ( " " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( " dir 1 / foo " ) ) , new diff report entry ( diff type modify , d f s util string 2 bytes ( " dir 2 " ) ) , new diff report entry ( diff type delete , d f s util string 2 bytes ( " dir 2 / bar " ) ) , new diff report entry ( diff type delete , d f s util string 2 bytes ( " dir 1 / foo / file " ) ) ) ; }


moves all dir trees under a given ' from ' dir to location ' to ' , while overwriting all files in the potentially existing ' to ' doesn ' t resolve symbolic links the source and the destination must be non - overlapping , otherwise an illegal argument exception will be thrown this method cannot be used to copy a dir tree to a sub tree of itself if no error occurs , the method returns normally if the given ' from ' does not exist , a file not found exception is thrown an i o exception is thrown when other erroneous situations occur ( e g read errors )

public static void move trees below ( path from , path to ) throws i o exception { if ( to starts with ( from ) ) { throw new illegal argument exception ( to + " is a subdirectory of " + from ) ; } collection < path > entries = from get directory entries ( ) ; for ( path entry : entries ) { if ( entry is directory ( symlinks nofollow ) ) { path sub dir = to get child ( entry get base name ( ) ) ; sub dir create directory ( ) ; move trees below ( entry , sub dir ) ; } else { path new entry = to get child ( entry get base name ( ) ) ; move file ( entry , new entry ) ; } } }


setup response for the ipc call on fatal error from a client that is using old version of hadoop the response is serialized using the previous protocol ' s response layout

private void setup response old version fatal ( byte array output stream response , rpc call call , writable rv , string error class , string error ) throws i o exception { final int old version fatal status = - 1 ; response reset ( ) ; data output stream out = new data output stream ( response ) ; out write int ( call call id ) ; / / write call id out write int ( old version fatal status ) ; / / write fatal status writable utils write string ( out , error class ) ; writable utils write string ( out , error ) ; call set response ( byte buffer wrap ( response to byte array ( ) ) ) ; }


add a link fallback to the config for the specified mount table

public static void add link fallback ( configuration conf , final string mount table name , final uri target ) { conf set ( get config view fs prefix ( mount table name ) + " " + constants config viewfs link fallback , target to string ( ) ) ; }


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

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


returns an array containing the modified utf - 8 form of { @ code s }

public static byte [ ] encode ( string s ) throws u t f data format exception { int utf count = ( int ) count bytes ( s , true ) ; byte [ ] result = new byte [ utf count ] ; encode ( result , 0 , s ) ; return result ; }


sets whether or not existing defined data should invalidate the creation of new data

public void set ignore defined data ( boolean ignore defined data ) { this ignore defined data = ignore defined data ; }


public void date time test ( ) { / / todo : test date time }


save this tree in a postscript file using a particular font name and size

public static void save ( tree t , list < string > rule names , string file name , string font name , int font size ) throws i o exception { write p s ( t , rule names , file name , font name , font size ) ; }


sets the doc to use for updates when a script is not specified

public update request doc ( map < string , object > source , x content type content type ) { safe doc ( ) source ( source , content type ) ; return this ; }


loads whatever instructions have been selected and stores the mnemonics , operands , and mask values for subsequent use

private void load selected instructions ( program program , program selection selection ) { / / first get the program listing listing listing = program get listing ( ) ; / / now check to make sure the user hasn ' t selected multiple regions ; if they have , / / let them know this situation is not allowed so pop up a dialog and cancel the whole show if ( selection get num address ranges ( ) > 1 ) { msg show warn ( this , null , " multiple regions selected " , " selected instructions must be contiguous " ) ; } / / if we ' re here , we have only 1 selection range , so proceed use an instruction / / iterator to loop over all addresses , processing each in turn address range addr range = selection get first range ( ) ; address set addr set = new address set ( addr range ) ; instruction iterator iter = listing get instructions ( addr set , true ) ; while ( iter has next ( ) ) { / / grab the next instruction instruction instr = iter next ( ) ; address addr = instr get address ( ) ; / / extract some info from the address if there ' s a problem , don ' t exit the entire loop , / / just move on to the next item sleigh debug logger logger = new sleigh debug logger ( program , addr , sleigh debug mode verbose ) ; if ( logger parse failed ( ) ) { break ; } / / get the bytes and mask info related to this instruction byte [ ] mask = logger get instruction mask ( ) ; byte [ ] value = logger get masked bytes ( mask ) ; mask value mnemonic mask = new mnemonic mask value ( mask , value , instr get mnemonic string ( ) ) ; mnemonics add ( mnemonic mask ) ; / / gets a code unit which can be used to determine if the operands are constants code unit cu = listing get code unit at ( addr ) ; store operands ( instr , logger , mnemonic mask , cu ) ; } }


writes an integer as a typed bytes sequence

public void write int ( int i ) throws i o exception { out write ( type int code ) ; out write int ( i ) ; }


public string native s q l ( string sql ) throws s q l exception { return null ; }


should the visitor keep visiting the tree called after visiting a node or skipping a tree branch , if the return value is { @ code false } , no more nodes will be visited


get structure length after all components have been added

int get length ( ) { if ( last component = = null ) { return 0 ; } int offset = 0 ; if ( group offset > = 0 & & last component is bit field component ( ) & & bit field packing use m s convention ( ) ) { / / skip beyond unused bits based upon allocation size bit field data type last bit field dt = ( bit field data type ) last component get data type ( ) ; offset = group offset + last bit field dt get base type size ( ) ; } else { offset = last component get offset ( ) + last component get length ( ) ; if ( ! bit field packing use m s convention ( ) & & last component is zero bit field component ( ) ) { / / factor in trailing zero - length bitfield bit field data type bitfield dt = ( bit field data type ) last component get data type ( ) ; int size alignment = composite alignment helper get packed alignment ( data organization , composite not packing , bitfield dt get base data type ( ) , bitfield dt get base type size ( ) ) ; get bit field alignment ( ( bit field data type ) last component get data type ( ) ) ; offset + = data organization impl get padding size ( size alignment , offset ) ; } } return offset ; }


public static < r > supplier < r > do if not null ( final object input , final supplier < r > true function , final supplier < r > false function ) { return ( ) - > { try { if ( input ! = null ) { return true function get ( ) ; } return false function get ( ) ; } catch ( final throwable e ) { logging utils warn ( logger , e ) ; return false function get ( ) ; } } ; }


public int get num cores ( ) { return num cores ; }


customize the given { @ link u r l connection } , obtained in the course of an { @ link # exists ( ) } , { @ link # content length ( ) } or { @ link # last modified ( ) } call calls { @ link resource utils # use caches if necessary ( u r l connection ) } and delegates to { @ link # customize connection ( http u r l connection ) } if possible can be overridden in subclasses

protected void customize connection ( u r l connection con ) throws i o exception { resource utils use caches if necessary ( con ) ; if ( con instanceof http u r l connection ) { customize connection ( ( http u r l connection ) con ) ; } }


print a formatted string followed by a newline to the output stream

protected static void println ( print stream out , string format , object args ) { out println ( string format ( format , args ) ) ; }


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


convenient method to find a single object given two int parameters

public t find object ( int p 1 , int p 2 ) throws data access exception { return find object ( p 1 , p 2 , null ) ; }


creates an appropriate javadoc depending on aspects of the type in question

static code block binding type docs ( type name type , boolean abstrakt , boolean members , boolean dependent ) { code block builder result = code block builder ( ) add ( " a { @ code binding < $ t > } implementation which satisfies \ n " , type ) add ( " dagger ' s infrastructure requirements including : \ n " ) ; if ( dependent ) { result add ( " \ n " ) add ( " owning the dependency links between { @ code $ t } and its \ n " , type ) add ( " dependencies \ n " ) ; } if ( ! abstrakt ) { result add ( " \ n " ) add ( " being a { @ code provider < $ t > } and handling creation and \ n " , type ) add ( " preparation of object instances \ n " ) ; } if ( members ) { result add ( " \ n " ) add ( " being a { @ code members injector < $ t > } and handling injection \ n " , type ) add ( " of annotated fields \ n " ) ; } return result build ( ) ; }


public list < shard routing > get shards ( ) { return shards ( ) ; }


runs the specified command using the current program

public final boolean run command ( command cmd ) { return cmd apply to ( current program ) ; }


marks the shard with the provided allocation id as in - sync with the primary shard this method will block until the local checkpoint on the specified shard advances above the current global checkpoint

public synchronized void mark allocation id as in sync ( final string allocation id , final long local checkpoint ) throws interrupted exception { assert invariant ( ) ; assert primary mode ; assert handoff in progress = = false ; checkpoint state cps = checkpoints get ( allocation id ) ; if ( cps = = null ) { / / can happen if replica was removed from cluster but recovery process is unaware of it yet throw new illegal state exception ( " no local checkpoint tracking information available for " + allocation id ) ; } assert local checkpoint > = sequence numbers no ops performed : " expected known local checkpoint for " + allocation id + " but was " + local checkpoint ; assert pending in sync contains ( allocation id ) = = false : " shard copy " + allocation id + " is already marked as pending in - sync " ; assert cps tracked : " shard copy " + allocation id + " cannot be marked as in - sync as it ' s not tracked " ; update local checkpoint ( allocation id , cps , local checkpoint ) ; / / if it was already in - sync ( because of a previously failed recovery attempt ) , global checkpoint must have been / / stuck from advancing assert ! cps in sync | | ( cps local checkpoint > = get global checkpoint ( ) ) : " shard copy " + allocation id + " that ' s already in - sync should have a local checkpoint " + cps local checkpoint + " that ' s above the global checkpoint " + get global checkpoint ( ) ; if ( cps local checkpoint < get global checkpoint ( ) ) { pending in sync add ( allocation id ) ; try { while ( true ) { if ( pending in sync contains ( allocation id ) ) { wait for local checkpoint to advance ( ) ; } else { break ; } } } finally { pending in sync remove ( allocation id ) ; } } else { cps in sync = true ; update replication group and notify ( ) ; logger trace ( " marked [ { } ] as in - sync " , allocation id ) ; update global checkpoint on primary ( ) ; } assert invariant ( ) ; }


get the number of milliseconds of each tick

public int get tick time ( ) { return tick time ; }


returns all the registered { @ link change log annotator } descriptors

public static extension list < change log annotator > all ( ) { return extension list lookup ( change log annotator class ) ; }


get a meaningful and short name for a server based on a java class the rules are defined to support the current naming schema of the generated protobuf classes where the final class usually an anonymous inner class of an inner class 1 for simple classes it returns with the simple name of the classes ( with the name without package name ) 2 for inner classes , this is the simple name of the inner class 3 if it is an object created from a class factory e g , org apache hadoop ipc test r p c $ test class $ 2 this method returns parent class test class 4 if it is an anonymous class e g , ' org apache hadoop ipc test r p c $ 10 ' server name from class returns parent class test r p c

static string server name from class ( class < ? > clazz ) { string name = clazz get name ( ) ; string [ ] names = clazz get name ( ) split ( " \ \ " , - 1 ) ; if ( names ! = null & & names length > 0 ) { name = names [ names length - 1 ] ; } matcher matcher = complex server name pattern matcher ( name ) ; if ( matcher find ( ) ) { return matcher group ( 1 ) ; } else { return name ; } }


test running an analysis worker from an ad hoc thread ( i e , main ) with events ignored by analysis at various priority levels

public void test disable ignore resume adhoc thread worker invocation ( ) throws exception { env show tool ( ) ; load program ( " notepad empty " ) ; auto analysis manager mgr = auto analysis manager get analysis manager ( program ) ; schedule ( mgr , new set test property command ( " p 0 " , 500 ) , 0 ) ; schedule ( mgr , new set test property command ( " p 1 " , 500 ) , 10 ) ; try { mgr schedule worker ( worker , null , false , task monitor adapter dummy monitor ) ; } catch ( exception e ) { fail with exception ( " unexpected exception " , e ) ; } verify program state then undo ( false ) ; }


a string that is a 10 digit number can have leading zeros

public string get pattern with digits ( ) { return pattern with digits ; }


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