looks for the dirs to clean the folder structure is y y y y m m d d serial so we can use that to more efficiently find the directories to clean by comparing the cutoff timestamp with the timestamp from the folder structure

public static list < file status > get history dirs for cleaning ( file context fc , path root , long cutoff ) throws i o exception { list < file status > fs list = new array list < file status > ( ) ; calendar c cal = calendar get instance ( ) ; c cal set time in millis ( cutoff ) ; int c year = c cal get ( calendar year ) ; int c month = c cal get ( calendar month ) + 1 ; int c date = c cal get ( calendar date ) ; remote iterator < file status > year dir it = fc list status ( root ) ; while ( year dir it has next ( ) ) { file status year dir = year dir it next ( ) ; try { int year = integer parse int ( year dir get path ( ) get name ( ) ) ; if ( year < = c year ) { remote iterator < file status > month dir it = fc list status ( year dir get path ( ) ) ; while ( month dir it has next ( ) ) { file status month dir = month dir it next ( ) ; try { int month = integer parse int ( month dir get path ( ) get name ( ) ) ; / / if we only checked the month here , then something like 07 / 2013 / / would incorrectly not pass when the cutoff is 06 / 2014 if ( year < c year | | month < = c month ) { remote iterator < file status > date dir it = fc list status ( month dir get path ( ) ) ; while ( date dir it has next ( ) ) { file status date dir = date dir it next ( ) ; try { int date = integer parse int ( date dir get path ( ) get name ( ) ) ; / / if we only checked the date here , then something like / / 07 / 21 / 2013 would incorrectly not pass when the cutoff is / / 08 / 20 / 2013 or 07 / 20 / 2012 if ( year < c year | | month < c month | | date < = c date ) { fs list add all ( remote iter to list ( fc list status ( date dir get path ( ) ) ) ) ; } } catch ( number format exception nfe ) { / / the directory didn ' t fit the format we ' re looking for so / / skip the dir } } } } catch ( number format exception nfe ) { / / the directory didn ' t fit the format we ' re looking for so skip / / the dir } } } } catch ( number format exception nfe ) { / / the directory didn ' t fit the format we ' re looking for so skip the dir } } return fs list ; }


counters or metrics if any else return null

set < timeline metric > get timeline metrics ( ) ;


sets { @ link format # initialization data } the default value is { @ code null }

public builder set initialization data ( @ nullable list < byte [ ] > initialization data ) { this initialization data = initialization data ; return this ; }


pop up editor window to allow the user to rename view

private void rename view ( ) { view provider service vps = get current view provider ( ) ; int tab index = tabbed pane get selected index ( ) ; string old name = vps get view name ( ) ; rectangle rect = tabbed pane get bounds at ( tab index ) ; tool show edit window ( old name , tabbed pane , rect , new rename listener ( vps , tab index ) ) ; }


determine whether the given object is an array : either an object array or a primitive array

public static boolean is array ( @ nullable object obj ) { return ( obj ! = null & & obj get class ( ) is array ( ) ) ; }


the text compaction mode includes all the printable ascii characters ( i e values from 32 to 126 ) and three ascii control characters : ht or tab ( ascii value 9 ) , lf or line feed ( ascii value 10 ) , and cr or carriage return ( ascii value 13 ) the text compaction mode also includes various latch and shift characters which are used exclusively within the mode the text compaction mode encodes up to 2 characters per codeword the compaction rules for converting data into pdf417 codewords are defined in 5 4 2 2 the sub - mode switches are defined in 5 4 2 3

private static void decode text compaction ( int [ ] text compaction data , int [ ] byte compaction data , int length , string builder result ) { / / beginning from an initial state of the alpha sub - mode / / the default compaction mode for pdf417 in effect at the start of each symbol shall always be text / / compaction mode alpha sub - mode ( uppercase alphabetic ) a latch codeword from another mode to the text / / compaction mode shall always switch to the text compaction alpha sub - mode mode sub mode = mode alpha ; mode prior to shift mode = mode alpha ; int i = 0 ; while ( i < length ) { int sub mode ch = text compaction data [ i ] ; char ch = 0 ; switch ( sub mode ) { case alpha : / / alpha ( uppercase alphabetic ) if ( sub mode ch < 26 ) { / / upper case alpha character ch = ( char ) ( ' a ' + sub mode ch ) ; } else { switch ( sub mode ch ) { case 26 : ch = ' ' ; break ; case ll : sub mode = mode lower ; break ; case ml : sub mode = mode mixed ; break ; case ps : / / shift to punctuation prior to shift mode = sub mode ; sub mode = mode punct shift ; break ; case mode shift to byte compaction mode : result append ( ( char ) byte compaction data [ i ] ) ; break ; case text compaction mode latch : sub mode = mode alpha ; break ; } } break ; case lower : / / lower ( lowercase alphabetic ) if ( sub mode ch < 26 ) { ch = ( char ) ( ' a ' + sub mode ch ) ; } else { switch ( sub mode ch ) { case 26 : ch = ' ' ; break ; case as : / / shift to alpha prior to shift mode = sub mode ; sub mode = mode alpha shift ; break ; case ml : sub mode = mode mixed ; break ; case ps : / / shift to punctuation prior to shift mode = sub mode ; sub mode = mode punct shift ; break ; case mode shift to byte compaction mode : / / todo does this need to use the current character encoding ? see other occurrences below result append ( ( char ) byte compaction data [ i ] ) ; break ; case text compaction mode latch : sub mode = mode alpha ; break ; } } break ; case mixed : / / mixed ( numeric and some punctuation ) if ( sub mode ch < pl ) { ch = mixed chars [ sub mode ch ] ; } else { switch ( sub mode ch ) { case pl : sub mode = mode punct ; break ; case 26 : ch = ' ' ; break ; case ll : sub mode = mode lower ; break ; case al : case text compaction mode latch : sub mode = mode alpha ; break ; case ps : / / shift to punctuation prior to shift mode = sub mode ; sub mode = mode punct shift ; break ; case mode shift to byte compaction mode : result append ( ( char ) byte compaction data [ i ] ) ; break ; } } break ; case punct : / / punctuation if ( sub mode ch < pal ) { ch = punct chars [ sub mode ch ] ; } else { switch ( sub mode ch ) { case pal : case text compaction mode latch : sub mode = mode alpha ; break ; case mode shift to byte compaction mode : result append ( ( char ) byte compaction data [ i ] ) ; break ; } } break ; case alpha shift : / / restore sub - mode sub mode = prior to shift mode ; if ( sub mode ch < 26 ) { ch = ( char ) ( ' a ' + sub mode ch ) ; } else { switch ( sub mode ch ) { case 26 : ch = ' ' ; break ; case text compaction mode latch : sub mode = mode alpha ; break ; } } break ; case punct shift : / / restore sub - mode sub mode = prior to shift mode ; if ( sub mode ch < pal ) { ch = punct chars [ sub mode ch ] ; } else { switch ( sub mode ch ) { case pal : case text compaction mode latch : sub mode = mode alpha ; break ; case mode shift to byte compaction mode : / / ps before shift - to - byte is used as a padding character , / / see 5 4 2 4 of the specification result append ( ( char ) byte compaction data [ i ] ) ; break ; } } break ; } if ( ch ! = 0 ) { / / append decoded character to result result append ( ch ) ; } i + + ; } }


returns an iterator for the entries in the map remove is supported if { @ link collections # allocate iterators } is false , the same iterator instance is returned each time this method is called use the { @ link ordered map entries } constructor for nested or multithreaded iteration

public entries < k , v > entries ( ) { if ( collections allocate iterators ) return new ordered map entries ( this ) ; if ( entries 1 = = null ) { entries 1 = new ordered map entries ( this ) ; entries 2 = new ordered map entries ( this ) ; } if ( ! entries 1 valid ) { entries 1 reset ( ) ; entries 1 valid = true ; entries 2 valid = false ; return entries 1 ; } entries 2 reset ( ) ; entries 2 valid = true ; entries 1 valid = false ; return entries 2 ; }


set the configuration source { @ code object } for this metadata element the exact type of the object will depend on the configuration mechanism used

public void set source ( @ nullable object source ) { this source = source ; }


public list < list < read only first > > get array array of model ( ) { return array array of model ; }


this implementation returns a url for the underlying class path resource

public url get u r l ( ) throws i o exception { return file to u r i ( ) to u r l ( ) ; }


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

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


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


validates the implementation of input stream skip and ensures there is no network io for version 1 of the block blob input stream

public void test 0307 skip bounds v 1 ( ) throws exception { validate skip bounds ( account using input stream v 1 get file system ( ) ) ; }


public map < string , object > proceed ( method method , object [ ] arguments , string xid , two phase business action business action , callback < object > target callback ) throws throwable { map < string , object > ret = new hash map < > ( 4 ) ; / / tcc name string action name = business action name ( ) ; business action context action context = new business action context ( ) ; action context set xid ( xid ) ; / / set action name action context set action name ( action name ) ; / / creating branch record string branch id = do tcc action log store ( method , arguments , business action , action context ) ; action context set branch id ( branch id ) ; / / set the parameter whose type is business action context class < ? > [ ] types = method get parameter types ( ) ; int arg index = 0 ; for ( class < ? > cls : types ) { if ( cls get name ( ) equals ( business action context class get name ( ) ) ) { arguments [ arg index ] = action context ; break ; } arg index + + ; } / / the final parameters of the try method ret put ( constants tcc method arguments , arguments ) ; / / the final result ret put ( constants tcc method result , target callback execute ( ) ) ; return ret ; }


checks if the input timeline entity object is an application entity

public static boolean is application entity ( timeline entity te ) { return ( te = = null ? false : te get type ( ) equals ( timeline entity type yarn application to string ( ) ) ) ; }


public static void show soft input ( @ non null final view view , final int flags ) { input method manager imm = ( input method manager ) utils get app ( ) get system service ( context input method service ) ; if ( imm = = null ) return ; view set focusable ( true ) ; view set focusable in touch mode ( true ) ; view request focus ( ) ; imm show soft input ( view , flags , new result receiver ( new handler ( ) ) { @ override protected void on receive result ( int result code , bundle result data ) { if ( result code = = input method manager result unchanged hidden | | result code = = input method manager result hidden ) { toggle soft input ( ) ; } } } ) ; imm toggle soft input ( input method manager show forced , input method manager hide implicit only ) ; }


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


resolve attributes from attribute definition store and provide map

protected map < string , list < object > > resolve attributes from attribute definition store ( final principal principal , final map < string , list < object > > principal attributes , final registered service registered service , final service selected service ) { val ctx = application context provider get application context ( ) ; if ( ctx = = null ) { logger trace ( " no application context can be retrieved to locate attribute definition store " ) ; return principal attributes ; } logger trace ( " located application context retrieving attribute definition store and attribute definitions " ) ; val bean factory = ctx get autowire capable bean factory ( ) ; if ( ! bean factory contains bean ( " attribute definition store " ) ) { logger trace ( " no attribute definition store is available in application context " ) ; return principal attributes ; } val attribute definition store = bean factory get bean ( attribute definition store class ) ; if ( attribute definition store is empty ( ) ) { logger trace ( " no attribute definitions are defined in the attribute definition store " ) ; return principal attributes ; } return attribute definition store resolve attribute values ( principal attributes , registered service ) ; }


& lt ; max a m share & gt ; = = > yarn scheduler capacity & lt ; queue - name & gt ; maximum - am - resource - percent

private void emit max a m share ( string queue name , f s queue queue ) { float queue max am share = queue get max a m share ( ) ; / / direct floating point comparison is ok here if ( queue max am share ! = 0 0f & & queue max am share ! = queue max a m share default & & queue max am share ! = queue max am share disabled ) { capacity scheduler config set float ( prefix + queue name + " maximum - am - resource - percent " , queue max am share ) ; } if ( queue max am share = = queue max am share disabled & & queue max am share ! = queue max a m share default ) { capacity scheduler config set float ( prefix + queue name + " maximum - am - resource - percent " , 1 0f ) ; } }


name of the listener used for the connection


an expectation for checking if the given text is present in the element that matches the given locator

public static expected condition < boolean > text to be present in element located ( final by locator , final string text ) { return new expected condition < boolean > ( ) { @ override public boolean apply ( web driver driver ) { try { string element text = driver find element ( locator ) get text ( ) ; return element text contains ( text ) ; } catch ( stale element reference exception e ) { return false ; } } @ override public string to string ( ) { return string format ( " text ( ' % s ' ) to be present in element found by % s " , text , locator ) ; } } ; }


builds the final { @ link tree artifact value }

public tree artifact value build ( ) { immutable sorted map < tree file artifact , file artifact value > final child data = child data build ( ) ; if ( final child data is empty ( ) & & archived representation = = null ) { return empty ; } fingerprint fingerprint = new fingerprint ( ) ; boolean entirely remote = archived representation = = null | | archived representation archived file value ( ) is remote ( ) ; for ( map entry < tree file artifact , file artifact value > child data : final child data entry set ( ) ) { / / digest will be deterministic because children are sorted fingerprint add path ( child data get key ( ) get parent relative path ( ) ) ; child data get value ( ) add to ( fingerprint ) ; / / tolerate a mix of local and remote children ( b / 152496153 # comment 8 0 ) entirely remote & = child data get value ( ) is remote ( ) ; } if ( archived representation ! = null ) { archived representation archived file value ( ) add to ( fingerprint ) ; } return new tree artifact value ( fingerprint digest and reset ( ) , final child data , archived representation , entirely remote ) ; }


geo shape values get geo shape values ( ) ;


initialize the registry with all the methods in a protocol so they all show up in the first snapshot convenient for jmx implementations

public void init ( class < ? > protocol ) { if ( protocol cache contains ( protocol ) ) return ; protocol cache add ( protocol ) ; for ( method method : protocol get declared methods ( ) ) { string name = method get name ( ) ; log debug ( name ) ; try { registry new rate ( name , name , false , true ) ; } catch ( exception e ) { log error ( " error creating rate metrics for " + method get name ( ) , e ) ; } } }


sets the streaming context environment to a test stream environment that runs its programs on the given cluster with the given default parallelism

public static void set as context ( final mini cluster mini cluster , final int parallelism ) { set as context ( mini cluster , parallelism , collections empty list ( ) , collections empty list ( ) ) ; }


configure the thread pool backing this message channel using a custom thread pool task executor

public task executor registration task executor ( @ nullable thread pool task executor task executor ) { if ( this registration = = null ) { this registration = ( task executor ! = null ? new task executor registration ( task executor ) : new task executor registration ( ) ) ; } return this registration ; }


mark the { @ linkplain application context application context } associated with this test context as dirty ( i e , by removing it from the context cache and closing it ) the default implementation delegates to the { @ link cache aware context loader delegate } that was supplied when this { @ code test context } was constructed

public void mark application context dirty ( @ nullable hierarchy mode hierarchy mode ) { this cache aware context loader delegate close context ( this merged context configuration , hierarchy mode ) ; }


creates an entity marker , serializing entity entry prefix + entity type + revstarttime + entity id

private static byte [ ] create entity marker key ( string entity id , string entity type , byte [ ] rev start time ) throws i o exception { return key builder new instance ( ) add ( entity entry prefix ) add ( entity type ) add ( rev start time ) add ( entity id ) get bytes for lookup ( ) ; }


get all properties belonging to list of input tags calls get all properties by tag internally

public properties get all properties by tags ( final list < string > tag list ) { properties prop = new properties ( ) ; for ( string tag : tag list ) { prop put all ( this get all properties by tag ( tag ) ) ; } return prop ; }


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


removes the specified range from this { @ code range set } ( optional operation ) after this operation , if { @ code range contains ( c ) } , { @ code this contains ( c ) } will return { @ code false } if { @ code range } is empty , this is a no - op


see original { @ link ongoing stubbing # then throw ( class , class [ ] ) }

b d d my ongoing stubbing < t > will throw ( class < ? extends throwable > throwable type , class < ? extends throwable > throwable types ) ;


public static string date format ( long ts , string format , time zone tz ) { simple date format formatter = formatter cache get ( format ) ; formatter set time zone ( tz ) ; date date time = new date ( ts ) ; return formatter format ( date time ) ; }


regression test for issue # 1295 $ e v yields incorrect value 0 in " e returns [ int v ] : ' 1 ' { $ v = 1 ; } | ' ( ' e ' ) ' { $ v = $ e v ; } ; " https : github comantlrantlr 4issues 1 2 9 5

@ test public void test rule refs recursive ( ) throws exception { string recursive template = " recursive template ( inline ) : : = < < \ n " + " parser grammar a ; \ n " + " e returns [ int v ] \ n " + " : int { $ v = $ int int ; } \ n " + " | ' ( ' e ' ) ' { \ n " + " # inline # < inline > # end - inline # \ n " + " } \ n " + " ; \ n " + " > > " ; string left recursive template = " recursive template ( inline ) : : = < < \ n " + " parser grammar a ; \ n " + " e returns [ int v ] \ n " + " : a = e op = ( ' * ' | ' / ' ) b = e { $ v = eval ( $ a v , $ op type , $ b v ) ; } \ n " + " | int { $ v = $ int int ; } \ n " + " | ' ( ' e ' ) ' { \ n " + " # inline # < inline > # end - inline # \ n " + " } \ n " + " ; \ n " + " > > " ; / / ref to value returned from recursive call to rule string action = " $ v = $ e v ; " ; string expected = " ( ( e context ) localctx ) v = ( ( e context ) localctx ) e v ; " ; test actions ( recursive template , " inline " , action , expected ) ; test actions ( left recursive template , " inline " , action , expected ) ; / / ref to predefined attribute obtained from recursive call to rule action = " $ v = $ e text length ( ) ; " ; expected = " ( ( e context ) localctx ) v = ( ( ( e context ) localctx ) e ! = null ? input get text ( ( ( e context ) localctx ) e start , ( ( e context ) localctx ) e stop ) : null ) length ( ) ; " ; test actions ( recursive template , " inline " , action , expected ) ; test actions ( left recursive template , " inline " , action , expected ) ; }


gracefully shut down all thread pool will wait for all lazy persist tasks to finish

synchronized void shutdown ( ) { if ( executors = = null ) { log warn ( " async lazy persist service has already shut down " ) ; } else { log info ( " shutting down all async lazy persist service threads " ) ; for ( map entry < string , thread pool executor > e : executors entry set ( ) ) { e get value ( ) shutdown ( ) ; } / / clear the executor map so that calling execute again will fail executors = null ; log info ( " all async lazy persist service threads have been shut down " ) ; } }


specifies what type of requested indices to ignore and how to deal with wildcard expressions for example indices that don ' t exist

public restore snapshot request indices options ( indices options indices options ) { this indices options = indices options ; return this ; }


public static int px 2dp ( final float px value ) { final float scale = resources get system ( ) get display metrics ( ) density ; return ( int ) ( px value / scale + 0 5f ) ; }


private void set blocks ( block info [ ] blocks ) { this blocks = ( blocks ! = null ? blocks : block info empty array ) ; }


the < a href = " https : en wikipedia orgwiki entropy ( information theory ) " > shannon entropy value computed over all terms collected by the aggregation shannon entropy quantifies the amount of information contained in the field it is a very useful metric for measuring a wide range of properties of a data set , such as diversity , similarity , randomness etc

public double get entropy ( ) { return entropy ; }


fetch charset from content - type header value as a char sequence a lot of sitespossibly clients have charset = " charset " , for example charset = " utf - 8 " or " utf 8 " instead of " utf - 8 " this is not according to standard , but this method provide an ability to catch desired mistakes manually in code

public static char sequence get charset as sequence ( char sequence content type value ) { object util check not null ( content type value , " content type value " ) ; int index of charset = ascii string index of ignore case ascii ( content type value , charset equals , 0 ) ; if ( index of charset = = ascii string index not found ) { return null ; } int index of encoding = index of charset + charset equals length ( ) ; if ( index of encoding < content type value length ( ) ) { char sequence charset candidate = content type value sub sequence ( index of encoding , content type value length ( ) ) ; int index of semicolon = ascii string index of ignore case ascii ( charset candidate , semicolon , 0 ) ; if ( index of semicolon = = ascii string index not found ) { return charset candidate ; } return charset candidate sub sequence ( 0 , index of semicolon ) ; } return null ; }


indicates there are no more contiguous chars to add to this matcher if a minimum or more number of included chars have been seen before this call , then a sequence is returned

public boolean end sequence ( ) { last sequence = null ; return check sequence ( sequence start index , current index , false ) ; }


protected void write to 0 ( annotated output out ) { boolean annotates = out annotates ( ) ; boolean first = true ; dex file file = get file ( ) ; int at = 0 ; for ( offsetted item one : items ) { if ( annotates ) { if ( first ) { first = false ; } else { out annotate ( 0 , " \ n " ) ; } } int align mask = one get alignment ( ) - 1 ; int write at = ( at + align mask ) & ~ align mask ; if ( at ! = write at ) { out write zeroes ( write at - at ) ; at = write at ; } one write to ( file , out ) ; at + = one write size ( ) ; } if ( at ! = write size ) { throw new runtime exception ( " output size mismatch " ) ; } }


return the activity object associated with a string id

public activity get activity ( string id ) { local activity record r = m activities get ( id ) ; return r ! = null ? r activity : null ; }


this method is here so that it can be overridden with extra processing code before and after the call - back to any particular parser

public void parse ( ) throws m d exception { dmang parse info push ( start index offset , get class ( ) get simple name ( ) ) ; parse internal ( ) ; dmang parse info pop ( ) ; }


test that program diff can determine the equate differences between program 1 and program 2


returns number of files which failed to parse properly this only reflects minimal parsing of old language files which will prevent them from being added to old language map this is intended to be used by a unit test

int bad file count ( ) { return bad file count ; }


get descriptive comment which includes type and description

public string get comment ( ) { string description = get description ( ) ; if ( description ! = null ) { return get type as string ( ) + " - " + description ; } return get type as string ( ) ; }


assert that a filesystem is bound to a dt ; that is : it is a delegate fs

protected static void assert bound to d t ( final s 3 a file system fs , final text token kind ) { final s 3 a delegation tokens dt support = fs get delegation tokens ( ) get ( ) ; assert true ( " expected bound to a delegation token : " + dt support , dt support is bound to d t ( ) ) ; assert equals ( " wrong token kind " , token kind , dt support get bound d t ( ) get ( ) get kind ( ) ) ; }


check if this collection has the same attributes as the other collection if compare values is true , it also compares the values of each attribute

public final boolean same ( final attributes other , boolean compare values ) { if ( other = = this ) return true ; if ( ( other = = null ) | | ( mask ! = other mask ) ) return false ; if ( ! compare values ) return true ; sort ( ) ; other sort ( ) ; for ( int i = 0 ; i < attributes size ; i + + ) if ( ! attributes get ( i ) equals ( other attributes get ( i ) ) ) return false ; return true ; }


configures the logging levels for loggers configured in the specified settings

private static void configure logger levels ( final settings settings ) { if ( loggers log default level setting exists ( settings ) ) { final level level = loggers log default level setting get ( settings ) ; loggers set level ( log manager get root logger ( ) , level ) ; } loggers log level setting get all concrete settings ( settings ) / / do not set a log level for a logger named level ( from the default log setting ) filter ( s - > s get key ( ) equals ( loggers log default level setting get key ( ) ) = = false ) for each ( s - > { final level level = s get ( settings ) ; loggers set level ( log manager get logger ( s get key ( ) substring ( " logger " length ( ) ) ) , level ) ; } ) ; }


get the list of acceptable media types , as specified by the { @ code accept } header returns an empty list if the acceptable media types are unspecified


helper routine that just checks the given attribute has the given type for this rule and throws an illegal exception if not

protected void check type ( string attr name , type < ? > type ) { integer index = rule class get attribute index ( attr name ) ; if ( index = = null ) { throw new illegal argument exception ( " no such attribute " + attr name + " in " + rule class + " rule " + rule label ) ; } attribute attr = rule class get attribute ( index ) ; if ( attr get type ( ) ! = type ) { throw new illegal argument exception ( " attribute " + attr name + " is of type " + attr get type ( ) + " and not of type " + type + " in " + rule class + " rule " + rule label ) ; } }


public void cancel disk balance plan ( string plan i d ) throws i o exception { check superuser privilege ( ) ; get disk balancer ( ) cancel plan ( plan i d ) ; }


returns the md5 content hash of the blaze binary ( includes deploy jar , embedded binaries , and anything else that ends up in the install base )

public hash code get install m d 5 ( ) { return install m d 5 ; }


tests whether or not the translog generation should be rolled to a new generation this test is based on the size of the current generation compared to the configured generation threshold size

boolean should roll translog generation ( ) { final engine engine = get engine or null ( ) ; if ( engine ! = null ) { try { return engine should roll translog generation ( ) ; } catch ( final already closed exception e ) { / / we are already closed , no need to flush or roll } } return false ; }


returns the < a href = " https : www iana orgassignmentsaddress - family - numbersaddress - family - numbers xhtml " > address number of the family

public int address number ( ) { return address number ; }


returns the { @ link mock handler } associated with this mock object the handler is the core of mock object method handling this method is useful for framework integrators for example , other frameworks may use mock handler to simulate method calls on the mock object


checks if an item ' s range bottom is below the top range if true , it means the item is inside range

private static boolean is below viewport top ( rect visible rect , incremental module item item ) { return visible rect top < item get enter range bottom ( ) | | ( visible rect top = = item get enter range bottom ( ) & & item get bounds ( ) bottom > visible rect top ) ; }


refer to https : www envoyproxy iodocsenvoylatestapi - v 2dataaccesslogv 2accesslog proto # data - accesslog - v 2 - responseflags

protected static string parse internal error code ( final response flags response flags ) { if ( response flags ! = null ) { if ( response flags get failed local healthcheck ( ) ) { return " failed local healthcheck " ; } else if ( response flags get no healthy upstream ( ) ) { return " no healthy upstream " ; } else if ( response flags get upstream request timeout ( ) ) { return " upstream request timeout " ; } else if ( response flags get local reset ( ) ) { return " local reset " ; } else if ( response flags get upstream connection failure ( ) ) { return " upstream connection failure " ; } else if ( response flags get upstream connection termination ( ) ) { return " upstream connection termination " ; } else if ( response flags get upstream overflow ( ) ) { return " upstream overflow " ; } else if ( response flags get no route found ( ) ) { return " no route found " ; } else if ( response flags get delay injected ( ) ) { return " delay injected " ; } else if ( response flags get fault injected ( ) ) { return " fault injected " ; } else if ( response flags get rate limited ( ) ) { return " rate limited " ; } else if ( response flags get unauthorized details ( ) ! = null ) { return " unauthorized details " ; } else if ( response flags get rate limit service error ( ) ) { return " rate limit service error " ; } else if ( response flags get downstream connection termination ( ) ) { return " downstream connection termination " ; } else if ( response flags get upstream retry limit exceeded ( ) ) { return " upstream retry limit exceeded " ; } else if ( response flags get stream idle timeout ( ) ) { return " stream idle timeout " ; } else if ( response flags get invalid envoy request headers ( ) ) { return " invalid envoy request headers " ; } else if ( response flags get downstream protocol error ( ) ) { return " downstream protocol error " ; } } return " " ; }


the main driver for creating the archives it takes at least three command line parameters the parent path , the src and the dest it does an lsr on the source paths the mapper created archuves and the reducer creates the archive index

public int run ( string [ ] args ) throws exception { try { / / parse cli options options options = new options ( ) ; options add option ( archive name , true , " name of the archive this is mandatory option " ) ; options add option ( parent path , true , " parent path of sources this is mandatory option " ) ; options add option ( replication , true , " replication factor archive files " ) ; options add option ( help , false , " show the usage " ) ; parser parser = new gnu parser ( ) ; command line command line = parser parse ( options , args , true ) ; if ( command line has option ( help ) ) { print usage ( options , true ) ; return 0 ; } if ( ! command line has option ( archive name ) ) { print usage ( options , false ) ; throw new i o exception ( " archive name not specified " ) ; } string archive name = command line get option value ( archive name ) ; if ( ! check valid name ( archive name ) ) { print usage ( options , false ) ; throw new i o exception ( " invalid name for archives " + archive name ) ; } / / check to see if relative parent has been provided or not / / this is a required parameter if ( ! command line has option ( parent path ) ) { print usage ( options , false ) ; throw new i o exception ( " parent path not specified " ) ; } path parent path = new path ( command line get option value ( parent path ) ) ; if ( ! parent path is absolute ( ) ) { parent path = parent path get file system ( get conf ( ) ) make qualified ( parent path ) ; } if ( command line has option ( replication ) ) { repl = short parse short ( command line get option value ( replication ) ) ; } / / remaining args args = command line get args ( ) ; list < path > src paths = new array list < path > ( ) ; path dest path = null ; / / read the rest of the paths for ( int i = 0 ; i < args length ; i + + ) { if ( i = = ( args length - 1 ) ) { dest path = new path ( args [ i ] ) ; if ( ! dest path is absolute ( ) ) { dest path = dest path get file system ( get conf ( ) ) make qualified ( dest path ) ; } } else { path arg path = new path ( args [ i ] ) ; if ( arg path is absolute ( ) ) { print usage ( options , false ) ; throw new i o exception ( " source path " + arg path + " is not relative to " + parent path ) ; } src paths add ( new path ( parent path , arg path ) ) ; } } if ( dest path = = null ) { print usage ( options , false ) ; throw new i o exception ( " destination path not specified " ) ; } if ( src paths size ( ) = = 0 ) { / / assuming if the user does not specify path for sources / / the whole parent directory needs to be archived src paths add ( parent path ) ; } / / do a glob on the src paths and then pass it on list < path > glob paths = new array list < path > ( ) ; for ( path p : src paths ) { file system fs = p get file system ( get conf ( ) ) ; file status [ ] statuses = fs glob status ( p ) ; if ( statuses ! = null ) { for ( file status status : statuses ) { glob paths add ( fs make qualified ( status get path ( ) ) ) ; } } } if ( glob paths is empty ( ) ) { throw new i o exception ( " the resolved paths set is empty " + " please check whether the src paths exist , where src paths = " + src paths ) ; } archive ( parent path , glob paths , archive name , dest path ) ; } catch ( i o exception ie ) { system err println ( ie get localized message ( ) ) ; return - 1 ; } return 0 ; }


public boolean acquire ( final lock lock ) { lock set unique id ( this unique id ) ; if ( this lock timeout > 0 ) { lock set expiration date ( zoned date time now ( zone offset utc ) plus seconds ( this lock timeout ) ) ; } else { lock set expiration date ( null ) ; } try { if ( lock get application id ( ) ! = null ) { this entity manager merge ( lock ) ; } else { lock set application id ( this application id ) ; this entity manager persist ( lock ) ; } return true ; } catch ( final exception e ) { if ( logger is debug enabled ( ) ) { logger debug ( " [ { } ] could not obtain [ { } ] lock " , this unique id , this application id , e ) ; } else { logger info ( " [ { } ] could not obtain [ { } ] lock " , this unique id , this application id ) ; } } return false ; }


set the value of < code > name < code > to the given time duration this is equivalent to < code > set ( & lt ; name & gt ; , value + & lt ; time suffix & gt ; ) < code >

public void set time duration ( string name , long value , time unit unit ) { set ( name , value + parsed time duration unit for ( unit ) suffix ( ) ) ; }


public find pets by tags oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


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


applies the given aggregation function to each window the aggregation function is called for each element , aggregating values incrementally and keeping the state to one accumulator per key and window

public < acc , r > bootstrap transformation < t > aggregate ( aggregate function < t , acc , r > function ) { check not null ( function , " function " ) ; if ( function instanceof rich function ) { throw new unsupported operation exception ( " this aggregation function cannot be a rich function " ) ; } type information < acc > accumulator type = type extractor get aggregate function accumulator type ( function , input get type ( ) , null , false ) ; return aggregate ( function , accumulator type ) ; }


the collector needs to apply the same decision to incremental updates in a trace

public void idempotent ( ) { collector sampler sampler 1 = collector sampler create ( 0 1f ) ; collector sampler sampler 2 = collector sampler create ( 0 1f ) ; assert that ( lots of spans ( ) filter ( s - > sampler 1 is sampled ( s trace id ( ) , false ) ) to array ( ) ) contains exactly ( lots of spans ( ) filter ( s - > sampler 2 is sampled ( s trace id ( ) , false ) ) to array ( ) ) ; }


subtracts the given costs from these costs if the given costs are unknown , then these costs are remain unchanged

public void subtract costs ( costs other ) { if ( this network cost ! = unknown & & other network cost ! = unknown ) { this network cost - = other network cost ; if ( this network cost < 0 ) { throw new illegal argument exception ( " cannot subtract more cost then there is " ) ; } } if ( this disk cost ! = unknown & & other disk cost ! = unknown ) { this disk cost - = other disk cost ; if ( this disk cost < 0 ) { throw new illegal argument exception ( " cannot subtract more cost then there is " ) ; } } if ( this cpu cost ! = unknown & & other cpu cost ! = unknown ) { this cpu cost - = other cpu cost ; if ( this cpu cost < 0 ) { throw new illegal argument exception ( " cannot subtract more cost then there is " ) ; } } / / - - - - - - - - - - relative costs - - - - - - - - - - this heuristic network cost - = other heuristic network cost ; if ( this heuristic network cost < 0 ) { throw new illegal argument exception ( " cannot subtract more cost then there is " ) ; } this heuristic disk cost - = other heuristic disk cost ; if ( this heuristic disk cost < 0 ) { throw new illegal argument exception ( " cannot subtract more cost then there is " ) ; } this heuristic cpu cost - = other heuristic cpu cost ; if ( this heuristic cpu cost < 0 ) { throw new illegal argument exception ( " cannot subtract more cost then there is " ) ; } }


tests a boolean query with no children clauses

public void test empty bool ( ) throws exception { create index ( " test " ) ; ensure green ( ) ; int num docs = random int between ( 100 , 150 ) ; index request builder [ ] docs = new index request builder [ num docs ] ; for ( int i = 0 ; i < num docs ; i + + ) { docs [ i ] = client ( ) prepare index ( " test " ) set id ( string value of ( i ) ) set source ( " field 1 " , english int to english ( i ) , " field 2 " , i ) ; } index random ( true , docs ) ; refresh ( ) ; query builder q = query builders bool query ( ) ; logger info ( " query : { } " , q ) ; search response resp = client ( ) prepare search ( ) set query ( q ) set profile ( true ) set search type ( search type query then fetch ) get ( ) ; assert not null ( " profile response element should not be null " , resp get profile results ( ) ) ; assert that ( " profile response should not be an empty array " , resp get profile results ( ) size ( ) , not ( 0 ) ) ; for ( map entry < string , profile shard result > shard result : resp get profile results ( ) entry set ( ) ) { for ( query profile shard result search profiles : shard result get value ( ) get query profile results ( ) ) { for ( profile result result : search profiles get query results ( ) ) { assert not null ( result get query name ( ) ) ; assert not null ( result get lucene description ( ) ) ; assert that ( result get time ( ) , greater than ( 0l ) ) ; assert not null ( result get time breakdown ( ) ) ; } collector result result = search profiles get collector result ( ) ; assert that ( result get name ( ) , is ( not ( empty or null string ( ) ) ) ) ; assert that ( result get time ( ) , greater than ( 0l ) ) ; } } }


writes protobuf varint 3 2 to ( @ link byte buf )

static void write raw varint 3 2 ( byte buf out , int value ) { while ( true ) { if ( ( value & ~ 0x 7 f ) = = 0 ) { out write byte ( value ) ; return ; } else { out write byte ( ( value & 0x 7 f ) | 0x 8 0 ) ; value > > > = 7 ; } } }


helper method to check if the queue should attempt assigning resources

boolean assign container pre check ( f s scheduler node node ) { if ( node get reserved container ( ) ! = null ) { log debug ( " assigning container failed on node ' { } ' because it has " + " reserved containers " , node get node name ( ) ) ; return false ; } else if ( ! resources fits in ( get resource usage ( ) , get max share ( ) ) ) { if ( log is debug enabled ( ) ) { log debug ( " assigning container failed on node ' " + node get node name ( ) + " because queue resource usage is larger than max share : " + dump state ( ) ) ; } return false ; } else { return true ; } }


called by framework code to determine whether a node is finished this will only be called on this node when all of its inputs are finished


single - sided unbounded streaming from server to client the server repeatedly returns the client payload as - is

public void streaming from server ( io grpc benchmarks proto messages simple request request , io grpc stub stream observer < io grpc benchmarks proto messages simple response > response observer ) { io grpc stub client calls async server streaming call ( get channel ( ) new call ( get streaming from server method ( ) , get call options ( ) ) , request , response observer ) ; }


handling of correlated in predicate involves group by over all symbols from source once aggregation is added to the plan , it prevents pruning of the unreferenced symbols however , the aggregation ' s result doesn ' t actually depended on those symbols and this test makes sure the symbols are pruned first

public void test symbols pruned in correlated in predicate source ( ) { assert plan ( " select orderkey , comment in ( select clerk from orders s where s orderkey = o orderkey and s orderkey < 7 ) from lineitem o " , any tree ( node ( join node class , any tree ( strict table scan ( " lineitem " , immutable map of ( " orderkey " , " orderkey " , " comment " , " comment " ) ) ) , any tree ( table scan ( " orders " ) ) ) ) ) ; }


return the jca activation spec to use for activating the endpoint

public activation spec get activation spec ( ) { return this activation spec ; }


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


test equal objects after adding multiple instances at once with a null

public void test add two equal objects at once with null ( ) { try { equals tester add equality group ( reference , equal object 1 , null ) ; fail ( " should fail on null equal object " ) ; } catch ( null pointer exception e ) { } }


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


{ { @ link rocks d b native metric monitor } } is enabled is any property is set

public boolean is enabled ( ) { return ! properties is empty ( ) ; }


indicate whether or not this { @ code model and view } has a view , either as a view name or as a direct { @ link view } instance

public boolean has view ( ) { return ( this view ! = null ) ; }


test that program merge can determine the memory reference differences between program 1 and program 2 with same " from " address but different " to " address

public void test apply mem ref to addr diff ( ) throws exception { / / 0x 1 0 0 2cfc : p 1 and p 2 have mem refs to different addresses program builder 1 create memory reference ( " 0x 1 0 0 2cfc " , " 0x 1 0 0 6 4a 0 " , ref type read , source type user defined , 0 ) ; program builder 2 create memory reference ( " 0x 1 0 0 2cfc " , " 0x 1 0 0 6 4 8 8 " , ref type read , source type user defined , 0 ) ; program merge = new program merge manager ( p 1 , p 2 , task monitor adapter dummy monitor ) ; address set as = new address set ( addr ( 0x 1 0 0 2cfc ) , addr ( 0x 1 0 0 2cfc ) ) ; program merge set diff filter ( new program diff filter ( program diff filter reference diffs ) ) ; program merge set merge filter ( new program merge filter ( program merge filter references , program merge filter replace ) ) ; assert equals ( as , program merge get filtered differences ( ) ) ; program merge merge ( as , task monitor adapter dummy monitor ) ; assert equals ( new address set ( ) , program merge get filtered differences ( ) ) ; }


private boolean verify access token request ( final http servlet request request , final http servlet response response ) { val validators = get o auth configuration context ( ) get access token grant request validators ( ) ; val context = new j e e context ( request , response , get o auth configuration context ( ) get session store ( ) ) ; return validators stream ( ) filter ( ext - > ext supports ( context ) ) find first ( ) or else throw ( ( supplier < runtime exception > ) ( ) - > new unsupported operation exception ( " access token request is not supported " ) ) validate ( context ) ; }


specialized parallel variant of { @ link sky query environment # get r build files }

static void get r build files parallel ( sky query environment env , collection < path fragment > file identifiers , query expression context < target > context , callback < target > callback ) throws query exception , interrupted exception { r build files visitor visitor = new r build files visitor ( env , / * visit uniquifier = * / env create sky key uniquifier ( ) , / * result uniquifier = * / env create sky key uniquifier ( ) , context , callback ) ; visitor visit file identifiers and wait for completion ( env graph , file identifiers ) ; }


return the number of bytes needed to encode an integer in unsigned variable - length format

static int size of unsigned varint ( int value ) { int bytes = 1 ; while ( ( value & 0xffffff 8 0 ) ! = 0l ) { bytes + = 1 ; value > > > = 7 ; } return bytes ; }


aggregate the values of records in this stream by the grouped key and defined sessions note that sessions are generated on a per - key basis and records with different keys create independent sessions records with { @ code null } key or value are ignored aggregating is a generalization of { @ link # reduce ( reducer ) combining via reduce ( ) } as it , for example , allows the result to have a different type than the input values the result is written into a local { @ link session store } ( which is basically an ever - updating materialized view ) furthermore , updates to the store are sent downstream into a { @ link k table } changelog stream the specified { @ link initializer } is applied directly before the first input record per session is processed to provide an initial intermediate aggregation result that is used to process the first record per session the specified { @ link aggregator } is applied for each input record and computes a new aggregate using the current aggregate ( or for the very first record using the intermediate aggregation result provided via the { @ link initializer } ) and the record ' s value the specified { @ link merger } is used to merge two existing sessions into one , i e , when the windows overlap , they are merged into a single session and the old sessions are discarded thus , { @ code aggregate ( ) } can be used to compute aggregate functions like count ( c f { @ link # count ( ) } ) the default key and value serde from the config will be used for serializing the result if a different serde is required then you should use { @ link # aggregate ( initializer , aggregator , merger , materialized ) } not all updates might get sent downstream , as an internal cache is used to deduplicate consecutive updates to the same window and key the rate of propagated updates depends on your input data rate , the number of distinct keys , the number of parallel running kafka streams instances , and the { @ link streams config configuration } parameters for { @ link streams config # cache max bytes buffering config cache size } , and { @ link streams config # commit interval ms config commit interval } for failure and recovery the store will be backed by an internal changelog topic that will be created in kafka the changelog topic will be named " $ { application id } - $ { internal store name } - changelog " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " internal store name " is an internal name and " - changelog " is a fixed suffix note that the internal store name may not be queryable through interactive queries you can retrieve all generated internal topic names via { @ link topology # describe ( ) }

< vr > k table < windowed < k > , vr > aggregate ( final initializer < vr > initializer , final aggregator < ? super k , ? super v , vr > aggregator , final merger < ? super k , vr > session merger ) ;


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


size judgment , in the case of the two names and so on completely consistent , according to the hierarchy

public int compare to ( resolved dependency info other ) { / / if the two are equal , follow the same sequence if ( indent < other indent ) { return - 1 ; } else { return 1 ; } }


sets the number of shard copies that should be active for indices closing to return defaults to { @ link active shard count # default } , which will wait for one shard copy ( the primary ) to become active set this value to { @ link active shard count # all } to wait for all shards ( primary and all replicas ) to be active before returning otherwise , use { @ link active shard count # from ( int ) } to set this value to any non - negative integer , up to the number of copies per shard ( number of replicas + 1 ) , to wait for the desired amount of shard copies to become active before returning indices closing will only wait up until the timeout value for the number of shard copies to be active before returning

public close index request builder set wait for active shards ( final active shard count wait for active shards ) { request wait for active shards ( wait for active shards ) ; return this ; }


this case will cost several minutes , which causes ci very slow , so it only runs when - d alarm core test = true existed

public void test trigger time point ( ) throws interrupted exception { string test = system get property ( " alarm core test " ) ; if ( test = = null ) { return ; } rules empty rules = new rules ( ) ; empty rules set rules ( new array list < > ( 0 ) ) ; empty rules set webhooks ( new array list < > ( 0 ) ) ; alarm core core = new alarm core ( new alarm rules watcher ( empty rules , null ) ) ; map < string , list < running rule > > running context = whitebox get internal state ( core , " running context " ) ; list < running rule > rules = new array list < > ( 1 ) ; running rule mock rule = power mockito mock ( running rule class ) ; list < local date time > check time = new linked list < > ( ) ; final boolean [ ] is add = { true } ; power mockito do answer ( new answer < object > ( ) { @ override public object answer ( invocation on mock mock ) throws throwable { if ( is add [ 0 ] ) { check time add ( local date time now ( ) ) ; } return new array list < > ( 0 ) ; } } ) when ( mock rule ) check ( ) ; rules add ( mock rule ) ; running context put ( " mock " , rules ) ; core start ( new array list < > ( 0 ) ) ; for ( int i = 0 ; i < 10 ; i + + ) { thread sleep ( 60 * 1000l ) ; if ( check time size ( ) > = 3 ) { is add [ 0 ] = false ; assert assert true ( check time points ( check time ) ) ; break ; } if ( i = = 9 ) { assert assert true ( false ) ; } } }


converts a hash into a bucket index ( primary or alternate ) if the hash is negative , this flips the bits the hash is then modulo num buckets to get the final index expert - level api

static int hash to index ( int hash , int num buckets ) { return hash & ( num buckets - 1 ) ; }


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


checks the correct result if a get operation fails during the lookup of the file

private void test get fails during lookup ( final job i d job id 1 , final job i d job id 2 , blob key blob type blob type ) throws i o exception , interrupted exception { final configuration config = new configuration ( ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; try ( blob server server = new blob server ( config , new void blob store ( ) ) ; blob cache service cache = new blob cache service ( config , new void blob store ( ) , new inet socket address ( " localhost " , server get port ( ) ) ) ) { server start ( ) ; byte [ ] data = new byte [ 2000000 ] ; rnd next bytes ( data ) ; / / put content addressable ( like libraries ) blob key key = put ( server , job id 1 , data , blob type ) ; assert not null ( key ) ; verify type ( blob type , key ) ; / / delete file to make sure that get requests fail file blob file = server get storage location ( job id 1 , key ) ; assert true ( blob file delete ( ) ) ; / / issue a get request that fails verify deleted ( cache , job id 1 , key ) ; / / add the same data under a second job id blob key key 2 = put ( server , job id 2 , data , blob type ) ; assert not null ( key 2 ) ; verify key different hash equals ( key , key 2 ) ; / / request for job id 2 should succeed get ( cache , job id 2 , key 2 ) ; / / request for job id 1 should still fail verify deleted ( cache , job id 1 , key ) ; if ( blob type = = permanent blob ) { / / still existing on server assert true ( server get storage location ( job id 2 , key 2 ) exists ( ) ) ; / / delete job id 2 on cache blob file = cache get permanent blob service ( ) get storage location ( job id 2 , key 2 ) ; assert true ( blob file delete ( ) ) ; / / try to retrieve again get ( cache , job id 2 , key 2 ) ; / / delete on cache and server , verify that it is not accessible anymore blob file = cache get permanent blob service ( ) get storage location ( job id 2 , key 2 ) ; assert true ( blob file delete ( ) ) ; blob file = server get storage location ( job id 2 , key 2 ) ; assert true ( blob file delete ( ) ) ; verify deleted ( cache , job id 2 , key 2 ) ; } else { / / deleted eventually on the server by the get request above verify deleted eventually ( server , job id 2 , key 2 ) ; / / delete job id 2 on cache blob file = cache get transient blob service ( ) get storage location ( job id 2 , key 2 ) ; assert true ( blob file delete ( ) ) ; / / verify that it is not accessible anymore verify deleted ( cache , job id 2 , key 2 ) ; } } }


create an activation framework data source for the given input stream source

protected data source create data source ( final input stream source input stream source , final string content type , final string name ) { return new data source ( ) { @ override public input stream get input stream ( ) throws i o exception { return input stream source get input stream ( ) ; } @ override public output stream get output stream ( ) { throw new unsupported operation exception ( " read - only javax activation data source " ) ; } @ override public string get content type ( ) { return content type ; } @ override public string get name ( ) { return name ; } } ; }


run log analyzer in test mode for file test log

public void test j h l a ( ) { string [ ] args = { " - test " , history log , " - job delimiter " , " ! ! file = * ! ! " } ; j h log analyzer main ( args ) ; args = new string [ ] { " - test " , history log , " - job delimiter " , " ! ! file = * ! ! " , " - users included " , " hadoop , hadoop 2 " } ; j h log analyzer main ( args ) ; args = new string [ ] { " - test " , history log , " - job delimiter " , " ! ! file = * ! ! " , " - users excluded " , " hadoop , hadoop 3 " } ; j h log analyzer main ( args ) ; }


returns a registered { @ link char filter factory } provider by { @ link index settings } or a registered { @ link char filter factory } provider by predefined name or < code > null < code > if the char filter was not registered

private analysis provider < char filter factory > get char filter provider ( string char filter , index settings index settings ) { return get provider ( component char filter , char filter , index settings , " index analysis char filter " , char filters , this : : get char filter provider ) ; }


public static boolean is scalar as address ( int operand type ) { return ( is address ( operand type ) & & is scalar ( operand type ) ) ; }


required one or more hosts exposed by this gateway while typically applicable to http services , it can also be used for tcp services using tls with sni a host is specified as a ` dns name ` with an optional ` namespace ` prefix the ` dns name ` should be specified using fqdn format , optionally including a wildcard character in the left - most component ( e g , ` prod & # 42 ; example com ` ) set the ` dns name ` to ` ` to select all ` virtual service ` hosts from the specified namespace ( e g , ` prod & # 42 ; ` ) the ` namespace ` can be set to ` ` or ` ` , representing any or the current namespace , respectively for example , ` & # 47 ; foo example com ` selects the service from any available namespace while ` foo example com ` only selects the service from the namespace of the sidecar the default , if no ` namespace ` is specified , is ` & # 47 ; ` , that is , select services from any namespace any associated ` destination rule ` in the selected namespace will also be used a ` virtual service ` must be bound to the gateway and must have one or more hosts that match the hosts specified in a server the match could be an exact match or a suffix match with the server ' s hosts for example , if the server ' s hosts specifies ` example com ` , a ` virtual service ` with hosts ` dev example com ` or ` prod example com ` will match however , a ` virtual service ` with host ` example com ` or ` newexample com ` will not match note : only virtual services exported to the gateway ' s namespace ( e g , ` export to ` value of ` ` ) can be referenced private configurations ( e g , ` export to ` set to ` ` ) will not be available refer to the ` export to ` setting in ` virtual service ` , ` destination rule ` , and ` service entry ` configurations for details < code > repeated string hosts = 2 ; < code >

public com google protobuf byte string get hosts bytes ( int index ) { return hosts get byte string ( index ) ; }


updates the ceiling constraints ( exclusive ) of the seek operation

private void update seek ceiling ( long ceiling time position , long ceiling byte position ) { this ceiling time position = ceiling time position ; this ceiling byte position = ceiling byte position ; update next search byte position ( ) ; }


public string get name ( ) { return get xfer addr ( ) ; }


creates a { @ code completable future } that polls a { @ code asynchronously created resource } until its { @ link asynchronously created resource # queue status ( ) queue status } becomes { @ link queue status id # completed completed } the future completes with the result of { @ link asynchronously created resource # resource ( ) }

private < r , a extends asynchronously created resource < r > > completable future < r > poll resource async ( final supplier < completable future < a > > resource future supplier ) { return poll resource async ( resource future supplier , new completable future < > ( ) , 0 ) ; }


private void clear buffers ( ) { get striped reader ( ) clear buffers ( ) ; target buffer clear ( ) ; }


write the keystore to the given config directory

public synchronized void save ( path config dir , char [ ] password ) throws exception { ensure open ( ) ; simple f s directory directory = new simple f s directory ( config dir ) ; / / write to tmp file first , then overwrite string tmp file = keystore filename + " tmp " ; try ( index output output = directory create output ( tmp file , i o context default ) ) { codec util write header ( output , keystore filename , format version ) ; output write byte ( password length = = 0 ? ( byte ) 0 : ( byte ) 1 ) ; / / new cipher params secure random random = randomness create secure ( ) ; / / use 64 bytes salt , which surpasses that recommended by owasp / / see https : / / www owasp org / index php / password storage cheat sheet byte [ ] salt = new byte [ 64 ] ; random next bytes ( salt ) ; / / use 96 bits ( 12 bytes ) for iv as recommended by nist / / see http : / / nvlpubs nist gov / nistpubs / legacy / sp / nistspecialpublication 8 0 0 - 3 8d pdf section 5 2 1 1 byte [ ] iv = new byte [ 12 ] ; random next bytes ( iv ) ; / / encrypted data byte [ ] encrypted bytes = encrypt ( password , salt , iv ) ; / / size of data block output write int ( 4 + salt length + 4 + iv length + 4 + encrypted bytes length ) ; output write int ( salt length ) ; output write bytes ( salt , salt length ) ; output write int ( iv length ) ; output write bytes ( iv , iv length ) ; output write int ( encrypted bytes length ) ; output write bytes ( encrypted bytes , encrypted bytes length ) ; codec util write footer ( output ) ; } catch ( final access denied exception e ) { final string message = string format ( locale root , " unable to create temporary keystore at [ % s ] , write permissions required for [ % s ] or run [ elasticsearch - keystore upgrade ] " , config dir resolve ( tmp file ) , config dir ) ; throw new user exception ( exit codes config , message , e ) ; } path keystore file = keystore path ( config dir ) ; files move ( config dir resolve ( tmp file ) , keystore file , standard copy option replace existing , standard copy option atomic move ) ; posix file attribute view attrs = files get file attribute view ( keystore file , posix file attribute view class ) ; if ( attrs ! = null ) { / / don ' t rely on umask : ensure the keystore has minimal permissions attrs set permissions ( posix file permissions from string ( " rw - rw - - - - " ) ) ; } }


private static list < string > list ( string args ) { return lists new array list ( args ) ; }


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


called to orderly shut down hudson this is a good opportunity to clean up resources that plugin started this method will not be invoked if the { @ link # start ( ) } failed abnormally

public void stop ( ) throws exception { }


public void set object ( int parameter index , object x ) throws s q l exception { }


private static string get localized values ( final string locale , final list < ? > items ) { val found locale = find locale ( string utils default string ( locale , " en " ) , items ) ; if ( found locale is present ( ) ) { return found locale get ( ) ; } if ( ! items is empty ( ) ) { val item = items get ( 0 ) ; var value = string utils empty ; if ( item instanceof localized name ) { value = ( ( localized name ) item ) get value ( ) ; } if ( item instanceof localized u r i ) { value = ( ( localized u r i ) item ) get u r i ( ) ; } if ( item instanceof x s string ) { value = ( ( x s string ) item ) get value ( ) ; } logger trace ( " loading first available locale [ { } ] " , value ) ; return value ; } return null ; }


returns the logical xor of this long value and the given particular long value

public long value xor ( particular long value other ) { return xor ( ( specific long value ) other ) ; }


builds a new cache directive stats populated with the set properties

public cache directive stats build ( ) { return new cache directive stats ( bytes needed , bytes cached , files needed , files cached , has expired ) ; }


when using the highlighter type { @ code fvh } this setting controls which scanner to use for fragment boundaries , and defaults to " simple "

public hb boundary scanner type ( string boundary scanner type ) { this boundary scanner type = boundary scanner type from string ( boundary scanner type ) ; return ( hb ) this ; }


sse builder comment ( string comment ) ;


the successful number of shards the search was executed on

public int get successful shards ( ) { return shard stats successful shards ; }


the set of arityplural mappings < code > repeated aapt pb plural entry entry = 1 ; < code >

public builder set entry ( int index , com android aapt resources plural entry builder builder for value ) { copy on write ( ) ; instance set entry ( index , builder for value ) ; return this ; }


a deserialized serialized atomic holds same value

public void test serialization ( ) throws exception { atomic double a = new atomic double ( ) ; atomic double b = serial clone ( a ) ; assert not same ( a , b ) ; a set ( - 22 0 ) ; atomic double c = serial clone ( a ) ; assert not same ( b , c ) ; assert bit equals ( - 22 0 , a get ( ) ) ; assert bit equals ( 0 0 , b get ( ) ) ; assert bit equals ( - 22 0 , c get ( ) ) ; for ( double x : values ) { atomic double d = new atomic double ( x ) ; assert bit equals ( serial clone ( d ) get ( ) , d get ( ) ) ; } }


gets all the { @ link item } s recursively in the { @ link item group } tree and filter them by the given type

default < t extends item > list < t > get all items ( class < t > type ) { return items get all items ( this , type ) ; }


sleep and suppress interrupted exception ( but re - signal it )

public static void quietly sleep ( final long millis ) { try { thread sleep ( millis ) ; } catch ( interrupted exception e ) { / / i said be quiet ! current thread ( ) interrupt ( ) ; } }


public void update modification time ( long time , boolean is output ) { if ( is output ) { update output modification time ( time ) ; } else { update input modification time ( time ) ; } }


when the group link is turned on and reset in the same change , assume this is the first time the link password it being set and do not show reset message

public void member changed group link access to on and reset ( ) { decrypted group change change = change by ( alice ) invite link access ( access control access required any ) reset group link ( ) build ( ) ; assert that ( describe change ( change ) , is ( singleton list ( " alice turned on the group link with admin approval off " ) ) ) ; }


determine the declared ( non - generic ) type of the wrapped parameterfield

public class < ? > get dependency type ( ) { if ( this field ! = null ) { if ( this nesting level > 1 ) { type type = this field get generic type ( ) ; for ( int i = 2 ; i < = this nesting level ; i + + ) { if ( type instanceof parameterized type ) { type [ ] args = ( ( parameterized type ) type ) get actual type arguments ( ) ; type = args [ args length - 1 ] ; } } if ( type instanceof class ) { return ( class < ? > ) type ; } else if ( type instanceof parameterized type ) { type arg = ( ( parameterized type ) type ) get raw type ( ) ; if ( arg instanceof class ) { return ( class < ? > ) arg ; } } return object class ; } else { return this field get type ( ) ; } } else { return obtain method parameter ( ) get nested parameter type ( ) ; } }


merge adds when the given key is not present

public void test merge 1 ( ) { concurrent map map = map 5 ( ) ; assert equals ( " y " , map merge ( six , " y " , ( x , y ) - > " z " ) ) ; }


same as { @ link # write array ( writeable [ ] ) } but the provided array may be null an additional boolean value is serialized to indicate whether the array was null or not

public < t extends writeable > void write optional array ( @ nullable t [ ] array ) throws i o exception { write optional array ( ( out , value ) - > value write to ( out ) , array ) ; }


returns the spawn action that generates an artifact implicitly assumes the action is a spawn action

protected final spawn action get generating spawn action ( artifact artifact ) { return ( spawn action ) get generating action ( artifact ) ; }


returns all the keys in the state in a { @ link collections # unmodifiable set ( set ) }

public iterable < k > keys ( ) { return collections unmodifiable set ( state key set ( ) ) ; }


returns a new equivalence relation for { @ code f } which evaluates equivalence by first applying { @ code function } to the argument , then evaluating using { @ code this } that is , for any pair of non - null objects { @ code x } and { @ code y } , { @ code equivalence on result of ( function ) equivalent ( a , b ) } is true if and only if { @ code equivalence equivalent ( function apply ( a ) , function apply ( b ) ) } is true for example : { @ code equivalence < person > same age = equivalence equals ( ) on result of ( get person age ) ; } { @ code function } will never be invoked with a null value note that { @ code function } must be consistent according to { @ code this } equivalence relation that is , invoking { @ link function # apply } multiple times for a given value must return equivalent results for example , { @ code equivalence identity ( ) on result of ( functions to string function ( ) ) } is broken because it ' s not guaranteed that { @ link object # to string } ) always returns the same string instance

public final < f > equivalence < f > on result of ( function < f , ? extends t > function ) { return new functional equivalence < > ( function , this ) ; }


initial delay after a rejection before retrying a bulk request with the default max retries the total backoff for retrying rejections is about one minute per bulk request once the entire bulk request is successful the retry counter resets

public self set retry backoff initial time ( time value retry backoff initial time ) { request set retry backoff initial time ( retry backoff initial time ) ; return self ( ) ; }


part ii of get additional block ( ) should repeat the same analysis of the file state as in part 1 , but under the write lock if the conditions still hold , then allocate a new block with the new targets , add it to the i node and to the blocks map

static located block store allocated block ( f s namesystem fsn , string src , long file id , string client name , extended block previous , datanode storage info [ ] targets ) throws i o exception { long offset ; / / run the full analysis again , since things could have changed / / while choose target ( ) was executing located block [ ] on retry block = new located block [ 1 ] ; i nodes in path iip = fsn dir resolve path ( null , src , file id ) ; file state file state = analyze file state ( fsn , iip , file id , client name , previous , on retry block ) ; final i node file pending file = file state inode ; src = file state path ; if ( on retry block [ 0 ] ! = null ) { if ( on retry block [ 0 ] get locations ( ) length > 0 ) { / / this is a retry just return the last block if having locations return on retry block [ 0 ] ; } else { / / add new chosen targets to already allocated block and return block info last block in file = pending file get last block ( ) ; last block in file get under construction feature ( ) set expected locations ( last block in file , targets , pending file get block type ( ) ) ; offset = pending file compute file size ( ) ; return make located block ( fsn , last block in file , targets , offset ) ; } } / / commit the last block and complete it if it has minimum replicas fsn commit or complete last block ( pending file , file state iip , extended block get local block ( previous ) ) ; / / allocate new block , record block locations in i node final block type block type = pending file get block type ( ) ; / / allocate new block , record block locations in i node block new block = fsn create new block ( block type ) ; i nodes in path inodes in path = i nodes in path from i node ( pending file ) ; save allocated block ( fsn , src , inodes in path , new block , targets , block type ) ; persist new block ( fsn , src , pending file ) ; offset = pending file compute file size ( ) ; / / return located block return make located block ( fsn , fsn get stored block ( new block ) , targets , offset ) ; }


use { @ link # get annotations map ( ) } instead

public java util map < java lang string , java lang string > get annotations ( ) { return get annotations map ( ) ; }


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


" overrides " the static method in { @ link managed channel builder }

public static google default channel builder for address ( string name , int port ) { return for target ( grpc util authority from host and port ( name , port ) ) ; }


public int get sql datetime sub ( ) { return sql datetime sub ; }


increases the capacity of the vertex set so additional vertices can be added

void grow ( ) { modification number + + ; if ( ( key indices size ( ) * 13 ) > ( capacity * 9 ) ) { int new capacity = ( int ) math round ( key indices size ( ) * 1 7 ) + 7 ; edge [ ] new first outgoing edge = new edge [ new capacity ] ; edge [ ] new first incoming edge = new edge [ new capacity ] ; edge [ ] new last outgoing edge = new edge [ new capacity ] ; edge [ ] new last incoming edge = new edge [ new capacity ] ; vertex [ ] new vertices = new vertex [ new capacity ] ; next index = 0 ; for ( int i = 0 ; i < capacity ; i + + ) { if ( vertices [ i ] ! = null ) { new vertices [ next index ] = vertices [ i ] ; new first outgoing edge [ next index ] = first outgoing edge [ i ] ; new first incoming edge [ next index ] = first incoming edge [ i ] ; new last outgoing edge [ next index ] = last outgoing edge [ i ] ; new last incoming edge [ next index ] = last incoming edge [ i ] ; key indices remove ( vertices [ i ] key ( ) ) ; key indices put ( vertices [ i ] key ( ) , next index ) ; next index + + ; } } capacity = new capacity ; vertices = new vertices ; first outgoing edge = new first outgoing edge ; first incoming edge = new first incoming edge ; last outgoing edge = new last outgoing edge ; last incoming edge = new last incoming edge ; } else / / tighten up { tighten ( ) ; } }


gets the gap policy to use for this aggregation

public gap policy gap policy ( ) { return gap policy ; }


pause existing requests with the given tag use { @ link # resume tag ( object ) } to resume requests with the given tag

public void pause tag ( @ non null object tag ) { check not null ( tag , " tag = = null " ) ; dispatcher dispatch pause tag ( tag ) ; }


updates the persistent state for the corresponding persistent task this doesn ' t affect the status of this allocated task

public void update persistent task state ( final persistent task state state , final action listener < persistent tasks custom metadata persistent task < ? > > listener ) { persistent tasks service send update state request ( persistent task id , allocation id , state , listener ) ; }


returns an unmodifiable iterable over the nodes in a tree structure , using breadth - first traversal that is , all the nodes of depth 0 are returned , then depth 1 , then 2 , and so on no guarantees are made about the behavior of the traversal when nodes change while iteration is in progress or when the iterators generated by { @ link # children } are advanced

public final fluent iterable < t > breadth first traversal ( final t root ) { check not null ( root ) ; return new fluent iterable < t > ( ) { @ override public unmodifiable iterator < t > iterator ( ) { return new breadth first iterator ( root ) ; } } ; }


create an auth tool instance with the auth fs config it will be closed in teardown

protected s 3 guard tool authoritative auth tool ( ) { return to close ( new s 3 guard tool authoritative ( get auth conf ( ) ) ) ; }


public static icon get built in icon ( boolean disabled ) { load images ( ) ; if ( disabled ) { return disabled built in icon ; } return built in icon ; }


fake endpoint for testing various parameters 가짜 엔드 포인트 fake endpoint for testing various parameters 가짜 엔드 포인트 < b > 400 < b > - invalid username supplied < b > 404 < b > - user not found

public response entity < void > test endpoint parameters with http info ( big decimal number , double double , string pattern without delimiter , byte [ ] byte , integer integer , integer int 3 2 , long int 6 4 , float float , string string , file binary , local date date , offset date time date time , string password , string param callback ) throws rest client exception { object post body = null ; / / verify the required parameter ' number ' is set if ( number = = null ) { throw new http client error exception ( http status bad request , " missing the required parameter ' number ' when calling test endpoint parameters " ) ; } / / verify the required parameter ' double ' is set if ( double = = null ) { throw new http client error exception ( http status bad request , " missing the required parameter ' double ' when calling test endpoint parameters " ) ; } / / verify the required parameter ' pattern without delimiter ' is set if ( pattern without delimiter = = null ) { throw new http client error exception ( http status bad request , " missing the required parameter ' pattern without delimiter ' when calling test endpoint parameters " ) ; } / / verify the required parameter ' byte ' is set if ( byte = = null ) { throw new http client error exception ( http status bad request , " missing the required parameter ' byte ' when calling test endpoint parameters " ) ; } string path = api client expand path ( " / fake " , collections < string , object > empty map ( ) ) ; final multi value map < string , string > query params = new linked multi value map < string , string > ( ) ; final http headers header params = new http headers ( ) ; final multi value map < string , string > cookie params = new linked multi value map < string , string > ( ) ; final multi value map < string , object > form params = new linked multi value map < string , object > ( ) ; if ( integer ! = null ) form params add ( " integer " , integer ) ; if ( int 3 2 ! = null ) form params add ( " int 3 2 " , int 3 2 ) ; if ( int 6 4 ! = null ) form params add ( " int 6 4 " , int 6 4 ) ; if ( number ! = null ) form params add ( " number " , number ) ; if ( float ! = null ) form params add ( " float " , float ) ; if ( double ! = null ) form params add ( " double " , double ) ; if ( string ! = null ) form params add ( " string " , string ) ; if ( pattern without delimiter ! = null ) form params add ( " pattern without delimiter " , pattern without delimiter ) ; if ( byte ! = null ) form params add ( " byte " , byte ) ; if ( binary ! = null ) form params add ( " binary " , new file system resource ( binary ) ) ; if ( date ! = null ) form params add ( " date " , date ) ; if ( date time ! = null ) form params add ( " date time " , date time ) ; if ( password ! = null ) form params add ( " password " , password ) ; if ( param callback ! = null ) form params add ( " callback " , param callback ) ; final string [ ] local var accepts = { } ; final list < media type > local var accept = api client select header accept ( local var accepts ) ; final string [ ] content types = { " application / x - www - form - urlencoded " } ; final media type content type = api client select header content type ( content types ) ; string [ ] auth names = new string [ ] { " http basic test " } ; parameterized type reference < void > return type = new parameterized type reference < void > ( ) { } ; return api client invoke a p i ( path , http method post , query params , post body , header params , cookie params , form params , local var accept , content type , auth names , return type ) ; }


tests that the sink correctly waits for pending requests ( including re - added requests ) on checkpoints ; we set a timeout because the test will not finish if the logic is broken

public void test at least once sink ( ) throws throwable { final dummy elasticsearch sink < string > sink = new dummy elasticsearch sink < > ( new hash map < string , string > ( ) , new simple sink function < string > ( ) , new dummy retry failure handler ( ) ) ; / / use a failure handler that simply / / re - adds requests final one input stream operator test harness < string , object > test harness = new one input stream operator test harness < > ( new stream sink < > ( sink ) ) ; test harness open ( ) ; / / setup the next bulk request , and its mock item failures ; / / it contains 1 request , which will fail and re - added to the next bulk request sink set mock item failures list for next bulk item responses ( collections singleton list ( new exception ( " artificial failure for record " ) ) ) ; test harness process element ( new stream record < > ( " msg " ) ) ; verify ( sink get mock bulk processor ( ) , times ( 1 ) ) add ( any ( index request class ) ) ; checked thread snapshot thread = new checked thread ( ) { @ override public void go ( ) throws exception { test harness snapshot ( 1l , 1000l ) ; } } ; snapshot thread start ( ) ; / / the snapshot should eventually be blocked before snapshot triggers flushing while ( snapshot thread get state ( ) ! = thread state waiting ) { thread sleep ( 10 ) ; } sink continue flush ( ) ; / / since the previous flush should have resulted in a request re - add from the failure / / handler , / / we should have flushed again , and eventually be blocked before snapshot triggers the 2nd / / flush while ( snapshot thread get state ( ) ! = thread state waiting ) { thread sleep ( 10 ) ; } / / current number of pending request should be 1 due to the re - add assert assert equals ( 1 , sink get num pending requests ( ) ) ; / / this time , let the bulk request succeed , so no - more requests are re - added sink set mock item failures list for next bulk item responses ( collections singleton list ( ( exception ) null ) ) ; sink continue flush ( ) ; / / the snapshot should finish with no exceptions snapshot thread sync ( ) ; test harness close ( ) ; }


draws an arc using { @ link shape type # line } or { @ link shape type # filled }

public void arc ( float x , float y , float radius , float start , float degrees , int segments ) { if ( segments < = 0 ) throw new illegal argument exception ( " segments must be > 0 " ) ; float color bits = color to float bits ( ) ; float theta = ( 2 * math utils pi * ( degrees / 360 0f ) ) / segments ; float cos = math utils cos ( theta ) ; float sin = math utils sin ( theta ) ; float cx = radius * math utils cos ( start * math utils degrees to radians ) ; float cy = radius * math utils sin ( start * math utils degrees to radians ) ; if ( shape type = = shape type line ) { check ( shape type line , shape type filled , segments * 2 + 2 ) ; renderer color ( color bits ) ; renderer vertex ( x , y , 0 ) ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , 0 ) ; for ( int i = 0 ; i < segments ; i + + ) { renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , 0 ) ; float temp = cx ; cx = cos * cx - sin * cy ; cy = sin * temp + cos * cy ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , 0 ) ; } renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , 0 ) ; } else { check ( shape type line , shape type filled , segments * 3 + 3 ) ; for ( int i = 0 ; i < segments ; i + + ) { renderer color ( color bits ) ; renderer vertex ( x , y , 0 ) ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , 0 ) ; float temp = cx ; cx = cos * cx - sin * cy ; cy = sin * temp + cos * cy ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , 0 ) ; } renderer color ( color bits ) ; renderer vertex ( x , y , 0 ) ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , 0 ) ; } float temp = cx ; cx = 0 ; cy = 0 ; renderer color ( color bits ) ; renderer vertex ( x + cx , y + cy , 0 ) ; }


add an archive path to the current set of classpath entries it adds the archive to cache as well intended to be used by user code

public static void add archive to class path ( path archive , configuration conf ) throws i o exception { add archive to class path ( archive , conf , archive get file system ( conf ) ) ; }


test the property ' prefix namespace number '

public void prefix namespace number test ( ) { / / todo : test prefix namespace number }


returns the appropriate { @ code if - lt } rop for the given sources the result is a shared instance

public static rop op if lt ( type list types ) { return pick if ( types , if ltz int , null , if lt int , null ) ; }


get the columns from feature cols who are included in the < code > categorical cols < code > , and the columns whose types are string or boolean if < code > categorical cols < code > is null , return all the categorical columns for example : in feature hasher which projects a number of categorical or numerical features into a feature vector of a specified dimension needs to identify the categorical features and the column which is the string or boolean must be categorical we need to find these columns as categorical when user do not specify the types ( categorical or numerical )

public static string [ ] get categorical cols ( table schema table schema , string [ ] feature cols , string [ ] categorical cols ) { if ( null = = feature cols ) { return categorical cols ; } list < string > categorical list = null = = categorical cols ? null : arrays as list ( categorical cols ) ; list < string > feature list = arrays as list ( feature cols ) ; if ( null ! = categorical cols & & ! feature list contains all ( categorical list ) ) { throw new illegal argument exception ( " categorical cols must be included in feature cols ! " ) ; } type information < ? > [ ] feature col types = find col types ( table schema , feature cols ) ; list < string > res = new array list < > ( ) ; for ( int i = 0 ; i < feature cols length ; i + + ) { boolean included = null ! = categorical list & & categorical list contains ( feature cols [ i ] ) ; if ( included | | types boolean = = feature col types [ i ] | | types string = = feature col types [ i ] ) { res add ( feature cols [ i ] ) ; } } return res to array ( new string [ 0 ] ) ; }


destroy the { @ link service discovery }


this test is meant to assure that test at least once sink is valid by testing that if flushing is disabled , the snapshot method does indeed finishes without waiting for pending requests ; we set a timeout because the test will not finish if the logic is broken

public void test does not wait for pending requests if flushing disabled ( ) throws exception { final dummy elasticsearch sink < string > sink = new dummy elasticsearch sink < > ( new hash map < string , string > ( ) , new simple sink function < string > ( ) , new dummy retry failure handler ( ) ) ; sink disable flush on checkpoint ( ) ; / / disable flushing final one input stream operator test harness < string , object > test harness = new one input stream operator test harness < > ( new stream sink < > ( sink ) ) ; test harness open ( ) ; / / setup the next bulk request , and let bulk request succeed sink set mock item failures list for next bulk item responses ( collections singleton list ( new exception ( " artificial failure for record " ) ) ) ; test harness process element ( new stream record < > ( " msg - 1 " ) ) ; verify ( sink get mock bulk processor ( ) , times ( 1 ) ) add ( any ( index request class ) ) ; / / the snapshot should not block even though we haven ' t flushed the bulk request test harness snapshot ( 1l , 1000l ) ; test harness close ( ) ; }


sets the column preferred widths if you give less widths then there are columns , then the widths will be applied in order , with the remaining columns going untouched note : this method needs to be called after building your columns so , call this after making any calls to { @ link # add column ( abstract dynamic table column ) } < b > warning ! < b > if you set the widths to a size that is smaller than the total display , then the table model will apply the extra space equally across your columns , resulting in sizes that you did not set so , the best way to use this method is to set the actual preferred size for your small columns and then set a very large size ( 400 or so ) for your columns that can be any size

public void set column preferred widths ( int widths ) { int column count = table get column count ( ) ; int n = math min ( widths length , column count ) ; table column model model = table get column model ( ) ; for ( int i = 0 ; i < n ; i + + ) { table column column = model get column ( i ) ; int width = widths [ i ] ; if ( width = = 75 ) { / / horrible code : we have special knowledge that a value of 75 is the default / / column size , which we use in table column model state to signal that we can / / override the size so , if the user sets that value , then change it to / / override our algorithm width = 76 ; } column set width ( width ) ; column set preferred width ( widths [ i ] ) ; } }


incoming image will be displayed in { @ link com nostra 1 3 universalimageloader core imageaware image aware image aware view } during image loading

public builder show image on loading ( int image res ) { image res on loading = image res ; return this ; }


creates a realm with the provided settings , rebuilds the ssl service to be aware of the new realm , and then returns the realm config

private realm config setup realm ( realm config realm identifier realm identifier , settings local settings ) { final settings merged settings = settings builder ( ) put ( global settings ) put ( local settings ) put ( get full setting key ( realm identifier , realm settings order setting ) , " 0 " ) build ( ) ; final environment env = test environment new environment ( merged settings ) ; this ssl service = new s s l service ( env ) ; return new realm config ( realm identifier , merged settings , env , new thread context ( merged settings ) ) ; }


public void place order test ( ) { / / todo : test validations order body = null ; / / order response = api place order ( body ) ; / / assert not null ( response ) ; }


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


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

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


writes out a single png which is three times the width of the input image , containing from left to right : the original image , the row sampling monochrome version , and the 2d sampling monochrome version

private static void dump black point ( uri uri , buffered image image , binary bitmap bitmap ) throws i o exception { int width = bitmap get width ( ) ; int height = bitmap get height ( ) ; int stride = width * 3 ; int [ ] pixels = new int [ stride * height ] ; / / the original image int [ ] argb = new int [ width ] ; for ( int y = 0 ; y < height ; y + + ) { image get r g b ( 0 , y , width , 1 , argb , 0 , width ) ; system arraycopy ( argb , 0 , pixels , y * stride , width ) ; } / / row sampling bit array row = new bit array ( width ) ; for ( int y = 0 ; y < height ; y + + ) { try { row = bitmap get black row ( y , row ) ; } catch ( not found exception nfe ) { / / if fetching the row failed , draw a red line and keep going int offset = y * stride + width ; arrays fill ( pixels , offset , offset + width , red ) ; continue ; } int offset = y * stride + width ; for ( int x = 0 ; x < width ; x + + ) { pixels [ offset + x ] = row get ( x ) ? black : white ; } } / / 2d sampling try { for ( int y = 0 ; y < height ; y + + ) { bit matrix matrix = bitmap get black matrix ( ) ; int offset = y * stride + width * 2 ; for ( int x = 0 ; x < width ; x + + ) { pixels [ offset + x ] = matrix get ( x , y ) ? black : white ; } } } catch ( not found exception ignored ) { / / continue } write result image ( stride , height , pixels , uri , " mono png " ) ; }


turns a keyvalue pair into a javac annotation processor flag received by data binding

private static string create processor flag ( string flag , artifact value ) { return create processor flag ( flag , value get exec path string ( ) ) ; }


observes and then instantly un - observes the supplied live data this will therefore only work in conjunction with { @ link live data rule }

public static < t > t observe and get one value ( final live data < t > live data ) { atomic reference < t > data = new atomic reference < > ( ) ; observer < t > observer = data : : set ; live data observe forever ( observer ) ; live data remove observer ( observer ) ; return data get ( ) ; }


manipulate this request ' s cookies with the given consumer the map provided to the consumer is " live " , so that the consumer can be used to { @ linkplain multi value map # set ( object , object ) overwrite } existing cookies , { @ linkplain multi value map # remove ( object ) remove } cookies , or use any of the other { @ link multi value map } methods

builder cookies ( consumer < multi value map < string , cookie > > cookies consumer ) ;


http patch variant see { @ link # get ( string , object ) } for general info

public static body builder patch ( string url template , object uri vars ) { return method ( http method patch , url template , uri vars ) ; }


set the coefficient of restitution this will not change the restitution of existing contacts

public void set restitution ( float restitution ) { m restitution = restitution ; }


unmaps a particular route from the collection of those that have been previously routed search for previously established routes using the given path and unmaps any matches that are found

public boolean unmap ( string path ) { return routes remove ( path ) ; }


check for a multipart request via this filter ' s multipart resolver , and wrap the original request with a multipart http servlet request if appropriate all later elements in the filter chain , most importantly servlets , benefit from proper parameter extraction in the multipart case , and are able to cast to multipart http servlet request if they need to

protected void do filter internal ( http servlet request request , http servlet response response , filter chain filter chain ) throws servlet exception , i o exception { multipart resolver multipart resolver = lookup multipart resolver ( request ) ; http servlet request processed request = request ; if ( multipart resolver is multipart ( processed request ) ) { if ( logger is trace enabled ( ) ) { logger trace ( " resolving multipart request " ) ; } processed request = multipart resolver resolve multipart ( processed request ) ; } else { / / a regular request if ( logger is trace enabled ( ) ) { logger trace ( " not a multipart request " ) ; } } try { filter chain do filter ( processed request , response ) ; } finally { if ( processed request instanceof multipart http servlet request ) { multipart resolver cleanup multipart ( ( multipart http servlet request ) processed request ) ; } } }


handles an inbound { @ code ping } acknowledgment

void on ping ack read ( channel handler context ctx , long data ) throws http 2 exception ;


public boolean has unique name ( ) { return has unique name ; }


check the consistency of this index table

boolean is consistent ( task monitor monitor ) throws i o exception , cancelled exception { return index table is consistent ( primary table get schema ( ) get field names ( ) [ index column ] , monitor ) ; }


returns { @ link # get pad top ( ) } plus { @ link # get pad bottom ( ) }

public float get pad y ( ) { return pad top get ( this ) + pad bottom get ( this ) ; }


collection of data for the build tool logs event this may only be modified until the build complete event is posted ; any changes after that event is handled will not be included in the build tool logs event

public build tool log collection get build tool log collection ( ) { return build tool log collection ; }


failure processing of the operation on the node

public static void on fail ( final server member manager manager , final member member , throwable ex ) { manager get member address infos ( ) remove ( member get address ( ) ) ; final node state old = member get state ( ) ; member set state ( node state suspicious ) ; member set fail access cnt ( member get fail access cnt ( ) + 1 ) ; int max fail access cnt = env util get property ( " nacos core member fail - access - cnt " , integer class , 3 ) ; / / if the number of consecutive failures to access the target node reaches / / a maximum , or the link request is rejected , the state is directly down if ( member get fail access cnt ( ) > max fail access cnt | | string utils contains ignore case ( ex get message ( ) , target member connect refuse errmsg ) ) { member set state ( node state down ) ; } if ( ! objects equals ( old , member get state ( ) ) ) { manager notify member change ( ) ; } }


sets fill x and fill y to 1 if true , 0 if false

public cell < t > fill ( boolean fill ) { fill x = fill ? onef : zerof ; fill y = fill ? onef : zerof ; return this ; }


returns the total number of undefined symbols

public int get undefined symbol count ( ) { return nundefsym ; }


returns true if this monitor { @ link # disable ( boolean ) isn ' t disabled } earlier this flag implements the ability for the admin to say " no thank you " to the monitor that he wants to ignore

public boolean is enabled ( ) { return ! jenkins get ( ) get disabled administrative monitors ( ) contains ( id ) ; }


list of all { @ link user property } s exposed primarily for the remoting api

public list < user property > get all properties ( ) { if ( has permission ( jenkins administer ) ) { return collections unmodifiable list ( properties ) ; } return collections empty list ( ) ; }


add all elements from another long array list at the end of this one

public boolean add all ( long array list other ) { return add all ( other array , 0 , other size , size ) ; }


extends the < code > allocate < code > to wrap the response with additional metadata

distributed scheduling allocate response allocate for distributed scheduling ( distributed scheduling allocate request request ) throws yarn exception , i o exception ;