assert that the two list sizes match ; failure message includes the lists

private < t > void assert list size equal ( string message , list < t > expected , list < t > actual ) { string left contents = expected stream ( ) map ( n - > n to string ( ) ) collect ( collectors joining ( " \ n " ) ) ; string right contents = actual stream ( ) map ( n - > n to string ( ) ) collect ( collectors joining ( " \ n " ) ) ; string summary = " \ n expected : " + left contents + " \ n - - - - - - - - - - - \ n " + " actual : " + right contents + " \ n - - - - - - - - - - - \ n " ; if ( expected size ( ) ! = actual size ( ) ) { log error ( message + summary ) ; } assert equals ( message + summary , expected size ( ) , actual size ( ) ) ; }


does this instance have an encryption key ?

public boolean has encryption key ( ) { return string utils is not empty ( encryption key ) ; }


{ @ code previous tmp } is a transient directory , which holds current file system state while the new state is saved into the new { @ code current } during upgrade if the saving succeeds { @ code previous tmp } will be moved to { @ code previous } , otherwise it will be renamed back to { @ code current } by the recovery procedure during startup

public file get previous tmp ( ) { if ( root = = null ) { return null ; } return new file ( root , storage tmp previous ) ; }


public static void clear ( ) { user to netgroups map clear ( ) ; }


pick a good estimate of the buffer size needed to contain the rows

int estimate size ( int rows ) { / * each column has either a ' | ' or a ' \ n ' after it * so initialize size to number of columns then add * up the actual widths of each column * / int row width estimate = width length ; for ( int w : width ) { row width estimate + = w ; } return row width estimate * rows ; }


return the output stream to use for writing remote invocation results , potentially decorating the given original output stream the default implementation returns the given stream as - is can be overridden , for example , for custom encryption or compression

protected output stream decorate output stream ( http servlet request request , http servlet response response , output stream os ) throws i o exception { return os ; }


causes rules of this type to require the specified toolchains be available via toolchain resolution when a target is configured

public builder add required toolchains ( label toolchain labels ) { return this add required toolchains ( lists new array list ( toolchain labels ) ) ; }


the number of top - matching documents that are considered during each hop ( default is { @ link sampler aggregation builder # default shard sample size } very small values ( less than 50 ) may not provide sufficient weight - of - evidence to identify significant connections between terms very large values ( many thousands ) are not recommended with loosely defined queries ( fuzzy queries or those with many or clauses ) this is because any useful signals in the best documents are diluted with irrelevant noise from low - quality matches performance is also typically better with smaller samples as there are less look - ups required for background frequencies of terms found in the documents

public void sample size ( int max number of docs per hop ) { sample size = max number of docs per hop ; }


sets the size of the compressed entry data in bytes

public void set compressed size ( long csize ) { if ( csize < 0 ) { throw new illegal argument exception ( " invalid entry size " ) ; } if ( csize > 0xffffffff l ) { feature set add ( feature zip64 csize ) ; } else { feature set remove ( feature zip64 csize ) ; } this csize = csize ; }


public redis connection config builder with timeout ( long timeout ) { assert util not null ( timeout , " timeout must not be null " ) ; assert util not null ( timeout > = 0 , " timeout must be greater or equal 0 " ) ; this timeout = timeout ; return this ; }


specify the maximum number of parts allowed in a given multipart request by default this is set to - 1 , meaning that there is no maximum

public void set max parts ( int max parts ) { this max parts = max parts ; }


handle a vote request this api may return the following errors : - { @ link errors # broker not available } if this node is currently shutting down - { @ link errors # fenced leader epoch } if the epoch is smaller than this node ' s epoch - { @ link errors # inconsistent voter set } if the request suggests inconsistent voter membership ( e g if this node or the sender is not one of the current known voters ) - { @ link errors # invalid request } if the last epoch or offset are invalid

private vote response data handle vote request ( raft request inbound request metadata ) throws i o exception { vote request data request = ( vote request data ) request metadata data ; if ( ! has valid topic partition ( request , log topic partition ( ) ) ) { / / until we support multi - raft , we treat topic partition mismatches as invalid requests return new vote response data ( ) set error code ( errors invalid request code ( ) ) ; } vote request data partition data partition request = request topics ( ) get ( 0 ) partitions ( ) get ( 0 ) ; int candidate id = partition request candidate id ( ) ; int candidate epoch = partition request candidate epoch ( ) ; int last epoch = partition request last offset epoch ( ) ; long last epoch end offset = partition request last offset ( ) ; if ( last epoch end offset < 0 | | last epoch < 0 | | last epoch > = candidate epoch ) { return build vote response ( errors invalid request , false ) ; } optional < errors > error opt = validate voter only request ( candidate id , candidate epoch ) ; if ( error opt is present ( ) ) { return build vote response ( error opt get ( ) , false ) ; } if ( candidate epoch > quorum epoch ( ) ) { transition to unattached ( candidate epoch ) ; } final boolean vote granted ; if ( quorum is leader ( ) ) { logger debug ( " rejecting vote request { } with epoch { } since we are already leader on that epoch " , request , candidate epoch ) ; vote granted = false ; } else if ( quorum is candidate ( ) ) { logger debug ( " rejecting vote request { } with epoch { } since we are already candidate on that epoch " , request , candidate epoch ) ; vote granted = false ; } else if ( quorum is resigned ( ) ) { logger debug ( " rejecting vote request { } with epoch { } since we have resigned as candidate / leader in this epoch " , request , candidate epoch ) ; vote granted = false ; } else if ( quorum is follower ( ) ) { follower state state = quorum follower state or throw ( ) ; logger debug ( " rejecting vote request { } with epoch { } since we already have a leader { } on that epoch " , request , candidate epoch , state leader id ( ) ) ; vote granted = false ; } else if ( quorum is voted ( ) ) { voted state state = quorum voted state or throw ( ) ; vote granted = state voted id ( ) = = candidate id ; if ( ! vote granted ) { logger debug ( " rejecting vote request { } with epoch { } since we already have voted for " + " another candidate { } on that epoch " , request , candidate epoch , state voted id ( ) ) ; } } else if ( quorum is unattached ( ) ) { offset and epoch last epoch end offset and epoch = new offset and epoch ( last epoch end offset , last epoch ) ; vote granted = last epoch end offset and epoch compare to ( end offset ( ) ) > = 0 ; if ( vote granted ) { transition to voted ( candidate id , candidate epoch ) ; } } else { throw new illegal state exception ( " unexpected quorum state " + quorum ) ; } logger info ( " vote request { } is { } " , request , vote granted ? " granted " : " rejected " ) ; return build vote response ( errors none , vote granted ) ; }


returns a hash of various properties of a rule which might contribute to the rule ' s " affectedness " this includes , but is not limited to , attribute values and error - state

static string compute ( rule rule , map < attribute , build attribute > serialized attributes , object extra data for attr hash , hash function hash function ) { hashing output stream hashing output stream = new hashing output stream ( hash function , byte streams null output stream ( ) ) ; coded output stream coded out = coded output stream new instance ( hashing output stream ) ; rule class rule class = rule get rule class object ( ) ; if ( rule class is starlark ( ) ) { try { coded out write byte array no tag ( preconditions check not null ( rule class get rule definition environment digest ( ) , rule ) ) ; } catch ( i o exception e ) { throw new illegal state exception ( " unexpected io failure writing to digest stream " , e ) ; } } raw attribute mapper raw attribute mapper = raw attribute mapper of ( rule ) ; for ( attribute attr : rule get attributes ( ) ) { string attr name = attr get name ( ) ; if ( attr name equals ( " generator location " ) ) { / / generator location can be ignored for the purpose of telling if a rule has changed continue ; } object value to hash = raw attribute mapper get raw attribute value ( rule , attr ) ; if ( value to hash instanceof computed default ) { / / configured defaults need special handling to detect changes in evaluated values computed default computed default = ( computed default ) value to hash ; if ( ! computed default dependencies ( ) is empty ( ) ) { / / todo ( b / 29038463 ) : we ' re skipping computed defaults that depend on other configurable / / attributes because there currently isn ' t a way to evaluate such a computed default ; / / there isn ' t * one * value it evaluates to continue ; } try { value to hash = computed default get default ( raw attribute mapper ) ; } catch ( illegal argument exception e ) { / / todo ( mschaller ) : catching illegal argument exception isn ' t ideal it ' s thrown by / / abstract attribute mapper # get if the attribute ' s type doesn ' t match its value , which / / would happen if a computed default function accessed an attribute whose value was / / configurable we check whether the computed default declared any configurable / / attribute dependencies above , but someone could make a mistake and fail to declare / / something there ' s no mechanism that enforces correct declaration right now / / this allows us to recover from such an error by skipping an attribute , as opposed to / / crashing logger at warning ( ) log ( " recovering from failed evaluation of computed default attribute value : " + e ) ; continue ; } } build attribute attr pb ; if ( value to hash instanceof selector list < ? > | | ! serialized attributes contains key ( attr ) ) { / / we didn ' t already serialize the attribute or it ' s a selector list latter may / / have been flattened while we want the full representation , so we start from scratch attr pb = attribute formatter get attribute proto ( attr , value to hash , / * explicitly specified = * / false , / / we care about value , not how it was set / * encode boolean and tri state as integer and string = * / false ) ; } else { attr pb = serialized attributes get ( attr ) ; } try { attr pb write to ( coded out ) ; } catch ( i o exception e ) { throw new illegal state exception ( " unexpected io failure writing to digest stream " , e ) ; } } try { / / rules can be considered changed when the containing package goes in / out of error coded out write bool no tag ( rule get package ( ) contains errors ( ) ) ; } catch ( i o exception e ) { throw new illegal state exception ( " unexpected io failure writing to digest stream " , e ) ; } try { / / include a summary of any package - wide data that applies to this target ( e g custom make / / variables aka ` vardef ` ) coded out write string no tag ( ( string ) extra data for attr hash ) ; } catch ( i o exception e ) { throw new illegal state exception ( " unexpected io failure writing to digest stream " , e ) ; } try { / / flush coded out to make sure all bytes make it to the underlying digest stream coded out flush ( ) ; } catch ( i o exception e ) { throw new illegal state exception ( " unexpected flush failure " , e ) ; } return base encoding base 6 4 ( ) encode ( hashing output stream hash ( ) as bytes ( ) ) ; }


gets the size of an unsigned little endian base 128 integer

public static int get u l e b 1 2 8 length ( program program , address addr ) { unsigned leb 1 2 8 data type uleb = unsigned leb 1 2 8 data type data type ; mem buffer buf = new dumb mem buffer impl ( program get memory ( ) , addr ) ; return uleb get length ( buf , - 1 ) ; }


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

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


tests that if an i o exception occurs in an output stream , the exception will be recorded and thrown when we call wait for completion

public void test asynchronous i o exception in consumer output stream ( ) { output stream out = new output stream ( ) { @ override public void write ( int b ) throws i o exception { throw new i o exception ( secret message ) ; } } ; out err consumers out err = consumers create streaming consumers ( out , out ) ; byte array input stream out input = new byte array input stream ( new byte [ ] { ' a ' } ) ; byte array input stream err input = new byte array input stream ( new byte [ 0 ] ) ; out err register inputs ( out input , err input , false ) ; i o exception e = assert throws ( i o exception class , ( ) - > out err wait for completion ( ) ) ; assert that ( e ) has message that ( ) is equal to ( secret message ) ; }


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

public abstract input stream decoding stream ( reader reader ) ;


returns a string representation of the object in general , the < code > to string < code > method returns a string that " textually represents " this object the result should be a concise but informative representation that is easy for a person to read

public string to string ( ) { return " producer = " + producer name + " , consumer = " + consumer name + " , event = " + event ; }


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


public int do end tag ( ) { if ( this previous nested path ! = null ) { / / expose previous nested path value this page context set attribute ( nested path variable name , this previous nested path , page context request scope ) ; } else { / / remove exposed nested path value this page context remove attribute ( nested path variable name , page context request scope ) ; } return eval page ; }


override the default jackson smile { @ code decoder } note that { @ link # max in memory size ( int ) } , if configured , will be applied to the given decoder

void jackson 2 smile decoder ( decoder < ? > decoder ) ;


visit a parse tree produced by the { @ code select expression } labeled alternative in { @ link sql base parser # select item }

t visit select expression ( sql base parser select expression context ctx ) ;


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


ensure exception if we publish to multicast ipv 6 address

public void test publish multicast v 6 ( ) throws exception { network service service = new network service ( collections empty list ( ) ) ; try { service resolve publish host addresses ( new string [ ] { " ff08 : : 108 " } ) ; fail ( " should have hit exception " ) ; } catch ( illegal argument exception e ) { assert true ( e get message ( ) contains ( " invalid : multicast " ) ) ; } }


retrieved a part of a cos object , which is specified the start position

public input stream retrieve ( string key , long byte range start ) throws i o exception { try { log debug ( " retrieve cos key : [ { } ] range start : [ { } ] " , key , byte range start ) ; long file size = get file length ( key ) ; long byte range end = file size - 1 ; get object request get object request = new get object request ( this bucket name , key ) ; if ( byte range end > = byte range start ) { get object request set range ( byte range start , file size - 1 ) ; } c o s object cos object = ( c o s object ) call c o s client with retry ( get object request ) ; return cos object get object content ( ) ; } catch ( exception e ) { string err msg = string format ( " retrieving cos key : [ % s ] occurs an exception " + " byte range start : [ % s ] , exception : [ % s ] " , key , byte range start , e to string ( ) ) ; log error ( err msg ) ; handle exception ( new exception ( err msg ) , key ) ; } / / never will get here return null ; }


set a custom x stream { @ link name coder } to use the default is an { @ link xml friendly name coder }

public void set name coder ( name coder name coder ) { this name coder = name coder ; }


， ， copy from commons lang 3 5 string utils , : 1 ， 2 3 preserve all tokens

public static list < string > split ( @ nullable final string str , final char separator char , int expect parts ) { if ( str = = null ) { return null ; } final int len = str length ( ) ; if ( len = = 0 ) { return list util empty list ( ) ; } final list < string > list = new array list < string > ( expect parts ) ; int i = 0 ; int start = 0 ; boolean match = false ; while ( i < len ) { if ( str char at ( i ) = = separator char ) { if ( match ) { list add ( str substring ( start , i ) ) ; match = false ; } start = + + i ; continue ; } match = true ; i + + ; } if ( match ) { list add ( str substring ( start , i ) ) ; } return list ; }


combine the value of records of the original { @ link k table } that got { @ link k table # group by ( key value mapper ) mapped } to the same key into a new instance of { @ link k table } records with { @ code null } key are ignored combining implies that the type of the aggregate result is the same as the type of the input value ( c f { @ link # aggregate ( initializer , aggregator , aggregator , materialized ) } ) the result is written into a local { @ link key value store } ( which is basically an ever - updating materialized view ) that can be queried using the provided { @ code queryable store name } furthermore , updates to the store are sent downstream into a { @ link k table } changelog stream each update to the original { @ link k table } results in a two step update of the result { @ link k table } the specified { @ link reducer adder } is applied for each update record and computes a new aggregate using the current aggregate ( first argument ) and the record ' s value ( second argument ) by adding the new record to the aggregate the specified { @ link reducer subtractor } is applied for each " replaced " record of the original { @ link k table } and computes a new aggregate using the current aggregate ( first argument ) and the record ' s value ( second argument ) by " removing " the " replaced " record from the aggregate if there is no current aggregate the { @ link reducer } is not applied and the new aggregate will be the record ' s value as - is thus , { @ code reduce ( reducer , reducer , string ) } can be used to compute aggregate functions like sum for sum , the adder and subtractor would work as follows : { @ code public class sum adder implements reducer < integer > { public integer apply ( integer current agg , integer new value ) { return current agg + new value ; } } public class sum subtractor implements reducer < integer > { public integer apply ( integer current agg , integer old value ) { return current agg - old value ; } } } not all updates might get sent downstream , as an internal cache is used to deduplicate consecutive updates to the same 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 } to query the local { @ link read only key value store } it must be obtained via { @ link kafka streams # store ( store query parameters ) kafka streams # store ( ) } : { @ code kafka streams streams = counting words read only key value store < k , value and timestamp < v > > local store = streams store ( queryable store name , queryable store types < k , value and timestamp < v > > timestamped key value store ( ) ) ; k key = " some - word " ; value and timestamp < v > reduce for word = local store get ( key ) ; key must be local ( application state is shared over all running kafka streams instances ) } for non - local keys , a custom rpc mechanism must be implemented using { @ link kafka streams # all metadata ( ) } to query the value of the key on a parallel running instance of your kafka streams application for failure and recovery the store will be backed by an internal changelog topic that will be created in kafka therefore , the store name defined by the materialized instance must be a valid kafka topic name and cannot contain characters other than ascii alphanumerics , ' ' , ' ' and ' - ' the changelog topic will be named " $ { application id } - $ { store name } - changelog " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " store name " is the provide store name defined in { @ code materialized } , and " - changelog " is a fixed suffix you can retrieve all generated internal topic names via { @ link topology # describe ( ) }

k table < k , v > reduce ( final reducer < v > adder , final reducer < v > subtractor , final named named , final materialized < k , v , key value store < bytes , byte [ ] > > materialized ) ;


tests functionality for big files ( > 5 gb ) upload

public void test file part upload no length check ( ) throws i o exception , u r i syntax exception { final path path = new path ( " / test / test file part upload length check " ) ; int len = 8192 ; final byte [ ] src = swift test utils dataset ( len , 32 , 144 ) ; f s data output stream out = fs create ( path , false , get buffer size ( ) , ( short ) 1 , block size ) ; try { int total partitions to write = len / part size bytes ; assert partitions written ( " startup " , out , 0 ) ; / / write 2048 int first write len = 2048 ; out write ( src , 0 , first write len ) ; / / assert long expected = get expected partitions written ( first write len , part size bytes , false ) ; swift utils debug ( log , " first write : predict % d partitions written " , expected ) ; assert partitions written ( " first write completed " , out , expected ) ; / / write the rest int remainder = len - first write len ; swift utils debug ( log , " remainder : writing : % d bytes " , remainder ) ; out write ( src , first write len , remainder ) ; expected = get expected partitions written ( len , part size bytes , false ) ; assert partitions written ( " remaining data " , out , expected ) ; out close ( ) ; expected = get expected partitions written ( len , part size bytes , true ) ; assert partitions written ( " stream closed " , out , expected ) ; header [ ] headers = fs get store ( ) get object headers ( path , true ) ; for ( header header : headers ) { log info ( header to string ( ) ) ; } byte [ ] dest = read dataset ( fs , path , len ) ; log info ( " read dataset from " + path + " : data length = " + len ) ; / / compare data swift test utils compare byte arrays ( src , dest , len ) ; file status status = fs get file status ( path ) ; / / now see what block location info comes back / / this will vary depending on the swift version , so the results / / aren ' t checked - merely that the test actually worked block location [ ] locations = fs get file block locations ( status , 0 , len ) ; assert not null ( " null get file block locations ( ) " , locations ) ; assert true ( " empty array returned for get file block locations ( ) " , locations length > 0 ) ; } finally { i o utils close stream ( out ) ; } }


returns the vertex at the given column index or null if there is no vertex at that column

public v get vertex ( int column ) { return vertices by column get ( column ) ; }


returns { @ code true } if the state is stopped

public boolean stopped ( ) { return state = = state stopped ; }


defined as the ratio between the width and the height of a node see < a href = " https : yogalayout comdocsaspect - ratio " > https : yogalayout comdocsaspect - ratio for more information

public t aspect ratio ( float aspect ratio ) { m component get or create common props ( ) aspect ratio ( aspect ratio ) ; return get this ( ) ; }


public static int calculate in sample size ( final bitmap factory options options , final int max width , final int max height ) { int height = options out height ; int width = options out width ; int in sample size = 1 ; while ( height > max height | | width > max width ) { height > > = 1 ; width > > = 1 ; in sample size < < = 1 ; } return in sample size ; }


this method is deprecated and will be removed in the future releases handle async db operation in your own logic instead

public average executor average async ( final class < ? > model class , final string column ) { return average async ( base utility change case ( d b utility get table name by class name ( model class get name ( ) ) ) , column ) ; }


sets the components from the given spherical coordinate

public vector 3 set from spherical ( float azimuthal angle , float polar angle ) { float cos polar = math utils cos ( polar angle ) ; float sin polar = math utils sin ( polar angle ) ; float cos azim = math utils cos ( azimuthal angle ) ; float sin azim = math utils sin ( azimuthal angle ) ; return this set ( cos azim * sin polar , sin azim * sin polar , cos polar ) ; }


execute the http method to the given uri template , writing the given request entity to the request , and returns the response as { @ link http rest result }

public < t > http rest result < t > exchange ( string url , http client config config , header header , query query , object body , string http method , type response type ) throws exception { request http entity request http entity = new request http entity ( config , header , query , body ) ; return execute ( url , http method , request http entity , response type ) ; }


adds the satellite viewer functionality to this provider

protected void add satellite feature ( ) { vg satellite featurette < v , e , g > satellite feature = new vg satellite featurette < > ( ) ; satellite feature init ( this ) ; sub features add ( satellite feature ) ; }


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


< code > optional string prefix = 1 ; < code >

public com google protobuf byte string get prefix bytes ( ) { return com google protobuf byte string copy from utf 8 ( prefix ) ; }


repeatedly applies this instance ' s input value to the given function until one of the following occurs : the function returns neither null nor false the function throws an unignored exception the timeout expires the current thread is interrupted

public < v > v until ( function < ? super t , v > is true ) { instant end = clock instant ( ) plus ( timeout ) ; throwable last exception ; while ( true ) { try { v value = is true apply ( input ) ; if ( value ! = null & & ( boolean class ! = value get class ( ) | | boolean true equals ( value ) ) ) { return value ; } / / clear the last exception ; if another retry or timeout exception would / / be caused by a false or null value , the last exception is not the / / cause of the timeout last exception = null ; } catch ( throwable e ) { last exception = propagate if not ignored ( e ) ; } / / check the timeout after evaluating the function to ensure conditions / / with a zero timeout can succeed if ( end is before ( clock instant ( ) ) ) { string message = message supplier ! = null ? message supplier get ( ) : null ; string timeout message = string format ( " expected condition failed : % s ( tried for % d second ( s ) with % d milliseconds interval ) " , message = = null ? " waiting for " + is true : message , timeout get seconds ( ) , interval to millis ( ) ) ; throw timeout exception ( timeout message , last exception ) ; } try { sleeper sleep ( interval ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new web driver exception ( e ) ; } } }


return the object being encapsulated in the { @ link transferable object }


convenience method to return a single instance that matches the query , or null if the query returns no results

protected e unique result ( query < e > query ) throws hibernate exception { return require non null ( query ) unique result ( ) ; }


enriches search hits and completion suggestion hits from < code > sorted docs < code > using < code > fetch results arr < code > , merges suggestions , aggregations and profile results expects sorted docs to have top search docs across all shards , optionally followed by top suggest docs for each named completion suggestion ordered by suggestion name

public internal search response merge ( boolean ignore from , reduced query phase reduced query phase , collection < ? extends search phase result > fetch results , int function < search phase result > results lookup ) { if ( reduced query phase is empty result ) { return internal search response empty ( ) ; } score doc [ ] sorted docs = reduced query phase sorted top docs score docs ; search hits hits = get hits ( reduced query phase , ignore from , fetch results , results lookup ) ; if ( reduced query phase suggest ! = null ) { if ( ! fetch results is empty ( ) ) { int current offset = hits get hits ( ) length ; for ( completion suggestion suggestion : reduced query phase suggest filter ( completion suggestion class ) ) { final list < completion suggestion entry option > suggestion options = suggestion get options ( ) ; for ( int score doc index = current offset ; score doc index < current offset + suggestion options size ( ) ; score doc index + + ) { score doc shard doc = sorted docs [ score doc index ] ; search phase result search result provider = results lookup apply ( shard doc shard index ) ; if ( search result provider = = null ) { / / this can happen if we are hitting a shard failure during the fetch phase / / in this case we referenced the shard result via the score doc but never got a / / result from fetch / / todo it would be nice to assert this in the future continue ; } fetch search result fetch result = search result provider fetch result ( ) ; final int index = fetch result counter get and increment ( ) ; assert index < fetch result hits ( ) get hits ( ) length : " not enough hits fetched index [ " + index + " ] length : " + fetch result hits ( ) get hits ( ) length ; search hit hit = fetch result hits ( ) get hits ( ) [ index ] ; completion suggestion entry option suggest option = suggestion options get ( score doc index - current offset ) ; hit score ( shard doc score ) ; hit shard ( fetch result get search shard target ( ) ) ; suggest option set hit ( hit ) ; } current offset + = suggestion options size ( ) ; } assert current offset = = sorted docs length : " expected no more score doc slices " ; } } return reduced query phase build response ( hits ) ; }


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


creates a new async stub that supports all call types for the service

public static listener discovery service stub new stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < listener discovery service stub > factory = new io grpc stub abstract stub stub factory < listener discovery service stub > ( ) { @ java lang override public listener discovery service stub new stub ( io grpc channel channel , io grpc call options call options ) { return new listener discovery service stub ( channel , call options ) ; } } ; return listener discovery service stub new stub ( factory , channel ) ; }


returns the given list of exceptions , without the ones that have empty code blocks

private int remove empty exceptions ( exception info [ ] exception infos , int exception info count ) { / / overwrite all empty exceptions int new index = 0 ; for ( int index = 0 ; index < exception info count ; index + + ) { exception info exception info = exception infos [ index ] ; if ( exception info u 2start p c < exception info u 2end p c ) { exception infos [ new index + + ] = exception info ; } } / / clear the unused array entries arrays fill ( exception infos , new index , exception info count , null ) ; return new index ; }


cancel any pending loads glide may have for the view and free any resources that may have been loaded for the view note that this will only work if { @ link view # set tag ( object ) } is not called on this view outside of glide

public void clear ( @ non null view view ) { clear ( new clear target ( view ) ) ; }


public static void set filter class ( configuration conf , class filter class ) { conf set ( filter class , filter class get name ( ) ) ; }


sets the < code > my boolean < code > property

public void set my boolean ( boolean my boolean ) { this my boolean = my boolean ; }


given the rounded value ( which was potentially generated by { @ link # round ( long ) } , returns the next rounding value for example , with interval based rounding , if the interval is 3 , { @ code next round value ( 6 ) = 9 }

public final long next rounding value ( long utc millis ) { return prepare ( utc millis , utc millis ) next rounding value ( utc millis ) ; }


writes a d w a r fv 3 - style unsigned leb128 integer for details , see the " dalvik executable format " document or dwarf v 3 section 7 6

public int write uleb 1 2 8 ( int value ) ;


public static void setup message bundle ( context context ) { base error prone java compiler setup message bundle ( context ) ; }


factory method for initializing a task executor memory configuration based on the passed configuration

public static task executor memory configuration create ( configuration config ) { return new task executor memory configuration ( get configuration value ( config , framework heap memory ) , get configuration value ( config , task heap memory ) , get configuration value ( config , framework off heap memory ) , get configuration value ( config , task off heap memory ) , get configuration value ( config , network memory max ) , get configuration value ( config , managed memory size ) , get configuration value ( config , jvm metaspace ) , get configuration value ( config , jvm overhead max ) , get configuration value ( config , total flink memory ) , get configuration value ( config , total process memory ) ) ; }


can disable a plugin with an optional dependent plugin with strategy none

public void can disable plugin with optional depender strategy none ( ) { assert that ( disable plugins c li command ( " - strategy " , " none " , " dependee " ) , succeeded ( ) ) ; assert plugin disabled ( " dependee " ) ; } @ test @ issue ( " jenkins - 27177 " ) @ with plugin ( { " depender - 0 0 2 hpi " , " dependee - 0 0 2 hpi " , " mandatory - depender - 0 0 2 hpi " }


remove all listeners for desired message id

public void remove listeners ( final int id ) { if ( debug ) { final list < ui message callback > callbacks = m listeners specific get ( id ) ; if ( callbacks = = null | | callbacks size ( ) = = 0 ) { log w ( tag , " trying to remove specific listeners that are not registered id " + id ) ; } } synchronized ( m listeners specific ) { m listeners specific delete ( id ) ; } }


returns a default port to { @ link name resolver } for use in cases where the target string doesn ' t include a port the default implementation returns { @ link grpc util # default port ssl }

int get default port ( ) { return channel builder default port provider get default port ( ) ; }


test { @ code text } read fieldswrite operations

public void test read write operations ( ) { string line = " adsawseeeeegqewgasddga " ; byte [ ] input bytes = line get bytes ( ) ; input bytes = bytes concat ( new byte [ ] { ( byte ) 22 } , input bytes ) ; data input buffer in = new data input buffer ( ) ; data output buffer out = new data output buffer ( ) ; text text = new text ( line ) ; try { in reset ( input bytes , input bytes length ) ; text read fields ( in ) ; } catch ( exception ex ) { fail ( " test read fields error ! ! ! " ) ; } try { text write ( out ) ; } catch ( i o exception ex ) { } catch ( exception ex ) { fail ( " test read write operations error ! ! ! " ) ; } }


sets the interval of the date histogram using fixed units ( ` 1ms ` , ` 1s ` , ` 1 0m ` , ` 4h ` , etc ) these are not calendar aware and are simply multiples of fixed , si units this is mutually exclusive with { @ link date histogram values source builder # calendar interval ( date histogram interval ) }

public date histogram values source builder fixed interval ( date histogram interval interval ) { date histogram interval fixed interval ( interval ) ; return this ; }


tests vertical composition first pointcut matches all setters second one matches all getters in the my test bean class test bean getters shouldn ' t pass

public void test union of all setters and subclass setters ( ) { assert that ( pointcuts matches ( my test bean setter pointcut , test bean set age , test bean class , 6 ) ) is false ( ) ; assert that ( pointcuts matches ( my test bean setter pointcut , test bean set age , my test bean class , 6 ) ) is true ( ) ; assert that ( pointcuts matches ( my test bean setter pointcut , test bean get age , test bean class ) ) is false ( ) ; pointcut union = pointcuts union ( my test bean setter pointcut , all class getter pointcut ) ; assert that ( pointcuts matches ( union , test bean get age , test bean class ) ) is true ( ) ; assert that ( pointcuts matches ( union , test bean get age , my test bean class ) ) is true ( ) ; / / still doesn ' t match superclass setter assert that ( pointcuts matches ( union , test bean set age , my test bean class , 6 ) ) is true ( ) ; assert that ( pointcuts matches ( union , test bean set age , test bean class , 6 ) ) is false ( ) ; }


creates a { @ link join record state view } depends on { @ link join input side spec }

public static join record state view create ( runtime context ctx , string state name , join input side spec input side spec , internal type info < row data > record type , long retention time ) { state ttl config ttl config = create ttl config ( retention time ) ; if ( input side spec has unique key ( ) ) { if ( input side spec join key contains unique key ( ) ) { return new join key contains unique key ( ctx , state name , record type , ttl config ) ; } else { return new input side has unique key ( ctx , state name , record type , input side spec get unique key type ( ) , input side spec get unique key selector ( ) , ttl config ) ; } } else { return new input side has no unique key ( ctx , state name , record type , ttl config ) ; } }


public span utils set bullet ( @ color int final int color , @ int range ( from = 0 ) final int radius , @ int range ( from = 0 ) final int gap width ) { this bullet color = color ; this bullet radius = radius ; this bullet gap width = gap width ; return this ; }


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

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


returns { @ code true } if an i pv 6 address should be preferred when a host has both an i pv 4 address and an i pv 6 address the default value of this property is { @ code false }

public static boolean is ip v 6 addresses preferred ( ) { return ipv6 addresses preferred ; }


builds and returns the formatted error message

public error message build ( ) { string builder sb = new string builder ( message ) ; if ( exception ! = null ) { sb append ( " \ n \ n - - - 8 < - - - 8 < - - - exception details - - - 8 < - - - 8 < - - - \ n " ) ; sb append ( throwables get stack trace as string ( exception ) trim ( ) ) ; sb append ( " \ n - - - 8 < - - - 8 < - - - end of exception details - - - 8 < - - - 8 < - - - " ) ; } if ( ! log text is empty ( ) ) { sb append ( " \ n \ n - - - 8 < - - - 8 < - - - start of log " ) ; if ( log text length ( ) > log size limit ) { sb append ( " snippet " ) ; } if ( log file ! = null ) { sb append ( " , file at " ) ; sb append ( log file get path string ( ) ) ; } sb append ( " - - - 8 < - - - 8 < - - - \ n " ) ; / / if the length of the log is longer than the limit , print only the last part if ( log text length ( ) > log size limit ) { sb append ( " [ truncated ] \ n " ) ; sb append ( log text , log text length ( ) - log size limit , log text length ( ) ) ; sb append ( " \ n - - - 8 < - - - 8 < - - - end of log snippet , " ) ; sb append ( log text length ( ) - log size limit ) ; sb append ( " chars omitted - - - 8 < - - - 8 < - - - " ) ; } else { sb append ( log text ) ; sb append ( " \ n - - - 8 < - - - 8 < - - - end of log - - - 8 < - - - 8 < - - - " ) ; } } return new auto value error message ( sb to string ( ) ) ; }


public string get local host name ( ) { string host = local address = = null ? null : local address get host name ( ) ; if ( string utils is empty ( host ) ) { return get local host ( ) ; } return host ; }


model tests for additional properties number

public void test additional properties number ( ) { / / todo : test additional properties number }


byte block set get byte block set ( ) { return block set ; }


finalize the request by preparing the header in the request and returns the request ready to be sent < br > once finalized , no data must be added < br > if the request does not need chunk ( is chunked ( ) = = false ) , this request is the only object to send to the remote server

public http request finalize request ( ) throws error data encoder exception { / / finalize the multipart http datas if ( ! header finalized ) { if ( is multipart ) { internal attribute internal = new internal attribute ( charset ) ; if ( during mixed mode ) { internal add value ( " \ r \ n - - " + multipart mixed boundary + " - - " ) ; } internal add value ( " \ r \ n - - " + multipart data boundary + " - - \ r \ n " ) ; multipart http datas add ( internal ) ; multipart mixed boundary = null ; current file upload = null ; during mixed mode = false ; global body size + = internal size ( ) ; } header finalized = true ; } else { throw new error data encoder exception ( " header already encoded " ) ; } http headers headers = request headers ( ) ; list < string > content types = headers get all ( http header names content type ) ; list < string > transfer encoding = headers get all ( http header names transfer encoding ) ; if ( content types ! = null ) { headers remove ( http header names content type ) ; for ( string content type : content types ) { / / " multipart / form - data ; boundary = - - 89421926422648 " string lowercased = content type to lower case ( ) ; if ( lowercased starts with ( http header values multipart form data to string ( ) ) | | lowercased starts with ( http header values application x www form urlencoded to string ( ) ) ) { / / ignore } else { headers add ( http header names content type , content type ) ; } } } if ( is multipart ) { string value = http header values multipart form data + " ; " + http header values boundary + ' = ' + multipart data boundary ; headers add ( http header names content type , value ) ; } else { / / not multipart headers add ( http header names content type , http header values application x www form urlencoded ) ; } / / now consider size for chunk or not long real size = global body size ; if ( ! is multipart ) { real size - = 1 ; / / last ' & ' removed } iterator = multipart http datas list iterator ( ) ; headers set ( http header names content length , string value of ( real size ) ) ; if ( real size > http post body util chunk size | | is multipart ) { is chunked = true ; if ( transfer encoding ! = null ) { headers remove ( http header names transfer encoding ) ; for ( char sequence v : transfer encoding ) { if ( http header values chunked content equals ignore case ( v ) ) { / / ignore } else { headers add ( http header names transfer encoding , v ) ; } } } http util set transfer encoding chunked ( request , true ) ; / / wrap to hide the possible content return new wrapped http request ( request ) ; } else { / / get the only one body and set it to the request http content chunk = next chunk ( ) ; if ( request instanceof full http request ) { full http request full request = ( full http request ) request ; byte buf chunk content = chunk content ( ) ; if ( full request content ( ) ! = chunk content ) { full request content ( ) clear ( ) write bytes ( chunk content ) ; chunk content release ( ) ; } return full request ; } else { return new wrapped full http request ( request , chunk ) ; } } }


true if this column contains any non - null values

public boolean contains non null ( ) { return get non null count ( ) > 0l ; }


fixme channel get url ( ) always binds to a fixed service , and this service is random we can choose to use a common service to carry on connect event if there ' s no easy way to get the specific service this connection is binding to

private invocation create invocation ( channel channel , url url , string method key ) { string method = url get parameter ( method key ) ; if ( method = = null | | method length ( ) = = 0 ) { return null ; } rpc invocation invocation = new rpc invocation ( method , url get parameter ( interface key ) , " " , new class < ? > [ 0 ] , new object [ 0 ] ) ; invocation set attachment ( path key , url get path ( ) ) ; invocation set attachment ( group key , url get parameter ( group key ) ) ; invocation set attachment ( interface key , url get parameter ( interface key ) ) ; invocation set attachment ( version key , url get parameter ( version key ) ) ; if ( url get parameter ( stub event key , false ) ) { invocation set attachment ( stub event key , boolean true to string ( ) ) ; } return invocation ; }


return an iterator wrapping the join collector

protected resetable iterator < tuple writable > get delegate ( ) { return new join delegation iterator ( ) ; }


returns the user code class loader of this invokable

public final class loader get user code class loader ( ) { return get environment ( ) get user code class loader ( ) as class loader ( ) ; }


choose a move for the source the block ' s source , target , and proxy are determined too when choosing proxy and target , source & target throttling has been considered they are chosen only when they have the capacity to support this block move the block should be dispatched immediately after this method is returned if the block is a block group only the internal block on this source will be dispatched

private pending move choose next move ( ) { for ( iterator < task > i = tasks iterator ( ) ; i has next ( ) ; ) { final task task = i next ( ) ; final d datanode target = task target get d datanode ( ) ; final pending move pending block = new pending move ( this , task target ) ; if ( target add pending block ( pending block ) ) { / / target is not busy , so do a tentative block allocation if ( pending block choose block and proxy ( ) ) { long block size = pending block reported block get num bytes ( this ) ; inc scheduled size ( - block size ) ; task size - = block size ; if ( task size < = 0 ) { i remove ( ) ; } return pending block ; } else { / / cancel the tentative move target remove pending block ( pending block ) ; } } } return null ; }


makes sure that provided token is of the expected type

public static void ensure expected token ( token expected , token actual , x content parser parser ) { if ( actual ! = expected ) { throw parsing exception ( parser , expected , actual ) ; } }


set whether or not detailed explanations of analysis should be returned

public analyze request explain ( boolean explain ) { this explain = explain ; return this ; }


indicates if a post - processing algorithm is running

public boolean is ps running ( ) { return ps algorithm ! = null & & ( ps state = = 1 | | ps state = = 3 ) ; }


public module reference table get module reference table ( ) { return mod ref table ; }


verify a node can transition from admin states entering maintenance to admin states normal

public void test take node out of entering maintenance ( ) throws exception { log info ( " starting test take node out of entering maintenance " ) ; final int replicas = 1 ; final path file = new path ( " / test take node out of entering maintenance dat " ) ; start cluster ( 1 , 1 ) ; final file system file sys = get cluster ( ) get file system ( 0 ) ; final f s namesystem ns = get cluster ( ) get namesystem ( 0 ) ; write file ( file sys , file , replicas , 1 ) ; final datanode info node outof service = take node outof service ( 0 , null , long max value , null , admin states entering maintenance ) ; / / when node is in entering maintenance state , it can still serve read / / requests check with retry ( ns , file sys , file , replicas , null , node outof service ) ; put node in service ( 0 , node outof service get datanode uuid ( ) ) ; cleanup file ( file sys , file ) ; }


public void test super call to inherited default method ( ) { assert that ( new interface with inherited methods impl ( ) name ( ) ) is equal to ( " base " ) ; assert that ( new interface with inherited methods impl ( ) suffix ( ) ) is equal to ( " ! " ) ; }


atomically removes all of the elements from this queue the queue will be empty after this call returns

public void clear ( ) { final monitor monitor = this monitor ; monitor enter ( ) ; try { q clear ( ) ; } finally { monitor leave ( ) ; } }


forget all finished downloads , but , doesn ' t delete any file

public void forget finished downloads ( ) { synchronized ( this ) { for ( finished mission mission : m missions finished ) { m finished mission store delete mission ( mission ) ; } m missions finished clear ( ) ; } }


put a value in the j s o n array , where the value will be a j s o n array which is produced from a collection

public j s o n array put ( int index , collection value ) throws j s o n exception { put ( index , new j s o n array ( value ) ) ; return this ; }


tests good path saslscram - sha - 256 client and server channels also tests successful re - authentication

public void test valid sasl scram sha 2 5 6 ( ) throws exception { security protocol security protocol = security protocol sasl ssl ; configure mechanisms ( " scram - sha - 256 " , arrays as list ( " scram - sha - 256 " ) ) ; server = create echo server ( security protocol ) ; update scram credential cache ( test jaas config username , test jaas config password ) ; check authentication and reauthentication ( security protocol , " 0 " ) ; }


get the last job that was run using this instance

public job get result ( ) { return job ; }


tests that directory making should be successful when attempting to create the root directory as it ' s already exist

public void test mkdir of root with fallback link and mount with same dir tree ( ) throws exception { configuration conf = new configuration ( ) ; conf set boolean ( constants config viewfs mount links as symlinks , false ) ; config util add link ( conf , " / user 1 " , new path ( target test root to string ( ) ) to uri ( ) ) ; path dir 1 = new path ( target test root , " fallback dir / user 1 " ) ; fs target mkdirs ( dir 1 ) ; path fallback target = new path ( target test root , " fallback dir " ) ; config util add link fallback ( conf , fallback target to uri ( ) ) ; abstract file system vfs = abstract file system get ( view fs default cluster uri , conf ) ; path p = new path ( " / " ) ; path test = path merge paths ( fallback target , p ) ; assert true ( fs target exists ( test ) ) ; vfs mkdir ( p , null , true ) ; assert true ( fs target exists ( test ) ) ; }


returns a new instance of the distance field shader , see https : github comlibgdxlibgdxwiki distance - field - fonts if the u smoothing uniform > 0 0 otherwise the same code as the default sprite batch shader is used

static public shader program create distance field shader ( ) { string vertex shader = " attribute vec 4 " + shader program position attribute + " ; \ n " / / + " attribute vec 4 " + shader program color attribute + " ; \ n " / / + " attribute vec 2 " + shader program texcoord attribute + " 0 ; \ n " / / + " uniform mat 4 u proj trans ; \ n " / / + " varying vec 4 v color ; \ n " / / + " varying vec 2 v tex coords ; \ n " / / + " \ n " / / + " void main ( ) { \ n " / / + " v color = " + shader program color attribute + " ; \ n " / / + " v color a = v color a * ( 255 0 / 254 0 ) ; \ n " / / + " v tex coords = " + shader program texcoord attribute + " 0 ; \ n " / / + " gl position = u proj trans * " + shader program position attribute + " ; \ n " / / + " } \ n " ; string fragment shader = " # ifdef gl es \ n " / / + " precision mediump float ; \ n " / / + " precision mediump int ; \ n " / / + " # endif \ n " / / + " \ n " / / + " uniform sampler 2 d u texture ; \ n " / / + " uniform float u smoothing ; \ n " / / + " varying vec 4 v color ; \ n " / / + " varying vec 2 v tex coords ; \ n " / / + " \ n " / / + " void main ( ) { \ n " / / + " if ( u smoothing > 0 0 ) { \ n " / / + " float smoothing = 0 25 / u smoothing ; \ n " / / + " float distance = texture 2 d ( u texture , v tex coords ) a ; \ n " / / + " float alpha = smoothstep ( 0 5 - smoothing , 0 5 + smoothing , distance ) ; \ n " / / + " gl frag color = vec 4 ( v color rgb , alpha * v color a ) ; \ n " / / + " } else { \ n " / / + " gl frag color = v color * texture 2 d ( u texture , v tex coords ) ; \ n " / / + " } \ n " / / + " } \ n " ; shader program shader = new shader program ( vertex shader , fragment shader ) ; if ( ! shader is compiled ( ) ) throw new illegal argument exception ( " error compiling distance field shader : " + shader get log ( ) ) ; return shader ; }


finds missing try { } finally { join pool ( e ) ; }

void check fork join pool thread leaks ( ) throws interrupted exception { thread [ ] survivors = new thread [ 5 ] ; int count = thread enumerate ( survivors ) ; for ( int i = 0 ; i < count ; i + + ) { thread thread = survivors [ i ] ; string name = thread get name ( ) ; if ( name starts with ( " fork join pool - " ) ) { / / give thread some time to terminate thread join ( long delay ms ) ; if ( ! thread is alive ( ) ) { continue ; } thread stop ( ) ; throw new assertion failed error ( string format ( " found leaked fork join pool thread test = % s thread = % s % n " , to string ( ) , name ) ) ; } } }


gets the api package name for generated sources

public string get api package ( ) { return api package ; }


subclasses can override this for greater filtering ( and performance )

public boolean matches ( class < ? > clazz ) { return true ; }


resolves a name to a global , predeclared , or universal binding

scope resolve ( string name ) throws undefined ;


asserts that the document history in lucene index is consistent with translog ' s on every index shard of the cluster this assertion might be expensive , thus we prefer not to execute on every test but only interesting tests

public void assert consistent history between translog and lucene index ( ) throws i o exception { for ( node and client node and client : nodes values ( ) ) { indices service index services = get instance ( indices service class , node and client name ) ; for ( index service index service : index services ) { for ( index shard index shard : index service ) { try { index shard test case assert consistent history between translog and lucene ( index shard ) ; } catch ( already closed exception ignored ) { / / shard is closed } } } } }


public final graph explore response explore ( graph explore request graph explore request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( graph explore request , graph request converters : : explore , options , graph explore response : : from x content , empty set ( ) ) ; }


determine if the mapped annotation is synthesizable consult the documentation for { @ link merged annotation # synthesize ( ) } for an explanation of what is considered synthesizable

boolean is synthesizable ( ) { return this synthesizable ; }


sets the coordinate vector of a multi - dimensional point

public void set coordinates ( double [ ] coordinates ) { this coordinates = coordinates ; }


how old ( in milliseconds ) files must be before being aged - off during cache maintenance

public long get max file age m s ( ) { return max file age ms ; }


return a new and not started { @ link stopwatch }

public static stopwatch create not started ( ) { return new stopwatch ( ) ; }


public comparator < t > comparator ( ) { if ( comparator ! = null ) { return comparator ; } throw new unsupported operation exception ( " this ordering does not define a comparator " ) ; }


register a listener that will be called when this model is unbound from a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public generate default layout method next parent layout $ with layout on unbind ( on model unbound listener < generate default layout method next parent layout $ with layout , object > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


helper method to set bearer token for the first bearer authentication

public api client set bearer token ( string bearer token ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof http bearer auth ) { ( ( http bearer auth ) auth ) set bearer token ( bearer token ) ; return this ; } } throw new runtime exception ( " no bearer authentication configured ! " ) ; }


public void add option with value ( string option ) { if ( options contains key ( option ) ) { throw new duplicated option exception ( option ) ; } options with value put ( option , null ) ; }


sets the last number of bytes the user entered for a data type

public void set last num bytes ( int num bytes ) { last num bytes = num bytes ; }


assemble time point based on { @ link # step } and { @ link # start } { @ link # end }

public list < point of time > assemble duration points ( ) { return duration utils instance get duration points ( step , get start time bucket ( ) , get end time bucket ( ) ) ; }


public task monitor show task monitor component ( string local title , boolean has progress , boolean can cancel ) { show progress bar ( local title , has progress , can cancel , default delay ) ; return task monitor component ; }


resets the column to default state - fills the is null array with false - sets no nulls to true

public void reset ( ) { if ( ! no nulls ) { arrays fill ( is null , false ) ; } no nulls = true ; }


this tests the scenario where put index { " settings " : { " number of replicas " : 0 , " number of shards " : 1 } } put index settings { " number of replicas " : 1 , " index routing allocation include id " : " { node - name } " }

public void test execute replicas not allocated on single node ( ) { index index = new index ( random alpha of length between ( 1 , 20 ) , random alpha of length between ( 1 , 20 ) ) ; map < string , string > requires = collections singleton map ( " id " , " node 1 " ) ; settings builder existing settings = settings builder ( ) put ( index metadata setting version created , version current id ) put ( index metadata index routing require group prefix + " id " , " node 1 " ) put ( index metadata setting index uuid , index get u u i d ( ) ) ; settings builder expected settings = settings builder ( ) ; settings builder node 1 settings = settings builder ( ) ; settings builder node 2 settings = settings builder ( ) ; requires for each ( ( k , v ) - > { expected settings put ( index metadata index routing require group setting get key ( ) + k , v ) ; } ) ; index routing table builder index routing table = index routing table builder ( index ) add shard ( test shard routing new shard routing ( new shard id ( index , 0 ) , " node 1 " , true , shard routing state started ) ) add shard ( test shard routing new shard routing ( new shard id ( index , 1 ) , " node 1 " , false , shard routing state started ) ) add shard ( test shard routing new shard routing ( new shard id ( index , 1 ) , " node 2 " , true , shard routing state started ) ) add shard ( test shard routing new shard routing ( new shard id ( index , 0 ) , null , null , false , shard routing state unassigned , new unassigned info ( unassigned info reason replica added , " no attempt " ) ) ) ; check shrink ready step step = create random instance ( ) ; assert allocate status ( index , 2 , 1 , step , existing settings , node 1 settings , node 2 settings , index routing table , new cluster state wait step result ( true , null ) ) ; }


appends an int to the fingerprint message

public fingerprint add int ( int x ) { try { coded out write int 3 2 no tag ( x ) ; } catch ( i o exception e ) { throw new illegal state exception ( " failed to write int " , e ) ; } return this ; }


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


@ test public void delay response ( ) throws i o exception { test util assume not windows ( ) ; server enqueue ( new mock response ( ) set body ( " abcdef " ) set body delay ( 1 , seconds ) ) ; long start nanos = system nano time ( ) ; u r l connection connection = server url ( " / " ) url ( ) open connection ( ) ; input stream in = connection get input stream ( ) ; assert that ( in read ( ) ) is equal to ( ' a ' ) ; long elapsed nanos = system nano time ( ) - start nanos ; long elapsed millis = nanoseconds to millis ( elapsed nanos ) ; assert that ( elapsed millis ) is greater than or equal to ( 1000l ) ; in close ( ) ; }


called by a child node of the current node to increment a storage count lock is needed as different datanodes may call recursively to modify the same parent todo : this may not happen at all , depending on how heartheat is processed

public synchronized void child add storage ( string child name , storage type type ) { log debug ( " child add storage : { } : { } " , child name , type ) ; / / children storage info should definitely contain this node already / / because update storage is called after node added preconditions check argument ( children storage info contains key ( child name ) ) ; enum map < storage type , integer > type count = children storage info get ( child name ) ; if ( type count contains key ( type ) ) { type count put ( type , type count get ( type ) + 1 ) ; } else { / / please be aware that , the counts are always " number of datanodes in / / this subtree " rather than " number of storages in this storage " / / so if the caller is a datanode , it should always be this branch rather / / than the + 1 branch above this depends on the caller in / / datanode descriptor to make sure only when a * new * storage type is added / / it calls this ( should not call this when a already existing storage / / is added ) / / but no such restriction for inner nodes type count put ( type , 1 ) ; } if ( storage type counts contains key ( type ) ) { storage type counts put ( type , storage type counts get ( type ) + 1 ) ; } else { storage type counts put ( type , 1 ) ; } if ( get parent ( ) ! = null ) { ( ( d f s topology node impl ) get parent ( ) ) child add storage ( get name ( ) , type ) ; } }


public int total shards ( ) { return total shards ; }


returns the x position of the actor ' s left edge


tests that a broken audit logger causes requests to fail

public void test broken logger ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; conf set ( dfs namenode audit loggers key , broken audit logger class get name ( ) ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf ) build ( ) ; try { cluster wait cluster up ( ) ; file system fs = cluster get file system ( ) ; long time = system current time millis ( ) ; fs set times ( new path ( " / " ) , time , time ) ; fail ( " expected exception due to broken audit logger " ) ; } catch ( remote exception re ) { / / expected } finally { cluster shutdown ( ) ; } }


sets the precision levels at which geohash cells neighbours are considered defaults to only considering neighbours at the index - time precision level

public builder set neighbours ( list < integer > neighbours ) { for ( int neighbour : neighbours ) { if ( neighbour < 1 | | neighbour > 12 ) { throw new illegal argument exception ( " neighbour value must be between 1 and 12 " ) ; } } this neighbours = neighbours ; return this ; }


public boolean equals ( object obj ) { return super equals ( obj ) ; }


adds runfiles inputs from runfiles supplier to input mappings

void add runfiles to inputs ( map < path fragment , action input > input map , runfiles supplier runfiles supplier , metadata provider action file cache , artifact expander artifact expander ) throws i o exception { map < path fragment , map < path fragment , artifact > > roots and mappings = runfiles supplier get mappings ( ) ; for ( map entry < path fragment , map < path fragment , artifact > > root and mappings : roots and mappings entry set ( ) ) { path fragment root = root and mappings get key ( ) ; preconditions check state ( ! root is absolute ( ) , root ) ; for ( map entry < path fragment , artifact > mapping : root and mappings get value ( ) entry set ( ) ) { path fragment location = root get relative ( mapping get key ( ) ) ; artifact local artifact = mapping get value ( ) ; if ( local artifact ! = null ) { preconditions check state ( ! local artifact is middleman artifact ( ) ) ; if ( local artifact is tree artifact ( ) ) { list < action input > expanded inputs = action input helper expand artifacts ( nested set builder create ( order stable order , local artifact ) , artifact expander ) ; for ( action input input : expanded inputs ) { add mapping ( input map , location get relative ( ( ( tree file artifact ) input ) get parent relative path ( ) ) , input ) ; } } else if ( local artifact is fileset ( ) ) { immutable list < fileset output symlink > fileset links ; try { fileset links = artifact expander get fileset ( local artifact ) ; } catch ( missing expansion exception e ) { throw new illegal state exception ( e ) ; } add fileset manifest ( location , local artifact , fileset links , input map ) ; } else { if ( strict ) { fail if directory ( action file cache , local artifact ) ; } add mapping ( input map , location , local artifact ) ; } } else { add mapping ( input map , location , virtual action input empty marker ) ; } } } }


create an input stream with a codec taken from the global codec pool

static compression input stream create input stream with codec pool ( compression codec codec , configuration conf , input stream in ) throws i o exception { decompressor decompressor = codec pool get decompressor ( codec ) ; compression input stream stream = null ; try { stream = codec create input stream ( in , decompressor ) ; } finally { if ( stream = = null ) { codec pool return decompressor ( decompressor ) ; } else { stream set tracked decompressor ( decompressor ) ; } } return stream ; }


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

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


return the parameter name discoverer to use for resolving method parameter names if needed ( may be { @ code null } in order to skip parameter detection )

protected parameter name discoverer get parameter name discoverer ( ) { return this parameter name discoverer ; }


public okhttp 3 call login user call ( string username , string password , final api callback callback ) throws api exception { object local var post body = null ; / / create path and map variables api operation api operation = local var api client get operation lookup map ( ) get ( " login user " ) ; if ( api operation = = null ) { throw new api exception ( " operation not found in oas " ) ; } operation operation = api operation get operation ( ) ; string local var path = api operation get path ( ) ; map < string , object > param map = new hash map < > ( ) ; param map put ( " username " , username ) ; param map put ( " password " , password ) ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; local var path = local var api client fill parameters from operation ( operation , param map , local var path , local var query params , local var collection query params , local var header params , local var cookie params ) ; final string [ ] local var accepts = { " application / xml " , " application / json " } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , api operation get method ( ) , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


save the state of the < tt > concurrent hash map < tt > instance to a stream ( i e , serialize it )

private void write object ( java io object output stream s ) throws i o exception { / / force all segments for serialization compatibility for ( int k = 0 ; k < segments length ; + + k ) { ensure segment ( k ) ; } s default write object ( ) ; final segment < k , v > [ ] segments = this segments ; for ( int k = 0 ; k < segments length ; + + k ) { segment < k , v > seg = segment at ( segments , k ) ; seg lock ( ) ; try { hash entry < k , v > [ ] tab = seg table ; for ( int i = 0 ; i < tab length ; + + i ) { hash entry < k , v > e ; for ( e = entry at ( tab , i ) ; e ! = null ; e = e next ) { s write object ( e key ) ; s write object ( e value ) ; } } } finally { seg unlock ( ) ; } } s write object ( null ) ; s write object ( null ) ; }


an id that uniquely identifies an allocation

public allocation id allocation id ( ) { return this allocation id ; }


this gives direct access to the underlying storage array the { @ link # to byte array ( ) } should be preferred over this method if the return value is changed then { @ link # array changed ( ) } must be called

public byte [ ] array ( ) { return value ; }


validate that the given { @ link spec method model } is static

public static list < spec model validation error > validate method is static ( spec model spec model , spec method model < ? , ? > method model ) { list < spec model validation error > validation errors = new array list < > ( ) ; if ( spec model get spec element type ( ) = = spec element type java class & & ! method model modifiers contains ( modifier static ) ) { validation errors add ( new spec model validation error ( method model represented object , " methods in a spec must be static " ) ) ; } return validation errors ; }


test opening many files via tcp ( not short - circuit ) this is practical when using unbuffer , because it reduces the number of sockets and amount of memory that we use

public void test open many files via tcp ( ) throws exception { final int num opens = 500 ; configuration conf = new configuration ( ) ; conf set boolean ( hdfs client config keys read short circuit key , false ) ; mini d f s cluster cluster = null ; f s data input stream [ ] streams = new f s data input stream [ num opens ] ; try { cluster = new mini d f s cluster builder ( conf ) build ( ) ; distributed file system dfs = cluster get file system ( ) ; final path test path = new path ( " / test file " ) ; d f s test util create file ( dfs , test path , 131072 , ( short ) 1 , 1 ) ; for ( int i = 0 ; i < num opens ; i + + ) { streams [ i ] = dfs open ( test path ) ; log info ( " opening file " + i + " " ) ; assert assert true ( - 1 ! = streams [ i ] read ( ) ) ; streams [ i ] unbuffer ( ) ; } } finally { for ( f s data input stream stream : streams ) { i o utils cleanup ( null , stream ) ; } if ( cluster ! = null ) { cluster shutdown ( ) ; } } }


< code > map & lt ; string , org apache dubbo metadata definition protobuf model phone number & gt ; double map = 9 ; < code >

public boolean contains double map ( java lang string key ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } return internal get double map ( ) get map ( ) contains key ( key ) ; }


set this body to have fixed rotation this causes the mass to be reset

public void set fixed rotation ( boolean flag ) { jni set fixed rotation ( addr , flag ) ; }


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


public synchronized service trust forward headers ( ) { if ( initialized ) { throw before route mapping exception ( ) ; } this trust forward headers = true ; return this ; }


sets the version , which will cause the index operation to only be performed if a matching version exists and no changes happened on the doc since then

public update request builder set version ( long version ) { request version ( version ) ; return this ; }


public void set duplicate ( boolean is duplicate ) { this is duplicate = is duplicate ; }


sets the uncompressed size of the entry data in bytes

public void set size ( long size ) { if ( size < 0 ) { throw new illegal argument exception ( " invalid entry size " ) ; } if ( size > 0xffffffff l ) { feature set add ( feature zip64 size ) ; } else { feature set remove ( feature zip64 size ) ; } this size = size ; }


configures rocks d b to use a fixed amount of memory shared between all instances ( operators ) in a slot see { @ link rocks d b options # fix per slot memory size } for details

public void set fixed memory per slot ( memory size fixed memory per slot ) { check argument ( fixed memory per slot = = null | | fixed memory per slot get bytes ( ) > 0 , " total memory per slot must be > 0 " ) ; this fixed memory per slot = fixed memory per slot ; }


public final int get vertex count ( ) { return m count ; }


gets the token , which together with the scheme , will be sent as the value of the authorization header

public string get bearer token ( ) { return bearer token ; }


attempts always load the resource into the cache and return the { @ link file } containing the cached source data this method is designed to work for remote data that is or will be cached using { @ link com bumptech glide load engine disk cache strategy # data } as a result , specifying a { @ link com bumptech glide load engine disk cache strategy } on this request is generally not recommended

public request builder < file > download only ( ) { return as ( file class ) apply ( download only options ) ; }


returns whether the given file is a project directory

public static boolean is project dir ( file file ) { return file is directory ( ) & & file get name ( ) ends with ( project dir suffix ) ; }


define the main panel for the dialog here

protected j panel build main panel ( ) { / / give base class the panel it needs to complete its construction / / and then finish building after base class is done main panel = new j panel ( ) ; main panel set layout ( new box layout ( main panel , box layout y axis ) ) ; list model = new default list model < > ( ) ; set plugin paths list data ( preferences get plugin paths ( ) ) ; / / construct the bottom error message panel j panel status message panel = new j panel ( ) ; status message = new g d label ( " ready to set user plugin paths " ) ; status message set name ( " status label " ) ; status message set foreground ( status message color ) ; status message panel add ( status message ) ; / / put the main panel together / / make sure to construct the plugin paths panel , since that / / creates the scroll pane we use for sizing the text fields on / / subsequent panels main panel add ( build plugin paths panel ( ) ) ; main panel add ( box create vertical strut ( 10 ) ) ; main panel add ( box create vertical glue ( ) ) ; main panel add ( status message panel ) ; main panel invalidate ( ) ; / / dialog sensitivity setup enable buttons ( false ) ; set apply enabled ( false ) ; return main panel ; }


void op ( byte trie node ifc < t > node ) ;


appends a new pattern to the existing one the new pattern enforces strict temporal contiguity this means that the whole pattern sequence matches only if an event which matches this pattern directly follows the preceding matching event thus , there cannot be any events in between two matching events

public pattern < t , t > next ( final string name ) { return new pattern < > ( name , this , consuming strategy strict , after match skip strategy ) ; }


gets the lag to use when calculating the serial difference


peeks at the next long without incrementing the current index

public long peek next long ( ) throws i o exception { return read long ( current index ) ; }


caches the resolved host : rack mappings the two list parameters must be of equal size

private void cache resolved hosts ( list < string > uncached hosts , list < string > resolved hosts ) { / / cache the result if ( resolved hosts ! = null ) { for ( int i = 0 ; i < uncached hosts size ( ) ; i + + ) { cache put ( uncached hosts get ( i ) , resolved hosts get ( i ) ) ; } } }


set the body of the request to a string if not set or set to { @ code null } then no body is sent with the request the { @ code content - type } will be sent as { @ code applicationjson } if you need a different content type then use { @ link # set entity ( http entity ) }

public void set json entity ( string entity ) { set entity ( entity = = null ? null : new n string entity ( entity , content type application json ) ) ; }


returns the { @ link type } corresponding to the response headers provided

public static int infer file type from response headers ( map < string , list < string > > response headers ) { @ nullable list < string > content types = response headers get ( header content type ) ; @ nullable string mime type = content types = = null | | content types is empty ( ) ? null : content types get ( 0 ) ; return infer file type from mime type ( mime type ) ; }


returns the transform associated with this texture view , either set explicitly by { @ link # set transform ( matrix ) } or computed according to the current scale type

public matrix get transform ( matrix transform ) { if ( transform = = null ) { transform = new matrix ( ) ; } transform set ( m transform ) ; return transform ; }


submits a { @ link runnable } to be executed asynchronously if max concurrent runnables are already running , the runnable will be queued

public < t > async result < t > submit ( final async task < t > task ) { if ( executor is shutdown ( ) ) { throw new gdx runtime exception ( " cannot run tasks on an executor that has been shutdown ( disposed ) " ) ; } return new async result ( executor submit ( new callable < t > ( ) { @ override public t call ( ) throws exception { return task call ( ) ; } } ) ) ; }


register a listener that will be called when this model is unbound from a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public model with all private field types on unbind ( on model unbound listener < model with all private field types , object > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


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


helper method that encodes any of the three - unit register - range formats

private static void encode register range ( decoded instruction insn , code output out ) { out write ( code unit ( insn get opcode ( ) , insn get register count ( ) ) , insn get index unit ( ) , insn get a unit ( ) ) ; }


given a { @ link stream info } and the existing queue items , provide the { @ link single play queue } consisting of the next video for auto queueing this method detects and prevents cycles by naively checking if a candidate next video ' s url already exists in the existing items the first item in { @ link stream info # get related streams ( ) } is checked first if it is non - null and is not part of the existing items , it will be used as the next stream otherwise , a random item with non - repeating url will be selected from the { @ link stream info # get related streams ( ) }

public static play queue auto queue of ( @ non null final stream info info , @ non null final list < play queue item > existing items ) { final set < string > urls = new hash set < > ( existing items size ( ) ) ; for ( final play queue item item : existing items ) { urls add ( item get url ( ) ) ; } final list < info item > related items = info get related streams ( ) ; if ( utils is null or empty ( related items ) ) { return null ; } if ( related items get ( 0 ) ! = null & & related items get ( 0 ) instanceof stream info item & & ! urls contains ( related items get ( 0 ) get url ( ) ) ) { return get auto queued single play queue ( ( stream info item ) related items get ( 0 ) ) ; } final list < stream info item > auto queue items = new array list < > ( ) ; for ( final info item item : related items ) { if ( item instanceof stream info item & & ! urls contains ( item get url ( ) ) ) { auto queue items add ( ( stream info item ) item ) ; } } collections shuffle ( auto queue items ) ; return auto queue items is empty ( ) ? null : get auto queued single play queue ( auto queue items get ( 0 ) ) ; }


returns the full url of the request including the query string used as a convenience method for logging purposes

protected string get request u r l ( http servlet request request ) { string buffer sb = request get request u r l ( ) ; if ( request get query string ( ) ! = null ) { sb append ( " ? " ) append ( request get query string ( ) ) ; } return sb to string ( ) ; }


deep comparison of array of < code > long < code > length and all values are compared the method { @ link # append ( long , long ) } is used

public equals builder append ( long [ ] lhs , long [ ] rhs ) { if ( ! is equals ) { return this ; } if ( lhs = = rhs ) { return this ; } if ( lhs = = null | | rhs = = null ) { this set equals ( false ) ; return this ; } if ( lhs length ! = rhs length ) { this set equals ( false ) ; return this ; } for ( int i = 0 ; i < lhs length & & is equals ; + + i ) { append ( lhs [ i ] , rhs [ i ] ) ; } return this ; }


does the actual work for extracting , decoding , encoding and muxing

private void do extract decode edit encode mux ( final @ nullable video track converter video track converter , final @ nullable audio track converter audio track converter , final @ non null muxer muxer ) throws i o exception , transcoding exception { boolean muxing = false ; int percent processed = 0 ; long input duration = math max ( video track converter = = null ? 0 : video track converter m input duration , audio track converter = = null ? 0 : audio track converter m input duration ) ; while ( ! m cancelled & & ( ( video track converter ! = null & & ! video track converter m video encoder done ) | | ( audio track converter ! = null & & ! audio track converter m audio encoder done ) ) ) { if ( verbose ) { log d ( tag , " loop : " + ( video track converter = = null ? " " : video track converter dump state ( ) ) + ( audio track converter = = null ? " " : audio track converter dump state ( ) ) + " muxing : " + muxing ) ; } if ( video track converter ! = null & & ( audio track converter = = null | | audio track converter m audio extractor done | | video track converter m muxing video presentation time < = audio track converter m muxing audio presentation time ) ) { video track converter step ( ) ; } if ( audio track converter ! = null & & ( video track converter = = null | | video track converter m video extractor done | | video track converter m muxing video presentation time > = audio track converter m muxing audio presentation time ) ) { audio track converter step ( ) ; } if ( input duration ! = 0 & & m listener ! = null ) { final long time from us = m time from < = 0 ? 0 : m time from * 1000 ; final long time to us = m time to < = 0 ? input duration : m time to * 1000 ; final int cur percent processed = ( int ) ( 100 * ( math max ( video track converter = = null ? 0 : video track converter m muxing video presentation time , audio track converter = = null ? 0 : audio track converter m muxing audio presentation time ) - time from us ) / ( time to us - time from us ) ) ; if ( cur percent processed ! = percent processed ) { percent processed = cur percent processed ; m cancelled = m cancelled | | m listener on progress ( percent processed ) ; } } if ( ! muxing & & ( video track converter = = null | | video track converter m encoder output video format ! = null ) & & ( audio track converter = = null | | audio track converter m encoder output audio format ! = null ) ) { if ( video track converter ! = null ) { video track converter set muxer ( muxer ) ; } if ( audio track converter ! = null ) { audio track converter set muxer ( muxer ) ; } log d ( tag , " muxer : starting " ) ; muxer start ( ) ; muxing = true ; } } / / basic sanity checks if ( video track converter ! = null ) { video track converter verify end state ( ) ; } if ( audio track converter ! = null ) { audio track converter verify end state ( ) ; } / / todo : check the generated output file }


resets the library search path to match the system search paths

public static void reset ( ) { path list clear ( ) ; load java library path ( ) ; }


convert the supplied month name to its numeric representation < br > for example , < tt > " january " < tt > ( or any substring ) would return < tt > 1 < tt > and < tt > " december " < tt > would return < tt > 12 < tt >

public static int month name to number ( string str ) { if ( str ! = null & & str length ( ) > = 3 ) { string lstr = str to lower case ( ) ; for ( int i = 0 ; i < months length ; i + + ) { if ( lstr starts with ( months [ i ] [ 0 ] ) | | months [ i ] [ 1 ] to lower case ( ) starts with ( lstr ) ) { return i + 1 ; } } } return unset ; }


verifies a given number of bytes from a file - less number of bytes may be read if a header can not be read in due to the byte limit

private verify output verify bytes ( long byte am , long bytes read , data input stream in ) throws i o exception , bad file exception { if ( byte am < = 0 ) { return new verify output ( 0 , 0 , 0 , 0 ) ; } long chunks same = 0 ; long chunks different = 0 ; long read time = 0 ; long bytes left = byte am ; long buf left = 0 ; long buf read = 0 ; long seq num = 0 ; data hasher hasher = null ; byte buffer read buf = byte buffer wrap ( new byte [ buffer size ] ) ; while ( bytes left > 0 ) { if ( buf left < = 0 ) { if ( bytes left < data writer get header length ( ) ) { / / no bytes left to read a header break ; } / / time to read a new header read info header = null ; try { header = read header ( in ) ; } catch ( e o f exception e ) { / / eof ok on header reads / / but not on data readers break ; } + + seq num ; hasher = new data hasher ( header get hash value ( ) ) ; buf left = header get byte am ( ) ; read time + = header get time taken ( ) ; bytes read + = header get bytes read ( ) ; bytes left - = header get bytes read ( ) ; buf read = 0 ; / / number of bytes to read greater than how many we want to read if ( buf left > bytes left ) { buf left = bytes left ; } / / does the buffer amount have anything ? ? if ( buf left < = 0 ) { continue ; } } / / figure out the buffer size to read int buf size = buffer size ; if ( bytes left < buf size ) { buf size = ( int ) bytes left ; } if ( buf left < buf size ) { buf size = ( int ) buf left ; } / / read it in try { read buf rewind ( ) ; long start time = timer now ( ) ; in read fully ( read buf array ( ) , 0 , buf size ) ; read time + = timer elapsed ( start time ) ; } catch ( e o f exception e ) { throw new bad file exception ( " could not read the number of expected data bytes " + buf size + " due to unexpected end of file during sequence " + seq num , e ) ; } / / update the counters bytes read + = buf size ; bytes left - = buf size ; buf left - = buf size ; / / verify what we read read buf rewind ( ) ; / / figure out the expected hash offset start point long v offset = determine offset ( buf read ) ; / / now update for new position buf read + = buf size ; / / verify verify info verify res = verify buffer ( read buf , buf size , v offset , hasher ) ; / / update the verification counters chunks same + = verify res get same ( ) ; chunks different + = verify res get different ( ) ; } return new verify output ( chunks same , chunks different , bytes read , read time ) ; }


updates statistics by setting the last buffer usage size

public synchronized void set last buffer size ( int value ) { last buffer size = value ; if ( min buffer size = = init value | | value < min buffer size ) { min buffer size = value ; } if ( value > max buffer size ) { max buffer size = value ; } }


public static chrono unit to chrono unit ( final time unit tu ) { if ( tu = = null ) { return null ; } switch ( tu ) { case days : return chrono unit days ; case hours : return chrono unit hours ; case minutes : return chrono unit minutes ; case microseconds : return chrono unit micros ; case milliseconds : return chrono unit millis ; case nanoseconds : return chrono unit nanos ; case seconds : default : return chrono unit seconds ; } }


public static string get file m d 5 to string ( final string file path ) { file file = utils bridge is space ( file path ) ? null : new file ( file path ) ; return get file m d 5 to string ( file ) ; }


the sibling column for this column if a normal column is included and the sibling is requested , then the sibling is included as well example : cat indices , requesting ` pri ` and wanting the ` cs ` columns ( which have a sibling , pri cs ) { @ code get catindices ? pri & h = cs & v } ss pri ss 2 9 0kb 2 9 0kb 2 3 0b 2 3 0b default : no sibling

public table column attribute builder set sibling ( string sibling ) { this sibling = sibling ; return this ; }


delegates to the { @ link log # error ( object ) } method of the underlying { @ link log } instance however , this form avoids superfluous object creation when the logger is disabled for level error

public void error ( string format , object arg ) { if ( logger is error enabled ( ) ) { formatting tuple ft = message formatter format ( format , arg ) ; logger error ( ft get message ( ) , ft get throwable ( ) ) ; } }


public void set component ( component component ) { if ( m component tree = = null ) { set component tree ( component tree create ( get component context ( ) , component ) build ( ) ) ; } else { m component tree set root ( component ) ; } }


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


returns all extra actions for that target ( including transitive actions )

protected immutable list < extra action > get transitive extra action actions ( configured target target ) { immutable list builder < extra action > result = new immutable list builder < > ( ) ; for ( artifact artifact : target get provider ( extra action artifacts provider class ) get transitive extra action artifacts ( ) to list ( ) ) { action action = get generating action ( artifact ) ; if ( action instanceof extra action ) { result add ( ( extra action ) action ) ; } } return result build ( ) ; }


the debug extension array holds extended debugging information which has no semantic effect on the java virtual machine the information is represented using a modified utf - 8 string with no terminating zero byte note that the debug extension array may denote a string longer than that which can be represented with an instance of class string

public byte [ ] get debug extension ( ) { return debug extension ; }


public client execute as ( function < response , response > handler ) { type ref < client > type = new type ref < client > ( ) { } ; return execute ( handler ) as ( type ) ; }


the run method where work can be performed on the given domain object

public void run ( undoable domain object domain object , task monitor monitor ) throws cancelled exception ;


generate index table schema for specified primary table and index column

private static schema get index table schema ( table primary table , int col index ) { schema primary schema = primary table get schema ( ) ; field indexed field = primary schema get field ( col index ) ; field primary key type = primary schema get key field type ( ) ; index field index key field = new index field ( indexed field , primary key type ) ; return new schema ( 0 , index key field , " index key " , fields , field names ) ; }


tests that the { @ code - - output directory name } option cannot be used on the command line

public void test configuration short name ( ) throws exception { / / check that output directory name is still the name , otherwise this test is not testing what / / we expect core options options = options get defaults ( core options class ) ; options output directory name = " / home / wonkaw / wonka chocolate / factory / out " ; assert with message ( " the flag ' s name may have been changed ; this test may need to be updated " ) that ( options as map ( ) get ( " output directory name " ) ) is equal to ( " / home / wonkaw / wonka chocolate / factory / out " ) ; options parsing exception e = assert throws ( options parsing exception class , ( ) - > use configuration ( " - - output directory name = foo " ) ) ; assert that ( e ) has message that ( ) is equal to ( " unrecognized option : - - output directory name = foo " ) ; }


skips to the data in the given wav input stream , and returns its bounds after calling , the input stream ' s position will point to the start of sample data in the wav if an exception is thrown , the input position will be left pointing to a chunk header

public static pair < long , long > skip to data ( extractor input input ) throws i o exception { assertions check not null ( input ) ; / / make sure the peek position is set to the read position before we peek the first header input reset peek position ( ) ; parsable byte array scratch = new parsable byte array ( chunk header size in bytes ) ; / / skip all chunks until we hit the data header chunk header chunk header = chunk header peek ( input , scratch ) ; while ( chunk header id ! = wav util data fourcc ) { if ( chunk header id ! = wav util riff fourcc & & chunk header id ! = wav util fmt fourcc ) { log w ( tag , " ignoring unknown wav chunk : " + chunk header id ) ; } long bytes to skip = chunk header size in bytes + chunk header size ; / / override size of riff chunk , since it describes its size as the entire file if ( chunk header id = = wav util riff fourcc ) { bytes to skip = chunk header size in bytes + 4 ; } if ( bytes to skip > integer max value ) { throw new parser exception ( " chunk is too large ( ~ 2gb + ) to skip ; id : " + chunk header id ) ; } input skip fully ( ( int ) bytes to skip ) ; chunk header = chunk header peek ( input , scratch ) ; } / / skip past the " data " header input skip fully ( chunk header size in bytes ) ; long data start position = input get position ( ) ; long data end position = data start position + chunk header size ; long input length = input get length ( ) ; if ( input length ! = c length unset & & data end position > input length ) { log w ( tag , " data exceeds input length : " + data end position + " , " + input length ) ; data end position = input length ; } return pair create ( data start position , data end position ) ; }


combines all the masks in the data - structure together into a single byte stream

private mask value combine instruction masks ( list < byte [ ] > masks , list < byte [ ] > values , int length ) { if ( masks size ( ) ! = values size ( ) ) { throw new illegal argument exception ( ) ; } / * * this portion of code takes the masks and values from each of the * different commands and concatenates them together to form * a single mask and value byte array * / byte [ ] final value array = new byte [ length ] ; byte [ ] final mask array = new byte [ length ] ; int index = 0 ; for ( int x = 0 ; x < values size ( ) ; x + + ) { / / iterates through each mnemonic for ( int i = 0 ; i < values get ( x ) length & & index < length ; i + + ) { final value array [ index ] = values get ( x ) [ i ] ; final mask array [ index ] = masks get ( x ) [ i ] ; index + + ; } } return new mask value ( final mask array , final value array ) ; }


a entry is a file if it is not a directory by implementing it and not marking as an override this subclass builds and runs in both hadoop versions

public boolean is file ( ) { return ! this is directory ( ) ; }


private void build free index list ( int first free buffer index ) throws i o exception { array list < integer > free index list = new array list < > ( ) ; int next index = first free buffer index ; while ( next index > = 0 ) { / / push index on stack free index list add ( new integer ( next index ) ) ; / / read block to get next index seek buffer block ( next index ) ; / / read version 1 buffer prefix and next empty index byte flags = raf read byte ( ) ; if ( ( flags & empty buffer ) = = 0 ) { throw new i o exception ( " corrupt file " ) ; } next index = raf read int ( ) ; } int [ ] new free indexes = new int [ free index list size ( ) ] ; for ( int i = 0 ; i < new free indexes length ; i + + ) { new free indexes [ i ] = free index list get ( i ) int value ( ) ; } set free indexes ( new free indexes ) ; }


public boolean needs scores ( ) { return false ; }