to test enum parameters to test enum parameters

public void test enum parameters ( list < string > enum header string array , string enum header string , list < string > enum query string array , string enum query string , integer enum query integer , double enum query double , list < string > enum form string array , string enum form string , api client auth info auth info , handler < async result < void > > result handler ) { object local var body = null ; / / create path and map variables string local var path = " / fake " ; / / query params list < pair > local var query params = new array list < > ( ) ; local var query params add all ( api client parameter to pairs ( " csv " , " enum query string array " , enum query string array ) ) ; local var query params add all ( api client parameter to pairs ( " " , " enum query string " , enum query string ) ) ; local var query params add all ( api client parameter to pairs ( " " , " enum query integer " , enum query integer ) ) ; local var query params add all ( api client parameter to pairs ( " " , " enum query double " , enum query double ) ) ; / / header params multi map local var header params = multi map case insensitive multi map ( ) ; if ( enum header string array ! = null ) local var header params add ( " enum header string array " , api client parameter to string ( enum header string array ) ) ; if ( enum header string ! = null ) local var header params add ( " enum header string " , api client parameter to string ( enum header string ) ) ; / / cookie params multi map local var cookie params = multi map case insensitive multi map ( ) ; / / form params / / todo : sending files within multipart / form - data is not supported yet ( because of vertx web - client ) map < string , object > local var form params = new hash map < > ( ) ; if ( enum form string array ! = null ) local var form params put ( " enum form string array " , enum form string array ) ; if ( enum form string ! = null ) local var form params put ( " enum form string " , enum form string ) ; string [ ] local var accepts = { } ; string [ ] local var content types = { " application / x - www - form - urlencoded " } ; string [ ] local var auth names = new string [ ] { } ; api client invoke a p i ( local var path , " get " , local var query params , local var body , local var header params , local var cookie params , local var form params , local var accepts , local var content types , local var auth names , auth info , null , result handler ) ; }


expects that after the test , the rule will fire an exception

public void expect failure ( failure assert failure assert ) { this failure assert = failure assert ; }


subclasses can override this for custom initialization behavior the default implementation is empty called by { @ link # init application context ( org springframework context application context ) }

protected void init application context ( ) throws beans exception { }


damages all entities and blocks in a radius that are enemies of the team

public static void damage ( team team , float x , float y , float radius , float damage , boolean complete ) { damage ( team , x , y , radius , damage , complete , true , true ) ; }


add the given class file transformer to the list of transformers that this class loader will apply

public void add transformer ( class file transformer transformer ) { assert not null ( transformer , " transformer must not be null " ) ; this class file transformers add ( transformer ) ; }


normalize the geo { @ code point } for its coordinates to lie within their respective normalized ranges note : a shift of 180 & deg ; is applied in the longitude if necessary , in order to normalize properly the latitude

public static void normalize point ( geo point point ) { normalize point ( point , true , true ) ; }


adds the specified mesh part to the current node the mesh will be managed by the model and disposed when the model is disposed the resources the material might contain are not managed , use { @ link # manage ( disposable ) } to add those to the model

public mesh part part ( final string id , final mesh mesh , int primitive type , final material material ) { return part ( id , mesh , primitive type , 0 , mesh get num indices ( ) , material ) ; }


sets whether to force use the default drm license server uri even if the media specifies its own drm license server uri if { @ link # set uri } is passed a non - null { @ code uri } , the drm force default license flag is used to create a { @ link playback properties } object otherwise it will be ignored

public builder set drm force default license uri ( boolean force default license uri ) { this drm force default license uri = force default license uri ; return this ; }


extracts method arguments from a locals list these will be collected from the input list and sorted by ascending register in the returned list

private array list < local list entry > extract method arguments ( ) { array list < local list entry > result = new array list ( desc get parameter types ( ) size ( ) ) ; int arg base = get param base ( ) ; bit set seen = new bit set ( reg size - arg base ) ; int sz = locals size ( ) ; for ( int i = 0 ; i < sz ; i + + ) { local list entry e = locals get ( i ) ; int reg = e get register ( ) ; if ( reg < arg base ) { continue ; } / / only the lowest - start - address entry is included if ( seen get ( reg - arg base ) ) { continue ; } seen set ( reg - arg base ) ; result add ( e ) ; } / / sort by ascending register collections sort ( result , new comparator < local list entry > ( ) { public int compare ( local list entry a , local list entry b ) { return a get register ( ) - b get register ( ) ; } public boolean equals ( object obj ) { return obj = = this ; } } ) ; return result ; }


hands in a channel after a successful connection

private void hand in channel ( channel channel ) { synchronized ( connect lock ) { if ( connection shutdown future get ( ) ! = null | | failure cause ! = null ) { / / close the channel and we are done any queued requests / / are removed on the close / failure call and after that no / / new ones can be enqueued channel close ( ) ; } else { established = new established connection ( server address , serializer , channel ) ; while ( ! queued requests is empty ( ) ) { final pending request pending = queued requests poll ( ) ; established send request ( pending request ) when complete ( ( response , throwable ) - > { if ( throwable ! = null ) { pending complete exceptionally ( throwable ) ; } else { pending complete ( response ) ; } } ) ; } / / publish the channel for the general public established connections put ( server address , established ) ; pending connections remove ( server address ) ; / / check shut down for possible race with shut down we / / don ' t want any lingering connections after shut down , / / which can happen if we don ' t check this here if ( client shutdown future get ( ) ! = null ) { if ( established connections remove ( server address , established ) ) { established close ( ) ; } } } } }


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


get the list of corrupt blocks and corresponding full file path including snapshots in given snapshottable directories

list < string > list corrupt file blocks with snapshot ( string path , list < string > snapshottable dirs , string [ ] cookie tab ) throws i o exception { final collection < corrupt file block info > corrupt file blocks = list corrupt file blocks ( path , cookie tab ) ; list < string > list = new array list < string > ( ) ; / / precalculate snapshottable feature list list < directory snapshottable feature > lsf = new array list < > ( ) ; if ( snapshottable dirs ! = null ) { for ( string snap : snapshottable dirs ) { final i node isnap = get f s directory ( ) get i node ( snap , dir op read link ) ; final directory snapshottable feature sf = isnap as directory ( ) get directory snapshottable feature ( ) ; if ( sf = = null ) { throw new snapshot exception ( " directory is not a snapshottable directory : " + snap ) ; } lsf add ( sf ) ; } } for ( corrupt file block info c : corrupt file blocks ) { if ( get file info ( c path , true , false , false ) ! = null ) { list add ( c to string ( ) ) ; } final collection < string > snaps = f s dir snapshot op get snapshot files ( get f s directory ( ) , lsf , c path ) ; if ( snaps ! = null ) { for ( string snap : snaps ) { / / follow the syntax of corrupt file block info # to string ( ) list add ( c block get block name ( ) + " \ t " + snap ) ; } } } return list ; }


gets the manifest for this rule if no manifest is specified in the rule ' s attributes , an empty manifest will be generated unlike { @ link # from attributes ( rule context , android data context , android semantics ) } , the android semantics - specific manifest processing methods will not be applied in this method the manifest returned by this method will be the same regardless of the android semantics being used

public static android manifest from attributes ( rule context rule context , android data context data context ) throws interrupted exception , rule error exception { return from attributes ( rule context , data context , null ) ; }


sets the maximum length of symbols and datatypes created during import

public void set name length cutoff ( int name len cutoff ) { this name length cutoff size = name len cutoff ; }


public static list < string > read assets 2 list ( final string assets path ) { return read assets 2 list ( assets path , " " ) ; }


returns a range from the given endpoint , which may be either inclusive ( closed ) or exclusive ( open ) , with no upper bound

public static < c extends comparable < ? > > range < c > down to ( c endpoint , bound type bound type ) { switch ( bound type ) { case open : return greater than ( endpoint ) ; case closed : return at least ( endpoint ) ; default : throw new assertion error ( ) ; } }


load the bean definitions with the given xml bean definition reader the lifecycle of the bean factory is handled by the refresh bean factory method ; therefore this method is just supposed to load andor register bean definitions delegates to a resource pattern resolver for resolving location patterns into resource instances

protected void load bean definitions ( xml bean definition reader reader ) throws i o exception { string [ ] config locations = get config locations ( ) ; if ( config locations ! = null ) { for ( string config location : config locations ) { reader load bean definitions ( config location ) ; } } }


public void head ( string path , string accept type , route route , response transformer transformer ) { add route ( http method head , response transformer route impl create ( path , accept type , route , transformer ) ) ; }


public static boolean is service running ( @ non null final class < ? > cls ) { return is service running ( cls get name ( ) ) ; }


indicates whether this buffer is based on a char array and is readwrite

public final boolean has array ( ) { return protected has array ( ) ; }


create a parent dir and set default acl to allow foo readwrite access create a sub dir and set default acl to allow bar group readwrite access parent dirfile can not be viewedappended by bar group parent dirchild dirfile can be viewedappended by bar group

public void test grad subdir more access ( ) throws exception { path parent = new path ( " / test grad subdir more access " ) ; hdfs mkdirs ( parent ) ; list < acl entry > acls parent = lists new array list ( acl entry ( default , user , " foo " , read execute ) ) ; list < acl entry > acls child = lists new array list ( acl entry ( default , group , " bar " , read write ) ) ; hdfs set acl ( parent , acls parent ) ; acl entry [ ] parent dir expected acl = new acl entry [ ] { acl entry ( default , user , all ) , acl entry ( default , user , " foo " , read execute ) , acl entry ( default , group , read execute ) , acl entry ( default , mask , read execute ) , acl entry ( default , other , read execute ) } ; acl status parent acl = hdfs get acl status ( parent ) ; assert array equals ( parent dir expected acl , parent acl get entries ( ) to array ( ) ) ; path child dir = new path ( parent , " child dir " ) ; hdfs mkdirs ( child dir ) ; hdfs modify acl entries ( child dir , acls child ) ; / / child dir should inherit the default acls from parent , plus bar group acl entry [ ] child dir expected acl = new acl entry [ ] { acl entry ( access , user , " foo " , read execute ) , acl entry ( access , group , read execute ) , acl entry ( default , user , all ) , acl entry ( default , user , " foo " , read execute ) , acl entry ( default , group , read execute ) , acl entry ( default , group , " bar " , read write ) , acl entry ( default , mask , all ) , acl entry ( default , other , read execute ) } ; acl status child dir acl = hdfs get acl status ( child dir ) ; assert array equals ( child dir expected acl , child dir acl get entries ( ) to array ( ) ) ; path parent file = new path ( parent , " parent file " ) ; hdfs create ( parent file ) close ( ) ; hdfs set permission ( parent file , new fs permission ( ( short ) 0640 ) ) ; / / parent dir / parent file allows foo to access but not bar group acl entry [ ] parent file expected acl = new acl entry [ ] { acl entry ( access , user , " foo " , read execute ) , acl entry ( access , group , read execute ) } ; acl status parent file acl = hdfs get acl status ( parent file ) ; assert array equals ( parent file expected acl , parent file acl get entries ( ) to array ( ) ) ; path child file = new path ( child dir , " child file " ) ; hdfs create ( child file ) close ( ) ; hdfs set permission ( child file , new fs permission ( ( short ) 0640 ) ) ; / / child dir / child file allows foo user and bar group to access acl entry [ ] child file expected acl = new acl entry [ ] { acl entry ( access , user , " foo " , read execute ) , acl entry ( access , group , read execute ) , acl entry ( access , group , " bar " , read write ) } ; acl status child file acl = hdfs get acl status ( child file ) ; assert array equals ( child file expected acl , child file acl get entries ( ) to array ( ) ) ; / / parent file should not be accessible for bar group assert false ( try access ( parent file , " bar user " , new string [ ] { " bar " } , read ) ) ; / / child file should be accessible for bar group assert true ( try access ( child file , " bar user " , new string [ ] { " bar " } , read ) ) ; / / parent file should be accessible for foo user assert true ( try access ( parent file , " foo " , new string [ ] { " foo group " } , read ) ) ; / / child file should be accessible for foo user assert true ( try access ( child file , " foo " , new string [ ] { " foo group " } , read ) ) ; hdfs delete ( parent , true ) ; }


public string to string ( ) { return object to string ( ) ; }


public integer get prefix integer ( ) { return prefix integer ; }


public linker state copy ( ) { linker state cp = new linker state ( ) ; cp which focus = this which focus ; for ( field state fs : field states ) { cp field states add ( fs copy ( ) ) ; } return cp ; }


finish handling this pipeline by writing a response with the " connection : close " header , flushing , and scheduling a close of the connection

private static void send response and close ( channel handler context ctx , default http response resp ) { resp headers ( ) set ( connection , close ) ; ctx write and flush ( resp ) add listener ( channel future listener close ) ; }


close an entry this method must be called for all file entries that contain data the reason is that we must buffer data written to the stream in order to satisfy the buffer ' s record based writes thus , there may be data fragments still being assembled that must be written to the output stream before this entry is closed and the next entry written

public void close entry ( ) throws i o exception { if ( this assem len > 0 ) { for ( int i = this assem len ; i < this assem buf length ; + + i ) { this assem buf [ i ] = 0 ; } this buffer write record ( this assem buf ) ; this curr bytes + = this assem len ; this assem len = 0 ; } if ( this curr bytes < this curr size ) { throw new i o exception ( " entry ' " + curr name + " ' closed at ' " + this curr bytes + " ' before the ' " + this curr size + " ' bytes specified in the header were written " ) ; } }


prints the c language token group into a string of c code

public decompiled function print ( boolean remove invalid chars ) { string buffer buff = new string buffer ( ) ; for ( clang line line : lines ) { buff append ( line get indent string ( ) ) ; list < clang token > tokens = line get all tokens ( ) ; for ( clang token token : tokens ) { boolean is token 2 clean = token instanceof clang func name token | | token instanceof clang variable token | | token instanceof clang type token | | token instanceof clang field token | | token instanceof clang label token ; / / do not clean constant variable tokens if ( is token 2 clean & & token get syntax type ( ) = = clang token const color ) { is token 2 clean = false ; } if ( remove invalid chars & & is token 2 clean ) { string token text = token get text ( ) ; for ( int i = 0 ; i < token text length ( ) ; + + i ) { if ( string utilities is valid c language char ( token text char at ( i ) ) ) { buff append ( token text char at ( i ) ) ; } else { buff append ( ' ' ) ; } } } else { buff append ( token get text ( ) ) ; } } buff append ( string utilities line separator ) ; } return new decompiled function ( find signature ( ) , buff to string ( ) ) ; }


set the domain owner the user doesn ' t need to set it , which will automatically set to the user who puts the domain

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


package a { @ link org litepal tablemanager model associations model } , and add it into { @ link # m association models } collection

private void add into association model collection ( string class name , string associated class name , string class holds foreign key , int association type ) { associations model association model = new associations model ( ) ; association model set table name ( d b utility get table name by class name ( class name ) ) ; association model set associated table name ( d b utility get table name by class name ( associated class name ) ) ; association model set table holds foreign key ( d b utility get table name by class name ( class holds foreign key ) ) ; association model set association type ( association type ) ; m association models add ( association model ) ; }


returns an unmodifiable view of the specified { @ code list multimap } query operations on the returned multimap " read through " to the specified multimap , and attempts to modify the returned multimap , either directly or through the multimap ' s views , result in an { @ code unsupported operation exception } the returned multimap will be serializable if the specified multimap is serializable

public static < k , v > list multimap < k , v > unmodifiable list multimap ( list multimap < k , v > delegate ) { if ( delegate instanceof unmodifiable list multimap | | delegate instanceof immutable list multimap ) { return delegate ; } return new unmodifiable list multimap < > ( delegate ) ; }


sets a disposable on this emitter ; any previous { @ link disposable } or { @ link cancellable } will be disposedcancelled

void set disposable ( @ nullable disposable d ) ;


performs dependency injection on the { @ link test context # get test instance ( ) test instance } of the supplied { @ link test context test context } by { @ link autowire capable bean factory # autowire bean properties ( object , int , boolean ) autowiring } and { @ link autowire capable bean factory # initialize bean ( object , string ) initializing } the test instance via its own { @ link test context # get application context ( ) application context } ( without checking dependencies ) the { @ link # reinject dependencies attribute } will be subsequently removed from the test context , regardless of its value

public void prepare test instance ( test context test context ) throws exception { if ( logger is debug enabled ( ) ) { logger debug ( " performing dependency injection for test context [ " + test context + " ] " ) ; } inject dependencies ( test context ) ; }


returns the number of parameters of the given internal method descriptor

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


assume that the specified log is not set to trace or debug

public static void not logging ( log log ) { assume false ( log is trace enabled ( ) ) ; assume false ( log is debug enabled ( ) ) ; }


boolean subscribe ( message handler handler ) ;


sasl extensions that are validated by the callback handler should be accessible through the { @ code # get negotiated property ( ) } method

public void saves custom extension as negotiated property ( ) throws exception { map < string , string > custom extensions = new hash map < > ( ) ; custom extensions put ( " first key " , " value 1 " ) ; custom extensions put ( " second key " , " value 2 " ) ; byte [ ] next challenge = sasl server evaluate response ( client initial response ( null , false , custom extensions ) ) ; assert true ( next challenge length = = 0 , " next challenge is not empty " ) ; assert equals ( " value 1 " , sasl server get negotiated property ( " first key " ) ) ; assert equals ( " value 2 " , sasl server get negotiated property ( " second key " ) ) ; }


returns collection of nameservice ids from the configuration

public static collection < string > get name service ids ( configuration conf ) { return conf get trimmed string collection ( dfs nameservices ) ; }


moves the component associated with the given source placeholder object from its current docked location to its own window that will be anchored at the given point

void move placeholder ( component placeholder source , point p ) { component node source node = source get node ( ) ; source node remove ( source ) ; root add ( source , p ) ; schedule update ( ) ; }


public string get type ( clazz clazz ) { return clazz get type ( u 2name and type index ) ; }


removes entries in { @ code values to inject } whose values are equal to the present values in the graph

private void prune injected values ( map < sky key , sky value > values to inject ) { for ( iterator < map entry < sky key , sky value > > it = values to inject entry set ( ) iterator ( ) ; it has next ( ) ; ) { map entry < sky key , sky value > entry = it next ( ) ; sky key key = entry get key ( ) ; sky value new value = entry get value ( ) ; node entry prev entry = graph get ( null , reason other , key ) ; if ( prev entry ! = null & & prev entry is done ( ) ) { if ( keep edges ) { try { if ( ! prev entry has at least one dep ( ) ) { if ( new value equals ( prev entry get value ( ) ) & & ! values to dirty contains ( key ) & & ! values to delete contains ( key ) ) { it remove ( ) ; } } else { / / rare situation of an injected dep that depends on another node usually the dep is / / the error transience node when working with external repositories , it can also be / / an external workspace file don ' t bother injecting it , just invalidate it / / we ' ll wastefully evaluate the node freshly during evaluation , but this happens very / / rarely values to dirty add ( key ) ; it remove ( ) ; } } catch ( interrupted exception e ) { throw new illegal state exception ( " in memory graph does not throw : " + entry + " , " + prev entry , e ) ; } } else { / / no incrementality just delete the old value from the graph the new value is about to / / be injected graph remove ( key ) ; } } } }


specify the jpa 2 0 shared cache mode for all of this manager ' s persistence units , overriding any value in { @ code persistence xml } if set

public void set shared cache mode ( shared cache mode shared cache mode ) { this shared cache mode = shared cache mode ; }


public boolean recycle ( ) { clear ( ) ; insert since recycled = false ; handle recycle ( this ) ; return true ; }


returns the status bar theme of this m t config object

public boolean is status bar theme ( ) { return status bar theme ; }


normalize a path by stripping off any trailing { @ link # path separator }

private static string normalize network location path ( string path ) { if ( path = = null | | path length ( ) = = 0 ) { return root ; } if ( path char at ( 0 ) ! = path separator ) { throw new illegal argument exception ( " network location " + " path doesn ' t start with " + path separator + " : " + path ) ; } int len = path length ( ) ; if ( path char at ( len - 1 ) = = path separator ) { return path substring ( 0 , len - 1 ) ; } return path ; }


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

public static rop op if ne ( type list types ) { return pick if ( types , if nez int , if nez object , if ne int , if ne object ) ; }


handles a custom source event from the source reader this method has a default implementation that does nothing , because it is only required to be implemented by some sources , which have a custom event protocol between reader and enumerator the common events for reader registration and split requests are not dispatched to this method , but rather invoke the { @ link # add reader ( int ) } and { @ link # handle split request ( int , string ) } methods

default void handle source event ( int subtask id , source event source event ) { }


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

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


create a lsda type table from the bytes between < code > bottom < code > and < code > top < code > this table is built from bottom - to - top < br > note : this method must get called before any of the " get " methods

public void create ( address bottom , address top ) { if ( bottom = = null | | top = = null | | monitor is cancelled ( ) ) { return ; } monitor set message ( " creating lsda type table " ) ; int encoding = region get l s d a table ( ) get header ( ) get t type encoding ( ) ; dwarf e h decoder decoder = dwarf decoder factory get decoder ( encoding ) ; data type encoded dt = decoder get data type ( program ) ; int stride = decoder get decode size ( program ) ; string comment = " type reference " ; top = align 4 ( top ) ; address addr = bottom subtract ( stride - 1 ) ; while ( addr compare to ( top ) > = 0 ) { dwarf decode context ctx = new dwarf decode context ( program , addr ) ; try { address type ref = decoder decode address ( ctx ) ; type info addrs add ( type ref ) ; create and comment data ( program , addr , encoded dt , comment , code unit eol comment ) ; if ( type ref get offset ( ) ! = 0 ) { program get reference manager ( ) add memory reference ( addr , type ref , ref type data , source type analysis , 0 ) ; } } catch ( memory access exception mae ) { set comment cmd comment cmd = new set comment cmd ( addr , code unit eol comment , " unable to resolve pointer " ) ; comment cmd apply to ( program ) ; } addr = addr subtract ( stride ) ; } set comment cmd comment cmd = new set comment cmd ( top , code unit plate comment , " ( lsda ) type table " ) ; comment cmd apply to ( program ) ; next address = bottom add ( 1 ) ; }


returns an array of key index paths that should be used during the lookup the indices are 0 - based and support composite keys within ( possibly nested ) structures for example , given a table with data type { @ code row < i int , s string , r row < i 2 int , s 2 string > > } , this method would return { @ code [ [ 0 ] , [ 2 , 1 ] ] } when { @ code i } and { @ code s 2 } are used for performing a lookup


returns true if the system clipboard has any g tree nodes that have the { @ link cuttable # is cut ( ) } flag set

public static boolean is cuttable present ( ) { for ( g tree node node : get data tree nodes from clipboard ( ) ) { if ( node instanceof cuttable ) { return ( ( cuttable ) node ) is cut ( ) ; } } return false ; }


prepare a list of modifications a modification may be a file creation , file deletion , or a modification operation such as appending to an existing file

private modification [ ] prepare modifications ( test directory tree node [ ] nodes ) throws exception { array list < modification > m list = new array list < modification > ( ) ; for ( test directory tree node node : nodes ) { / / if the node does not have files in it , create files if ( node file list = = null ) { node init file list ( hdfs , node node path get name ( ) , blocksize , replication , seed , 6 ) ; } / / / / modification iterations are as follows : / / iteration 0 - create : file list [ 5 ] , delete : file list [ 0 ] , / / append : file list [ 1 ] , chmod : file list [ 2 ] , / / chown : file list [ 3 ] , change replication : file list [ 4 ] / / set null file index to 0 / / / / iteration 1 - create : file list [ 0 ] , delete : file list [ 1 ] , / / append : file list [ 2 ] , chmod : file list [ 3 ] , / / chown : file list [ 4 ] , change replication : file list [ 5 ] / / set null file index to 1 / / / / iteration 2 - create : file list [ 1 ] , delete : file list [ 2 ] , / / append : file list [ 3 ] , chmod : file list [ 4 ] , / / chown : file list [ 5 ] , change replication : file list [ 6 ] / / set null file index to 2 / / / / modification create = new file creation ( node file list get ( node null file index ) , hdfs , blocksize ) ; modification delete = new file deletion ( node file list get ( ( node null file index + 1 ) % node file list size ( ) ) , hdfs ) ; path f = node file list get ( ( node null file index + 2 ) % node file list size ( ) ) ; modification append = new file append ( f , hdfs , blocksize ) ; file append not close append not close = new file append not close ( f , hdfs , blocksize ) ; modification append close = new file append close ( f , hdfs , blocksize , append not close ) ; modification chmod = new file change permission ( node file list get ( ( node null file index + 3 ) % node file list size ( ) ) , hdfs , gen random permission ( ) ) ; string [ ] user group = gen random owner ( ) ; modification chown = new file chown ( node file list get ( ( node null file index + 4 ) % node file list size ( ) ) , hdfs , user group [ 0 ] , user group [ 1 ] ) ; modification replication = new file change replication ( node file list get ( ( node null file index + 5 ) % node file list size ( ) ) , hdfs , ( short ) ( random next int ( replication ) + 1 ) ) ; node null file index = ( node null file index + 1 ) % node file list size ( ) ; modification dir change = new dir creation or deletion ( node node path , hdfs , node , random next boolean ( ) ) ; / / dir rename node dst parent = dir tree get random dir node ( random , arrays as list ( nodes ) ) ; modification dir rename = new dir rename ( node node path , hdfs , node , dst parent ) ; m list add ( create ) ; m list add ( delete ) ; m list add ( append ) ; m list add ( append not close ) ; m list add ( append close ) ; m list add ( chmod ) ; m list add ( chown ) ; m list add ( replication ) ; m list add ( dir change ) ; m list add ( dir rename ) ; } return m list to array ( new modification [ m list size ( ) ] ) ; }


build an " empty " result only called if there isn ' t any data on this shard


protected list < row lock > collect row locks ( branch session branch session ) { list < row lock > locks = new array list < > ( ) ; if ( branch session = = null | | string utils is blank ( branch session get lock key ( ) ) ) { return locks ; } string xid = branch session get xid ( ) ; string resource id = branch session get resource id ( ) ; long transaction id = branch session get transaction id ( ) ; string lock key = branch session get lock key ( ) ; return collect row locks ( lock key , resource id , xid , transaction id , branch session get branch id ( ) ) ; }


create a new acl entry with scope , type and permission ( no name )

public static acl entry acl entry ( acl entry scope scope , acl entry type type , fs action permission ) { return new acl entry builder ( ) set scope ( scope ) set type ( type ) set permission ( permission ) build ( ) ; }


public int get ordinal position ( ) { return ordinal position ; }


creates a temporary table with optional partitioning requirements temporary table might have different default storage format , compression scheme , replication factor , etc , and gets automatically dropped when the transaction ends this spi is unstable and subject to change in the future

default connector table handle create temporary table ( connector session session , list < column metadata > columns , optional < connector partitioning metadata > partitioning metadata ) { throw new presto exception ( not supported , " this connector does not support creating temporary tables " ) ; }


sets the input to the union of the given operators

public void set inputs ( list < operator < in > > inputs ) { this input = operator create union cascade ( null , inputs to array ( new operator [ inputs size ( ) ] ) ) ; }


required : the port on which the proxy should listen for incoming connections < code > istio networking v 1alpha 3 port port = 1 ; < code >

public builder clear port ( ) { if ( port builder = = null ) { port = null ; on changed ( ) ; } else { port = null ; port builder = null ; } return this ; }


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


returns the { @ link extent } of this geometry

protected extent get extent ( ) { if ( tree offset = = 0 ) { get sum centroid weight ( ) ; / / skip centroid header + var - long sum - weight extent read from compressed ( input , extent ) ; tree offset = input get position ( ) ; } else { input set position ( tree offset ) ; } return extent ; }


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

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


returns pet inventories by status returns a map of status codes to quantities

public map < string , integer > get inventory ( ) ;


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

public java util list < ? extends com android aapt resources entry or builder > get entry or builder list ( ) { return entry ; }


set the { @ link requested content type resolver } to use to determine requested media types if not set , the default constructor is used

public void set content type resolver ( requested content type resolver content type resolver ) { assert not null ( content type resolver , " ' content type resolver ' must not be null " ) ; this content type resolver = content type resolver ; }


public void set s s l context ( s s l context ssl context ) { if ( ssl context ! = null ) { https u r l connection set default s s l socket factory ( ssl context get socket factory ( ) ) ; } }


adds the contents of this class path element to the given class path

public void append class path entries to ( class path class path , boolean output ) { file base dir = get project ( ) get base dir ( ) ; string [ ] file names ; if ( is reference ( ) ) { / / get the referenced path or file set object referenced object = get checked ref ( data type class , data type class get name ( ) ) ; if ( referenced object instanceof path ) { path path = ( path ) referenced object ; / / get the names of the files in the referenced path file names = path list ( ) ; } else if ( referenced object instanceof abstract file set ) { abstract file set file set = ( abstract file set ) referenced object ; / / get the names of the existing input files in the referenced file set directory scanner scanner = file set get directory scanner ( get project ( ) ) ; base dir = scanner get basedir ( ) ; file names = scanner get included files ( ) ; } else { throw new build exception ( " the refid attribute doesn ' t point to a < path > element or a < fileset > element " ) ; } } else { / / get the names of the files in this path file names = list ( ) ; } if ( output ) { if ( file names length ! = 1 ) { throw new build exception ( " the < outjar > element must specify exactly one file or directory [ " + file names length + " ] " ) ; } } / / else / / { / / if ( file names length < 1 ) / / { / / throw new build exception ( " the < injar > element must specify at least one file or directory " ) ; / / } / / } for ( int index = 0 ; index < file names length ; index + + ) { / / create a new class path entry , with the proper file name and / / any filters string file name = file names [ index ] ; file file = new file ( file name ) ; class path entry entry = new class path entry ( file is absolute ( ) ? file : new file ( base dir , file name ) , output ) ; entry set filter ( list util comma separated list ( filter ) ) ; entry set apk filter ( list util comma separated list ( apk filter ) ) ; entry set jar filter ( list util comma separated list ( jar filter ) ) ; entry set aar filter ( list util comma separated list ( aar filter ) ) ; entry set war filter ( list util comma separated list ( war filter ) ) ; entry set ear filter ( list util comma separated list ( ear filter ) ) ; entry set zip filter ( list util comma separated list ( zip filter ) ) ; / / add it to the class path class path add ( entry ) ; } } / / ant task attributes


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


returns the set of defines needed to compile this target this includes definitions from the transitive deps closure for the target the order of the returned collection is deterministic

public immutable list < string > get defines ( ) { return command line cc compilation context defines ; }


return the date and time at which the message is no longer valid , as specified by the { @ code expires } header the date is returned as the number of milliseconds since january 1 , 1970 gmt returns - 1 when the date is unknown

public long get expires ( ) { return get first date ( expires , false ) ; }


filter the list to completed builds warning : this method mutates the original list and then returns it

public run list < r > completed only ( ) { return filter ( new predicate < r > ( ) { public boolean apply ( r r ) { return ! r is building ( ) ; } } ) ; }


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


creates an xml item this route creates an xml item

public void create xml item ( xml item xml item ) throws api exception { create xml item with http info ( xml item ) ; }


private boolean paste fragment ( program node node to paste , program module target module , program fragment fragment ) throws not found exception , duplicate group exception { boolean paste o k = false ; if ( target module contains ( fragment ) ) { if ( target module equals ( node to paste get parent module ( ) ) ) { remove from clipboard ( node to paste ) ; } } else if ( action mgr clipboard contains ( node to paste ) ) { target module reparent ( node to paste get name ( ) , node to paste get parent module ( ) ) ; remove from clipboard ( node to paste ) ; paste o k = true ; } else { target module add ( fragment ) ; paste o k = true ; } return paste o k ; }


returns the value of the given calendar field

public static int get value by calendar field ( final int field ) { calendar cal = calendar get instance ( ) ; return cal get ( field ) ; }


extracts snapshot directory property value from the container

public static file get snap dir ( properties props ) { return new file ( props get property ( snap dir ) ) ; }


creates and releases all periods ( including ad periods ) defined in the last timeline to be returned from { @ link # prepare source ( ) } , { @ link # assert timeline change ( ) } or { @ link # assert timeline change blocking ( ) } the { @ link media period id # window sequence number } is set to the index of the window

public void assert prepare and release all periods ( ) throws interrupted exception { timeline period period = new timeline period ( ) ; for ( int i = 0 ; i < timeline get period count ( ) ; i + + ) { timeline get period ( i , period , / * set ids = * / true ) ; assert prepare and release period ( new media period id ( period uid , period window index ) ) ; for ( int ad group index = 0 ; ad group index < period get ad group count ( ) ; ad group index + + ) { for ( int ad index = 0 ; ad index < period get ad count in ad group ( ad group index ) ; ad index + + ) { assert prepare and release period ( new media period id ( period uid , ad group index , ad index , period window index ) ) ; } } } }


returns a fluent iterable that wraps { @ code iterable } , or { @ code iterable } itself if it is already a { @ code fluent iterable } < b > { @ code stream } equivalent : < b > { @ link collection # stream } if { @ code iterable } is a { @ link collection } ; { @ link streams # stream ( iterable ) } otherwise

public static < e > fluent iterable < e > from ( final iterable < e > iterable ) { return ( iterable instanceof fluent iterable ) ? ( fluent iterable < e > ) iterable : new fluent iterable < e > ( iterable ) { @ override public iterator < e > iterator ( ) { return iterable iterator ( ) ; } } ; }


return the configured { @ link forwarded header transformer }

public forwarded header transformer get forwarded header transformer ( ) { return this forwarded header transformer ; }


return true if this additional properties object object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } additional properties object additional properties object = ( additional properties object ) o ; return objects equals ( this name , additional properties object name ) & & objects equals ( this additional properties , additional properties object additional properties ) & & super equals ( o ) ; }


generates a random chart data object with just one data set

private bar data generate data ( int cnt ) { array list < bar entry > entries = new array list < > ( ) ; for ( int i = 0 ; i < 12 ; i + + ) { entries add ( new bar entry ( i , ( float ) ( math random ( ) * 70 ) + 30 ) ) ; } bar data set d = new bar data set ( entries , " new data set " + cnt ) ; d set colors ( color template vordiplom colors ) ; d set bar shadow color ( color rgb ( 203 , 203 , 203 ) ) ; array list < i bar data set > sets = new array list < > ( ) ; sets add ( d ) ; bar data cd = new bar data ( sets ) ; cd set bar width ( 0 9f ) ; return cd ; }


create a map of case insensitive parameter names together with the original name

public static map < string , string > extract case insensitive parameter names ( sql parameter source parameter source ) { map < string , string > case insensitive parameter names = new hash map < > ( ) ; string [ ] param names = parameter source get parameter names ( ) ; if ( param names ! = null ) { for ( string name : param names ) { case insensitive parameter names put ( name to lower case ( ) , name ) ; } } return case insensitive parameter names ; }


register this implementation as the default in the system

public static void register ( ) { if ( main is unit test & & jenkins loc = = null ) { mock off ( ) ; return ; } class filter set default ( new class filter impl ( ) ) ; if ( suppress all ) { logger warning ( " all class filtering suppressed your jenkins installation is at risk from known attacks see https : / / jenkins io / redirect / class - filter / " ) ; } else if ( suppress whitelist ) { logger warning ( " jep - 200 class filtering by whitelist suppressed your jenkins installation may be at risk see https : / / jenkins io / redirect / class - filter / " ) ; } }


saves the configuration info to the disk

public synchronized void save ( ) { if ( are stats disabled ( ) ) { return ; } if ( bulk change contains ( this ) ) return ; / * * note : the user folder should never be null at this point * the user folder could be null during user creation with the new storage approach * but when this code is called , from token used / removed , the folder exists * / file user folder = get user folder ( ) ; if ( user folder = = null ) { return ; } xml file config file = get config file ( user folder ) ; try { config file write ( this ) ; saveable listener fire on change ( this , config file ) ; } catch ( i o exception e ) { logger log ( level warning , " failed to save " + config file , e ) ; } }


public string get prefix ns string ( ) { return prefix ns string ; }


log the throwable , which occurs in dubbo rpc service

private void deal exception ( throwable throwable ) { abstract span span = context manager active span ( ) ; span log ( throwable ) ; }


helper method to set access token for the first o auth 2 authentication

public void set access token ( string access token ) { for ( authentication auth : authentications values ( ) ) { if ( auth instanceof o auth ) { ( ( o auth ) auth ) set access token ( access token ) ; return ; } } throw new runtime exception ( " no o auth 2 authentication configured ! " ) ; }


tests decommission for non federated cluster

public void test decommission ( ) throws i o exception { test decommission ( 1 , 6 ) ; }


stores the hash table mask as the number of bits needed to represent an index

private void set hash table mask ( int mask ) { int hash table bits = integer size - integer number of leading zeros ( mask ) ; metadata = compact hashing mask combine ( metadata , hash table bits , compact hashing hash table bits mask ) ; }


returns an immutable multimap containing a single entry

public static < k , v > immutable set multimap < k , v > of ( k k 1 , v v 1 ) { immutable set multimap builder < k , v > builder = immutable set multimap builder ( ) ; builder put ( k 1 , v 1 ) ; return builder build ( ) ; }


this is a hack for filter scripts , which must return booleans instead of doubles as expression do see https : github comelasticelasticsearchissues 2 6 4 2 9

private static filter script leaf factory new filter script ( expression expr , search lookup lookup , @ nullable map < string , object > vars ) { score script leaf factory search leaf factory = new score script ( expr , lookup , vars ) ; return ctx - > { score script script = search leaf factory new instance ( ctx ) ; return new filter script ( vars , lookup , ctx ) { @ override public boolean execute ( ) { return script execute ( null ) ! = 0 0 ; } @ override public void set document ( int docid ) { script set document ( docid ) ; } } ; } ; }


uri builder replace path ( @ nullable string path ) ;


opens a new { @ link writer } for writing to this sink this method returns a new , independent writer each time it is called the caller is responsible for ensuring that the returned writer is closed

public abstract writer open stream ( ) throws i o exception ;


formats an { @ code int } as a 3 - byte unsigned hex value

public static string u 3 ( int v ) { char [ ] result = new char [ 6 ] ; for ( int i = 0 ; i < 6 ; i + + ) { result [ 5 - i ] = character for digit ( v & 0x 0f , 16 ) ; v > > = 4 ; } return new string ( result ) ; }


set the { @ link invocable handler method } to use to invoke the method processing an incoming { @ link javax jms message }

public void set handler method ( invocable handler method handler method ) { this handler method = handler method ; }


convert an array of this chunks to an array of byte array note the chunk buffers are not affected

protected byte [ ] [ ] to arrays ( e c chunk [ ] chunks ) { byte [ ] [ ] bytes arr = new byte [ chunks length ] [ ] ; for ( int i = 0 ; i < chunks length ; i + + ) { if ( chunks [ i ] ! = null ) { bytes arr [ i ] = chunks [ i ] to bytes array ( ) ; } } return bytes arr ; }


specify the advisor adapter registry to use default is the global advisor adapter registry

public void set advisor adapter registry ( advisor adapter registry advisor adapter registry ) { this advisor adapter registry = advisor adapter registry ; }


public void update binary stream ( int column index , input stream x ) throws s q l exception { }


a wrapper around { @ code private static final dalvik system dex path list # make path elements }

private static object [ ] make path elements ( object dex path list , array list < file > files , file optimized directory , array list < i o exception > suppressed exceptions ) throws illegal access exception , invocation target exception , no such method exception { method make path elements ; try { make path elements = share reflect util find method ( dex path list , " make path elements " , list class , file class , list class ) ; } catch ( no such method exception e ) { share tinker log e ( tag , " no such method exception : make path elements ( list , file , list ) failure " ) ; try { make path elements = share reflect util find method ( dex path list , " make path elements " , array list class , file class , array list class ) ; } catch ( no such method exception e 1 ) { share tinker log e ( tag , " no such method exception : make dex elements ( array list , file , array list ) failure " ) ; try { share tinker log e ( tag , " no such method exception : try use v 1 9 instead " ) ; return v19 make dex elements ( dex path list , files , optimized directory , suppressed exceptions ) ; } catch ( no such method exception e 2 ) { share tinker log e ( tag , " no such method exception : make dex elements ( list , file , list ) failure " ) ; throw e 2 ; } } } return ( object [ ] ) make path elements invoke ( dex path list , files , optimized directory , suppressed exceptions ) ; }


public static string string empty and then execute ( string source , callable < string > callable ) { if ( string utils is empty ( source ) ) { try { return callable call ( ) ; } catch ( exception e ) { log utils naming logger error ( " string empty and then execute cause an exception " , e ) ; } } return source trim ( ) ; }


， " bread " & " butter " & quot ; bread & quot ; & amp ; & quot ; butter & quot ;

public static string escape html ( string html ) { return string escape utils escape html 4 ( html ) ; }


parses a page composition segment , as defined by etsi en 300 743 7 2 2

private static page composition parse page composition ( parsable bit array data , int length ) { int timeout secs = data read bits ( 8 ) ; int version = data read bits ( 4 ) ; int state = data read bits ( 2 ) ; data skip bits ( 2 ) ; int remaining length = length - 2 ; sparse array < page region > regions = new sparse array < > ( ) ; while ( remaining length > 0 ) { int region id = data read bits ( 8 ) ; data skip bits ( 8 ) ; / / skip reserved int region horizontal address = data read bits ( 16 ) ; int region vertical address = data read bits ( 16 ) ; remaining length - = 6 ; regions put ( region id , new page region ( region horizontal address , region vertical address ) ) ; } return new page composition ( timeout secs , version , state , regions ) ; }


deletes the entry associated with the given key

v remove entry ( object key ) throws eval exception { starlark check mutable ( this ) ; return contents remove ( key ) ; }


get the minimum cardinality of the constraint

public int get min cardinality ( ) { return min cardinality ; }


call this to transfer the { @ link com facebook litho annotations state } annotated values between two { @ link section } with the same global scope

protected void transfer state ( @ nullable state container previous state container , @ nullable state container next state container ) { }


returns the dns names associated with the record type and information

public name [ ] get names ( ) { return names ; }


public void test replace datanode on failure ( ) throws exception { final configuration conf = new hdfs configuration ( ) ; / / do not consider load factor when selecting a data node conf set boolean ( d f s config keys dfs namenode redundancy considerload key , false ) ; / / always replace a datanode replace datanode on failure write ( policy always , true , conf ) ; final string [ ] racks = new string [ replication ] ; arrays fill ( racks , rack0 ) ; final mini d f s cluster cluster = new mini d f s cluster builder ( conf ) racks ( racks ) num data nodes ( replication ) build ( ) ; try { cluster wait active ( ) ; final distributed file system fs = cluster get file system ( ) ; final path dir = new path ( dir ) ; final int num writers = 10 ; final int first batch = 5 ; final slow writer [ ] slowwriters = new slow writer [ num writers ] ; for ( int i = 1 ; i < = slowwriters length ; i + + ) { / / create slow writers in different speed slowwriters [ i - 1 ] = new slow writer ( fs , new path ( dir , " file " + i ) , i * 200l ) ; } for ( int i = 0 ; i < first batch ; i + + ) { slowwriters [ i ] start ( ) ; } / / let slow writers write something / / some of them are too slow and will be not yet started sleep seconds ( 3 ) ; / / start new datanodes cluster start data nodes ( conf , 2 , true , null , new string [ ] { rack1 , rack1 } ) ; cluster wait active ( ) ; / / wait for first block reports for up to 10 seconds cluster wait first b r completed ( 0 , 10000 ) ; / / stop an old datanode mini d f s cluster data node properties dnprop = cluster stop data node ( append test util next int ( replication ) ) ; for ( int i = first batch ; i < slowwriters length ; i + + ) { slowwriters [ i ] start ( ) ; } wait for block replication ( slowwriters ) ; / / check replication and interrupt for ( slow writer s : slowwriters ) { s check replication ( ) ; s interrupt running ( ) ; } / / close files for ( slow writer s : slowwriters ) { s join and close ( ) ; } / / verify the file log info ( " verify the file " ) ; for ( int i = 0 ; i < slowwriters length ; i + + ) { log info ( slowwriters [ i ] filepath + " : length = " + fs get file status ( slowwriters [ i ] filepath ) get len ( ) ) ; f s data input stream in = null ; try { in = fs open ( slowwriters [ i ] filepath ) ; for ( int j = 0 , x ; ( x = in read ( ) ) ! = - 1 ; j + + ) { assert assert equals ( j , x ) ; } } finally { i o utils close stream ( in ) ; } } } finally { if ( cluster ! = null ) { cluster shutdown ( ) ; } } }


replaces active queue with the newly requested one and transfers all calls to the new q before returning

public synchronized void swap queue ( class < ? extends rpc scheduler > scheduler class , class < ? extends blocking queue < e > > queue class to use , int max size , string ns , configuration conf ) { int priority levels = parse num levels ( ns , conf ) ; this scheduler stop ( ) ; rpc scheduler new scheduler = create scheduler ( scheduler class , priority levels , ns , conf ) ; int [ ] capacity weights = parse capacity weights ( priority levels , ns , conf ) ; blocking queue < e > new q = create call queue instance ( queue class to use , priority levels , max size , ns , capacity weights , conf ) ; / / our current queue becomes the old queue blocking queue < e > old q = put ref get ( ) ; / / swap put ref first : allow blocked puts ( ) to be unblocked put ref set ( new q ) ; / / wait for handlers to drain the old q while ( ! queue is really empty ( old q ) ) { } / / swap take ref to handle new calls take ref set ( new q ) ; this scheduler = new scheduler ; log info ( " old queue : " + string repr ( old q ) + " , " + " replacement : " + string repr ( new q ) ) ; }


specify the uri for the request using a uri template and uri variables if a { @ link uri builder factory } was configured for the client ( e g with a base uri ) it will be used to expand the uri template

s uri ( string uri , object uri variables ) ;


show the given tooltip on the component with the given anchor key

public static void show tooltip ( component context c , litho tooltip litho tooltip , @ nullable string anchor key , int x offset , int y offset ) { final component tree component tree = c get component tree ( ) ; final component root component = c get component scope ( ) ; if ( component tree = = null | | component tree is released ( ) | | ! component tree has mounted ( ) ) { return ; } final string anchor global key ; if ( root component = = null & & anchor key = = null ) { return ; } else if ( root component = = null ) { anchor global key = anchor key ; } else if ( anchor key = = null ) { anchor global key = component get global key ( c , root component ) ; } else { anchor global key = component key utils get key with separator ( component get global key ( c , root component ) , anchor key ) ; } component tree show tooltip ( litho tooltip , anchor global key , x offset , y offset ) ; }


reverses the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive this is equivalent to { @ code collections reverse ( floats as list ( array ) sub list ( from index , to index ) ) } , but is likely to be more efficient

public static void reverse ( float [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; for ( int i = from index , j = to index - 1 ; i < j ; i + + , j - - ) { float tmp = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = tmp ; } }


returns a formatter for a two digit hour of day , two digit minute of hour , two digit second of minute , three digit fraction of second , and time zone offset prefixed by ' t ' ( ' t ' hh : mm : ss ssszz ) the time zone offset is ' z ' for zero , and of the form ' ± hh : mm ' for non - zero the parser is strict by default , thus time string { @ code 24 : 00 } cannot be parsed the returned formatter prints and parses only this format , which includes milliseconds see { @ link # time parser ( ) } for a more flexible parser that accepts different formats

public static date time formatter t time ( ) { return constants tt ; }


retrieve the given message source resolvable ( e g an object error instance )

public string get message ( message source resolvable resolvable , boolean html escape ) throws no such message exception { string msg = this message source get message ( resolvable , this locale ) ; return ( html escape ? html utils html escape ( msg ) : msg ) ; }


netty tsi handshaker just converts { @ link byte buffer } to { @ link byte buf } , so check that the other methods are otherwise the same

public void handshaker methods match ( ) { list < string > expected methods = new array list < > ( ) ; for ( method m : tsi handshaker class get declared methods ( ) ) { expected methods add ( m get name ( ) ) ; } list < string > actual methods = new array list < > ( ) ; for ( method m : netty tsi handshaker class get declared methods ( ) ) { actual methods add ( m get name ( ) ) ; } assert that ( actual methods ) contains at least elements in ( expected methods ) ; }


calculates the delay left based on current time ( in nanoseconds ) and the delay defined by the index settings only relevant if shard is effectively delayed ( see { @ link # is delayed ( ) } ) returns 0 if delay is negative

public long get remaining delay ( final long nano time now , final settings index settings ) { long delay timeout nanos = index delayed node left timeout setting get ( index settings ) nanos ( ) ; assert nano time now > = unassigned time nanos ; return math max ( 0l , delay timeout nanos - ( nano time now - unassigned time nanos ) ) ; }


public static string to string ( reader reader ) throws i o exception { char array writer sw = new char array writer ( ) ; copy ( reader , sw ) ; return sw to string ( ) ; }


public model api response upload file with required file ( long pet id , file required file , string additional metadata ) throws api exception { return upload file with required file with http info ( pet id , required file , additional metadata ) get data ( ) ; }


blocks until the task is complete or the timeout expires throws a { @ link timeout exception } if the timer expires , otherwise behaves like { @ link # get ( ) }

v get ( long nanos ) throws timeout exception , cancellation exception , execution exception , interrupted exception { / / attempt to acquire the shared lock with a timeout if ( ! try acquire shared nanos ( - 1 , nanos ) ) { throw new timeout exception ( " timeout waiting for task " ) ; } return get value ( ) ; }


allows the attachment to decide of it should be of disposition type attachment or inline , which is important for being able to display inside of desktop email clients


get the fixed - delay tasks as an unmodifiable list of { @ link interval task } objects

public list < interval task > get fixed delay task list ( ) { return ( this fixed delay tasks ! = null ? collections unmodifiable list ( this fixed delay tasks ) : collections empty list ( ) ) ; }


get the repository server adapter associated with a url which specifies a repository or repository server

public repository server adapter get repository server adapter ( ) { return repository server adapter ; }


returns a list of launch launches to be retained

public set < string > get retain launches ( ) { return retain launches ; }


removes the ( local ) variables and creates a new { @ link historic variable update } for each of them


same as { @ link application # on terminate ( ) }


returns a { @ code file } object for the given path parts

private static file file ( file first , string more ) { / / not very efficient , but should definitely be correct file file = first ; for ( string name : more ) { file = new file ( file , name ) ; } return file ; }


inserts the given element in the given array the array is extended if necessary

public static short [ ] insert ( short [ ] array , int size , int index , short element ) { array = extend array ( array , size + 1 ) ; / / move the last part system arraycopy ( array , index , array , index + 1 , size - index ) ; array [ index ] = element ; return array ; }


create a proxy for an interface of implementations of that interface using the given { @ link failover proxy provider } and the a set of retry policies specified by method name if no retry policy is defined for a method then a default of { @ link retry policies # try once then fail } is used

public static < t > object create ( class < t > iface , failover proxy provider < t > proxy provider , map < string , retry policy > method name to policy map , retry policy default policy ) { return proxy new proxy instance ( proxy provider get interface ( ) get class loader ( ) , new class < ? > [ ] { iface } , new retry invocation handler < t > ( proxy provider , default policy , method name to policy map ) ) ; }


adds an enum value proto annotation that , when set , overrides the default < b > enum < b > value serializationdeserialization of this adapter for example , if you add the ' { @ code serialized value } ' annotation and you define an enum in your proto like the one below : enum my enum { unknown = 0 ; client app id = 1 [ ( serialized value ) = " app id " ] ; two = 2 [ ( serialized value ) = " 2 " ] ; } the adapter will serialize the value { @ code client app id } as " { @ code app id } " and the value { @ code two } as " { @ code 2 } " this works for both serialization and deserialization note that you need to set the enum serialization of this adapter to { @ link enum serialization # name } , otherwise these annotations will be ignored

public builder add serialized enum value extension ( extension < enum value options , string > serialized enum value extension ) { serialized enum value extensions add ( check not null ( serialized enum value extension ) ) ; return this ; }


public synchronized void stop ( ) { if ( ! monitor active ) { return ; } monitor active = false ; reset accounting ( milli second from nano ( ) ) ; traffic shaping handler do accounting ( this ) ; if ( scheduled future ! = null ) { scheduled future cancel ( true ) ; } }


returns a list of nodes that returned stats

public list < node > get nodes ( ) { return nodes ; }


creates cluster state with several indexes , shards and replicas and all shards started

public static cluster state state with assigned primaries and replicas ( string [ ] indices , int number of shards , int number of replicas ) { int number of data nodes = number of replicas + 1 ; discovery nodes builder disco builder = discovery nodes builder ( ) ; for ( int i = 0 ; i < number of data nodes + 1 ; i + + ) { final discovery node node = new node ( i ) ; disco builder = disco builder add ( node ) ; } disco builder local node id ( new node ( 0 ) get id ( ) ) ; disco builder master node id ( new node ( number of data nodes + 1 ) get id ( ) ) ; cluster state builder state = cluster state builder ( new cluster name ( " test " ) ) ; state nodes ( disco builder ) ; builder routing table builder = routing table builder ( ) ; metadata builder metadata builder = metadata builder ( ) ; for ( string index : indices ) { index metadata index metadata = index metadata builder ( index ) settings ( settings builder ( ) put ( setting version created , version current ) put ( setting number of shards , number of shards ) put ( setting number of replicas , number of replicas ) put ( setting creation date , system current time millis ( ) ) ) timestamp range ( index long field range unknown ) build ( ) ; metadata builder put ( index metadata , false ) generate cluster uuid if needed ( ) ; index routing table builder index routing table builder = index routing table builder ( index metadata get index ( ) ) ; for ( int i = 0 ; i < number of shards ; i + + ) { final shard id shard id = new shard id ( index , " na " , i ) ; index shard routing table builder index shard routing builder = new index shard routing table builder ( shard id ) ; index shard routing builder add shard ( test shard routing new shard routing ( index , i , new node ( 0 ) get id ( ) , null , true , shard routing state started ) ) ; for ( int replica = 0 ; replica < number of replicas ; replica + + ) { index shard routing builder add shard ( test shard routing new shard routing ( index , i , new node ( replica + 1 ) get id ( ) , null , false , shard routing state started ) ) ; } index routing table builder add index shard ( index shard routing builder build ( ) ) ; } routing table builder add ( index routing table builder build ( ) ) ; } state metadata ( metadata builder ) ; state routing table ( routing table builder build ( ) ) ; return state build ( ) ; }


public static authentication builder new instance ( ) { return new default authentication builder ( ) ; }


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


public static void set ( transaction manager mock ) { singleton holder instance = mock ; }


test the case where the futures are fulfilled prior to constructing the list future there was a bug where the loop that connects a listener to each of the futures would die on the last loop - check as done ( ) on list future nulled out the variable being looped over ( the list of futures )

public void test all as list done futures ( ) throws exception { / / create input and output settable future < string > future 1 = settable future create ( ) ; settable future < string > future 2 = settable future create ( ) ; settable future < string > future 3 = settable future create ( ) ; / / satisfy each input prior to creating compound and check the output future 1 set ( data1 ) ; future 2 set ( data2 ) ; future 3 set ( data3 ) ; @ suppress warnings ( " unchecked " ) / / array is never modified listenable future < list < string > > compound = all as list ( future 1 , future 2 , future 3 ) ; / / attach a listener single call listener listener = new single call listener ( ) ; listener expect call ( ) ; compound add listener ( listener , direct executor ( ) ) ; assert true ( listener was called ( ) ) ; list < string > results = get done ( compound ) ; assert that ( results ) contains exactly ( data1 , data2 , data3 ) in order ( ) ; }


tests that with { @ link high availability mode # zookeeper } distributed j a rs are recoverable from any participating blob server

public void test blob cache recovery ( ) throws exception { configuration config = new configuration ( ) ; config set string ( high availability options ha mode , " zookeeper " ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; config set string ( high availability options ha storage path , temporary folder new folder ( ) get path ( ) ) ; blob store service blob store service = null ; try { blob store service = blob utils create blob store from config ( config ) ; test blob cache recovery ( config , blob store service ) ; } finally { if ( blob store service ! = null ) { blob store service close and cleanup all data ( ) ; } } }


starts two namenodes and two secondary namenodes , verifies that secondary namenodes are configured correctly to talk to their respective namenodes and can do the checkpoint

public void test multiple secondary namenodes ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; string nameservice id 1 = " ns 1 " ; string nameservice id 2 = " ns 2 " ; conf set ( d f s config keys dfs nameservices , nameservice id 1 + " , " + nameservice id 2 ) ; mini d f s cluster cluster = null ; secondary name node secondary 1 = null ; secondary name node secondary 2 = null ; try { cluster = new mini d f s cluster builder ( conf ) nn topology ( mini d f s n n topology simple federated topology ( conf get ( d f s config keys dfs nameservices ) ) ) build ( ) ; configuration sn conf 1 = new hdfs configuration ( cluster get configuration ( 0 ) ) ; configuration sn conf 2 = new hdfs configuration ( cluster get configuration ( 1 ) ) ; inet socket address nn 1 rpc address = cluster get name node ( 0 ) get name node address ( ) ; inet socket address nn 2 rpc address = cluster get name node ( 1 ) get name node address ( ) ; string nn 1 = nn 1 rpc address get host name ( ) + " : " + nn 1 rpc address get port ( ) ; string nn 2 = nn 2 rpc address get host name ( ) + " : " + nn 2 rpc address get port ( ) ; / / set the service rpc address to empty to make sure the node specific / / setting works sn conf 1 set ( d f s config keys dfs namenode service rpc address key , " " ) ; sn conf 2 set ( d f s config keys dfs namenode service rpc address key , " " ) ; / / set the nameservice ids sn conf 1 set ( d f s util add key suffixes ( d f s config keys dfs namenode service rpc address key , nameservice id 1 ) , nn 1 ) ; sn conf 2 set ( d f s util add key suffixes ( d f s config keys dfs namenode service rpc address key , nameservice id 2 ) , nn 2 ) ; secondary 1 = start secondary name node ( sn conf 1 ) ; secondary 2 = start secondary name node ( sn conf 2 ) ; / / make sure the two secondary namenodes are talking to correct namenodes assert equals ( secondary 1 get name node address ( ) get port ( ) , nn 1 rpc address get port ( ) ) ; assert equals ( secondary 2 get name node address ( ) get port ( ) , nn 2 rpc address get port ( ) ) ; assert true ( secondary 1 get name node address ( ) get port ( ) ! = secondary 2 get name node address ( ) get port ( ) ) ; / / both should checkpoint secondary 1 do checkpoint ( ) ; secondary 2 do checkpoint ( ) ; } finally { cleanup ( secondary 1 ) ; secondary 1 = null ; cleanup ( secondary 2 ) ; secondary 2 = null ; cleanup ( cluster ) ; cluster = null ; } }


returns whether the upstream source is ready this method may be called when the renderer is in the following states : { @ link # state enabled } , { @ link # state started }

protected final boolean is source ready ( ) { return has read stream to end ( ) ? stream is final : assertions check not null ( stream ) is ready ( ) ; }


test serialization of outer boolean types

public void fake outer boolean serialize ( boolean body , handler < async result < boolean > > result handler ) { fake outer boolean serialize ( body , null , result handler ) ; }


returns the { @ link media period id } in the composite source corresponding to the specified { @ link media period id } in a child source the default implementation does not change the media period id

protected media period id get media period id for child media period id ( @ unknown null t id , media period id media period id ) { return media period id ; }


returns the number of sessions proposed by clients and either found in the internal or external session cache in server mode , but that were invalid due to timeout these sessions are not included in the { @ link # hits ( ) } count

public long timeouts ( ) { lock reader lock = context ctx lock read lock ( ) ; reader lock lock ( ) ; try { return s s l context session timeouts ( context ctx ) ; } finally { reader lock unlock ( ) ; } }


formats an { @ code int } as a 2 - byte signed hex value

public static string s 2 ( int v ) { char [ ] result = new char [ 5 ] ; if ( v < 0 ) { result [ 0 ] = ' - ' ; v = - v ; } else { result [ 0 ] = ' + ' ; } for ( int i = 0 ; i < 4 ; i + + ) { result [ 4 - i ] = character for digit ( v & 0x 0f , 16 ) ; v > > = 4 ; } return new string ( result ) ; }


creates a { @ code priority blocking queue } containing the given elements < b > note : < b > if the specified iterable is a { @ code sorted set } or a { @ code priority queue } , this priority queue will be ordered according to the same ordering

public static < e extends comparable > priority blocking queue < e > new priority blocking queue ( iterable < ? extends e > elements ) { if ( elements instanceof collection ) { return new priority blocking queue < e > ( ( collection < ? extends e > ) elements ) ; } priority blocking queue < e > queue = new priority blocking queue < e > ( ) ; iterables add all ( queue , elements ) ; return queue ; } / / priority queue


return the key at < code > 0 & lt ; = index & lt ; = capacity ( ) < code > the result is undefined if the slot is unused

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


talks to the http interface to get the json output of a status command on the given file

private void get status ( string filename , string command , boolean expect o k ) throws exception { string user = hadoop users conf test helper get hadoop users ( ) [ 0 ] ; / / remove leading / from filename if ( filename char at ( 0 ) = = ' / ' ) { filename = filename substring ( 1 ) ; } string path ops = message format format ( " / webhdfs / v 1 / { 0 } ? user name = { 1 } & op = { 2 } " , filename , user , command ) ; url url = new url ( test jetty helper get jetty u r l ( ) , path ops ) ; http u r l connection conn = ( http u r l connection ) url open connection ( ) ; conn connect ( ) ; int resp = conn get response code ( ) ; buffered reader reader ; if ( expect o k ) { assert assert equals ( http u r l connection http ok , resp ) ; reader = new buffered reader ( new input stream reader ( conn get input stream ( ) ) ) ; string res = reader read line ( ) ; assert assert true ( ! res contains ( " acl bit " ) ) ; assert assert true ( res contains ( " owner " ) ) ; / / basic sanity check } else { assert assert equals ( http u r l connection http internal error , resp ) ; reader = new buffered reader ( new input stream reader ( conn get error stream ( ) ) ) ; string res = reader read line ( ) ; assert assert true ( res contains ( " acl exception " ) ) ; assert assert true ( res contains ( " support for a c ls has been disabled " ) ) ; } }


return the first global position in the entire set of items for a given adapter

private int get sub adapter first global position ( @ non null recycler view adapter adapter ) { int count = 0 ; for ( child adapter child adapter wrapper : adapters ) { recycler view adapter child adapter = child adapter wrapper adapter ; if ( child adapter = = adapter ) { return count ; } count + = child adapter get item count ( ) ; } throw new assertion error ( " adapter not found in list of adapters " ) ; }


append query properties to the redirect url stringifies , url - encodes and formats model attributes as query properties

protected void append query properties ( string builder target url , map < string , object > model , string encoding scheme ) throws unsupported encoding exception { / / extract anchor fragment , if any string fragment = null ; int anchor index = target url index of ( " # " ) ; if ( anchor index > - 1 ) { fragment = target url substring ( anchor index ) ; target url delete ( anchor index , target url length ( ) ) ; } / / if there aren ' t already some parameters , we need a " ? " boolean first = ( target url to string ( ) index of ( ' ? ' ) < 0 ) ; for ( map entry < string , object > entry : query properties ( model ) entry set ( ) ) { object raw value = entry get value ( ) ; collection < ? > values ; if ( raw value ! = null & & raw value get class ( ) is array ( ) ) { values = collection utils array to list ( raw value ) ; } else if ( raw value instanceof collection ) { values = ( ( collection < ? > ) raw value ) ; } else { values = collections singleton ( raw value ) ; } for ( object value : values ) { if ( first ) { target url append ( ' ? ' ) ; first = false ; } else { target url append ( ' & ' ) ; } string encoded key = url encode ( entry get key ( ) , encoding scheme ) ; string encoded value = ( value ! = null ? url encode ( value to string ( ) , encoding scheme ) : " " ) ; target url append ( encoded key ) append ( ' = ' ) append ( encoded value ) ; } } / / append anchor fragment , if any , to end of url if ( fragment ! = null ) { target url append ( fragment ) ; } }


set flag which indicates bitfield parsed from data is missing bit - offset which is indicative to old xml data

void set missing bit offset error ( ) { bitfield has missing bit offset = true ; }


public object get anytype 3 ( ) { return anytype 3 ; }


prints an error message & fails the compilation

public void error ( element e , string msg ) { messager print message ( diagnostic kind error , msg , e ) ; }


if a schema contains a reference to another schema with ' $ ref ' , returns the referenced schema if it is found or the actual schema in the other cases

public static schema get referenced schema ( open a p i open a p i , schema schema ) { if ( schema ! = null & & string utils is not empty ( schema get $ ref ( ) ) ) { string name = get simple ref ( schema get $ ref ( ) ) ; schema referenced schema = get schema ( open a p i , name ) ; if ( referenced schema ! = null ) { return referenced schema ; } } return schema ; }


any non - null < code > set < code > since mockito 2 1 0 , only allow non - null < code > set < code > as this is a nullable reference , the suggested api to match < code > null < code > wrapper would be { @ link # is null ( ) } we felt this change would make tests harness much safer that it was with mockito 1 x see examples in javadoc for { @ link argument matchers } class

public static < t > set < t > any set ( ) { report matcher ( new instance of ( set class , " < any set > " ) ) ; return new hash set < t > ( 0 ) ; }


process the incoming element to produce multiple { @ link action request actions requests } the produced requests should be added to the provided { @ link request indexer }

void process ( t element , runtime context ctx , request indexer indexer ) ;


the topic name this sink node is writing to could be { @ code null } if the topic name can only be dynamically determined based on { @ link topic name extractor }


return the number of thread - bound objects created


get all exported { @ link url # get service key ( ) service keys }

set < string > get all service keys ( ) ;


should file sizes be returned in human readable format rather than bytes ?

boolean is human readable ( ) { return this human readable ; }


throws an { @ link eval exception } if the given starlark name is not valid for this type

public void validate starlark name ( string attr starlark name ) throws eval exception { if ( attr starlark name is empty ( ) ) { throw new eval exception ( " attribute name must not be empty " ) ; } if ( must have starlark prefix & & ! attr starlark name starts with ( starlark prefix ) ) { throw starlark errorf ( " when an attribute value is a function , the attribute must be private " + " ( i e start with ' % s ' ) found ' % s ' " , starlark prefix , attr starlark name ) ; } }


public object get anytype 1 ( ) { return anytype 1 ; }


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

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


public void test get transaction id ( ) { assert that ( xid get transaction id ( null ) ) is equal to ( - 1 ) ; assert that ( xid get transaction id ( " 127 0 0 1 : 8080 : 8577662204289747564 " ) ) is equal to ( 8577662204289747564l ) ; }


see { @ link mutable configuration # set read through }

public void set read through ( boolean is read through ) { delegate set read through ( is read through ) ; }


trigger { @ code before completion } callbacks

private mono < void > trigger before completion ( transaction synchronization manager synchronization manager , generic reactive transaction status ) { if ( status is new synchronization ( ) ) { if ( status is debug ( ) ) { logger trace ( " triggering before completion synchronization " ) ; } return transaction synchronization utils trigger before completion ( synchronization manager get synchronizations ( ) ) ; } return mono empty ( ) ; }


evaluate the json path expression against the supplied { @ code content } and assert that the resulting value is a { @ link map }

public void assert value is map ( string content ) { object value = assert exists and return ( content ) ; matcher assert assert that ( failure reason ( " a map " , value ) , value , core matchers instance of ( map class ) ) ; }


sets the test to initialise the { @ link storage component } before each test rather than the test class generally , tests will run faster if the storage is initialized as infrequently as possibly while clearing data between runs , but for certain backends like cassandra , it ' s difficult to reliably clear data between runs and tends to be very slow anyways

protected boolean initialize storage per test ( ) { return false ; }


file [ ] list all task directories ( ) { final file [ ] task directories ; if ( ! has persistent stores | | ! state dir exists ( ) ) { task directories = new file [ 0 ] ; } else { task directories = state dir list files ( pathname - > pathname is directory ( ) & & path name matcher ( pathname get name ( ) ) matches ( ) ) ; } return task directories = = null ? new file [ 0 ] : task directories ; }


always decompiles the function containing the given location before positioning the decompiler panel ' s cursor to the closest equivalent position

public void refresh display ( program program , program location location , file debug file ) { clear cache ( ) ; decompiler mgr decompile ( program , location , null , debug file , true ) ; }


utility method : assert that the { @ link # collector ( ) } has received a debug message with the { @ code expected message }

public event assert contains debug ( string expected message ) { return more asserts assert contains event ( event collector , expected message , event kind debug ) ; }


get the formatted string for the block length ; shown in decimal and hex in parens

string get length string ( ) { long length = block get size ( ) ; return length + " ( 0x " + long to hex string ( length ) + " ) " ; }


gets the charset in which the log file is written

public final @ non null charset get charset ( ) { if ( charset = = null ) return charset default charset ( ) ; return charset for name ( charset ) ; }


tests the basic ui behavior of the node monitoring

public void configuration ( ) throws exception { web client client = j create web client ( ) ; html form form = client go to ( " computer / configure " ) get form by name ( " config " ) ; j submit ( form ) ; }


public string [ ] get menu path ( ) { return menu path ; }


update the peer state based on the given proposed leader also update the leading vote set if it becomes the leader

private void set peer state ( long proposed leader , synced learner tracker vote set ) { server state ss = ( proposed leader = = self get id ( ) ) ? server state leading : learning state ( ) ; self set peer state ( ss ) ; if ( ss = = server state leading ) { leading vote set = vote set ; } }


returns { @ code true } if this set contains no elements


manipulate the " live " list of currently configured filters

public web http handler builder filters ( consumer < list < web filter > > consumer ) { consumer accept ( this filters ) ; update filters ( ) ; return this ; }


public string get status ( ) { return status ; }


tests that with { @ link high availability mode # zookeeper } distributed j a rs are recoverable from any participating blob server when talking to the { @ link org apache flink runtime blob blob server } directly

public void test blob server recovery ( ) throws exception { org apache flink configuration configuration config = new org apache flink configuration configuration ( ) ; config set string ( high availability options ha mode , " zookeeper " ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; config set string ( high availability options ha storage path , hdfs u r i ) ; blob store service blob store service = blob utils create blob store from config ( config ) ; try { blob server recovery test test blob server recovery ( config , blob store service ) ; } finally { blob store service close and cleanup all data ( ) ; } }


public float get angle ( ) { return body get angle ( ) ; }


model tests for additional properties array

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


public static boolean finish to activity ( @ non null final class < ? extends activity > clz , final boolean is include self , @ anim res final int enter anim , @ anim res final int exit anim ) { list < activity > activities = utils bridge get activity list ( ) ; for ( activity act : activities ) { if ( act get class ( ) equals ( clz ) ) { if ( is include self ) { finish activity ( act , enter anim , exit anim ) ; } return true ; } finish activity ( act , enter anim , exit anim ) ; } return false ; }


set the last incoming edge of v to be e it is assumed that v has already been added to the graph

void set last incoming edge ( vertex v , edge e ) { try { last incoming edge [ index ( v ) ] = e ; } catch ( array index out of bounds exception exc ) { msg error ( this , " no value exception in set last incoming edge ( ) " + " \ t vertex : " + v to string ( ) + " \ t edge : " + e to string ( ) , exc ) ; } }


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

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


test serialization of outer number types

public completable future < big decimal > fake outer number serialize ( big decimal body ) throws api exception { try { http request builder local var request builder = fake outer number serialize request builder ( body ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " fake outer number serialize " , local var response ) ) ; } try { return completable future completed future ( member var object mapper read value ( local var response body ( ) , new type reference < big decimal > ( ) { } ) ) ; } catch ( i o exception e ) { return completable future failed future ( new api exception ( e ) ) ; } } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


public map < string , list < string > > get response headers ( ) { return response headers ; }


returns the empty immutable set preferred over { @ link collections # empty set } for code consistency , and because the return type conveys the immutability guarantee

public static < e > immutable set < e > of ( ) { return ( immutable set < e > ) regular immutable set empty ; }


returns true if < code > o < code > is an enum set writable with the same value , or both are null

public boolean equals ( object o ) { if ( o = = null ) { throw new illegal argument exception ( " null argument passed in equal ( ) " ) ; } if ( ! ( o instanceof enum set writable ) ) return false ; enum set writable < ? > other = ( enum set writable < ? > ) o ; if ( this = = o | | ( this value = = other value ) ) return true ; if ( this value = = null ) / / other value must not be null if we reach here return false ; return this value equals ( other value ) ; }


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


completable future < cluster overview > request cluster overview ( @ rpc timeout time timeout ) ;


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


set the < code > container id < code > of the container

public abstract void set container id ( container id container id ) ;


public indices aliases request builder add alias ( string indices [ ] , string alias , string filter ) { request add alias action ( alias actions add ( ) indices ( indices ) alias ( alias ) filter ( filter ) ) ; return this ; }


public void add tenant ( string tenant name ) { tenant calls count put if absent ( tenant name , new atomic long ( 0 ) ) ; }


public string get index ( ) { if ( failure ! = null ) { return failure get index ( ) ; } return response get index ( ) ; }


returns a fixed - size list backed by the specified array , similar to { @ link arrays # as list ( object [ ] ) } the list supports { @ link list # set ( int , object ) } , but any attempt to set a value to { @ code null } will result in a { @ link null pointer exception } the returned list maintains the values , but not the identities , of { @ code integer } objects written to or read from it for example , whether { @ code list get ( 0 ) = = list get ( 0 ) } is true for the returned list is unspecified < b > note : < b > when possible , you should represent your data as an { @ link immutable int array } instead , which has an { @ link immutable int array # as list as list } view

public static list < integer > as list ( int backing array ) { if ( backing array length = = 0 ) { return collections empty list ( ) ; } return new int array as list ( backing array ) ; }


public void add role ( string role , string user name ) { string sql = " insert into roles ( role , username ) values ( ? , ? ) " ; try { jt update ( sql , role , user name ) ; } catch ( cannot get jdbc connection exception e ) { log util fatal log error ( " [ db - error ] " + e to string ( ) , e ) ; throw e ; } }


returns the maximum sequence number of operations in this checkpoint after applying { @ link # trimmed above seq no }

long max effective seq no ( ) { if ( trimmed above seq no = = sequence numbers unassigned seq no ) { return max seq no ; } else { return math min ( trimmed above seq no , max seq no ) ; } }


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


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


sets the indentation string to be repeated for each level of indentation in the encoded document if { @ code indent is empty ( ) } the encoded document will be compact otherwise the encoded document will be more human - readable

public void set indent ( string indent ) { this indent = ! indent is empty ( ) ? indent : null ; }


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


return the persistent instance of the given entity class with the given identifier , or { @ code null } if not found obtains the specified lock mode if the instance exists this method is a thin wrapper around { @ link org hibernate session # get ( string , serializable , lock mode ) } for convenience for an explanation of the exact semantics of this method , please do refer to the hibernate api documentation in the first instance

object get ( string entity name , serializable id , lock mode lock mode ) throws data access exception ;


public sort mode sort mode ( ) { return this sort mode ; }


get a boolean parameter , with a fallback value never throws an exception can pass a distinguished value as default to enable checks of whether it was supplied accepts " true " , " on " , " yes " ( any case ) and " 1 " as values for true ; treats every other non - empty value as false ( i e parses leniently )

public static boolean get boolean parameter ( servlet request request , string name , boolean default val ) { if ( request get parameter ( name ) = = null ) { return default val ; } try { return get required boolean parameter ( request , name ) ; } catch ( servlet request binding exception ex ) { return default val ; } }


change the auto - pass property for all functions with given full hash

public void set auto pass by full hash ( long hash , boolean value ) throws i o exception { check update allowed ( ) ; list < function record > func list = find functions by full hash ( hash ) ; modify flags ( func list , function record auto pass flag , value ) ; }


configure the maximum allowable frame payload length setting this value to your application ' s requirement may reduce denial of service attacks using long data frames corresponds to the argument with the same name in the constructor of { @ link io netty handler codec http websocketx web socket server handshaker factory web socket server handshaker factory } in netty by default set to 65536 ( 64k )

public void set max frame payload length ( integer max frame payload length ) { this max frame payload length = max frame payload length ; }


public void test big cat ( ) { / / todo : test big cat }


returns a valid lower - hex trace id , padded left as needed to 16 or 32 characters

public static string normalize trace id ( string trace id ) { if ( trace id = = null ) throw new null pointer exception ( " trace id = = null " ) ; int length = trace id length ( ) ; if ( length = = 0 ) throw new illegal argument exception ( " trace id is empty " ) ; if ( length > 32 ) throw new illegal argument exception ( " trace id length > 32 " ) ; int zeros = validate hex and return zero prefix ( trace id ) ; if ( zeros = = length ) throw new illegal argument exception ( " trace id is all zeros " ) ; if ( length = = 15 ) throw new runtime exception ( " wtf " ) ; if ( length = = 32 | | length = = 16 ) { if ( length = = 32 & & zeros > = 16 ) return trace id substring ( 16 ) ; return trace id ; } else if ( length < 16 ) { return pad left ( trace id , 16 ) ; } else { return pad left ( trace id , 32 ) ; } }


headers to be added to the { @ link script exception } for structured rendering

public map < string , list < string > > get headers ( painless lookup painless lookup ) { map < string , list < string > > headers = new tree map < > ( ) ; string to string = " null " ; string java class name = null ; string painless class name = null ; if ( object to explain ! = null ) { to string = object to explain to string ( ) ; java class name = object to explain get class ( ) get name ( ) ; painless class struct = painless lookup lookup painless class ( object to explain get class ( ) ) ; if ( struct ! = null ) { painless class name = painless lookup utility type to canonical type name ( object to explain get class ( ) ) ; } } headers put ( " es to string " , singleton list ( to string ) ) ; if ( painless class name ! = null ) { headers put ( " es painless class " , singleton list ( painless class name ) ) ; } if ( java class name ! = null ) { headers put ( " es java class " , singleton list ( java class name ) ) ; } return headers ; }


public list < field > non primary keys ( ) { list < field > non pk fields = new array list < > ( ) ; for ( field field : fields ) { if ( key type primary key ! = field get key type ( ) ) { non pk fields add ( field ) ; } } return non pk fields ; }