set the id of the last scroll used for debugging

public final void set scroll ( string scroll id ) { this scroll id set ( scroll id ) ; }


close the connection , which includes ; send session disconnect to the server , shutdown the sendevent threads

public void close ( ) throws i o exception { log debug ( " closing client for session : 0x { } " , long to hex string ( get session id ( ) ) ) ; try { request header h = new request header ( ) ; h set type ( zoo defs op code close session ) ; submit request ( h , null , null , null ) ; } catch ( interrupted exception e ) { / / ignore , close the send / event threads } finally { disconnect ( ) ; } }


builder method for process instance id parameter

public builder with process instance id ( string process instance id ) { this process instance id = process instance id ; return this ; }


static string new block pool i d ( ) throws unknown host exception { string ip ; try { ip = dns get default i p ( " default " ) ; } catch ( unknown host exception e ) { log warn ( " could not find ip address of \ " default \ " inteface " ) ; throw e ; } int rand = d f s util get secure random ( ) next int ( integer max value ) ; return " bp - " + rand + " - " + ip + " - " + time now ( ) ; }


re - encrypts the given encryption zone path if the given path is not the root of an encryption zone , an exception is thrown

list < x attr > reencrypt encryption zone ( final i nodes in path zone i i p , final string key version name ) throws i o exception { assert dir has write lock ( ) ; if ( reencryption handler = = null ) { throw new i o exception ( " no key provider configured , re - encryption " + " operation is rejected " ) ; } final list < x attr > x attrs = lists new array list with capacity ( 1 ) ; final i node inode = zone i i p get last i node ( ) ; final string zone name = zone i i p get path ( ) ; check encryption zone root ( inode , zone name ) ; if ( get reencryption status ( ) has running zone ( inode get id ( ) ) ) { throw new i o exception ( " zone " + zone name + " is already submitted for re - encryption " ) ; } log info ( " zone { } ( { } ) is submitted for re - encryption " , zone name , inode get id ( ) ) ; final x attr xattr = f s dir encryption zone op update reencryption submitted ( dir , zone i i p , key version name ) ; x attrs add ( xattr ) ; reencryption handler notify new submission ( ) ; return x attrs ; }


creates a tree prop with the size information we need to do this every time we call set root and size spec on the new tree

private static tree props get tree prop with size ( component context c , int width spec , int height spec ) { tree props tp = c get tree props copy ( ) ; if ( tp = = null ) { tp = new tree props ( ) ; } tp put ( size class , new size ( width spec , height spec ) ) ; return tp ; }


deletes unused resources from value xml files

private void rewrite xml ( set < file > rewrite , map < file , string > rewritten , set < resource > deleted ) throws i o exception , parser configuration exception , s a x exception { / / delete value resources : must rewrite the xml files for ( file file : rewrite ) { string xml = files to string ( file , utf 8 ) ; document document = xml utils parse document ( xml , true ) ; element root = document get document element ( ) ; if ( root ! = null & & tag resources equals ( root get tag name ( ) ) ) { list < resource > removed = lists new array list ( ) ; strip unused ( root , removed ) ; deleted add all ( removed ) ; logger fine ( string format ( " removed % d unused resources from % s : \ n % s " , removed size ( ) , file , joiner on ( " , " ) join ( lists transform ( removed , new function < resource , string > ( ) { @ override public string apply ( resource resource ) { return resource get url ( ) ; } } ) ) ) ) ; string formatted = xml pretty printer pretty print ( document , xml ends with ( " \ n " ) ) ; rewritten put ( file , formatted ) ; } } }


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


public static < t > ordering < t > from ( ordering < t > ordering ) { return check not null ( ordering ) ; }


public void att n a m e test ( ) { / / todo : test att name }


when schemas are disabled , fields are mapped to connect maps

public void schemaless with empty field value to connect ( ) { / / this characterizes the messages with empty data when json schemas is disabled map < string , boolean > props = collections singleton map ( " schemas enable " , false ) ; converter configure ( props , true ) ; string input = " { \ " a \ " : \ " \ " , \ " b \ " : null } " ; schema and value converted = converter to connect data ( topic , input get bytes ( ) ) ; map < string , string > expected = new hash map < > ( ) ; expected put ( " a " , " " ) ; expected put ( " b " , null ) ; assert equals ( new schema and value ( null , expected ) , converted ) ; }


gets the value at the { @ code block } { @ code internal position - offset base } as a long without boundary checks

long get long unchecked ( unchecked block block , int internal position ) ;


get bundles for plugins installed in the given plugins directory

static set < bundle > get plugin bundles ( final path plugins directory ) throws i o exception { return find bundles ( plugins directory , " plugin " ) ; }


example for testing blocking server - streaming

public void list features error ( ) { final feature response feature 1 = feature new builder ( ) set name ( " feature 1 " ) build ( ) ; final atomic reference < rectangle > rectangle delivered = new atomic reference < rectangle > ( ) ; final status runtime exception fake error = new status runtime exception ( status invalid argument ) ; / / implement the fake service route guide impl base list features impl = new route guide impl base ( ) { @ override public void list features ( rectangle rectangle , stream observer < feature > response observer ) { rectangle delivered set ( rectangle ) ; / / send one response message response observer on next ( response feature 1 ) ; / / let the rpc fail response observer on error ( fake error ) ; } } ; service registry add service ( list features impl ) ; client list features ( 1 , 2 , 3 , 4 ) ; assert equals ( rectangle new builder ( ) set lo ( point new builder ( ) set latitude ( 1 ) set longitude ( 2 ) build ( ) ) set hi ( point new builder ( ) set latitude ( 3 ) set longitude ( 4 ) build ( ) ) build ( ) , rectangle delivered get ( ) ) ; argument captor < throwable > error captor = argument captor for class ( throwable class ) ; verify ( test helper ) on message ( response feature 1 ) ; verify ( test helper ) on rpc error ( error captor capture ( ) ) ; assert equals ( fake error get status ( ) , status from throwable ( error captor get value ( ) ) ) ; }


given an index , retrieve the specific segment it refers to this incorporates the special borland segments , where the index has the bit 0x 4 0 0 0 set

public omf segment header resolve segment ( int index ) throws omf exception { int subindex = - 1 ; omf segment header res ; if ( ( index & 0x 4 0 0 0 ) ! = 0 ) { subindex = index & 0x 3fff ; if ( ( subindex < = 0 ) | | ( subindex > extra seg size ( ) ) ) { throw new omf exception ( " bad extra segment index " ) ; } res = extra seg get ( subindex - 1 ) ; return res ; } if ( ( index < = 0 ) | | ( index > segments size ( ) ) ) { throw new omf exception ( " bad segment index " ) ; } res = segments get ( index - 1 ) ; return res ; }


shifts full lines of text and fills the new empty space with text

public void shift lines ( string text , boolean forward ) { if ( text length ( ) = = 0 ) return ; int lines in text = ( text length ( ) - 1 ) / number of columns + 1 ; int current limit = math min ( data length ( ) , lines times columns ) ; text changing event event = new text changing event ( this ) ; event start = forward ? 0 : current limit ; event new text = text ; event replace char count = 0 ; event new char count = text length ( ) ; event replace line count = 0 ; event new line count = lines in text ; for ( text change listener my text listener : text listeners ) my text listener text changing ( event ) ; data insert ( event start , text ) ; text changed event changed event = new text changed event ( this ) ; for ( text change listener my text listener : text listeners ) my text listener text changed ( changed event ) ; event = new text changing event ( this ) ; / / event start = forward ? lines times columns : 0 ; event start = forward ? lines times columns - 1 : 0 ; event new text = " " ; event replace char count = lines in text * number of columns - lines times columns + current limit ; event new char count = 0 ; event replace line count = lines in text ; event new line count = 0 ; for ( text change listener my text listener : text listeners ) my text listener text changing ( event ) ; / / data delete ( event start , event start + event replace char count ) ; if ( forward ) data delete ( lines times columns , lines times columns + event replace char count ) ; else data delete ( 0 , event replace char count ) ; changed event = new text changed event ( this ) ; for ( text change listener my text listener : text listeners ) my text listener text changed ( changed event ) ; }


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


adds all resources in the specified skin json file

public void load ( file handle skin file ) { try { get json loader ( skin file ) from json ( skin class , skin file ) ; } catch ( serialization exception ex ) { throw new serialization exception ( " error reading file : " + skin file , ex ) ; } }


returns the name of the discriminator property for this schema in the open a p i document in the open a p i document , the discriminator may be specified in the local schema or it may be inherited , such as through a ' all of ' schema which references another schema that has a discriminator , recursively

public string get discriminator name ( ) { return discriminator = = null ? null : discriminator get property name ( ) ; }


verify that delayed s3 listings doesn ' t stop the fs from deleting a directory tree this has not always been the case ; this test verifies the fix and prevents regression

public void test delete uses s 3 guard ( ) throws throwable { describe ( " verify that delete ( ) uses s 3 guard to get a consistent " + " listing of its directory structure " ) ; assume v 2 list a p i ( ) ; s 3 a file system fs = get file system ( ) ; path root = path ( " test delete uses s 3 guard - " + default delay key substring ) ; for ( int i = 0 ; i < 3 ; i + + ) { path path = new path ( root , " file - " + i ) ; touch ( fs , path ) ; } / / we now expect the listing to miss these string key = fs path to key ( root ) + " / " ; / / verify that the inconsistent listing does not show these log info ( " listing objects before executing delete ( ) " ) ; list < path > pre delete paths = objects to paths ( list objects v 2 ( fs , key , null ) ) ; assertions assert that ( pre delete paths ) is empty ( ) ; / / do the delete fs delete ( root , true ) ; / / now go through every file and verify that it is not there / / if you comment out the delete above and run this test case , / / the assertion will fail ; this is how the validity of the assertions / / were verified clear inconsistency ( fs ) ; list < path > post delete paths = objects to paths ( list objects v 2 ( fs , key , null ) ) ; assertions assert that ( post delete paths ) is empty ( ) ; }


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


clears the defined component at the given component index clearing a component causes a defined component to be replaced with a number of undefined data types to offset the removal of the defined data type

public void clear component ( int index ) throws array index out of bounds exception ;


sends the event to the specified channel on the specified input gate

public void process event ( abstract event event , int input gate , int channel ) { input gates [ input gate ] send event ( event , channel ) ; }


here we override the super method to avoid test error from ` describe statement ` supported in original calcite

public void test describe statement ( ) { }


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


test the property ' map of enum string '

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


returns { @ code true } if this window intersects the given window

public boolean intersects ( time window other ) { return this start < = other end & & this end > = other start ; }


waits until we have received all of the request messages and then returns the aggregate payload size for all of the received requests

public stream observer < messages streaming input call request > streaming input call ( final stream observer < messages streaming input call response > response observer ) { return new stream observer < streaming input call request > ( ) { private int total payload size ; @ override public void on next ( streaming input call request message ) { total payload size + = message get payload ( ) get body ( ) size ( ) ; } @ override public void on completed ( ) { response observer on next ( streaming input call response new builder ( ) set aggregated payload size ( total payload size ) build ( ) ) ; response observer on completed ( ) ; } @ override public void on error ( throwable cause ) { response observer on error ( cause ) ; } } ; }


returns a new address in this space with the given offset note : for those spaces with an addressable unit size other than 1 , the address returned may not correspond to an addressable unitword boundary if a byte - offset is specified

address get address ( long offset , boolean is addressable word offset ) throws address out of bounds exception ;


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


public long get scan throttle event count ( ) { return scan throttle events get ( ) ; }


remove tool template from the tool chest

public boolean remove ( string name ) { file tool file = tool utils get tool file ( name ) ; boolean removed = tool file delete ( ) ; if ( ! removed & & tool file exists ( ) ) { return false ; } map remove ( name ) ; / / notify listeners of removed tool config system utilities run swing now ( ( ) - > { tool chest change listener [ ] tc listeners = new tool chest change listener [ listeners size ( ) ] ; listeners to array ( tc listeners ) ; for ( int l = 0 ; l < tc listeners length ; l + + ) { tc listeners [ l ] tool removed ( name ) ; } } ) ; return true ; }


get { @ link application attempt id } of the application master

public application attempt id get application attempt id ( ) { return app scheduling info get application attempt id ( ) ; }


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


removes the edge returned by the most recent call to next ( )

public boolean remove ( ) throws concurrent modification exception { boolean removed ; if ( edge set modification number ! = get modification number ( ) ) { throw new concurrent modification exception ( " edge set modified " ) ; } removed = edge set this remove ( edges [ current position ] ) ; edge set modification number = get modification number ( ) ; return removed ; }


the path of this register , which includes the parent path of this register tree if this register tree has a parent

public string get register path ( ) { string parent path = get parent register path ( ) ; if ( parent path ! = null ) { return parent path + separator + get register ( ) get name ( ) ; } return get register ( ) get name ( ) ; }


public int get first byte of data r v a ( ) { return rva to first byte of data ; }


augments the given exception with the given context , and return the result the result is either the given exception if it was an { @ link exception with context } , or a newly - constructed exception if it was not

public static exception with context with context ( throwable ex , string str ) { exception with context ewc ; if ( ex instanceof exception with context ) { ewc = ( exception with context ) ex ; } else { ewc = new exception with context ( ex ) ; } ewc add context ( str ) ; return ewc ; }


public string to human ( ) { return type to human ( ) ; }


updates the operator state accessible by { @ link # value ( ) } to the given value the next time { @ link # value ( ) } is called ( for the same state partition ) the returned state will represent the updated value when a partitioned state is updated with null , the state for the current key will be removed and the default value is returned on the next access

void update ( t value ) throws i o exception ;


get default diagram image as bytes array

protected input stream get default diagram ( string diagram image file name ) { string image file name = diagram image file name ! = null ? diagram image file name : get default diagram image file name ( ) ; input stream image stream = get class ( ) get resource as stream ( image file name ) ; if ( image stream = = null ) { throw new activiti image exception ( " error occurred while getting default diagram image from file : " + image file name ) ; } return image stream ; }


registers any actions necessary to link this rule and its dependencies automatically infers the toolchain from the configuration of this compilation support dsym bundle is generated if { @ link objc configuration # generate dsym ( ) } is set when bazel flags { @ code - - compilation mode = opt } and { @ code - - objc enable binary stripping } are specified , additional optimizations will be performed on the linked binary : all - symbol stripping ( using { @ code usrbinstrip } ) and dead - code stripping ( using linker flags : { @ code - dead strip } )

compilation support register link actions ( objc provider objc provider , j 2 objc mapping file provider j 2 objc mapping file provider , j 2 objc entry class provider j 2 objc entry class provider , extra link args extra link args , iterable < artifact > extra link inputs , boolean is stamping enabled ) throws interrupted exception , rule error exception { iterable < artifact > pruned j 2 objc archives = compute and strip pruned j 2 objc archives ( j 2 objc entry class provider , j 2 objc mapping file provider , objc provider ) ; immutable list < artifact > bazel built libraries = iterables is empty ( pruned j 2 objc archives ) ? objc provider get objc libraries ( ) : substitute j 2 objc pruned libraries ( objc provider ) ; / / passing large numbers of inputs on the command line triggers a bug in apple ' s clang / / ( b / 29094356 ) , so we ' ll create an input list manually and pass - filelist path / to / input / list / / we can ' t populate this list yet - - it needs to contain any linkstamp objects , which we won ' t / / know about until we actually create the cpp link action - - but it needs to go into the / / cpp link action too , so create it now artifact input file list = intermediate artifacts linker obj list ( ) ; immutable set < artifact > force link artifacts = get force load artifacts ( objc provider ) ; / / clang loads archives specified in filelists and also specified as - force load twice , / / resulting in duplicate symbol errors unless they are deduped immutable set < artifact > obj files = immutable set copy of ( iterables filter ( iterables concat ( bazel built libraries , objc provider get ( imported library ) to list ( ) , objc provider get cc libraries ( ) ) , predicates not ( predicates in ( force link artifacts ) ) ) ) ; link target type link type = objc provider is ( flag uses cpp ) ? link target type objcpp executable : link target type objc executable ; objc variables extension builder extension builder = new objc variables extension builder ( ) set rule context ( rule context ) set objc provider ( objc provider ) set configuration ( build configuration ) set intermediate artifacts ( intermediate artifacts ) set framework names ( framework names ( objc provider ) ) set framework search path ( framework library search paths ( objc provider ) ) set library names ( library names ( objc provider ) ) set force load artifacts ( get force load artifacts ( objc provider ) ) set attribute linkopts ( attributes linkopts ( ) ) add variable category ( variable category executable linking variables ) ; artifact binary to link = get binary to link ( ) ; cpp link action builder executable link action builder = new cpp link action builder ( rule context , rule context , rule context get label ( ) , binary to link , build configuration , toolchain , toolchain get fdo context ( ) , get feature configuration ( rule context , toolchain , build configuration , create objc cpp semantics ( ) ) , create objc cpp semantics ( ) ) set grep includes ( cpp helper get grep includes ( rule context ) ) set is stamping enabled ( is stamping enabled ) set test or test only target ( rule context is test only target ( ) | | rule context is test target ( ) ) set mnemonic ( " objc link " ) add action inputs ( bazel built libraries ) add action inputs ( objc provider get cc libraries ( ) ) add transitive action inputs ( objc provider get ( imported library ) ) add transitive action inputs ( objc provider get ( static framework file ) ) add transitive action inputs ( objc provider get ( dynamic framework file ) ) add transitive action inputs ( objc provider get ( link inputs ) ) set linker files ( toolchain get linker files ( ) ) add action inputs ( pruned j 2 objc archives ) add action inputs ( extra link inputs ) add action input ( input file list ) set link type ( link type ) set linking mode ( linking mode static ) add linkopts ( immutable list copy of ( extra link args ) ) ; if ( objc configuration generate dsym ( ) ) { artifact dsym symbol = objc configuration should strip binary ( ) ? intermediate artifacts dsym symbol for unstripped binary ( ) : intermediate artifacts dsym symbol for stripped binary ( ) ; extension builder set dsym symbol ( dsym symbol ) add variable category ( variable category dsym variables ) ; executable link action builder add action output ( dsym symbol ) ; } if ( objc configuration generate linkmap ( ) ) { artifact linkmap = intermediate artifacts linkmap ( ) ; extension builder set linkmap ( linkmap ) add variable category ( variable category linkmap variables ) ; executable link action builder add action output ( linkmap ) ; } if ( apple configuration get bitcode mode ( ) = = apple bitcode mode embedded ) { artifact bitcode symbol map = intermediate artifacts bitcode symbol map ( ) ; extension builder set bitcode symbol map ( bitcode symbol map ) add variable category ( variable category bitcode variables ) ; executable link action builder add action output ( bitcode symbol map ) ; } executable link action builder add variables extension ( extension builder build ( ) ) ; for ( cc linking context context : cpp helper get linking contexts from deps ( immutable list copy of ( rule context get prerequisites ( " deps " ) ) ) ) { executable link action builder add linkstamps ( context get linkstamps ( ) to list ( ) ) ; } cpp link action executable link action = executable link action builder build ( ) ; / / populate the input file list with both the compiled object files and any linkstamp object / / files register obj filelist action ( immutable set < artifact > builder ( ) add all ( obj files ) add all ( executable link action get linkstamp object file inputs ( ) ) build ( ) , input file list ) ; rule context register action ( executable link action ) ; if ( objc configuration should strip binary ( ) ) { register binary strip action ( binary to link , get stripping type ( extra link args ) ) ; } return this ; }


returns a new { @ code mutable class to instance map } instance backed by a { @ link hash map } using the default initial capacity and load factor

public static < b > mutable class to instance map < b > create ( ) { return new mutable class to instance map < b > ( new hash map < class < ? extends b > , b > ( ) ) ; }


removes a single instance of the specified element from this queue , if it is present more formally , removes an element < tt > e < tt > such that < tt > o equals ( e ) < tt > , if this queue contains one or more such elements returns < tt > true < tt > if this queue contained the specified element ( or equivalently , if this queue changed as a result of the call )

public boolean remove ( @ nullable decl object o ) { if ( o = = null ) return false ; final e [ ] items = this items ; final monitor monitor = this monitor ; monitor enter ( ) ; try { int i = take index ; int k = 0 ; for ( ; ; ) { if ( k + + > = count ) return false ; if ( o equals ( items [ i ] ) ) { remove at ( i ) ; return true ; } i = inc ( i ) ; } } finally { monitor leave ( ) ; } }


tests that concurrent leadership operations ( granting and revoking ) leadership leave the system in a sane state

public void test concurrent leadership operations ( ) throws exception { final leader election service dispatcher leader election service = embedded ha services get dispatcher leader election service ( ) ; final testing leader contender leader contender = new testing leader contender ( ) ; dispatcher leader election service start ( leader contender ) ; final uuid old leader session id = leader contender get leader session future ( ) get ( ) ; assert that ( dispatcher leader election service has leadership ( old leader session id ) , is ( true ) ) ; embedded ha services get dispatcher leader service ( ) revoke leadership ( ) get ( ) ; assert that ( dispatcher leader election service has leadership ( old leader session id ) , is ( false ) ) ; embedded ha services get dispatcher leader service ( ) grant leadership ( ) ; final uuid new leader session id = leader contender get leader session future ( ) get ( ) ; assert that ( dispatcher leader election service has leadership ( new leader session id ) , is ( true ) ) ; dispatcher leader election service confirm leadership ( old leader session id , address ) ; dispatcher leader election service confirm leadership ( new leader session id , address ) ; assert that ( dispatcher leader election service has leadership ( new leader session id ) , is ( true ) ) ; leader contender try rethrow exception ( ) ; }


receive a reported block copy response from the input stream

private void receive response ( data input stream in ) throws i o exception { long start time = time monotonic now ( ) ; block op response proto response = block op response proto parse from ( vint prefixed ( in ) ) ; while ( response get status ( ) = = status in progress ) { / / read intermediate responses response = block op response proto parse from ( vint prefixed ( in ) ) ; / / stop waiting for slow block moves even if it stops waiting , / / the actual move may continue if ( stop waiting for response ( start time ) ) { throw new i o exception ( " block move timed out " ) ; } } string log info = " reported block move is failed " ; data transfer proto util check block op status ( response , log info , true ) ; }


returns true if the the given member is a method that overrides { @ link object # equals ( object ) } the documentation for { @ link object # equals } says it should accept null , so don ' t require an explicit { @ code @ nullable decl } annotation ( see < a href = " https : github comgoogleguavaissues 1 8 1 9 " > # 1819 ) it is not necessary to consider visibility , return type , or type parameter declarations the declaration of a method with the same name and formal parameters as { @ link object # equals } that is not public and boolean - returning , or that declares any type parameters , would be rejected at compile - time

private static boolean is equals ( member member ) { if ( ! ( member instanceof method ) ) { return false ; } method method = ( method ) member ; if ( ! method get name ( ) content equals ( " equals " ) ) { return false ; } class < ? > [ ] parameters = method get parameter types ( ) ; if ( parameters length ! = 1 ) { return false ; } if ( ! parameters [ 0 ] equals ( object class ) ) { return false ; } return true ; }


returns the drawables associated with this component host for animations , for example the background drawable andor the drawable that otherwise has a transition key on it that has caused it to be hosted in this component host the core purpose of exposing these drawables is so that when animating the bounds of this component host , we also properly animate the bounds of its contained drawables at the same time

public @ nullable list < drawable > get linked drawables for animation ( ) { list < drawable > drawables = null ; for ( int i = 0 , size = ( m drawable mount items = = null ) ? 0 : m drawable mount items size ( ) ; i < size ; i + + ) { final mount item mount item = m drawable mount items value at ( i ) ; if ( ( get layout output ( mount item ) get flags ( ) & layout output layout flag match host bounds ) ! = 0 ) { if ( drawables = = null ) { drawables = new array list < > ( ) ; } drawables add ( ( drawable ) mount item get content ( ) ) ; } } return drawables ; }


converts a relational tree of { @ link modify operation } s into a set of runnable { @ link transformation } s this method accepts a list of { @ link modify operation } s to allow reusing common subtrees of multiple relational queries each query ' s top node should be a { @ link modify operation } in order to pass the expected properties of the output { @ link transformation } such as output mode ( append , retract , upsert ) or the expected output type

list < transformation < ? > > translate ( list < modify operation > modify operations ) ;


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

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


set a { @ link conversion service } for binding jdbc values to bean properties , or { @ code null } for none default is a { @ link default conversion service } , as of spring 4 3 this provides support for { @ code java time } conversion and other special types

public void set conversion service ( @ nullable conversion service conversion service ) { this conversion service = conversion service ; }


returns the number of undefined bytes that are available in the structure beginning at the specified row index

protected int get num undefined bytes at ( int row index ) { return 0 ; }


returns a new { @ link progressive media source } using the current parameters

public progressive media source create media source ( media item media item ) { check not null ( media item playback properties ) ; boolean needs tag = media item playback properties tag = = null & & tag ! = null ; boolean needs custom cache key = media item playback properties custom cache key = = null & & custom cache key ! = null ; if ( needs tag & & needs custom cache key ) { media item = media item build upon ( ) set tag ( tag ) set custom cache key ( custom cache key ) build ( ) ; } else if ( needs tag ) { media item = media item build upon ( ) set tag ( tag ) build ( ) ; } else if ( needs custom cache key ) { media item = media item build upon ( ) set custom cache key ( custom cache key ) build ( ) ; } return new progressive media source ( media item , data source factory , extractors factory , drm session manager ! = null ? drm session manager : media source drm helper create ( media item ) , load error handling policy , continue loading check interval bytes ) ; }


returns the value of a header with the specified name if there is more than one value for the specified name , the first value in insertion order is returned


create a new g r p c { @ link managed channel }

public static managed channel new channel ( string target , string proxy , auth and t l s options options , @ nullable list < client interceptor > interceptors ) throws i o exception { preconditions check not null ( target ) ; preconditions check not null ( options ) ; ssl context ssl context = is tls enabled ( target ) ? create s sl context ( options tls certificate , options tls client certificate , options tls client key ) : null ; string target url = convert target scheme ( target ) ; try { netty channel builder builder = new netty channel builder ( target url , proxy ) negotiation type ( is tls enabled ( target ) ? negotiation type tls : negotiation type plaintext ) ; if ( options grpc keepalive time ! = null ) { builder keep alive time ( options grpc keepalive time get seconds ( ) , time unit seconds ) ; builder keep alive timeout ( options grpc keepalive timeout get seconds ( ) , time unit seconds ) ; } if ( interceptors ! = null ) { builder intercept ( interceptors ) ; } if ( ssl context ! = null ) { builder ssl context ( ssl context ) ; if ( options tls authority override ! = null ) { builder override authority ( options tls authority override ) ; } } return builder build ( ) ; } catch ( runtime exception e ) { / / g r p c might throw all kinds of runtime exceptions : status runtime exception , / / illegal state exception , null pointer exception , string message = " failed to connect to ' % s ' : % s " ; throw new i o exception ( string format ( message , target url , e get message ( ) ) ) ; } }


decodes a byte array into a purgeable bitmap

protected bitmap decode byte array as purgeable ( closeable reference < pooled byte buffer > bytes ref , bitmap factory options options ) { return decode file descriptor as purgeable ( bytes ref , bytes ref get ( ) size ( ) , null , options ) ; }


protected map < string , double > get kurtosis ( ) { return collections unmodifiable map ( results kurtosis ) ; }


delete this repository and its contents < p > note : this method is not yet implemented server admin should stop server and simply delete those repository directories which are unwanted

void delete ( string current user ) throws i o exception , user access exception { synchronized ( file system ) { validate ( ) ; validate admin privilege ( current user ) ; / / todo delete repository contents throw new i o exception ( " delete repository not yet implemented " ) ; } }


public int compare ( annotation item item 1 , annotation item item 2 ) { int index 1 = item 1 type get index ( ) ; int index 2 = item 2 type get index ( ) ; if ( index 1 < index 2 ) { return - 1 ; } else if ( index 1 > index 2 ) { return 1 ; } return 0 ; }


not supported < b > you are attempting to create a set that may contain a non - { @ code comparable } element < b > proper calls will resolve to the version in { @ code immutable sorted set } , not this dummy version

public static < e > immutable sorted set < e > of ( e e 1 , e e 2 , e e 3 , e e 4 , e e 5 , e e 6 , e remaining ) { throw new unsupported operation exception ( ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void enter builtin date time function ( sql base parser builtin date time function context ctx ) { }


public < t extends metric > t register ( string name , t metric ) throws illegal argument exception { if ( metric = = null ) { throw new null pointer exception ( " metric = = null " ) ; } return metric ; }


implementing add and remove together in one function , means that less items are shifted ( reduction of 3 times from trivial implementation )

private int replace ( hashed item fpaux , byte victim , int bucket start , int removed offset ) { byte chain id = fpaux chain id ; fpaux chain id = victim ; this cache [ bucket start + removed offset ] = 0 ; tiny set indexing remove item ( fpaux , chain index , last index ) ; fpaux chain id = chain id ; int idx to add = tiny set indexing add item ( fpaux , chain index , last index ) ; int delta = ( removed offset < idx to add ) ? - 1 : 1 ; replace items ( idx to add , fpaux value , bucket start , delta ) ; return removed offset ; }


returns all highlights for the given function

public set < highlight token > get highlights by function ( function f ) { set < highlight token > results = new hash set < > ( ) ; set < token key > keys = get highlight keys ( f ) ; for ( token key key : keys ) { highlight token hl = highlights by token get ( key ) ; results add ( hl ) ; } return results ; }


< code > optional aapt pb plural plural = 5 ; < code >

public com android aapt resources plural get plural ( ) { return instance get plural ( ) ; }


reads the entire file into a string using the specified charset @ throw gdx runtime exception if the file handle represents a directory , doesn ' t exist , or could not be read

public string read string ( string charset ) { if ( preloader is text ( file ) ) return preloader texts get ( file ) ; try { return new string ( read bytes ( ) , " utf - 8 " ) ; } catch ( unsupported encoding exception e ) { return null ; } }


an unsafe operation that sets the reference count directly

public final void set ref cnt ( t instance , int ref cnt ) { updater ( ) set ( instance , ref cnt > 0 ? ref cnt < < 1 : 1 ) ; / / overflow ok here }


public void set comment ( string comment ) ;


domain name mode access way does not support the delimiter ( ; ) , and only one domain name can be set

public void set namesrv addr ( string namesrv addr ) { this namesrv addr = namesrv addr ; }


create an object for the given class and initialize it from conf

public static < t > t new instance ( class < t > the class , configuration conf , class < ? > [ ] arg types , object values ) { t result ; if ( arg types length ! = values length ) { throw new illegal argument exception ( arg types length + " parameters are required but " + values length + " arguments are provided " ) ; } try { constructor < t > meth = ( constructor < t > ) constructor cache get ( the class ) ; if ( meth = = null ) { meth = the class get declared constructor ( arg types ) ; meth set accessible ( true ) ; constructor cache put ( the class , meth ) ; } result = meth new instance ( values ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } set conf ( result , conf ) ; return result ; }


creates a csv reader to read a comma separated value ( csv ) file the reader has options to define parameters and field types and will eventually produce the data set that corresponds to the read and parsed csv input

public csv reader read csv file ( string file path ) { return new csv reader ( file path , this ) ; }


namespaces defined on this element < code > repeated aapt pb xml namespace namespace declaration = 1 ; < code >

public builder clear namespace declaration ( ) { copy on write ( ) ; instance clear namespace declaration ( ) ; return this ; }


find purchase order by id for valid response try integer i ds with value & lt ; & # x 3 d ; 5 or & gt ; 10 other values will generated exceptions

public void get order by id test ( ) { / / todo : test validations long order id = null ; / / order response = api get order by id ( order id ) ; / / assert not null ( response ) ; }


public long tick ( ) { return tick ( null ) ; }


implementations should return an instance of { @ code managed operation } if the supplied { @ code method } has the corresponding metadata otherwise should return { @ code null }

managed operation get managed operation ( method method ) throws invalid metadata exception ;


helper method to set username for the first http basic authentication

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


initialize data organization to reflect big - endian mips 3 2 cspec specification ( mips 32 - bit )

public static void init data organization 3 2 bit mips ( data organization impl data org ) { data org set big endian ( true ) ; data org set pointer size ( 4 ) ; data org set float size ( 4 ) ; data org set double size ( 8 ) ; data org set long double size ( 8 ) ; data org set size alignment ( 1 , 1 ) ; data org set size alignment ( 2 , 2 ) ; data org set size alignment ( 4 , 4 ) ; data org set size alignment ( 8 , 8 ) ; bit field packing impl bit field packing = new bit field packing impl ( ) ; / / use defaults data org set bit field packing ( bit field packing ) ; }


public int get channel max read idle seconds ( ) { return max read idle seconds ; }


the following exceptions maybe thrown from the state manager flushing call

protected void maybe write checkpoint ( final boolean enforce checkpoint ) { final map < topic partition , long > offset snapshot = state mgr changelog offsets ( ) ; if ( state manager util checkpoint needed ( enforce checkpoint , offset snapshot since last flush , offset snapshot ) ) { / / the state ' s current offset would be used to checkpoint state mgr flush ( ) ; state mgr checkpoint ( ) ; offset snapshot since last flush = new hash map < > ( offset snapshot ) ; } }


number of translog operations that have been skipped

public int get skipped operations ( ) { return skipped operations ; }


change the jar file path as the make dex elements do android o change its path

public static string optimized path for ( file path , file optimized directory ) { if ( share tinker internals is after android o ( ) ) { / / dex location = / foo / bar / baz jar / / odex location = / foo / bar / oat / < isa > / baz odex string current instruction set ; try { current instruction set = share tinker internals get current instruction set ( ) ; } catch ( exception e ) { throw new tinker runtime exception ( " get current instruction set fail : " , e ) ; } file parent file = path get parent file ( ) ; string file name = path get name ( ) ; int index = file name last index of ( ' ' ) ; if ( index > 0 ) { file name = file name substring ( 0 , index ) ; } string result = parent file get absolute path ( ) + " / oat / " + current instruction set + " / " + file name + share constants odex suffix ; return result ; } string file name = path get name ( ) ; if ( ! file name ends with ( share constants dex suffix ) ) { int last dot = file name last index of ( " " ) ; if ( last dot < 0 ) { file name + = share constants dex suffix ; } else { string builder sb = new string builder ( last dot + 4 ) ; sb append ( file name , 0 , last dot ) ; sb append ( share constants dex suffix ) ; file name = sb to string ( ) ; } } file result = new file ( optimized directory , file name ) ; return result get path ( ) ; }


creates the main gui panel , containing the known users , button , and user access panels

protected void create main panel ( string [ ] known users , boolean anonymous server access allowed ) { j panel main panel = new j panel ( ) ; main panel set border ( border factory create empty border ( 5 , 10 , 5 , 10 ) ) ; main panel set layout ( new box layout ( main panel , box layout x axis ) ) ; known users panel = new known users panel ( arrays as list ( known users ) ) ; user access panel = new user access panel ( current user ) ; add remove button panel = new button panel ( ) ; main panel add ( known users panel ) ; main panel add ( add remove button panel ) ; main panel add ( user access panel ) ; add ( main panel , border layout center ) ; if ( anonymous server access allowed ) { anonymous access c b = new g check box ( " allow anonymous access " , orig anonymous access enabled ) ; anonymous access c b set border ( border factory create empty border ( 10 , 10 , 0 , 0 ) ) ; add ( anonymous access c b , border layout south ) ; } }


returns the headers of the current input record ; could be null if it is not available ( for example , if this method is invoked from the punctuate call )


this should be primarily used for testing

replica info fetch replica info ( string bpid , long block id ) { replica info r = volume map get ( bpid , block id ) ; if ( r = = null ) { return null ; } switch ( r get state ( ) ) { case finalized : case rbw : case rwr : case rur : case temporary : return new replica builder ( r get state ( ) ) from ( r ) build ( ) ; } return null ; }


get the broadcast variables of the sum function

public list < tuple 2 < string , data set < ? > > > get sum bcast vars ( ) { return this bc vars sum ; }


public static matcher get matcher for inline groovy script ( final string script ) { return inline groovy pattern matcher ( script ) ; }


private void iterate long keys ( boolean test stored d b , int record cnt , long key increment , int var data size ) throws i o exception { d b record [ ] recs = null ; if ( key increment = = 0 ) { recs = create random long key table records ( null , record cnt , var data size ) ; } else { recs = create ordered long key table records ( record cnt , key increment , var data size ) ; } arrays sort ( recs ) ; if ( test stored d b ) { save as and reopen ( db name ) ; } table table = dbh get table ( table 1 name ) ; assert equals ( record cnt , table get record count ( ) ) ; assert equals ( recs [ record cnt - 1 ] get key ( ) , table get max key ( ) ) ; / / forward iteration ( no start ) int rec ix = 0 ; d b long iterator iter = table long key iterator ( ) ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( record cnt , rec ix ) ; / / forward iteration ( start in middle ) rec ix = record cnt / 2 ; iter = table long key iterator ( recs [ rec ix ] get key ( ) ) ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( record cnt , rec ix ) ; / / reverse iteration ( no start ) rec ix = record cnt - 1 ; iter = table long key iterator ( long max value ) ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( - 1 , rec ix ) ; / / reverse iteration ( start in middle ) rec ix = record cnt / 2 ; iter = table long key iterator ( recs [ rec ix ] get key ( ) ) ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( - 1 , rec ix ) ; / / range iteration ( forward ) starting at min on existing record int min ix = record cnt / 10 ; int max ix = 2 * min ix ; iter = table long key iterator ( recs [ min ix ] get key ( ) , recs [ max ix ] get key ( ) , recs [ min ix ] get key ( ) ) ; rec ix = min ix ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( rec ix , max ix + 1 ) ; / / range iteration ( reverse ) starting at max on existing record iter = table long key iterator ( recs [ min ix ] get key ( ) , recs [ max ix ] get key ( ) , recs [ max ix ] get key ( ) ) ; rec ix = max ix ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( rec ix , min ix - 1 ) ; / / assumes consecutive keys do not exist - assumption could be a problem with random keys if ( key increment ! = 1 ) { / / range iteration ( forward ) starting at min and not on existing record long missing min key = recs [ min ix ] get key ( ) - 1 ; long missing max key = recs [ max ix ] get key ( ) + 1 ; iter = table long key iterator ( missing min key , missing max key , missing min key ) ; rec ix = min ix ; assert true ( ! iter has previous ( ) ) ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( rec ix , max ix + 1 ) ; / / range iteration - no records ( forward and reverse ) iter = table long key iterator ( missing min key , missing min key , missing min key ) ; assert true ( ! iter has next ( ) ) ; assert true ( ! iter has previous ( ) ) ; iter = table long key iterator ( missing max key , missing max key , missing max key ) ; assert true ( ! iter has next ( ) ) ; assert true ( ! iter has previous ( ) ) ; / / range iteration ( reverse ) starting at max and not on existing record iter = table long key iterator ( missing min key , missing max key , missing max key ) ; rec ix = max ix ; assert true ( ! iter has next ( ) ) ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( rec ix , min ix - 1 ) ; / / range iteration ( reverse ) starting at mid and not on existing record int mid ix = ( min ix + max ix ) / 2 ; long missing mid key = recs [ mid ix ] get key ( ) - 1 ; iter = table long key iterator ( missing min key , missing max key , missing mid key ) ; rec ix = mid ix - 1 ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; } assert equals ( rec ix , min ix - 1 ) ; / / range iteration ( forward ) starting at mid and not on existing record iter = table long key iterator ( missing min key , missing max key , missing mid key ) ; rec ix = mid ix ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; } assert equals ( rec ix , max ix + 1 ) ; } / / delete ( forward ) long tx id = dbh start transaction ( ) ; iter = table long key iterator ( recs [ min ix ] get key ( ) , recs [ max ix ] get key ( ) , recs [ min ix ] get key ( ) ) ; rec ix = min ix ; while ( iter has next ( ) ) { assert equals ( recs [ rec ix + + ] get key ( ) , iter next ( ) ) ; iter delete ( ) ; } assert equals ( rec ix , max ix + 1 ) ; dbh end transaction ( tx id , true ) ; record cnt - = max ix - min ix + 1 ; assert equals ( table get record count ( ) , record cnt ) ; iter = table long key iterator ( recs [ min ix - 1 ] get key ( ) , recs [ max ix + 1 ] get key ( ) , recs [ min ix - 1 ] get key ( ) ) ; assert equals ( recs [ min ix - 1 ] get key ( ) , iter next ( ) ) ; assert equals ( recs [ max ix + 1 ] get key ( ) , iter next ( ) ) ; / / range iteration ( reverse ) tx id = dbh start transaction ( ) ; min ix = min ix * 3 ; max ix + = min ix ; iter = table long key iterator ( recs [ min ix ] get key ( ) , recs [ max ix ] get key ( ) , recs [ max ix ] get key ( ) ) ; rec ix = max ix ; while ( iter has previous ( ) ) { assert equals ( recs [ rec ix - - ] get key ( ) , iter previous ( ) ) ; iter delete ( ) ; } assert equals ( rec ix , min ix - 1 ) ; dbh end transaction ( tx id , true ) ; record cnt - = max ix - min ix + 1 ; assert equals ( table get record count ( ) , record cnt ) ; iter = table long key iterator ( recs [ min ix - 1 ] get key ( ) , recs [ max ix + 1 ] get key ( ) , recs [ min ix - 1 ] get key ( ) ) ; assert equals ( recs [ min ix - 1 ] get key ( ) , iter next ( ) ) ; assert equals ( recs [ max ix + 1 ] get key ( ) , iter next ( ) ) ; }


adjusts the buffer size as the storage requirements change every time the buffer is resized , arrays are compacted

private void adjust space ( int new size ) { if ( new size < 10 ) { new size = 10 ; } byte [ ] new bytes = new byte [ new size ] ; int pos = 1 ; for ( int i = 0 ; i < starts length ; i + + ) { if ( starts [ i ] > 0 ) { int len = lengths [ i ] & 0x f f f f ; system arraycopy ( bytes , starts [ i ] , new bytes , pos , len ) ; starts [ i ] = pos ; pos + = len ; } } next free = pos ; bytes = new bytes ; }


private void handle responses ( long now , list < client response > responses ) { for ( client response response : responses ) { int correlation id = response request header ( ) correlation id ( ) ; call call = correlation id to calls get ( correlation id ) ; if ( call = = null ) { / / if the server returns information about a correlation id we didn ' t use yet , / / an internal server error has occurred close the connection and log an error message log error ( " internal server error on { } : server returned information about unknown " + " correlation id { } , request header = { } " , response destination ( ) , correlation id , response request header ( ) ) ; client disconnect ( response destination ( ) ) ; continue ; } / / stop tracking this call correlation id to calls remove ( correlation id ) ; list < call > calls = calls in flight get ( response destination ( ) ) ; if ( ( calls = = null ) | | ( ! calls remove ( call ) ) ) { log error ( " internal server error on { } : ignoring call { } in correlation id to call " + " that did not exist in calls in flight " , response destination ( ) , call ) ; continue ; } / / handle the result of the call this may involve retrying the call , if we got a / / retriable exception if ( response version mismatch ( ) ! = null ) { call fail ( now , response version mismatch ( ) ) ; } else if ( response was disconnected ( ) ) { authentication exception auth exception = client authentication exception ( call cur node ( ) ) ; if ( auth exception ! = null ) { call fail ( now , auth exception ) ; } else { call fail ( now , new disconnect exception ( string format ( " cancelled % s request with correlation id % s due to node % s being disconnected " , call call name , correlation id , response destination ( ) ) ) ) ; } } else { try { call handle response ( response response body ( ) ) ; if ( log is trace enabled ( ) ) log trace ( " { } got response { } " , call , response response body ( ) ) ; } catch ( throwable t ) { if ( log is trace enabled ( ) ) log trace ( " { } handle response failed with { } " , call , pretty print exception ( t ) ) ; call fail ( now , t ) ; } } } }


public < t > t execute ( function < response , t > handler ) { return handler apply ( rest assured given ( ) spec ( req spec build ( ) ) expect ( ) spec ( resp spec build ( ) ) when ( ) request ( req method , req uri ) ) ; }


return the configured { @ link requested content type resolver }

public requested content type resolver get content type resolver ( ) { return this content type resolver ; }


public synchronized int get last buffer size ( ) { return last buffer size ; }


verify that unchecking then checking the " create strings containing existing strings " option works as expected

public void test strings containing existing strings ( ) throws exception { program test program = build program ( " libopencoreplayer so " , false ) ; listing listing = test program get listing ( ) ; address space space = test program get language ( ) get address factory ( ) get default address space ( ) ; / / create a string that overlaps where a string normally would be automatically created string [ ] make existing strs = new string [ ] { " duration " , " video m i o " } ; int [ ] offsets = new int [ ] { 0xa 7 1 9 8 1 2 4 , 0xa 7 1 9 5fd 8 } ; address [ ] make existing addrs = new address [ offsets length ] ; create data cmd cmd ; data data here ; string string here ; for ( int i = 0 ; i < offsets length ; i + + ) { make existing addrs [ i ] = addr ( space , offsets [ i ] ) ; cmd = new create data cmd ( make existing addrs [ i ] , true , new string data type ( ) ) ; cmd apply to ( test program ) ; data here = listing get defined data at ( make existing addrs [ i ] ) ; assert not null ( data here ) ; string here = data here get default value representation ( ) ; assert equals ( " \ " " + make existing strs [ i ] + " \ " " , string here ) ; } / / offsets where there shouldn ' t be strings because existing strings were / / " in the way " int [ ] non expected offsets = new int [ ] { 0xa 7 1 9 8 1 2 0 , 0xa 7 1 9 5fd 4 } ; / / verify these are not there before running the strings analyzer for ( int non expected offset : non expected offsets ) { data here = listing get defined data at ( addr ( space , non expected offset ) ) ; assert null ( data here ) ; } auto analysis manager manager = auto analysis manager get analysis manager ( test program ) ; / / run strings analyzer strings analyzer analyzer = new strings analyzer ( ) ; analyzer set string end alignment ( 1 ) ; analyzer set create string over existing string ( false ) ; / / option is unchecked analyzer added ( test program , null , monitor , manager get message log ( ) ) ; for ( int non expected offset : non expected offsets ) { data here = listing get defined data at ( addr ( space , non expected offset ) ) ; assert null ( data here ) ; } / / larger string that would have been created if parameter is checked string [ ] larger strs = new string [ ] { " drm / duration " , " p v f m video m i o " } ; / / now run again with parameter enabled and verify strings are there analyzer set create string over existing string ( true ) ; / / option is checked analyzer added ( test program , null , monitor , manager get message log ( ) ) ; for ( int i = 0 ; i < non expected offsets length ; i + + ) { data here = listing get defined data at ( addr ( space , non expected offsets [ i ] ) ) ; assert not null ( data here ) ; string here = data here get default value representation ( ) ; assert equals ( " \ " " + larger strs [ i ] + " \ " " , string here ) ; } }


configures a friendly name for the generator this will be used by the generator to select the library with the - l flag

public string get name ( ) { return " cpp - ue 4 " ; }


the default implementation of this method will simply replace { @ code this } { @ link sni handler } instance with a { @ link ssl handler } users may override this method to implement custom behavior please be aware that this method may get called after a client has already disconnected and custom implementations must take it into consideration when overriding this method it ' s also possible for the hostname argument to be { @ code null }

protected void replace handler ( channel handler context ctx , string hostname , ssl context ssl context ) throws exception { ssl handler ssl handler = null ; try { ssl handler = new ssl handler ( ssl context , ctx alloc ( ) ) ; ctx pipeline ( ) replace ( this , ssl handler class get name ( ) , ssl handler ) ; ssl handler = null ; } finally { / / since the ssl handler was not inserted into the pipeline the ownership of the s s l engine was not / / transferred to the ssl handler / / see https : / / github com / netty / netty / issues / 5678 if ( ssl handler ! = null ) { reference count util safe release ( ssl handler engine ( ) ) ; } } }


boolean set ( long bit index ) { if ( get ( bit index ) ) { return false ; } int long index = ( int ) ( bit index > > > long addressable bits ) ; long mask = 1l < < bit index ; / / only cares about low 6 bits of bit index long old value ; long new value ; do { old value = data get ( long index ) ; new value = old value | mask ; if ( old value = = new value ) { return false ; } } while ( ! data compare and set ( long index , old value , new value ) ) ; / / we turned the bit on , so increment bit count bit count increment ( ) ; return true ; }


appends the given { @ link resource decoder } onto the list of available { @ link resource decoder } s in this bucket , allowing it to be used if all earlier and default { @ link resource decoder } s for the given types in this bucket fail ( or there are none ) if you ' re attempting to replace an existing { @ link resource decoder } or would like to ensure that your { @ link resource decoder } gets the chance to run before an existing { @ link resource decoder } , use { @ link # prepend ( class , class , resource decoder ) } this method is best for new types of resources and data or as a way to add an additional fallback decoder for an existing type of data

public < data , t resource > registry append ( @ non null string bucket , @ non null class < data > data class , @ non null class < t resource > resource class , @ non null resource decoder < data , t resource > decoder ) { decoder registry append ( bucket , decoder , data class , resource class ) ; return this ; }


the unassigned meta is kept when a shard goes to initializing , but cleared when it moves to started

public void test state transition meta handling ( ) { shard routing shard = test shard routing new shard routing ( " test " , 1 , null , null , true , shard routing state unassigned , new unassigned info ( unassigned info reason index created , null ) ) ; assert that ( shard unassigned info ( ) , not null value ( ) ) ; shard = shard initialize ( " test node " , null , - 1 ) ; assert that ( shard state ( ) , equal to ( shard routing state initializing ) ) ; assert that ( shard unassigned info ( ) , not null value ( ) ) ; shard = shard move to started ( ) ; assert that ( shard state ( ) , equal to ( shard routing state started ) ) ; assert that ( shard unassigned info ( ) , null value ( ) ) ; }


combines two { @ link result } s and returns the worse one this method is null - safe ( any { @ link result } is " worse " than { @ code null } , and { @ code null } is returned if both parameters are { @ code null } )

public static result combine ( result r 1 , result r 2 ) { if ( r 1 = = null ) { return r 2 ; } else if ( r 2 = = null ) { return r 1 ; } else { return r 1 combine ( r 2 ) ; } }


public heavy get heavy ( ) { if ( heavy = = null ) { heavy = new heavy ( ) ; } return heavy ; }


initializes the instance using specified context

public void init ( a m r m proxy application context app context ) { super init ( app context ) ; log info ( " initializing federation interceptor " ) ; / / update the conf if available configuration conf = app context get conf ( ) ; if ( conf = = null ) { conf = get conf ( ) ; } else { set conf ( conf ) ; } / / the proxy ugi used to talk to home rm as well as yarn registry , loaded / / with the up - to - date a m r m token issued by home rm user group information app owner ; try { app owner = user group information create proxy user ( app context get user ( ) , user group information get current user ( ) ) ; } catch ( exception ex ) { throw new yarn runtime exception ( ex ) ; } if ( app context get registry client ( ) ! = null ) { this registry client = new federation registry client ( conf , app context get registry client ( ) , app owner ) ; / / add all app tokens for yarn registry access if ( app context get credentials ( ) ! = null ) { app owner add credentials ( app context get credentials ( ) ) ; } } this attempt id = app context get application attempt id ( ) ; application id app id = this attempt id get application id ( ) ; this home sub cluster id = sub cluster id new instance ( yarn configuration get cluster id ( conf ) ) ; this home r m relayer = new a m r m client relayer ( create home r m proxy ( app context , application master protocol class , app owner ) , app id , this home sub cluster id to string ( ) ) ; this home heartbeart handler = create home heartbeart handler ( conf , app id , this home r m relayer ) ; this home heartbeart handler set u g i ( app owner ) ; this home heartbeart handler set daemon ( true ) ; this home heartbeart handler start ( ) ; / / set last response id to - 1 before application master registers this last allocate response = record factory new record instance ( allocate response class ) ; this last allocate response set response id ( a m r m client utils pre register response id ) ; this federation facade = federation state store facade get instance ( ) ; this sub cluster resolver = this federation facade get sub cluster resolver ( ) ; / / a m r m proxy policy will be initialized in register application master this policy interpreter = null ; this uam pool init ( conf ) ; this uam pool start ( ) ; this heartbeat max wait time ms = conf get long ( yarn configuration federation amrmproxy hb max wait ms , yarn configuration default federation amrmproxy hb max wait ms ) ; this sub cluster time out = conf get long ( yarn configuration federation amrmproxy subcluster timeout , yarn configuration default federation amrmproxy subcluster timeout ) ; if ( this sub cluster time out < = 0 ) { log info ( " { } configured to be { } , should be positive using default of { } " , yarn configuration federation amrmproxy subcluster timeout , this sub cluster time out , yarn configuration default federation amrmproxy subcluster timeout ) ; this sub cluster time out = yarn configuration default federation amrmproxy subcluster timeout ; } }


guaranteed to throw an exception and leave the { @ code range map } unmodified

public void put all ( range map < k , v > range map ) { throw new unsupported operation exception ( ) ; }


return the attribute of the specified keyed object as a string

public string get value as string ( keyed object o ) { try { return long to string ( get value ( o ) ) ; } catch ( ghidra util exception no value exception exc ) { return " 0 " ; } }


replaces the given instruction by an infinite loop

private void replace by infinite loop ( clazz clazz , int offset ) { if ( debug ) system out println ( " inserting infinite loop at [ " + offset + " ] " ) ; / / mark the instruction mark instruction ( offset ) ; / / replace the instruction by an infinite loop instruction replacement instruction = new branch instruction ( instruction constants op goto , 0 ) ; code attribute editor replace instruction ( offset , replacement instruction ) ; }


public static builder new builder ( ) { return new builder ( ) ; }


checks if the cluster state allows this node to add x - pack metadata to the cluster state , and throws an exception otherwise this check should be called before installing any x - pack metadata to the cluster state , to ensure that the other nodes that are part of the cluster will be able to deserialize that metadata note that if the cluster state already contains x - pack metadata , this check assumes that the nodes are already ready to receive additional x - pack metadata having this check properly in place everywhere allows to install x - pack into a cluster using a rolling restart

public static void check ready for x pack custom metadata ( cluster state cluster state ) { if ( already contains x pack custom metadata ( cluster state ) ) { return ; } list < discovery node > not ready nodes = nodes not ready for x pack custom metadata ( cluster state ) ; if ( not ready nodes is empty ( ) = = false ) { throw new illegal state exception ( " the following nodes are not ready yet for enabling x - pack custom metadata : " + not ready nodes ) ; } }


use this to connect the zipkin v 1 interface will be under " apiv 1 "

public string http url ( ) { return string format ( " http : / / % s : % s " , server get host name ( ) , server get port ( ) ) ; }


public void add cache pool ( cache pool info info ) throws i o exception { statistics increment write ops ( 1 ) ; storage statistics increment op counter ( op type add cache pool ) ; cache pool info validate ( info ) ; dfs add cache pool ( info ) ; }


find all supported generic fields in the class supporting rule is in { @ link base utility # is generic type supported ( string ) }

protected list < field > get supported generic fields ( string class name ) { list < field > generic field list = class generic fields map get ( class name ) ; if ( generic field list = = null ) { list < field > supported generic fields = new array list < > ( ) ; class < ? > clazz ; try { clazz = class for name ( class name ) ; } catch ( class not found exception e ) { throw new database generate exception ( database generate exception class not found + class name ) ; } recursive supported generic fields ( clazz , supported generic fields ) ; class generic fields map put ( class name , supported generic fields ) ; return supported generic fields ; } return generic field list ; }


fake endpoint to test group parameters ( optional ) fake endpoint to test group parameters ( optional )

public void test group parameters ( @ query param ( " required string group " ) @ not null integer required string group , @ header param ( " required boolean group " ) @ not null boolean required boolean group , @ query param ( " required int 6 4 group " ) @ not null long required int 6 4 group , @ query param ( " string group " ) integer string group , @ header param ( " boolean group " ) boolean boolean group , @ query param ( " int 6 4 group " ) long int 6 4 group ) ;


creates a { @ link data set } that represents the primitive type produced by reading the given file line wise this method is similar to { @ link # read csv file ( string ) } with single field , but it produces a data set not through { @ link org apache flink api java tuple tuple 1 }

public < x > data source < x > read file of primitives ( string file path , class < x > type class ) { preconditions check not null ( file path , " the file path may not be null " ) ; return new data source < > ( this , new primitive input format < > ( new path ( file path ) , type class ) , type extractor get for class ( type class ) , utils get call location name ( ) ) ; }


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


return the registered handlers per transport type

public map < transport type , transport handler > get transport handlers ( ) { return collections unmodifiable map ( this handlers ) ; }


get the extents of the aabb ( half - widths )

public final vec 2 get extents ( ) { final vec 2 center = new vec 2 ( upper bound ) ; center sub local ( lower bound ) ; center mul local ( 5f ) ; return center ; }


finds the child with the specified name and returns it as a long

public long get long ( string name ) { json value child = get ( name ) ; if ( child = = null ) throw new illegal argument exception ( " named value not found : " + name ) ; return child as long ( ) ; }


gets the number of bytes remaining within the current page in the buffer

private int get bytes remaining in current page ( ) throws i o exception { if ( ! data available in buffer ( ) ) { return 0 ; } / / calculate our current position relative to the start of the current / / page int current data offset in page = ( current buffer offset % page size ) - page header size ; int page boundary = get current page start in buffer ( ) ; / / get the data size of the current page from the header short size of current page = get page size ( blob , current buffer , page boundary ) ; return size of current page - current data offset in page ; }


rx version of { @ link abstract dao # delete by key in tx ( iterable ) } returning an observable

public observable < void > delete by key in tx ( final iterable < k > keys ) { return wrap ( new callable < void > ( ) { @ override public void call ( ) throws exception { dao delete by key in tx ( keys ) ; return null ; } } ) ; }


apply the selected theme ( on new pipe settings ) in the context with the default style ( see { @ link # set theme ( context , int ) } )

public static void set theme ( final context context ) { set theme ( context , - 1 ) ; }


removes the translational part and transposes the matrix

public matrix 4 to normal matrix ( ) { val [ m03 ] = 0 ; val [ m13 ] = 0 ; val [ m23 ] = 0 ; return inv ( ) tra ( ) ; }


should this request wait for all found tasks to complete ?

public get task request set wait for completion ( boolean wait for completion ) { this wait for completion = wait for completion ; return this ; }


get a representation of an address as it would appear in bytes in memory

public static byte [ ] get direct address bytes ( program program , address to address ) { memory memory = program get memory ( ) ; boolean is big endian = memory is big endian ( ) ; int addr size = to address get size ( ) ; data converter data converter = data converter get instance ( memory is big endian ( ) ) ; byte [ ] address bytes = new byte [ addr size / 8 ] ; if ( to address instanceof segmented address ) { / / only search for offset ( exclude segment ) address bytes = new byte [ 2 ] ; segmented address seg addr = ( segmented address ) to address ; short addr short = ( short ) seg addr get segment offset ( ) ; data converter get bytes ( addr short , address bytes ) ; } else if ( addr size = = 64 ) { long addr long = to address get addressable word offset ( ) ; data converter get bytes ( addr long , address bytes ) ; } else if ( addr size = = 32 ) { int addr int = ( int ) to address get addressable word offset ( ) ; data converter get bytes ( addr int , address bytes ) ; } else if ( addr size = = 16 ) { short addr short = ( short ) to address get addressable word offset ( ) ; data converter get bytes ( addr short , address bytes ) ; } else { / / handle any addr size the hard way byte [ ] temp bytes = new byte [ 8 ] ; long addr long = to address get addressable word offset ( ) ; data converter get bytes ( addr long , temp bytes ) ; system arraycopy ( temp bytes , is big endian ? ( temp bytes length - address bytes length ) : 0 , address bytes , 0 , address bytes length ) ; } return address bytes ; }


return the function return type string at this location

public string get return type ( ) { return return type str ; }


get a connection form the connection pool

public connection get connection ( database configuration database configuration ) throws database service exception { try { if ( connection ! = null ) { connection close ( ) ; } class for name ( type get class path ( ) ) ; string db u r l = get database url ( database configuration ) ; connection = driver manager get connection ( db u r l ) ; logger debug ( " * * * acquired new connection for : : { } * * * * " , db u r l ) ; return connection ; } catch ( class not found exception e ) { logger error ( " jdbc driver not found " , e ) ; throw new database service exception ( e get message ( ) ) ; } catch ( s q l exception e ) { logger error ( " s q l exception : : couldn ' t get a connection ! " , e ) ; throw new database service exception ( true , e get s q l state ( ) , e get error code ( ) , e get message ( ) ) ; } }


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


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit single statement ( sql base parser single statement context ctx ) { return visit children ( ctx ) ; }


performs a modifier key release after focusing on an element equivalent to : actions click ( element ) send keys ( the key ) ;

public actions key up ( web element target , char sequence key ) { if ( is building actions ( ) ) { action add action ( new key up action ( json keyboard , json mouse , ( locatable ) target , as keys ( key ) ) ) ; } return focus in ticks ( target ) add key action ( key , code point - > tick ( default keyboard create key up ( code point ) ) ) ; }


tests that pending slot requests are tried to be fulfilled upon new slot registrations

public void test fulfilling pending slot request ( ) throws exception { final resource manager id resource manager id = resource manager id generate ( ) ; final resource i d resource i d = resource i d generate ( ) ; final job i d job id = new job i d ( ) ; final slot i d slot id = new slot i d ( resource i d , 0 ) ; final string target address = " localhost " ; final allocation i d allocation id = new allocation i d ( ) ; final resource profile resource profile = resource profile unknown ; final slot request slot request = new slot request ( job id , allocation id , resource profile , target address ) ; final atomic integer number allocate resource calls = new atomic integer ( 0 ) ; resource actions resource manager actions = new testing resource actions builder ( ) set allocate resource consumer ( ignored - > number allocate resource calls increment and get ( ) ) build ( ) ; final completable future < tuple 6 < slot i d , job i d , allocation i d , resource profile , string , resource manager id > > request future = new completable future < > ( ) ; / / accept an incoming slot request final task executor gateway task executor gateway = new testing task executor gateway builder ( ) set request slot function ( tuple 6 - > { request future complete ( tuple 6 of ( tuple 6 f 0 , tuple 6 f 1 , tuple 6 f 2 , tuple 6 f 3 , tuple 6 f 4 , tuple 6 f 5 ) ) ; return completable future completed future ( acknowledge get ( ) ) ; } ) create testing task executor gateway ( ) ; final task executor connection task executor connection = new task executor connection ( resource i d , task executor gateway ) ; final slot status slot status = new slot status ( slot id , resource profile any ) ; final slot report slot report = new slot report ( slot status ) ; try ( slot manager impl slot manager = create slot manager ( resource manager id , resource manager actions ) ) { assert true ( " the slot request should be accepted " , slot manager register slot request ( slot request ) ) ; assert that ( number allocate resource calls get ( ) , is ( 1 ) ) ; slot manager register task manager ( task executor connection , slot report , resource profile any , resource profile any ) ; assert that ( request future get ( ) , is ( equal to ( tuple 6 of ( slot id , job id , allocation id , resource profile , target address , resource manager id ) ) ) ) ; task manager slot slot = slot manager get slot ( slot id ) ; assert equals ( " the slot has not been allocated to the expected allocation id " , allocation id , slot get allocation id ( ) ) ; } }


public void set dynamic attribute ( string uri , string local name , object value ) throws jsp exception { if ( this dynamic attributes = = null ) { this dynamic attributes = new hash map < > ( ) ; } if ( ! is valid dynamic attribute ( local name , value ) ) { throw new illegal argument exception ( " attribute " + local name + " = \ " " + value + " \ " is not allowed " ) ; } this dynamic attributes put ( local name , value ) ; }


returns the { @ link request manager tree node } that provides tree traversal methods relative to the associated { @ link request manager }

public request manager tree node get request manager tree node ( ) { return request manager tree node ; }


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


reads the number of cpu cores from the first available information from { @ code sysdevicessystemcpupossible } , { @ code sysdevicessystemcpupresent } , then { @ code sysdevicessystemcpu }

public static int get number of c p u cores ( ) { if ( s num cores ! = num cores not set ) { return s num cores ; } if ( build version sdk int < = build version codes gingerbread mr1 ) { / / gingerbread doesn ' t support giving a single application access to both cores , but a / / handful of devices ( atrix 4g and droid x2 for example ) were released with a dual - core / / chipset and gingerbread ; that can let an app in the background run without impacting / / the foreground application but for our purposes , it makes them single core return 1 ; } int cores ; try { cores = get cores from file info ( " / sys / devices / system / cpu / possible " ) ; if ( cores = = deviceinfo unknown ) { cores = get cores from file info ( " / sys / devices / system / cpu / present " ) ; } if ( cores = = deviceinfo unknown ) { cores = get cores from c p u file list ( ) ; } } catch ( security exception e ) { cores = deviceinfo unknown ; } catch ( null pointer exception e ) { cores = deviceinfo unknown ; } s num cores = cores ; return cores ; }


return a new routing function with attributes manipulated with the given consumer the map provided to the consumer is " live " , so that the consumer can be used to { @ linkplain map # put ( object , object ) overwrite } existing attributes , { @ linkplain map # remove ( object ) remove } attributes , or use any of the other { @ link map } methods

default router function < t > with attributes ( consumer < map < string , object > > attributes consumer ) { assert not null ( attributes consumer , " attributes consumer must not be null " ) ; map < string , object > attributes = new linked hash map < > ( ) ; attributes consumer accept ( attributes ) ; return new router functions attributes router function < > ( this , attributes ) ; }


public void copy interval ( terminal row line , int source x 1 , int source x 2 , int destination x ) { m has non one width or surrogate chars | = line m has non one width or surrogate chars ; final int x 1 = line find start of column ( source x 1 ) ; final int x 2 = line find start of column ( source x 2 ) ; boolean starting from second half of wide char = ( source x 1 > 0 & & line wide display character starting at ( source x 1 - 1 ) ) ; final char [ ] source chars = ( this = = line ) ? arrays copy of ( line m text , line m text length ) : line m text ; int latest non combining width = 0 ; for ( int i = x 1 ; i < x 2 ; i + + ) { char source char = source chars [ i ] ; int code point = character is high surrogate ( source char ) ? character to code point ( source char , source chars [ + + i ] ) : source char ; if ( starting from second half of wide char ) { / / just treat copying second half of wide char as copying whitespace code point = ' ' ; starting from second half of wide char = false ; } int w = wc width width ( code point ) ; if ( w > 0 ) { destination x + = latest non combining width ; source x 1 + = latest non combining width ; latest non combining width = w ; } set char ( destination x , code point , line get style ( source x 1 ) ) ; } }


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


return the { @ code object mapper } for this view

public final object mapper get object mapper ( ) { return this object mapper ; }


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

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


called when the provider is being disposed


determines whether the deadline is in the past , i e whether the time left is negative


updates the expiration time of the provided < code > doc id < code > if the place - holder document is still present ( update )

public void update expiration time ( string doc id , long expiration time millis , action listener < update response > listener ) { map < string , object > source = collections singleton map ( expiration time field , expiration time millis ) ; update request request = new update request ( ) index ( index ) id ( doc id ) doc ( source , x content type json ) retry on conflict ( 5 ) ; client update ( request , listener ) ; }


creates a { @ code listenable future task } that will upon running , execute the given { @ code runnable } , and arrange that { @ code get } will return the given result on successful completion

static < v > trusted listenable future task < v > create ( runnable runnable , @ nullable decl v result ) { return new trusted listenable future task < v > ( executors callable ( runnable , result ) ) ; } / * * in certain circumstances , this field might theoretically not be visible to an after done ( ) call * triggered by cancel ( ) for details , see the comments on the fields of timeout future * * < p > { @ code volatile }


determines whether or not the user is being prompted to resolve a conflict

public synchronized boolean is prompting user ( ) { return prompting ; }


post fake : fake endpoint for testing various parameters 가짜 엔드 포인트 fake endpoint for testing various parameters 가짜 엔드 포인트

default response entity < void > test endpoint parameters ( @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " number " , required = true ) big decimal number , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " double " , required = true ) double double , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " pattern without delimiter " , required = true ) string pattern without delimiter , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " byte " , required = true ) byte [ ] byte , @ api param ( value = " none " ) @ valid @ request part ( value = " integer " , required = false ) integer integer , @ api param ( value = " none " ) @ valid @ request part ( value = " int 3 2 " , required = false ) integer int 3 2 , @ api param ( value = " none " ) @ valid @ request part ( value = " int 6 4 " , required = false ) long int 6 4 , @ api param ( value = " none " ) @ valid @ request part ( value = " float " , required = false ) float float , @ api param ( value = " none " ) @ valid @ request part ( value = " string " , required = false ) string string , @ api param ( value = " none " ) @ valid @ request part ( value = " binary " , required = false ) multipart file binary , @ api param ( value = " none " ) @ valid @ request part ( value = " date " , required = false ) local date date , @ api param ( value = " none " ) @ valid @ request part ( value = " date time " , required = false ) offset date time date time , @ api param ( value = " none " ) @ valid @ request part ( value = " password " , required = false ) string password , @ api param ( value = " none " ) @ valid @ request part ( value = " callback " , required = false ) string param callback ) { return get delegate ( ) test endpoint parameters ( number , double , pattern without delimiter , byte , integer , int 3 2 , int 6 4 , float , string , binary , date , date time , password , param callback ) ; }


obtain an object to expose from the given factory bean , if available in cached form quick check for minimal synchronization

protected object get cached object for factory bean ( string bean name ) { return this factory bean object cache get ( bean name ) ; }


commit the logs make sure that everything hits the disk

public synchronized void commit ( ) throws i o exception { if ( log stream ! = null ) { log stream flush ( ) ; } for ( file output stream log : streams to flush ) { log flush ( ) ; if ( force sync ) { long start sync n s = system nano time ( ) ; file channel channel = log get channel ( ) ; channel force ( false ) ; sync elapsed m s = time unit nanoseconds to millis ( system nano time ( ) - start sync n s ) ; if ( sync elapsed m s > fsync warning threshold m s ) { if ( server stats ! = null ) { server stats increment fsync threshold exceed count ( ) ; } log warn ( " fsync - ing the write ahead log in { } took { } ms which will adversely effect operation latency " + " file size is { } bytes see the zoo keeper troubleshooting guide " , thread current thread ( ) get name ( ) , sync elapsed m s , channel size ( ) ) ; } server metrics get metrics ( ) fsync time add ( sync elapsed m s ) ; } } while ( streams to flush size ( ) > 1 ) { streams to flush poll ( ) close ( ) ; } / / roll the log file if we exceed the size limit if ( txn log size limit > 0 ) { long log size = get current log size ( ) ; if ( log size > txn log size limit ) { log debug ( " log size limit reached : { } " , log size ) ; roll log ( ) ; } } }


find data source in all available registries deprecated triggering all projects open may cause issues ( especially when they are secured )

public static d b p data source container find data source ( string data source id ) { d b p workspace workspace = d b workbench get platform ( ) get workspace ( ) ; for ( d b p project project : workspace get projects ( ) ) { d b p data source registry data source registry = project get data source registry ( ) ; if ( data source registry ! = null ) { d b p data source container data source container = data source registry get data source ( data source id ) ; if ( data source container ! = null ) { return data source container ; } } } return null ; }


public void set begin time ( long begin time ) { this begin time = begin time ; }


set the number of children for this entity ( default = 0 )

public builder children ( int children num ) { this children num = children num ; return this ; }


discards all samples in the queue and advances the read position

public final void discard to end ( ) { sample data queue discard downstream to ( discard sample metadata to end ( ) ) ; }


returns completion hints for the given statement at the given cursor position the completion happens case insensitively

string [ ] get completion hints ( string statement , int position ) ;


reads an integer from the input stream and returns it this function validates that the integer is between [ lower , upper ] , inclusive

public static int read v int in range ( data input stream , int lower , int upper ) throws i o exception { long n = read v long ( stream ) ; if ( n < lower ) { if ( lower = = 0 ) { throw new i o exception ( " expected non - negative integer , got " + n ) ; } else { throw new i o exception ( " expected integer greater than or equal to " + lower + " , got " + n ) ; } } if ( n > upper ) { throw new i o exception ( " expected integer less or equal to " + upper + " , got " + n ) ; } return ( int ) n ; }


same as { @ link # start read write ( string , long , long ) } however , if the cache entry is locked , then instead of blocking , this method will return null as the { @ link cache span } this method may be slow and shouldn ' t normally be called on the main thread

cache span start read write non blocking ( string key , long position , long length ) throws cache exception ;


@ t c description : nacos open a p i @ test step : 1 2 @ expect result :

public void nacos open a p i query beta delete ( ) { http rest result < string > result = null ; try { final string content = " test - beta " ; map < string , string > headers = new hash map < > ( ) ; headers put ( " beta ips " , " 127 0 0 1 " ) ; map < string , string > params = new hash map < > ( ) ; params put ( " data id " , data id ) ; params put ( " group " , group ) ; params put ( " content " , content ) ; result = agent http post ( config controller path + " / " , headers , params , agent get encode ( ) , time out ) ; assert assert equals ( http u r l connection http ok , result get code ( ) ) ; assert assert equals ( " true " , result get data ( ) ) ; params clear ( ) ; params put ( " data id " , data id ) ; params put ( " group " , group ) ; params put ( " beta " , " true " ) ; result = agent http delete ( config controller path + " / " , null , params , agent get encode ( ) , time out ) ; assert assert equals ( http u r l connection http ok , result get code ( ) ) ; assert assert true ( jackson utils to obj ( result get data ( ) ) get ( " data " ) boolean value ( ) ) ; } catch ( exception e ) { e print stack trace ( ) ; assert fail ( ) ; } }


allow the xml to be extensible by processing any custom element types last , after we finished processing the bean definitions this method is a natural extension point for any other custom post - processing of the xml the default implementation is empty subclasses can override this method to convert custom elements into standard spring bean definitions , for example implementors have access to the parser ' s bean definition reader and the underlying xml resource , through the corresponding accessors

protected void post process xml ( element root ) { }


attaches the first { @ link sasl extensions } found in the public credentials of the subject

private static void handle callback ( sasl extensions callback extensions callback , subject subject ) { if ( subject ! = null & & ! subject get public credentials ( sasl extensions class ) is empty ( ) ) { sasl extensions extensions = subject get public credentials ( sasl extensions class ) iterator ( ) next ( ) ; extensions callback extensions ( extensions ) ; } }


private closeable reference < bitmap > decode from stream ( input stream input stream , bitmap factory options options , @ nullable rect region to decode , @ nullable final color space color space ) { preconditions check not null ( input stream ) ; int target width = options out width ; int target height = options out height ; if ( region to decode ! = null ) { target width = region to decode width ( ) / options in sample size ; target height = region to decode height ( ) / options in sample size ; } @ nullable bitmap bitmap to reuse = null ; boolean should use hardware bitmap config = false ; if ( build version sdk int > = build version codes o ) { should use hardware bitmap config = m preverification helper ! = null & & m preverification helper should use hardware bitmap config ( options in preferred config ) ; } if ( region to decode = = null & & should use hardware bitmap config ) { / / cannot reuse bitmaps with bitmap config hardware options in mutable = false ; } else { if ( region to decode ! = null & & should use hardware bitmap config ) { / / if region decoding was requested we need to fallback to default config options in preferred config = bitmap config argb 8888 ; } final int size in bytes = get bitmap size ( target width , target height , options ) ; bitmap to reuse = m bitmap pool get ( size in bytes ) ; if ( bitmap to reuse = = null ) { throw new null pointer exception ( " bitmap pool get returned null " ) ; } } / / in bitmap can be nullable / / noinspection constant conditions options in bitmap = bitmap to reuse ; / / performs transformation at load time to target color space if ( build version sdk int > = build version codes o ) { options in preferred color space = color space = = null ? color space get ( color space named srgb ) : color space ; } bitmap decoded bitmap = null ; byte buffer byte buffer = m decode buffers acquire ( ) ; if ( byte buffer = = null ) { byte buffer = byte buffer allocate ( decode buffer size ) ; } try { options in temp storage = byte buffer array ( ) ; if ( build version sdk int > = build version codes kitkat & & region to decode ! = null & & bitmap to reuse ! = null ) { bitmap region decoder bitmap region decoder = null ; try { bitmap to reuse reconfigure ( target width , target height , options in preferred config ) ; bitmap region decoder = bitmap region decoder new instance ( input stream , true ) ; decoded bitmap = bitmap region decoder decode region ( region to decode , options ) ; } catch ( i o exception e ) { f log e ( tag , " could not decode region % s , decoding full bitmap instead " , region to decode ) ; } finally { if ( bitmap region decoder ! = null ) { bitmap region decoder recycle ( ) ; } } } if ( decoded bitmap = = null ) { decoded bitmap = bitmap factory decode stream ( input stream , null , options ) ; } } catch ( illegal argument exception e ) { if ( bitmap to reuse ! = null ) { m bitmap pool release ( bitmap to reuse ) ; } / / this is thrown if the bitmap options are invalid , so let ' s just try to decode the bitmap / / as - is , which might be inefficient - but it works try { / / we need to reset the stream first input stream reset ( ) ; bitmap naive decoded bitmap = bitmap factory decode stream ( input stream ) ; if ( naive decoded bitmap = = null ) { throw e ; } return closeable reference of ( naive decoded bitmap , simple bitmap releaser get instance ( ) ) ; } catch ( i o exception re ) { / / we throw the original exception instead since it ' s the one causing this workaround in the / / first place throw e ; } } catch ( runtime exception re ) { if ( bitmap to reuse ! = null ) { m bitmap pool release ( bitmap to reuse ) ; } throw re ; } finally { m decode buffers release ( byte buffer ) ; } / / if bitmap with bitmap config hardware was used , ` bitmap to reuse ` will be null and it ' s / / expected if ( bitmap to reuse ! = null & & bitmap to reuse ! = decoded bitmap ) { m bitmap pool release ( bitmap to reuse ) ; decoded bitmap recycle ( ) ; throw new illegal state exception ( ) ; } return closeable reference of ( decoded bitmap , m bitmap pool ) ; }


collection < saml registered service metadata resolver > get registered metadata resolvers ( ) ;


create a connected { @ link hive metastore client } to this hive cluster

hive metastore client create metastore client ( ) throws t exception ;


serializable save ( string entity name , object entity ) throws data access exception ;


static boolean save credentials in secured storage ( @ not null d b p project project , @ nullable data source descriptor data source , @ nullable string sub node , @ not null secure credentials credentials ) { final d b a secure storage secure storage = project get secure storage ( ) ; { try { i secure preferences pref node = data source = = null ? project get secure storage ( ) get secure preferences ( ) : data source get secure preferences ( ) ; if ( ! secure storage use secure preferences ( ) ) { pref node remove node ( ) ; } else { if ( sub node ! = null ) { for ( string node name : sub node split ( " / " ) ) { pref node = pref node node ( node name ) ; } } pref node put ( " name " , data source ! = null ? data source get name ( ) : project get name ( ) , false ) ; if ( ! common utils is empty ( credentials get user name ( ) ) ) { pref node put ( registry constants attr user , credentials get user name ( ) , true ) ; } else { pref node remove ( registry constants attr user ) ; } if ( ! common utils is empty ( credentials get user password ( ) ) ) { pref node put ( registry constants attr password , credentials get user password ( ) , true ) ; } else { pref node remove ( registry constants attr password ) ; } if ( ! common utils is empty ( credentials get properties ( ) ) ) { for ( map entry < string , string > prop : credentials get properties ( ) entry set ( ) ) { pref node put ( prop get key ( ) , prop get value ( ) , true ) ; } } return true ; } } catch ( throwable e ) { log error ( " can ' t save credentials in secure storage " , e ) ; } } return false ; }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case success : return is set success ( ) ; case e : return is set e ( ) ; } throw new illegal state exception ( ) ; }


returns the annotation engine available for the current runtime returns { @ link org mockito internal configuration injecting annotation engine } if no { @ link org mockito plugins annotation engine } extension exists or is visible in the current classpath

public static annotation engine get annotation engine ( ) { return registry get annotation engine ( ) ; }


generate a string of query string from the specified request parameters { @ link map }

public static string to query string ( map < string , list < string > > params ) { string builder builder = new string builder ( ) ; for ( string line : to name and values set ( params ) ) { builder append ( line ) append ( and ) ; } return builder to string ( ) ; }


returns a url that represents this file object

public url to u r l ( ) throws malformed u r l exception { return resource to u r l ( ) ; }


returns true if windows - sandbox should be used for this build returns true if requested in [ " auto " , " yes " ] and binary is valid throws an error if state is " yes " and binary is not valid

private static boolean should use windows sandbox ( tri state requested , path fragment binary ) throws i o exception { switch ( requested ) { case auto : return windows sandbox util is available ( binary ) ; case no : return false ; case yes : if ( ! windows sandbox util is available ( binary ) ) { throw new i o exception ( " windows - sandbox explicitly requested but \ " " + binary + " \ " could not be found or is not valid " ) ; } return true ; } throw new illegal state exception ( " not reachable " ) ; }


set the health check registry to be used when registering health checks currently only codahale health checks are supported

public void set health check registry ( object health check registry ) { if ( health check registry ! = null ) { codahale health checker register health checks ( this , config , ( health check registry ) health check registry ) ; } } / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / i bag state listener callback / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *